Test Setup Failed
Push — master ( 611735...70ce31 )
by Angel Fernando Quiroz
163:12 queued 101:29
created
main/inc/lib/exercise_show_functions.lib.php 2 patches
Doc Comments   +37 added lines patch added patch discarded remove patch
@@ -24,6 +24,10 @@  discard block
 block discarded – undo
24 24
 	 * @param int       Question ID
25 25
      * @param int $resultsDisabled
26 26
      * @param string $originalStudentAnswer
27
+     * @param integer $feedbackType
28
+     * @param string $answer
29
+     * @param integer $id
30
+     * @param integer $questionId
27 31
 	 * @return void
28 32
 	 */
29 33
 	public static function display_fill_in_blanks_answer($feedbackType, $answer, $id, $questionId, $resultsDisabled, $originalStudentAnswer = '')
@@ -62,6 +66,10 @@  discard block
 block discarded – undo
62 66
      * @param string    Answer text
63 67
      * @param int       Exercise ID
64 68
      * @param int       Question ID
69
+     * @param integer $feedback_type
70
+     * @param string $answer
71
+     * @param integer $id
72
+     * @param integer $questionId
65 73
      * @return void
66 74
      */
67 75
     static function display_calculated_answer($feedback_type, $answer, $id, $questionId)
@@ -95,6 +103,9 @@  discard block
 block discarded – undo
95 103
 	 * @param string    Answer text
96 104
 	 * @param int       Exercise ID
97 105
 	 * @param int       Question ID
106
+	 * @param integer $feedback_type
107
+	 * @param integer $exe_id
108
+	 * @param integer $questionId
98 109
 	 * @return void
99 110
 	 */
100 111
 	static function display_free_answer($feedback_type, $answer, $exe_id, $questionId, $questionScore = null)
@@ -117,6 +128,12 @@  discard block
 block discarded – undo
117 128
         }
118 129
 	}
119 130
 
131
+	/**
132
+	 * @param integer $feedback_type
133
+	 * @param integer $id
134
+	 * @param integer $questionId
135
+	 * @param Nanogong $nano
136
+	 */
120 137
 	static function display_oral_expression_answer($feedback_type, $answer, $id, $questionId, $nano = null)
