A fix for SC178. The match question is now encrypted slightly.

This commit is contained in:
moodler
2006-03-29 06:11:50 +00:00
parent 28680c9b32
commit f2feb260f7
@@ -224,7 +224,7 @@ class quiz_match_qtype extends quiz_default_questiontype {
echo '</td>';
/// Drop-down list:
$menuname = $nameprefix.$subquestion->id;
$menuname = $nameprefix.rc4encrypt($subquestion->id);
$response = isset($state->responses[$subquestion->id])
? $state->responses[$subquestion->id] : '0';
if ($options->readonly
@@ -256,6 +256,14 @@ class quiz_match_qtype extends quiz_default_questiontype {
function grade_responses(&$question, &$state, $quiz) {
$subquestions = $state->options->subquestions;
foreach ($state->responses as $key => $value) { // Decrypt strings back to numbers
if ((string)(int)$key == (string)$key) { // Has been done before
continue;
}
unset($state->responses[$key]);
$state->responses[rc4decrypt($key)] = $value;
}
$responses = &$state->responses;
$answers = array();