Permalink
Browse files

MDL-29095: initialise_question_instance should use extra_question_fields

Shortanswer question type converted to use extra question fields.

Signed-off-by: Oleg Sychev <oasychev@gmail.com>
  • Loading branch information...
oasychev authored and timhunt committed Nov 14, 2011
1 parent 6be90ce commit 106777513117c4d8ca5f38a569e9db5be15ab3ab
@@ -702,6 +702,16 @@ protected function initialise_question_instance(question_definition $question, $
$question->createdby = $questiondata->createdby;
$question->modifiedby = $questiondata->modifiedby;
//Fill extra question fields values
$extraquestionfields = $this->extra_question_fields();
if (is_array($extraquestionfields)) {
//omit table name
array_shift($extraquestionfields);
foreach($extraquestionfields as $field) {
$question->$field = $questiondata->options->$field;
}
}
$this->initialise_question_hints($question, $questiondata);
}
@@ -59,10 +59,6 @@ protected function data_preprocessing($question) {
$question = $this->data_preprocessing_answers($question);
$question = $this->data_preprocessing_hints($question);
if (!empty($question->options)) {
$question->usecase = $question->options->usecase;
}
return $question;
}
@@ -124,7 +124,6 @@ public function save_question_options($question) {
protected function initialise_question_instance(question_definition $question, $questiondata) {
parent::initialise_question_instance($question, $questiondata);
$question->usecase = $questiondata->options->usecase;
$this->initialise_question_answers($question, $questiondata);
}

0 comments on commit 1067775

Please sign in to comment.