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 Adriane,
Just discovered a bug in your drag&drop ordering question. In teacher preview mode, the Fill with correct option does not work. Here is a fix. In order/questiontype.php, replace
 function get_correct_responses(&$question, &$state) {
 $responses = array();
 foreach ($state->options->subquestions as $sub) {
 foreach ($sub->options->answers as $answer) {
 if (1 == $answer->fraction && $sub->questiontext) {
 $responses[$sub->id] = $answer->id;
 }
 }
 }
 return empty($responses) ? null : $responses;
 }
with
 function get_correct_responses(&$question, &$state) {
 $responses = array();
 foreach ($question->options->subquestions as $sub) {
 $responses[$sub->code] = $sub->answertext;
 }
 return empty($responses) ? null : $responses;
 }

NOTE.- See attached screen shot to view the different rendering with JS enabled/disabled. With JS disabled it would look nicer if the items were ordered (and the dropdown list numbers ranged from 1 to ...n). But I do not know how to do it and - given the low number of people who surf the Internet with JS disabled anyway - I do not think it worthwhile to spend time on it.

Joseph
Attachment image00.jpg
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers Picture of Translators
Hi, just started testing the new questions bank system. When I click on the Categories tab in order to edit catetories or add a new one, in Add category, there is a dropdown list of existing categories which is "called" Parent. I am finding it strange that the default category name which appears in that list is the first name of the alphabetically ordered list of categories within my course. This is not really intuitive, and I would prefer that dropdown list to default either to Top (if when I clicked on the Category Tab I was inside the Default category) or to the category in which I was when I clicked that tab. This is related to MDL-10776.
Joseph