121 138
     {
122 139
         if (isset($nano)) {
@@ -234,6 +251,12 @@  discard block
 block discarded – undo
234 251
 	 * @param integer Exercise ID
235 252
 	 * @param integer Question ID
236 253
 	 * @param boolean Whether to show the answer comment or not
254
+	 * @param integer $answerType
255
+	 * @param string $answer
256
+	 * @param string $answerComment
257
+	 * @param integer $answerCorrect
258
+	 * @param integer $id
259
+	 * @param integer $questionId
237 260
 	 * @return void
238 261
 	 */
239 262
 	static function display_unique_or_multiple_answer(
@@ -318,6 +341,13 @@  discard block
 block discarded – undo
318 341
      * @param integer Exercise ID
319 342
      * @param integer Question ID
320 343
      * @param boolean Whether to show the answer comment or not
344
+     * @param integer $feedback_type
345
+     * @param integer $answerType
346
+     * @param string $answer
347
+     * @param string $answerComment
348
+     * @param integer $answerCorrect
349
+     * @param integer $id
350
+     * @param integer $questionId
321 351
      * @return void
322 352
      */
323 353
     static function display_multiple_answer_true_false(
@@ -408,6 +438,13 @@  discard block
 block discarded – undo
408 438
      * @param integer Exercise ID
409 439
      * @param integer Question ID
410 440
      * @param boolean Whether to show the answer comment or not
441
+     * @param integer $feedback_type
442
+     * @param integer $answerType
443
+     * @param string $answer
444
+     * @param string $answerComment
445
+     * @param integer $answerCorrect
446
+     * @param integer $id
447
+     * @param integer $questionId
411 448
      * @return void
412 449
      */
413 450
     static function display_multiple_answer_combination_true_false(
Please login to merge, or discard this patch.
Indentation   +88 added lines, -88 removed lines patch added patch discarded remove patch
@@ -17,16 +17,16 @@  discard block
 block discarded – undo
17 17
  */
18 18
 class ExerciseShowFunctions
19 19
 {
20
-	/**
21
-	 * Shows the answer to a fill-in-the-blanks question, as HTML
22
-	 * @param string    Answer text
23
-	 * @param int       Exercise ID
24
-	 * @param int       Question ID
20
+    /**
21
+     * Shows the answer to a fill-in-the-blanks question, as HTML
22
+     * @param string    Answer text
23
+     * @param int       Exercise ID
24
+     * @param int       Question ID
25 25
      * @param int $resultsDisabled
26 26
      * @param string $originalStudentAnswer
27
-	 * @return void
28
-	 */
29
-	public static function display_fill_in_blanks_answer($feedbackType, $answer, $id, $questionId, $resultsDisabled, $originalStudentAnswer = '')
27
+     * @return void
28
+     */
29
+    public static function display_fill_in_blanks_answer($feedbackType, $answer, $id, $questionId, $resultsDisabled, $originalStudentAnswer = '')
30 30
     {
31 31
         $answerHTML = FillBlanks::getHtmlDisplayForAnswer($answer, $resultsDisabled);
32 32
         if (strpos($originalStudentAnswer, 'font color') !== false) {
@@ -55,7 +55,7 @@  discard block
 block discarded – undo
55 55
             </tr>
56 56
         <?php
57 57
         }
58
-	}
58
+    }
59 59
 
60 60
     /**
61 61
      * Shows the answer to a calculated question, as HTML
@@ -90,14 +90,14 @@  discard block
 block discarded – undo
90 90
         }
91 91
     }
92 92
 
93
-	/**
94
-	 * Shows the answer to a free-answer question, as HTML
95
-	 * @param string    Answer text
96
-	 * @param int       Exercise ID
97
-	 * @param int       Question ID
98
-	 * @return void
99
-	 */
100
-	static function display_free_answer($feedback_type, $answer, $exe_id, $questionId, $questionScore = null)
93
+    /**
94
+     * Shows the answer to a free-answer question, as HTML
95
+     * @param string    Answer text
96
+     * @param int       Exercise ID
97
+     * @param int       Question ID
98
+     * @return void
99
+     */
100
+    static function display_free_answer($feedback_type, $answer, $exe_id, $questionId, $questionScore = null)
101 101
     {
102 102
         $comments = Event::get_comments($exe_id, $questionId);
103 103
 
@@ -115,9 +115,9 @@  discard block
 block discarded – undo
115 115
                 echo '</tr>';
116 116
             }
117 117
         }
118
-	}
118
+    }
119 119
 
120
-	static function display_oral_expression_answer($feedback_type, $answer, $id, $questionId, $nano = null)
120
+    static function display_oral_expression_answer($feedback_type, $answer, $id, $questionId, $nano = null)
121 121
     {
122 122
         if (isset($nano)) {
123 123
             echo $nano->show_audio_file();
@@ -151,8 +151,8 @@  discard block
 block discarded – undo
151 151
         }
152 152
     }
153 153
 
154
-	/**
155
-	 * Displays the answer to a hotspot question
154
+    /**
155
+     * Displays the answer to a hotspot question
156 156
      * @param int $feedback_type
157 157
      * @param int $answerId
158 158
      * @param string $answer
@@ -161,7 +161,7 @@  discard block
 block discarded – undo
161 161
      * @param string $in_results_disabled
162 162
      * @param int $orderColor
163 163
      */
164
-	public static function display_hotspot_answer(
164
+    public static function display_hotspot_answer(
165 165
         $feedback_type,
166 166
         $answerId,
167 167
         $answer,
@@ -176,7 +176,7 @@  discard block
 block discarded – undo
176 176
             $hide_expected_answer = true;
177 177
         }
178 178
 
179
-		$hotspot_colors = array(
179
+        $hotspot_colors = array(
180 180
             "", // $i starts from 1 on next loop (ugly fix)
181 181
             "#4271B5",
182 182
             "#FE8E16",
@@ -191,7 +191,7 @@  discard block
 block discarded – undo
191 191
             "#ED2024",
192 192
             "#3B3B3B",
193 193
             "#F7BDE2");
194
-		?>
194
+        ?>
195 195
 		<table class="data_table">
196 196
 		<tr>
197 197
             <td class="text-center" width="5%">
@@ -203,10 +203,10 @@  discard block
 block discarded – undo
203 203
 			<td class="text-left" width="10%">
204 204
 				<?php
205 205
                 if (!$hide_expected_answer) {
206
-    				$my_choice = ($studentChoice)?get_lang('Correct'):get_lang('Fault');
207
-    				echo $my_choice;
206
+                    $my_choice = ($studentChoice)?get_lang('Correct'):get_lang('Fault');
207
+                    echo $my_choice;
208 208
                 }
209
-				?>
209
+                ?>
210 210
 			</td>
211 211
 			<?php if ($feedback_type != EXERCISE_FEEDBACK_TYPE_EXAM) { ?>
212 212
 			<td class="text-left" width="60%">
@@ -214,29 +214,29 @@  discard block
 block discarded – undo
214 214
                 if ($studentChoice) {
215 215
                     echo '<span style="font-weight: bold; color: #008000;">'.nl2br($answerComment).'</span>';
216 216
                 }
217
-				?>
217
+                ?>
218 218
 			</td>
219 219
 			<?php } else { ?>
220 220
 				<td class="text-left" width="60%">&nbsp;</td>
221 221
 			<?php } ?>
222 222
 		</tr>
223 223
 		<?php
224
-	}
224
+    }
225 225
 
226
-	/**
227
-	 * Display the answers to a multiple choice question
228
-	 * @param int $feedback_type Feedback type
229
-	 * @param integer Answer type
230
-	 * @param integer Student choice
231
-	 * @param string  Textual answer
232
-	 * @param string  Comment on answer
233
-	 * @param string  Correct answer comment
234
-	 * @param integer Exercise ID
235
-	 * @param integer Question ID
236
-	 * @param boolean Whether to show the answer comment or not
237
-	 * @return void
238
-	 */
239
-	static function display_unique_or_multiple_answer(
226
+    /**
227
+     * Display the answers to a multiple choice question
228
+     * @param int $feedback_type Feedback type
229
+     * @param integer Answer type
230
+     * @param integer Student choice
231
+     * @param string  Textual answer
232
+     * @param string  Comment on answer
233
+     * @param string  Correct answer comment
234
+     * @param integer Exercise ID
235
+     * @param integer Question ID
236
+     * @param boolean Whether to show the answer comment or not
237
+     * @return void
238
+     */
239
+    static function display_unique_or_multiple_answer(
240 240
         $feedback_type,
241 241
         $answerType,
242 242
         $studentChoice,
@@ -269,39 +269,39 @@  discard block
 block discarded – undo
269 269
         } else {
270 270
             echo "-";
271 271
         }
272
-		echo '</td>';
273
-		echo '<td width="40%">';
272
+        echo '</td>';
273
+        echo '<td width="40%">';
274 274
         echo $answer;
275
-		echo '</td>';
275
+        echo '</td>';
276 276
 
277 277
         if ($feedback_type != EXERCISE_FEEDBACK_TYPE_EXAM) {
278
-		    echo '<td width="20%">';
278
+            echo '<td width="20%">';
279 279
             if ($studentChoice) {
280
-				if ($answerCorrect) {
280
+                if ($answerCorrect) {
281 281
                     $color = 'green';
282
-					//echo '<span style="font-weight: bold; color: #008000;">'.nl2br($answerComment).'</span>';
283
-				} else {
282
+                    //echo '<span style="font-weight: bold; color: #008000;">'.nl2br($answerComment).'</span>';
283
+                } else {
284 284
                     $color = 'black';
285 285
                     //echo '<span style="font-weight: bold; color: #FF0000;">'.nl2br($answerComment).'</span>';
286
-				}
286
+                }
287 287
                 echo '<span style="font-weight: bold; color: '.$color.';">'.nl2br($answerComment).'</span>';
288 288
 
289
-			} else {
290
-				if ($answerCorrect) {
291
-					//echo '<span style="font-weight: bold; color: #000;">'.nl2br($answerComment).'</span>';
292
-				} else {
289
+            } else {
290
+                if ($answerCorrect) {
291
+                    //echo '<span style="font-weight: bold; color: #000;">'.nl2br($answerComment).'</span>';
292
+                } else {
293 293
                     //echo '<span style="font-weight: normal; color: #000;">'.nl2br($answerComment).'</span>';
294
-				}
295
-			}
296
-		    echo '</td>';
297
-		    if ($ans==1) {
298
-		        $comm = Event::get_comments($id,$questionId);
299
-			}
294
+                }
295
+            }
296
+            echo '</td>';
297
+            if ($ans==1) {
298
+                $comm = Event::get_comments($id,$questionId);
299
+            }
300 300
         } else {
301
-			echo '<td>&nbsp;</td>';
302
-		}
303
-		echo '</tr>';
304
-	}
301
+            echo '<td>&nbsp;</td>';
302
+        }
303
+        echo '</tr>';
304
+    }
305 305
 
