Skip to content

Commit

Permalink
Merge branch 'MDL-26486' of git://github.com/rwijaya/moodle
Browse files Browse the repository at this point in the history
  • Loading branch information
Aparup Banerjee committed Oct 3, 2011
2 parents c04b01f + c90ba16 commit b735bd1
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 15 deletions.
25 changes: 11 additions & 14 deletions mod/lesson/pagetypes/matching.php
Original file line number Diff line number Diff line change
Expand Up @@ -383,26 +383,23 @@ public function report_answers($answerpage, $answerdata, $useranswer, $pagestats
} else {
$answerdata->response = $answer->response;
}
if ($this->lesson->custom) {
$answerdata->score = get_string("pointsearned", "lesson").": ".$answer->score;
} else {
$answerdata->score = get_string("receivedcredit", "lesson");
}
} elseif ($n == 1 && $useranswer != NULL && !$useranswer->correct) {
if ($answer->response == NULL && $useranswer != NULL) {
$answerdata->response = get_string("thatsthewronganswer", "lesson");
} else {
$answerdata->response = $answer->response;
}
} elseif ($n > 1) {
if ($n == 2 && $useranswer != NULL && $useranswer->correct) {
if ($this->lesson->custom) {
$answerdata->score = get_string("pointsearned", "lesson").": ".$answer->score;
} else {
$answerdata->score = get_string("receivedcredit", "lesson");
}
} elseif ($n == 3 && $useranswer != NULL && !$useranswer->correct) {
if ($this->lesson->custom) {
$answerdata->score = get_string("pointsearned", "lesson").": ".$answer->score;
} else {
$answerdata->score = get_string("didnotreceivecredit", "lesson");
}
if ($this->lesson->custom) {
$answerdata->score = get_string("pointsearned", "lesson").": ".$answer->score;
} else {
$answerdata->score = get_string("didnotreceivecredit", "lesson");
}
} elseif ($n > 1) {
$data = "<select disabled=\"disabled\"><option selected=\"selected\">".strip_tags(format_string($answer->answer))."</option></select>";
if ($useranswer != NULL) {
$userresponse = explode(",", $useranswer->useranswer);
Expand All @@ -427,7 +424,7 @@ public function report_answers($answerpage, $answerdata, $useranswer, $pagestats
$percent = get_string("nooneansweredthisquestion", "lesson");
}
} else {
$percent = "";
$percent = '';
}

$answerdata->answers[] = array($data, $percent);
Expand Down
2 changes: 1 addition & 1 deletion mod/lesson/pagetypes/shortanswer.php
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ public function report_answers($answerpage, $answerdata, $useranswer, $pagestats
$answerdata->answers[] = array(get_string("nooneansweredthisquestion", "lesson"), " ");
}
$i++;
} else if ($useranswer != null && ($answer->id == $useranswer->answerid || ($answer == end($answers) && empty($answerdata)))) {
} else if ($useranswer != null && ($answer->id == $useranswer->answerid || $answer == end($answers))) {
// get in here when what the user entered is not one of the answers
$data = '<input type="text" size="50" disabled="disabled" readonly="readonly" value="'.s($useranswer->useranswer).'">';
if (isset($pagestats[$this->properties->id][$useranswer->useranswer])) {
Expand Down

0 comments on commit b735bd1

Please sign in to comment.