Posts made by Joseph Rézeau

Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers Picture of Translators

Hi Shawn,

Thanks for reporting this bug, of which I was already aware. I have posted a bug report (MDL-26281) for which you can vote and where you will find an easy fix.

Joseph

Fix (for moodle 2.0)

in file lesson/pagetypes/shortanswer.php
around line 80
replace:

foreach ($answers as $answer) {
$i++;
$expectedanswer = $answer->answer; // for easier handling of $answer->answer

with

foreach ($answers as $answer) {
$i++;
$expectedanswer = s($answer->answer); // for easier handling of $answer->answer
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers Picture of Translators

Hi Andreas,

I had tried to answer a feedback on the front page as guest and had not succeeded, because I did not know about that global feedback setting "allowfullanonymous". Thanks for the information.

Maybe we should have a similar setting for the Questionnaire module (in Moodle 2.0) then?

Joseph

Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers Picture of Translators

Hello Panos,

Thanks for reporting this. I'm afraid I had taken our friend Matt Fedorko's word and not thoroughly checked that it worked for all question types.blush

Here then is the correct hack for all the question types:

In the mod/lesson/pagetypes/ folder, for each of the following files: truefalse.php, multichoice.php, matching.php:
locate public function display($renderer, $attempt)
a few lines down that function, locate $params = array() and add 'title' at the end:
$params = array('answers'=>$answers, 'lessonid'=>$this->lesson->id, 'contents'=>$this->get_contents(), 'attempt'=>$attempt, 'title'=>$this->title);
--------------------
In the mod/lesson/pagetypes/ folder, for essay.php, shortanswer.php, numerical.php:
where *** = essay / shortanswer /numerical:
locate public function display($renderer, $attempt)
a few lines down that function, locate:
$mform = new lesson_display_answer_form_***($CFG->wwwroot.'/mod/lesson/continue.php', array('contents'=>$this->get_contents()));
and add 'title' at the end:
$mform = new lesson_display_answer_form_***($CFG->wwwroot.'/mod/lesson/continue.php', array('contents'=>$this->get_contents(), 'title'=>$this->title));

Joseph