| @@ -58,18 +58,18 @@ | ||
| 58 | 58 | |
| 59 | 59 | if ( $answers ) { |
| 60 | 60 | $correct = true; |
| 61 | 61 | foreach ( $answers as $key => $option ) { |
| 62 | - $selected = $this->is_selected_option( $option, $user_answer ); | |
| 62 | + $data = $option->get_data(); | |
| 63 | + $selected = $this->is_selected_option( $data, $user_answer ); | |
| 63 | 64 | |
| 64 | - // If the option is FALSE but user selected => WRONG | |
| 65 | 65 | if ( $selected && ! $option->is_true() ) { |
| 66 | 66 | $correct = false; |
| 67 | - } elseif ( ! $selected && $option->is_true() ) { // If option is TRUE but user did not select => WRONG | |
| 67 | + } elseif ( ! $selected && $option->is_true() ) { | |
| 68 | 68 | $correct = false; |
| 69 | 69 | } |
| 70 | 70 | |
| 71 | - // Only one option is selected wrong | |
| 71 | + // Only one option is selected wrong will wrong the answer. | |
| 72 | 72 | if ( ! $correct ) { |
| 73 | 73 | break; |
| 74 | 74 | } |
| 75 | 75 | } |