Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
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...
commit 7a3cd7d57ccec9044819d6ddc54ad89bbbf41151 1 parent e25ecdf
@oasychev oasychev authored timhunt committed
View
10 question/type/questiontypebase.php
@@ -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);
}
View
4 question/type/shortanswer/edit_shortanswer_form.php
@@ -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;
}
View
1  question/type/shortanswer/questiontype.php
@@ -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 7a3cd7d

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