get_answers(); if ( $answers ) { $correct = true; foreach ( $answers as $key => $option ) { $data = $option->get_data(); $selected = $this->is_selected_option( $data, $user_answer ); if ( $selected && ! $option->is_true() ) { $correct = false; } elseif ( ! $selected && $option->is_true() ) { $correct = false; } // Only one option is selected wrong will wrong the answer. if ( ! $correct ) { break; } } if ( $correct ) { $return = array( 'correct' => true, 'mark' => floatval( $this->get_mark() ), ); } } return $return; } } }