mirror of
https://github.com/moodle/moodle.git
synced 2025-08-07 18:06:51 +02:00
Merge branch 'MDL-45763-master' of https://github.com/merrill-oakland/moodle
This commit is contained in:
commit
2d8d99ab5b
5 changed files with 122 additions and 3 deletions
|
@ -213,7 +213,7 @@ function quiz_add_random_questions($quiz, $addonpage, $categoryid, $number,
|
|||
SELECT *
|
||||
FROM {quiz_slots}
|
||||
WHERE questionid = q.id)
|
||||
ORDER BY id", array($category->id, $includesubcategories))) {
|
||||
ORDER BY id", array($category->id, ($includesubcategories ? '1' : '0')))) {
|
||||
// Take as many of these as needed.
|
||||
while (($existingquestion = array_shift($existingquestions)) && $number > 0) {
|
||||
quiz_add_quiz_question($existingquestion->id, $quiz, $addonpage);
|
||||
|
@ -228,7 +228,7 @@ function quiz_add_random_questions($quiz, $addonpage, $categoryid, $number,
|
|||
// More random questions are needed, create them.
|
||||
for ($i = 0; $i < $number; $i += 1) {
|
||||
$form = new stdClass();
|
||||
$form->questiontext = array('text' => $includesubcategories, 'format' => 0);
|
||||
$form->questiontext = array('text' => ($includesubcategories ? '1' : '0'), 'format' => 0);
|
||||
$form->category = $category->id . ',' . $category->contextid;
|
||||
$form->defaultmark = 1;
|
||||
$form->hidden = 1;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue