MDL-74470 quiz: fix typos & small bug from MDL-74255.
I think that, because how PHP works, the MDL-74255 bug (lack of explode) generally does not break anything, which is why no tests failed. Still. Good to fix.
This commit is contained in:
@@ -19,7 +19,6 @@ namespace mod_quiz\question\bank;
|
||||
use core_question\local\bank\question_version_status;
|
||||
use core_question\local\bank\random_question_loader;
|
||||
use qubaid_condition;
|
||||
use quiz_attempt;
|
||||
|
||||
defined('MOODLE_INTERNAL') || die();
|
||||
|
||||
@@ -130,7 +129,7 @@ class qbank_helper {
|
||||
|
||||
-- This way of getting the latest version for each slot is a bit more complicated
|
||||
-- than we would like, but the simpler SQL did not work in Oracle 11.2.
|
||||
-- (It did work find in Oracle 19.x, so once we have updated our min supported
|
||||
-- (It did work fine in Oracle 19.x, so once we have updated our min supported
|
||||
-- version we could consider digging the old code out of git history from
|
||||
-- just before the commit that added this comment.
|
||||
-- For relevant question_bank_entries, this gets the latest non-draft slot number.
|
||||
@@ -202,17 +201,14 @@ class qbank_helper {
|
||||
/**
|
||||
* Get this list of random selection tag ids from one of the slots returned by get_question_structure.
|
||||
*
|
||||
* @param \stdClass $slotdata one of the array elements returend by get_question_structure.
|
||||
* @param \stdClass $slotdata one of the array elements returned by get_question_structure.
|
||||
* @return array list of tag ids.
|
||||
*/
|
||||
public static function get_tag_ids_for_slot(\stdClass $slotdata): array {
|
||||
if (empty($slot->randomtags)) {
|
||||
return [];
|
||||
}
|
||||
|
||||
$tagids = [];
|
||||
foreach ($slotdata->randomtags as $tag) {
|
||||
$tagids[] = $tag->id;
|
||||
foreach ($slotdata->randomtags as $taginfo) {
|
||||
[$id] = explode(',', $taginfo, 2);
|
||||
$tagids[] = $id;
|
||||
}
|
||||
return $tagids;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user