Skip to content
Browse files

Merge branch 'MDL-27155_20' of git://github.com/timhunt/moodle into M…

…OODLE_20_STABLE
  • Loading branch information...
2 parents 9c39028 + 847dee6 commit ed85c0acd249997d9b042de782c9c6ba39d86deb Sam Hemelryk committed May 2, 2011
Showing with 7 additions and 2 deletions.
  1. +7 −2 question/type/numerical/questiontype.php
View
9 question/type/numerical/questiontype.php
@@ -299,9 +299,14 @@ function save_numerical_options($question) {
$options->unitsleft = 0 ;
}
- $options->instructions = $this->import_or_save_files($question->instructions,
+ if (isset($question->instructions) && is_array($question->instructions)){
+ $options->instructions = $this->import_or_save_files($question->instructions,
$question->context, 'qtype_'.$question->qtype , 'instruction', $question->id);
- $options->instructionsformat = $question->instructions['format'];
+ $options->instructionsformat = $question->instructions['format'];
+ } else {
+ $options->instructions = '' ;
+ $options->instructionsformat = editors_get_preferred_format();
+ }
$DB->update_record('question_numerical_options', $options);

0 comments on commit ed85c0a

Please sign in to comment.
Something went wrong with that request. Please try again.