Minor improvements to match and multianswer.
This commit is contained in:
@@ -216,7 +216,8 @@ class quiz_match_qtype extends quiz_default_questiontype {
|
||||
|
||||
///// Print the input controls //////
|
||||
echo '<table border="0" cellpadding="10" align="right">';
|
||||
foreach ($subquestions as $key => $subquestion) {
|
||||
foreach ($state->options->order as $key) {
|
||||
$subquestion = $subquestions[$key];
|
||||
|
||||
/// Subquestion text:
|
||||
echo '<tr><td align="left" valign="top">';
|
||||
@@ -268,7 +269,7 @@ class quiz_match_qtype extends quiz_default_questiontype {
|
||||
|
||||
$sumgrade = 0;
|
||||
foreach ($subquestions as $key => $sub) {
|
||||
if (isset($responses[$key]) and isset($sub->options->answers[$responses[$key]])) {
|
||||
if (isset($sub->options->answers[$responses[$key]])) {
|
||||
$sumgrade += $sub->options->answers[$responses[$key]]->fraction;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -457,7 +457,8 @@ function quiz_qtype_multianswer_extract_question($text) {
|
||||
$wrapped->answer = array();
|
||||
$wrapped->fraction = array();
|
||||
$wrapped->feedback = array();
|
||||
$wrapped->questiontext = $answerregs[0]; //addslashes($answerregs[0]);
|
||||
$wrapped->questiontext = addslashes(str_replace('&\#', '&#',
|
||||
$answerregs[0]));
|
||||
$wrapped->questiontextformat = 0;
|
||||
|
||||
$remainingalts = $answerregs[ANSWER_REGEX_ALTERNATIVES];
|
||||
|
||||
Reference in New Issue
Block a user