Skip to content
Browse files

Merge branch 'MDL-28612_21' of git://github.com/timhunt/moodle into M…

…OODLE_21_STABLE
  • Loading branch information...
2 parents 62bdb79 + 788e2b3 commit cf7daeae7ea5fee712a0f082dd75c01d66b946cf @samhemelryk samhemelryk committed
Showing with 10 additions and 4 deletions.
  1. +9 −3 mod/quiz/report/statistics/responseanalysis.php
  2. +1 −1 question/type/questionbase.php
View
12 mod/quiz/report/statistics/responseanalysis.php
@@ -98,12 +98,18 @@ public function has_response_classes() {
/**
* @return bool whether this analysis has a response class more than one
- * different acutal response.
+ * different acutal response, or if the actual response is different from
+ * the model response.
*/
public function has_actual_responses() {
foreach ($this->responseclasses as $subpartid => $partclasses) {
- foreach ($partclasses as $responseclassid => $notused) {
- if (count($this->responses[$subpartid][$responseclassid]) > 1) {
+ foreach ($partclasses as $responseclassid => $modelresponse) {
+ $numresponses = count($this->responses[$subpartid][$responseclassid]);
+ if ($numresponses > 1) {
+ return true;
+ }
+ $actualresponse = key($this->responses[$subpartid][$responseclassid]);
+ if ($numresponses == 1 && $actualresponse != $modelresponse->responseclass) {
return true;
}
}
View
2 question/type/questionbase.php
@@ -454,7 +454,7 @@ public function __construct($responseclassid, $response, $fraction) {
}
public static function no_response() {
- return new question_classified_response(null, null, null);
+ return new question_classified_response(null, get_string('noresponse', 'question'), null);
}
}

0 comments on commit cf7daea

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