306 306
     /**
307 307
      * Display the answers to a multiple choice question
@@ -345,7 +345,7 @@  discard block
 block discarded – undo
345 345
         if (isset($new_options[$studentChoice])) {
346 346
             echo get_lang($new_options[$studentChoice]['name']);
347 347
         } else {
348
-        	echo '-';
348
+            echo '-';
349 349
         }
350 350
 
351 351
         ?>
@@ -353,7 +353,7 @@  discard block
 block discarded – undo
353 353
         <td width="5%">
354 354
         <?php
355 355
 
356
-		//Expected choice
356
+        //Expected choice
357 357
         if (!$hide_expected_answer) {
358 358
             if (isset($new_options[$answerCorrect])) {
359 359
                 echo get_lang($new_options[$answerCorrect]['name']);
@@ -393,19 +393,19 @@  discard block
 block discarded – undo
393 393
         <?php
394 394
     }
395 395
 
396
-     /**
397
-     * Display the answers to a multiple choice question
398
-     *
399
-     * @param integer Answer type
400
-     * @param integer Student choice
401
-     * @param string  Textual answer
402
-     * @param string  Comment on answer
403
-     * @param string  Correct answer comment
404
-     * @param integer Exercise ID
405
-     * @param integer Question ID
406
-     * @param boolean Whether to show the answer comment or not
407
-     * @return void
408
-     */
396
+        /**
397
+         * Display the answers to a multiple choice question
398
+         *
399
+         * @param integer Answer type
400
+         * @param integer Student choice
401
+         * @param string  Textual answer
402
+         * @param string  Comment on answer
403
+         * @param string  Correct answer comment
404
+         * @param integer Exercise ID
405
+         * @param integer Question ID
406
+         * @param boolean Whether to show the answer comment or not
407
+         * @return void
408
+         */
409 409
     static function display_multiple_answer_combination_true_false(
410 410
         $feedback_type,
411 411
         $answerType,
@@ -426,7 +426,7 @@  discard block
 block discarded – undo
426 426
         <tr>
427 427
         <td width="5%">
428 428
         <?php
429
-		//Your choice
429
+        //Your choice
430 430
         $question = new MultipleAnswerCombinationTrueFalse();
431 431
         if (isset($question->options[$studentChoice])) {
432 432
             echo $question->options[$studentChoice];
@@ -437,7 +437,7 @@  discard block
 block discarded – undo
437 437
         </td>
438 438
         <td width="5%">
439 439
         <?php
440
-		//Expected choice
440
+        //Expected choice
441 441
         if (!$hide_expected_answer) {
442 442
             if (isset($question->options[$answerCorrect])) {
443 443
                 echo $question->options[$answerCorrect];
@@ -462,20 +462,20 @@  discard block
 block discarded – undo
462 462
             <?php
463 463
             //@todo replace this harcoded value
464 464
             if ($studentChoice) {
465
-                 $color = "black";
465
+                    $color = "black";
466 466
                 if ($studentChoice == $answerCorrect) {
467 467
                     $color = "green";
468 468
                 }
469 469
                 echo '<span style="font-weight: bold; color: '.$color.';">'.nl2br($answerComment).'</span>';
470 470
             }
471 471
             if ($studentChoice == 2 || $studentChoice == '') {
472
-            	//echo '<span style="font-weight: bold; color: #000;">'.nl2br($answerComment).'</span>';
472
+                //echo '<span style="font-weight: bold; color: #000;">'.nl2br($answerComment).'</span>';
473 473
             } else {
474
-				if ($studentChoice == $answerCorrect) {
475
-	            	//echo '<span style="font-weight: bold; color: #008000;">'.nl2br($answerComment).'</span>';
476
-				} else {
474
+                if ($studentChoice == $answerCorrect) {
475
+                    //echo '<span style="font-weight: bold; color: #008000;">'.nl2br($answerComment).'</span>';
476
+                } else {
477 477
                     //echo '<span style="font-weight: bold; color: #FF0000;">'.nl2br($answerComment).'</span>';
478
-				}
478
+                }
479 479
             }
480 480
             ?>
481 481
         </td>
Please login to merge, or discard this patch.