|
[
Permalink
| « Hide
]
Itamar Tzadok added a comment - 11/May/08 06:15 AM
An alternative and perhaps a simpler improvement may be to allow a Multiple Choice question to present the choices horizontally rather then vertically. The discussion that triggered this issue does not seem to suggest that more than that is needed.
It is effectively easier to change the display of Multiple Choice although horizontally is useful only for short sentence.
Horizontal is te best choice on a screen as vertical scolling is easier. Sorry
Horizontal is not in general the best choice on a screen as vertical scolling is easier. Yes, but if the options are short enough then you don't have horizontal scrolling and you can have more items in the view and thus less vertical scrolling.
This illustrate the three possible layouts of the multichoice.
The vertical and horizontal use a table following the code of the standard multichoice. Here is the HTML question code of the first example.
<p>This question consists of some text with an answer embedded right here {1:MULTICHOICE:Wrong answer#Feedback for this wrong answer~Another wrong answer#Feedback for the other wrong answer~=Correct answer#Feedback for correct answer~%50%Answer that gives half the credit#Feedback for half credit answer}.</p> <p>VERTICALThe same multichoice in vertical mode <table width="50%"> <tbody> <tr> <td>{2:MCV:Wrong answer#Feedback for this wrong answer~Another wrong answer#Feedback for the other wrong answer~=Correct answer#Feedback for correct answer~%50%Answer that gives half the credit#Feedback for half credit answer}.</td> </tr> <tr> </tr> </tbody> </table> <table> <tbody> <tr> <td>HORIZONTALThe same multichoice in horizontal mode</td> <td>{2:MCH:Wrong answer#Feedback for this wrong answer~Another wrong answer#Feedback for the other wrong answer~=Correct answer#Feedback for correct answer~%50%Answer that gives half the credit#Feedback for half credit answer}</td> </tr> </tbody> </table> </p> <p>.</p> <p> </p> Notice that the Horizontal has been put in a table so that the answers output (i.e. between the {2:MCH:...answer} is place in one cell so that his dimension is controlled by the cell width. The code is transparent to the ordinary cloze question as these vertical and horizontal dispaly are declared by using for The multipleanswer/questiontype.php integrate the code of the multichoice/questiontype.php and multichoice/display.html using a table to contain the answers and the feedback. As the only changes to the cloze text are the new MCV and MCH terms this modification will be easily merged to 1.9 or older version if necessary. Further testing the XML import and export shows that everything is OK so I will CVS to HEAD.
Backup and restore should work as this is the same questions and subquestion structure. The various tests show that the code is OK.
todo: help and doc with example and merging to older version. Tim the actual multianswer code decode the question text using regexp and for doing so define some constants outside the multianswer questions type. line 867 of multianswer/questiontype.php ///////////////////////////////////////////////////////////// //// ADDITIONAL FUNCTIONS //// The functions below deal exclusivly with editing //// of questions with question type 'multianswer'. //// Therefore they are kept in this file. //// They are not in the class as they are not //// likely to be subject for overriding. ///////////////////////////////////////////////////////////// // ANSWER_ALTERNATIVE regexes // Parenthesis positions for ANSWER_ALTERNATIVE_REGEX and also the function I think that this should be changed because of plug-ins. Tim,
Could you revise the help text before I put it on 1.9.3 The code for the new display is already on 1.9.3. In 1.9.3 do I put this as help/quiz/multianswer.html or as help/qtype_multianswer/multianswer.html as in 2.0? The help/qtype_multianswer/multianswer.html does not seem to work on 1.9.3 although there is a similar help/qtype_multichoice/multichoice.html. From a suggestion of Tieku Bortei-Doku I will eliminate the numbering and let the user add it at its convenience
see http://moodle.org/mod/forum/discuss.php?d=96799#p484226 Everything seems to be set even the help file and comments are positive on forum.
Just tested latest version of multianswer questiontype.php,v 1.41.2.16 2009/01/26 01:27:16 pichetp with moodle 1.9.4.
I have used the online Help example provided to create a multianswer/cloze question. I am using standard theme. The display is not correct, the questions following a vertical or horizontal multiple choice question are displayed to the right of the table instead of below ; see attached screenshot JR (1). The only way I have found to get a correct display of the online Help example is to style the paragraphs following those MCQ questions with a clear:both CSS style. It does work but the correct display should be provided by the multianswer/cloze question type itself, rather than resorting to this hack. see screenshot JR (2). Joseph Thanks Joseph for your continuous testing and suggestions.
I have noticed that the following questions are not displayed correctly strictu sensu. However it will be nice if you could put additional info in moodle docs on how to get different displays of these table elements using CSS. The actual help is already quite long but I can add a specific reference once you have set moodle docs. You could also suggest a totally new example to put in the help that will illustrate more clearly all these new options. I think that this is more an help problem than a question code one. The attached patch multianswerpatchjr.txt (against current 1.9.4 version) works fine.
Joseph patch by Joseph Rézeau to get correct display after feedback tables in MCQ horizontal and vertical display tables.
The <table> are already <table class="answer"> as in multichoice so that they will be rendered like multichoice.
The Joseph patch is to add <div class="clearfix"></div> after the table . I did not add any formatting to the question text as I want to give complete freedom to the users. If we look at the forum the horizontal or vertical displays will be mostly used for a complete list of similar questions and the resulting tables will be displayed correctly. The forum feedbacks were satisfied with the actual code. The <div class="clearfix"></div> trick could be inserted in the help text. If there is a sufficient feedback from the users, we could do fix following Joseph patch. Pierre, I leave it up to you to decide whether to apply my patch or not. I agree that my patch is only needed if a multianswer question is not made of a succession of MCQ questions of the same type...
Joseph Let do it by modifying the help file .
Coul you suggest a new example for the help file. I was actually suggesting changing <table class="answer"> to <table class="answer clearfix">.
My feeling is that more people would prefer it with that there. I think it is the behaviour more people would expect. However, I am happy to leave it up to your judgement. This seems to vary following other variables like here a display in explorer from a preview.
The text is put after the table element. So let the code as it is and practice a wait and see policy on the forum. These improvments were done because of forum posts. As usual http://132.208.141.198/moodle_19/ user:moodle pw:moodle Josph if you agree, close it Tim Hunt added a comment - 03/Feb/09 02:15 PM
> I was actually suggesting changing <table class="answer"> to <table class="answer clearfix">. No, Tim, that won't work. What we need is to clear AFTER the table, not BEFORE, as clearfix will do! My suggested hack does just that. Tim > Oh, but that may not work if you put it on the floated element itself.
I think it does not work because <table class="answer"> is already included in a clearfix div... Again, my fix seems the only working solution. Joseph |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||