Code Duplication    Length = 5-9 lines in 2 locations

main/inc/lib/exercise.lib.php 1 location

@@ 276-284 (lines=9) @@
273
                // Unique answer
274
                if (in_array($answerType, [UNIQUE_ANSWER, UNIQUE_ANSWER_NO_OPTION, UNIQUE_ANSWER_IMAGE])) {
275
                    $input_id = 'choice-' . $questionId . '-' . $answerId;
276
                    if (isset($user_choice[0]) && $user_choice[0]->getAnswer() == $numAnswer) {
277
                        $attributes = array(
278
                            'id' => $input_id,
279
                            'checked' => 1,
280
                            'selected' => 1
281
                        );
282
                    } else {
283
                        $attributes = array('id' => $input_id);
284
                    }
285
286
                    if ($debug_mark_answer) {
287
                        if ($answerCorrect) {

main/exercice/exercise.class.php 1 location

@@ 7009-7013 (lines=5) @@
7006
                if (in_array($answerType, array(UNIQUE_ANSWER, UNIQUE_ANSWER_IMAGE, UNIQUE_ANSWER_NO_OPTION))) {
7007
7008
                    $input_id = 'choice-'.$questionId.'-'.$answerId;
7009
                    if (isset($user_choice[0]['answer']) && $user_choice[0]['answer'] == $numAnswer) {
7010
                        $attributes = array('id' => $input_id, 'checked' => 1, 'selected' => 1);
7011
                    } else {
7012
                        $attributes = array('id' => $input_id);
7013
                    }
7014
7015
                    if ($debug_mark_answer) {
7016
                        if ($answerCorrect) {