-
Bug
-
Resolution: Fixed
-
Minor
-
2.4.6, 2.4.7
-
MOODLE_24_STABLE
-
MOODLE_24_STABLE, MOODLE_25_STABLE, MOODLE_26_STABLE
-
Two issues:
- The html tags are not stripped when the question is edited.
- If the tags are present, $correctanswer is not an object.
To reproduce:
- Moodle 2.4.7 (Build: 20131111)
- Create a quiz question > Multianswer (Embedded answer/Cloze) > with something like this question text:
During my two hour study session, I will be working on {1:MULTICHOICE:=1. studying for a quiz~2. lab assignment~3. reading the textbook~4. lecture learning~5. seminar engagement~6. practice questions or test~7. SOMETHING ELSE} in {1:SHORTANSWER:=****************************<em>****<em>****************************<em>****</em></em>***********************</em>******************************************************} (eg. PSY 100).
I've added some error_log() lines to /question/type/multianswer/renderer.php ~line 222
error_log(__FUNCTION__.'::qtype='.$subq->qtype->name()); |
error_log(__FUNCTION__.'::$correctanswer='.is_object($correctanswer)); |
error_log(__FUNCTION__.'::id='.$inputattributes['id']); |
$feedbackpopup = $this->feedback_popup($subq, $matchinganswer->fraction, |
$subq->format_text($matchinganswer->feedback, $matchinganswer->feedbackformat,
|
$qa, 'question', 'answerfeedback', $matchinganswer->id), |
s($correctanswer->answer), $options);
|
I get this in the PHP error log when I review a student's quiz attempt:
[error] subquestion::qtype=shortanswer
[error] subquestion::$correctanswer=
[error] subquestion::id=q24366:8_sub2_answer
[error] PHP Notice: Trying to get property of non-object in /question/type/multianswer/renderer.php on line 228, referer: http://moodle.mydomain.com/question/question.php?cmid=3850&returnurl=%2Fmod%2Fquiz%2Freview.php%3Fattempt%3D23623%23q8&id=20371