Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge branch 'MDL-26486' of git://github.com/rwijaya/moodle

  • Loading branch information...
commit b735bd19cce4e1bc3d2a3e5f640d25b66f23ee25 2 parents c04b01f + c90ba16
@nebgor nebgor authored
View
25 mod/lesson/pagetypes/matching.php
@@ -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);
@@ -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);
View
2  mod/lesson/pagetypes/shortanswer.php
@@ -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])) {

0 comments on commit b735bd1

Please sign in to comment.
Something went wrong with that request. Please try again.