|
56 | 56 | '{qtype_stack_options} o, {question_versions} v WHERE q.id = o.questionid AND q.id = v.id ' . ' |
57 | 57 | AND NOT v.status = "hidden" AND o.compiledcache = ?;'; |
58 | 58 |
|
59 | | -$notcompiled = $DB->get_recordset_sql($query, ['{}']); |
60 | | - |
61 | | -$nnotcompiled = 0; |
62 | | -$ncompiled = 0; |
63 | | -foreach ($notcompiled as $item) { |
64 | | - $nnotcompiled = $item->notcompiled; |
65 | | -} |
66 | | -$notcompiled->close(); |
| 59 | +$notcompiled = $DB->get_record_sql($query, ['{}']); |
| 60 | +$nnotcompiled = $notcompiled->notcompiled; |
67 | 61 |
|
68 | 62 | $query = 'SELECT count(*) as compiled FROM {question} q, ' . |
69 | 63 | '{qtype_stack_options} o, {question_versions} v WHERE q.id = o.questionid AND q.id = v.id ' . ' |
70 | | - AND NOT v.status = "hidden" AND o.compiledcache = ?;'; |
| 64 | + AND NOT v.status = "hidden" AND o.compiledcache != ?;'; |
71 | 65 |
|
72 | | -$compiled = $DB->get_recordset_sql($query, ['{}']); |
73 | | - |
74 | | -foreach ($compiled as $item) { |
75 | | - $ncompiled = $item->compiled; |
76 | | -} |
77 | | -$compiled->close(); |
| 66 | +$compiled = $DB->get_record_sql($query, ['{}']); |
| 67 | +$ncompiled = $compiled->compiled; |
78 | 68 |
|
79 | 69 | echo $OUTPUT->header(); |
80 | 70 | echo $OUTPUT->heading($title); |
81 | 71 |
|
82 | 72 | echo '<p>This tool only acts on succesfully compiled questions, to compile questions run the bulk tester ' . |
83 | 73 | 'or preview/use those questions.</p><p>'; |
84 | | -if ($ncompiled !== $notcompiled) { |
| 74 | +if ($nnotcompiled) { |
85 | 75 | echo stack_string_error('errors') . '. '; |
86 | 76 | } |
87 | 77 | echo 'Currently there are ' . $ncompiled . ' compiled questions and ' . $nnotcompiled . |
|
328 | 318 | // Load the whole question, simpler to get the contexts correct that way. |
329 | 319 | foreach ($qs as $item) { |
330 | 320 | $q = question_bank::load_question($item->questionid); |
331 | | - $tags = $q->get_question_todos(); |
| 321 | + list($hastodos, $tags) = $q->get_question_todos(); |
332 | 322 | list($context, $seed, $urlparams) = qtype_stack_setup_question_test_page($q); |
333 | 323 | $qurl = qbank_previewquestion\helper::question_preview_url($item->questionid, |
334 | 324 | null, null, null, null, $context); |
|
0 commit comments