Skip to content

Commit

Permalink
Merge pull request #49 from Dmfama20/master
Browse files Browse the repository at this point in the history
adapted to M4.0; bumped version.php
  • Loading branch information
kulmann authored Mar 28, 2023
2 parents d61f959 + 9502e56 commit 85c5291
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 8 deletions.
16 changes: 11 additions & 5 deletions classes/model/level.php
Original file line number Diff line number Diff line change
Expand Up @@ -128,11 +128,17 @@ public function get_random_question(): \question_definition {

// build query for moodle question selection
$sql = "
SELECT q.id
FROM {question} q
INNER JOIN {qtype_multichoice_options} qmo ON q.id=qmo.questionid
WHERE q.qtype = ? AND qmo.single = ? AND q.category $cat_sql
";
SELECT q.id
FROM {question} q
INNER JOIN {qtype_multichoice_options} qmo ON q.id=qmo.questionid
JOIN {question_versions} qv ON qv.questionid = q.id
JOIN {question_bank_entries} qbe ON qv.questionbankentryid = qbe.id
JOIN {question_categories} qc ON qc.id = qbe.questioncategoryid
WHERE (qv.version = (SELECT MAX(v.version)
FROM {question_versions} v
JOIN {question_bank_entries} be ON be.id = v.questionbankentryid
WHERE be.id = qbe.id))
AND q.qtype = ? AND qmo.single = ? AND qc.id $cat_sql ";
$params = \array_merge(["multichoice", 1], $cat_params);

// Get all available questions.
Expand Down
6 changes: 3 additions & 3 deletions version.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
defined('MOODLE_INTERNAL') || die();

$plugin->component = 'mod_millionaire';
$plugin->requires = 2017111302;
$plugin->requires = 2022041900; //requires at least Moodle 4.0!
$plugin->maturity = MATURITY_BETA;
$plugin->version = 2020040301;
$plugin->release = '0.3.16';
$plugin->version = 2023011200;
$plugin->release = '0.3.17';

0 comments on commit 85c5291

Please sign in to comment.