Completed
Pull Request — master (#1301)
by Dwain
06:19
created
templates/single-quiz/question_type-boolean.php 1 patch
Spacing   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if ( ! defined( 'ABSPATH' ) ) exit;
2
+if ( ! defined('ABSPATH')) exit;
3 3
 /**
4 4
  * The Template for displaying True/False ( Boolean ) Question type.
5 5
  *
@@ -16,8 +16,8 @@  discard block
 block discarded – undo
16 16
      * Get the question data with the current quiz id
17 17
      * All data is loaded in this array to keep the template clean.
18 18
      */
19
-    $question_data = WooThemes_Sensei_Question::get_template_data( sensei_get_the_question_id(), get_the_ID() );
20
-    $boolean_options = array( 'true', 'false' );
19
+    $question_data = WooThemes_Sensei_Question::get_template_data(sensei_get_the_question_id(), get_the_ID());
20
+    $boolean_options = array('true', 'false');
21 21
 
22 22
 ?>
23 23
 
@@ -27,20 +27,20 @@  discard block
 block discarded – undo
27 27
 
28 28
     // setup the options the right answer set by the admin/teacher
29 29
     // will be compared to.
30
-    $boolean_options = array( true, false );
30
+    $boolean_options = array(true, false);
31 31
 
32 32
     //loop through the 2 boolean options and compare them with
33 33
     // the selected right answer
34
-    foreach ( $boolean_options as $option ){
34
+    foreach ($boolean_options as $option) {
35 35
 
36 36
         $answer_class = '';
37 37
 
38 38
         // Add classes to indicate correctness, only if there is a grade
39
-        if( isset( $question_data[ 'user_correct' ] ) && 0 < $question_data['question_grade'] ) {
39
+        if (isset($question_data['user_correct']) && 0 < $question_data['question_grade']) {
40 40
 
41
-            if( $question_right_answer == $question_data[ 'question_right_answer' ] ) {
41
+            if ($question_right_answer == $question_data['question_right_answer']) {
42 42
 
43
-                if( $question_data[ 'user_correct' ] ) {
43
+                if ($question_data['user_correct']) {
44 44
 
45 45
                     $answer_class = 'user_right';
46 46
 
@@ -50,7 +50,7 @@  discard block
 block discarded – undo
50 50
 
51 51
             } else {
52 52
 
53
-                if( ! $question_data[ 'user_correct' ] ) {
53
+                if ( ! $question_data['user_correct']) {
54 54
 
55 55
                     $answer_class = 'user_wrong';
56 56
 
@@ -64,25 +64,25 @@  discard block
 block discarded – undo
64 64
 
65 65
     ?>
66 66
 
67
-    <li class="<?php esc_attr_e( $answer_class ); ?>">
67
+    <li class="<?php esc_attr_e($answer_class); ?>">
68 68
 
69 69
         <input type="radio"
70
-               id="<?php echo esc_attr( 'question_' . $question_data[ 'ID' ]  ) . '-option-'. $option_value; ?>"
71
-               name="<?php echo esc_attr( 'sensei_question[' . $question_data[ 'ID' ]  . ']' ); ?>"
70
+               id="<?php echo esc_attr('question_'.$question_data['ID']).'-option-'.$option_value; ?>"
71
+               name="<?php echo esc_attr('sensei_question['.$question_data['ID'].']'); ?>"
72 72
                value="<?php echo $option_value; ?>"
73
-            <?php echo checked( $question_data[ 'user_answer_entry' ], $option_value, false ); ?>
74
-            <?php if ( !is_user_logged_in() ) { echo ' disabled'; } ?>
73
+            <?php echo checked($question_data['user_answer_entry'], $option_value, false); ?>
74
+            <?php if ( ! is_user_logged_in()) { echo ' disabled'; } ?>
75 75
 	    />
76
-        <label for="<?php echo esc_attr( 'question_' . $question_data[ 'ID' ]  ) . '-option-' . $option_value; ?>">
76
+        <label for="<?php echo esc_attr('question_'.$question_data['ID']).'-option-'.$option_value; ?>">
77 77
             <?php
78 78
 
79
-            if( 'true' == $option ){
79
+            if ('true' == $option) {
80 80
 
81
-                _e( 'True', 'woothemes-sensei' );
81
+                _e('True', 'woothemes-sensei');
82 82
 
83
-            }else{
83
+            } else {
84 84
 
85
-                _e( 'False', 'woothemes-sensei' );
85
+                _e('False', 'woothemes-sensei');
86 86
 
87 87
             }
88 88
 
Please login to merge, or discard this patch.