added a comment - - edited
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
define("ANSWER_ALTERNATIVE_FRACTION_REGEX",
'=|%(-?[0-9]+)%');
// for the syntax '(?<!' see http://www.perl.com/doc/manual/html/pod/perlre.html#item_C
define("ANSWER_ALTERNATIVE_ANSWER_REGEX",
'.+?(?<!\\\\|&|&)(?=~#}|$)');
define("ANSWER_ALTERNATIVE_FEEDBACK_REGEX",
'.*?(?<!\\\\)(?=[~}]|$)');
define("ANSWER_ALTERNATIVE_REGEX",
'(' . ANSWER_ALTERNATIVE_FRACTION_REGEX .')?' .
'(' . ANSWER_ALTERNATIVE_ANSWER_REGEX . ')' .
'(#(' . ANSWER_ALTERNATIVE_FEEDBACK_REGEX .'))?');
// Parenthesis positions for ANSWER_ALTERNATIVE_REGEX
define("ANSWER_ALTERNATIVE_REGEX_PERCENTILE_FRACTION", 2);
define("ANSWER_ALTERNATIVE_REGEX_FRACTION", 1);
define("ANSWER_ALTERNATIVE_REGEX_ANSWER", 3);
define("ANSWER_ALTERNATIVE_REGEX_FEEDBACK", 5);
and also the function
function qtype_multianswer_extract_question($text) {
I think that this should be changed because of plug-ins.
How can these constants be "define" inside a class ( in PHP5 and if different in PHP4)?
PHP5 which is the only one in 2.0
and PHP4 because 1.9 will be the Moodle for servers that are not migrating to PHP4...
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.