Skip to content

Commit

Permalink
quiz-data - CI fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
EJMFarrow committed Nov 20, 2024
1 parent 881585b commit 4cc03b4
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 2 deletions.
11 changes: 10 additions & 1 deletion .github/workflows/moodle-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,16 @@ jobs:
matrix: # I don't know why, but mariadb is much slower, so mostly use pgsql.
include:
- php: '8.2'
moodle-branch: 'master'
moodle-branch: 'main'
database: 'pgsql'
- php: '8.2'
moodle-branch: 'MOODLE_405_STABLE'
database: 'pgsql'
- php: '8.2'
moodle-branch: 'MOODLE_404_STABLE'
database: 'pgsql'
- php: '8.1'
moodle-branch: 'MOODLE_403_STABLE'
database: 'pgsql'
- php: '8.1'
moodle-branch: 'MOODLE_402_STABLE'
Expand Down
8 changes: 7 additions & 1 deletion classes/external/import_quiz_data.php
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,13 @@ public static function execute(array $quiz, array $sections, array $questions, a
$module = get_module_from_cmid($moduleinfo->coursemodule)[0];
// Sort questions by slot.
usort($params['questions'], function($a, $b) {
return ((int) $a['slot'] > (int) $b['slot']) ? true : false;
if ((int) $a['slot'] > (int) $b['slot']) {
return 1;
} else if ((int) $a['slot'] < (int) $b['slot']) {
return -1;
} else {
return 0;
}
});
foreach ($params['questions'] as $question) {
$qdata = get_minimal_question_data($question['questionbankentryid']);
Expand Down

0 comments on commit 4cc03b4

Please sign in to comment.