Merge branch 'MDL-37374_23' of git://github.com/timhunt/moodle into MOODLE_23_STABLE
This commit is contained in:
@@ -481,7 +481,7 @@ abstract class question_edit_form extends question_wizard_form {
|
||||
if (is_array($extraquestionfields) && !empty($question->options)) {
|
||||
array_shift($extraquestionfields);
|
||||
foreach ($extraquestionfields as $field) {
|
||||
if (isset($question->options->$field)) {
|
||||
if (property_exists($question->options->$field)) {
|
||||
$question->$field = $question->options->$field;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -454,21 +454,12 @@ class question_type {
|
||||
$options->$questionidcolname = $question->id;
|
||||
}
|
||||
foreach ($extraquestionfields as $field) {
|
||||
if (!isset($question->$field)) {
|
||||
$result = new stdClass();
|
||||
$result->error = "No data for field $field when saving " .
|
||||
$this->name() . ' question id ' . $question->id;
|
||||
return $result;
|
||||
if (property_exists($question->$field)) {
|
||||
$options->$field = $question->$field;
|
||||
}
|
||||
$options->$field = $question->$field;
|
||||
}
|
||||
|
||||
if (!$DB->{$function}($question_extension_table, $options)) {
|
||||
$result = new stdClass();
|
||||
$result->error = 'Could not save question options for ' .
|
||||
$this->name() . ' question id ' . $question->id;
|
||||
return $result;
|
||||
}
|
||||
$DB->{$function}($question_extension_table, $options);
|
||||
}
|
||||
|
||||
$extraanswerfields = $this->extra_answer_fields();
|
||||
|
||||
Reference in New Issue
Block a user