mirror of
https://github.com/moodle/moodle.git
synced 2025-08-09 10:56:56 +02:00
MDL-83127 qtype_ordering: handle NULL in question_hints table entries.
This commit is contained in:
parent
3477082aa9
commit
bdd8770347
1 changed files with 10 additions and 3 deletions
|
@ -54,9 +54,16 @@ class question_hint_ordering extends question_hint_with_parts {
|
||||||
global $DB;
|
global $DB;
|
||||||
|
|
||||||
// Initialize with the old questions.
|
// Initialize with the old questions.
|
||||||
if (is_null($row->options) || is_null($row->shownumcorrect)) {
|
if (is_null($row->options) || is_null($row->shownumcorrect) || is_null($row->clearwrong)) {
|
||||||
|
if (is_null($row->options)) {
|
||||||
$row->options = 1;
|
$row->options = 1;
|
||||||
|
}
|
||||||
|
if (is_null($row->shownumcorrect)) {
|
||||||
$row->shownumcorrect = 1;
|
$row->shownumcorrect = 1;
|
||||||
|
}
|
||||||
|
if (is_null($row->clearwrong)) {
|
||||||
|
$row->clearwrong = 1;
|
||||||
|
}
|
||||||
$DB->update_record('question_hints', $row);
|
$DB->update_record('question_hints', $row);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue