Permalink
Browse files

Merge branch 'MDL-27155_master' of git://github.com/timhunt/moodle

  • Loading branch information...
2 parents 290a5db + 64d5c1c commit 598a9f77267f68f0464e1ca937a57fde2d70f271 Sam Hemelryk committed May 2, 2011
Showing with 7 additions and 2 deletions.
  1. +7 −2 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 598a9f7

Please sign in to comment.