MDL-34050 Lesson Module: Fixed spacing and removed array_unique() for responses
authorRossiani Wijaya <rwijaya@moodle.com>
Tue, 15 Jan 2013 03:17:55 +0000 (11:17 +0800)
committerRossiani Wijaya <rwijaya@moodle.com>
Tue, 15 Jan 2013 03:17:55 +0000 (11:17 +0800)
mod/lesson/locallib.php
mod/lesson/pagetypes/matching.php

index 3a139a4..10b8541 100644 (file)
@@ -2311,9 +2311,9 @@ abstract class lesson_page extends lesson_base {
             $count = 0;
             $qtype = $properties->qtype;
             foreach ($this->answers as $answer) {
-                $properties->{'answer_editor['.$count.']'} = array('text'=>$answer->answer, 'format'=>$answer->answerformat);
+                $properties->{'answer_editor['.$count.']'} = array('text' => $answer->answer, 'format' => $answer->answerformat);
                 if ($qtype != LESSON_PAGE_MATCHING) {
-                    $properties->{'response_editor['.$count.']'} = array('text'=>$answer->response, 'format'=>$answer->responseformat);
+                    $properties->{'response_editor['.$count.']'} = array('text' => $answer->response, 'format' => $answer->responseformat);
                 } else {
                     $properties->{'response_editor['.$count.']'} = $answer->response;
                 }
index d27cecc..00b0dcb 100644 (file)
@@ -80,7 +80,6 @@ class lesson_page_type_matching extends lesson_page {
         if (!empty($responses)) {
             $shuffleresponses = $responses;
             shuffle($shuffleresponses);
-            $shuffleresponses = array_unique($shuffleresponses);
             foreach ($shuffleresponses as  $response) {
                 $key = array_search($response, $responses);
                 $responseoptions[$key] = $response;