MDL-10680:

subquestions/subanswers needed swapped for matching questions
This commit is contained in:
thepurpleblob 2007-08-01 13:43:29 +00:00
parent a871e630b2
commit f4c0f3d062

View file

@ -166,8 +166,8 @@ class qformat_webct extends qformat_default {
} }
function readquestions ($lines) { function readquestions ($lines) {
global $QTYPES ; global $QTYPES ;
// $qtypecalculated = new qformat_webct_modified_calculated_qtype(); // $qtypecalculated = new qformat_webct_modified_calculated_qtype();
$webctnumberregex = $webctnumberregex =
'[+-]?([0-9]+(\\.[0-9]*)?|\\.[0-9]+)((e|E|\\*10\\*\\*)([+-]?[0-9]+|\\([+-]?[0-9]+\\)))?'; '[+-]?([0-9]+(\\.[0-9]*)?|\\.[0-9]+)((e|E|\\*10\\*\\*)([+-]?[0-9]+|\\([+-]?[0-9]+\\)))?';
@ -348,6 +348,13 @@ class qformat_webct extends qformat_default {
unset($question->answer); //not used in calculated question unset($question->answer); //not used in calculated question
break; break;
case MATCH: case MATCH:
// MDL-10680:
// switch subquestions and subanswers
foreach ($question->subquestions as $id=>$subquestion) {
$temp = $question->subquestions[$id];
$question->subquestions[$id] = $question->subanswers[$id];
$question->subanswers[$id] = $temp;
}
if (count($question->answer) < 3){ if (count($question->answer) < 3){
// add a dummy missing question // add a dummy missing question
$question->name = 'Dummy question added '.$question->name ; $question->name = 'Dummy question added '.$question->name ;