Merge branch 'MDL-37374_23' of git://github.com/timhunt/moodle into MOODLE_23_STABLE

This commit is contained in:
Dan Poltawski
2013-01-15 12:59:54 +08:00
2 changed files with 4 additions and 13 deletions
+1 -1
View File
@@ -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;
}
}
+3 -12
View File
@@ -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();