Skip to content

Commit

Permalink
MDL-27155 qtype_numerical problem with GIFT import.
Browse files Browse the repository at this point in the history
  • Loading branch information
timhunt committed Apr 29, 2011
1 parent b8df941 commit 64d5c1c
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions question/type/numerical/questiontype.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit 64d5c1c

Please sign in to comment.