Skip to content

Commit

Permalink
quiz-data - fix ignore
Browse files Browse the repository at this point in the history
  • Loading branch information
EJMFarrow committed Dec 4, 2024
1 parent 529adb1 commit 275d1ad
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 10 deletions.
2 changes: 1 addition & 1 deletion classes/create_repo.php
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@ public function call_repo_creation(string $rootdirectory, string $moodleinstance
chdir($scriptdirectory);
return shell_exec('php createrepo.php -u ' . $this->usegit . ' -w -r "' .
$rootdirectory . '" -i "' . $moodleinstance .
'" -l "module" -n ' . $instanceid . ' -t "' . $token . '" -x ' . $ignorecat);
'" -l "module" -n ' . $instanceid . ' -t ' . $token . $ignorecat);
}

/**
Expand Down
9 changes: 5 additions & 4 deletions classes/export_repo.php
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,7 @@ public function update_quiz_directories($clihelper, $scriptdirectory) {
$quizmanifestname = cli_helper::get_manifest_path($moodleinstance, 'module', null,
$contextinfo->contextinfo->coursename, $quiz->name, '');
$output = $this->call_export_repo($rootdirectory, $moodleinstance, $token,
$quizmanifestname, $scriptdirectory);
$quizmanifestname, $ignorecat, $scriptdirectory);
}
echo $output;
$quizmanifestpath = cli_helper::get_manifest_path($moodleinstance, 'module', null,
Expand All @@ -372,7 +372,7 @@ public function call_repo_creation(string $rootdirectory, string $moodleinstance
): ?string {
chdir($scriptdirectory);
return shell_exec('php createrepo.php -u ' . $this->usegit . ' -w -r "' . $rootdirectory . '" -i "' . $moodleinstance .
'" -l "module" -n ' . $instanceid . ' -t ' . $token . ' -x ' . $ignorecat);
'" -l "module" -n ' . $instanceid . ' -t ' . $token . $ignorecat);
}

/**
Expand All @@ -397,13 +397,14 @@ public function call_export_quiz(string $moodleinstance, string $token,
* @param string $moodleinstance
* @param string $token
* @param string $quizmanifestname
* @param string $ignorecat
* @param string $scriptdirectory
* @return string|null
*/
public function call_export_repo(string $rootdirectory, string $moodleinstance, string $token,
string $quizmanifestname, string $scriptdirectory): ?string {
string $quizmanifestname, string $ignorecat, string $scriptdirectory): ?string {
chdir($scriptdirectory);
return shell_exec('php exportrepofrommoodle.php -u ' . $this->usegit . ' -w -r "' . $rootdirectory . '" -i "' .
$moodleinstance . '" -f "' . $quizmanifestname . '" -t ' . $token);
$moodleinstance . '" -f "' . $quizmanifestname . '" -t ' . $token . $ignorecat);
}
}
12 changes: 7 additions & 5 deletions classes/import_repo.php
Original file line number Diff line number Diff line change
Expand Up @@ -921,7 +921,7 @@ public function update_quizzes($clihelper, $scriptdirectory) {
echo "\nImporting quiz context: {$structurecontents->quiz->name}\n";
if (is_file($quizmanifestpath)) {
$output = $this->call_import_repo($rootdirectory, $moodleinstance, $token,
$quizmanifestname, null, $scriptdirectory);
$quizmanifestname, null, $ignorecat, $scriptdirectory);
echo $output;
} else {
// No quiz manifest. We need to import questions into context of created quiz.
Expand All @@ -941,7 +941,7 @@ public function update_quizzes($clihelper, $scriptdirectory) {
$this->manifestcontents->quizzes = [];
}
$output = $this->call_import_repo($rootdirectory, $moodleinstance, $token,
null, $quizcmid, $scriptdirectory);
null, $quizcmid, $ignorecat, $scriptdirectory);
echo $output;
}
if ($instanceid === false) {
Expand Down Expand Up @@ -992,18 +992,20 @@ public function update_quizzes($clihelper, $scriptdirectory) {
* @param string $token
* @param string|null $quizmanifestname
* @param string|null $cmid
* @param string $ignorecat
* @param string $scriptdirectory
* @return string|null
*/
public function call_import_repo(string $rootdirectory, string $moodleinstance, string $token,
?string $quizmanifestname, ?string $quizcmid, string $scriptdirectory): string {
?string $quizmanifestname, ?string $quizcmid,
string $ignorecat, string $scriptdirectory): string {
chdir($scriptdirectory);
if ($quizmanifestname) {
return shell_exec('php importrepotomoodle.php -u ' . $this->usegit . ' -w -r "' . $rootdirectory .
'" -i "' . $moodleinstance . '" -f "' . $quizmanifestname . '" -t ' . $token);
'" -i "' . $moodleinstance . '" -f "' . $quizmanifestname . '" -t ' . $token . $ignorecat);
} else {
return shell_exec('php importrepotomoodle.php -u ' . $this->usegit . ' -w -r "' . $rootdirectory .
'" -i "' . $moodleinstance . '" -l "module" -n ' . $quizcmid . ' -t ' . $token);
'" -i "' . $moodleinstance . '" -l "module" -n ' . $quizcmid . ' -t ' . $token . $ignorecat);
}
}

Expand Down

0 comments on commit 275d1ad

Please sign in to comment.