Details
-
Type:
Bug
-
Status: Closed
-
Priority:
Minor
-
Resolution: Fixed
-
Affects Version/s: 2.1, 2.2
-
Fix Version/s: 2.1.2
-
Component/s: Questions
-
Labels:
-
Database:MySQL
-
Testing Instructions:
-
Workaround:
-
Affected Branches:MOODLE_21_STABLE, MOODLE_22_STABLE
-
Fixed Branches:MOODLE_21_STABLE
-
Pull from Repository:
-
Pull Master Branch:
-
Pull Master Diff URL:
Description
When attempting to import questions in Aiken format, the upload fails with the following information...
—
Parsing questions from import file.
Importing 2 questions from file
Notice: Undefined property: stdClass::$questiontextformat in /usr/local/moodle/question/format.php on line 874
1. How can ecology best help each of us understand the role of humans in nature?
Notice: Uninitialized string offset: 0 in /usr/local/moodle/question/type/questiontypebase.php on line 1066 Notice: Uninitialized string offset: 0 in /usr/local/moodle/question/type/multichoice/questiontype.php on line 90
Error writing to database
More information about this error
Debug info: Incorrect integer value: 'E' for column 'answerformat' at row 1
UPDATE mdl_question_answers SET question = ?,answer = ?,feedback = ?,answerformat = ?,fraction = ?,feedbackformat = ? WHERE id=?
[array (
0 => 12952,
1 => 'E',
2 => '',
3 => 'E',
4 => 0,
5 => 0,
6 => 50466,
)]
Stack trace:
line 397 of /lib/dml/moodle_database.php: dml_write_exception thrown
line 984 of /lib/dml/mysqli_native_moodle_database.php: call to moodle_database->query_end()
line 1016 of /lib/dml/mysqli_native_moodle_database.php: call to mysqli_native_moodle_database->update_record_raw()
line 92 of /question/type/multichoice/questiontype.php: call to mysqli_native_moodle_database->update_record()
line 417 of /question/format.php: call to qtype_multichoice->save_question_options()
line 121 of /question/import.php: call to qformat_default->importprocess()
The problem seems to be that the functions that handle the Aiken format import passes a string with the text of the answer when the database import expects to get an array containing: format, text, and files.