diff --git a/styles/choice.css b/styles/choice.css index d4f31aa..3da28f8 100644 --- a/styles/choice.css +++ b/styles/choice.css @@ -60,6 +60,11 @@ border-radius: 5px; } +.h5p-choices-user.h5p-choices-answered.h5p-choices-user-correct.h5p-choices-no-correct { + background-color: #186df7; + border: none; +} + .h5p-choices-user.h5p-choices-answered.h5p-choices-user-correct:before { font-family: 'h5p-reporting-icons'; content: "\e90c"; diff --git a/type-processors/choice-processor.class.php b/type-processors/choice-processor.class.php index 4ae1946..9c4b5ad 100644 --- a/type-processors/choice-processor.class.php +++ b/type-processors/choice-processor.class.php @@ -24,7 +24,8 @@ public function generateHTML($description, $crp, $response, $extras = NULL, $sco // We need some style for our report $this->setStyle('styles/choice.css'); - $correctAnswers = explode('[,]', $crp[0]); + // choice type exercises lack correct reponses pattern if there's no right/wrong answer + $correctAnswers = (isset($crp)) ? explode('[,]', $crp[0]) : NULL; $responses = explode('[,]', $response); $headerHtml = $this->generateHeader($description, $scoreSettings); @@ -77,19 +78,22 @@ private function generateDescription($description) { * @return string Table element */ private function generateTable($extras, $correctAnswers, $responses) { + $hasNoRightOrWrong = !isset($correctAnswers); $choices = $extras->choices; $tableHeader = '