Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

MDL-37845 multichoice qtype: Fix some display issues.

1. Better handling of multi-line choices in the correct answer display.
2. Remove dangerous CSS that is no longer needed.
  • Loading branch information...
commit 9994233477a406a08318991cc12927138bd05523 1 parent cf5a329
Tim Hunt authored April 25, 2013
8  question/type/multichoice/renderer.php
@@ -227,8 +227,8 @@ public function correct_response(question_attempt $qa) {
227 227
             if (question_state::graded_state_for_fraction($ans->fraction) ==
228 228
                     question_state::$gradedright) {
229 229
                 return get_string('correctansweris', 'qtype_multichoice',
230  
-                        $question->format_text($ans->answer, $ans->answerformat,
231  
-                                $qa, 'question', 'answer', $ansid));
  230
+                        $question->make_html_inline($question->format_text($ans->answer, $ans->answerformat,
  231
+                                $qa, 'question', 'answer', $ansid)));
232 232
             }
233 233
         }
234 234
 
@@ -278,8 +278,8 @@ public function correct_response(question_attempt $qa) {
278 278
         $right = array();
279 279
         foreach ($question->answers as $ansid => $ans) {
280 280
             if ($ans->fraction > 0) {
281  
-                $right[] = $question->format_text($ans->answer, $ans->answerformat,
282  
-                        $qa, 'question', 'answer', $ansid);
  281
+                $right[] = $question->make_html_inline($question->format_text($ans->answer, $ans->answerformat,
  282
+                        $qa, 'question', 'answer', $ansid));
283 283
             }
284 284
         }
285 285
 
11  question/type/multichoice/styles.css
... ...
@@ -1,21 +1,12 @@
1 1
 .que.multichoice .answer .specificfeedback {
2  
-    padding: 0 0.7em;
3  
-    background: #FFF3BF;
4  
-}
5  
-.que.multichoice .answer .specificfeedback * {
6 2
     display: inline;
  3
+    padding: 0 0.7em;
7 4
     background: #FFF3BF;
8 5
 }
9  
-.que.multichoice .answer .specificfeedback script {
10  
-    display: none;
11  
-}
12 6
 .que.multichoice .answer div.r0,
13 7
 .que.multichoice .answer div.r1 {
14 8
     padding: 0.3em;
15 9
 }
16  
-.que.multichoice .feedback .rightanswer * {
17  
-    display: inline;
18  
-}
19 10
 
20 11
 /* Editing form. */
21 12
 body#page-question-type-multichoice div[id^=fitem_id_][id*=answer_] {

0 notes on commit 9994233

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