-
Bug
-
Resolution: Fixed
-
Minor
-
2.7.7, 2.8.5
-
MOODLE_27_STABLE, MOODLE_28_STABLE
-
MOODLE_27_STABLE, MOODLE_28_STABLE
-
This was discovered while testing MDLQA-7902 and MDLQA-7903.
When you import questions and some of them have fractional grades, then the import fails because in mod/lesson/format.php in the lesson_save_question_options function there is
$answer->grade = $question->fraction[$key] * 100;
|
for shortanswer, numerical, truefalse and multichoice questions
but the grade field of the lesson_answersis defined as TYPE int
So we should round this expression during import.
Some notes:
- in fact answer->grade is never used in the lesson code for anything and if you create any question type directly in the lesson activity, answer->grade is always 0, I must admit I don't understand why this field is here !!
- on the contrary several lesson pages types use answer->score to grade the student during attempt
- but during import for several question types answer->score is not set correctly so you must edit the question after import if you want it to work correctly !
Summary
- as always in lesson things are broken and/or not fully implemented
- this lesson import code that "borrow" some code from the question bank is an awful mess
- blocks
-
MDL-43042 Lession multichoice questions with multiple answers : user can not understand which answer was correct
-
- Closed
-
-
MDL-44840 correct answer and wrong answer both set to zero on lessons true/false question import
-
- Closed
-
-
MDL-49948 Multi-choice questions do not import correctly into the lesson module
-
- Closed
-
- is blocked by
-
MDL-49880 Notice while importing questions in lesson
-
- Closed
-
- will help resolve
-
MDL-44840 correct answer and wrong answer both set to zero on lessons true/false question import
-
- Closed
-
-
MDL-49947 Numeric questions to not import consistently in lesson
-
- Closed
-
-
MDL-49948 Multi-choice questions do not import correctly into the lesson module
-
- Closed
-