Code Duplication    Length = 19-19 lines in 2 locations

main/exercise/exercise_submit.php 1 location

@@ 1277-1295 (lines=19) @@
1274
        );
1275
1276
        // Button save and continue
1277
        switch ($objExercise->type) {
1278
            case ONE_PER_PAGE:
1279
                $exercise_actions .= $objExercise->show_button($questionId, $current_question);
1280
                break;
1281
            case ALL_ON_ONE_PAGE :
1282
                $button = [
1283
                    Display::button(
1284
                        'save_now',
1285
                        get_lang('SaveForNow'),
1286
                        ['type' => 'button', 'class' => 'btn btn-info', 'data-question' => $questionId]
1287
                    ),
1288
                    '<span id="save_for_now_'.$questionId.'"></span>&nbsp;'
1289
                ];
1290
                $exercise_actions .= Display::div(
1291
                    implode(PHP_EOL, $button),
1292
                    array('class'=>'exercise_save_now_button')
1293
                );
1294
                break;
1295
        }
1296
1297
        // Checkbox review answers
1298
        if ($objExercise->review_answers) {

main/exercise/exercise.class.php 1 location

@@ 6936-6954 (lines=19) @@
6933
            echo $this->showQuestion($question_obj, false, $origin, $i, $showTitle, false, $user_choice, false, null, false, $this->getModelType(), $this->categoryMinusOne);
6934
6935
            // Button save and continue
6936
            switch ($this->type) {
6937
                case ONE_PER_PAGE:
6938
                    $exercise_actions .= $this->show_button($questionId, $current_question, null, $remindList);
6939
                    break;
6940
                case ALL_ON_ONE_PAGE:
6941
                    $button = [
6942
                        Display::button(
6943
                            'save_now',
6944
                            get_lang('SaveForNow'),
6945
                            ['type' => 'button', 'class' => 'btn btn-primary', 'data-question' => $questionId]
6946
                        ),
6947
                        '<span id="save_for_now_'.$questionId.'" class="exercise_save_mini_message"></span>'
6948
                    ];
6949
                    $exercise_actions .= Display::div(
6950
                        implode(PHP_EOL, $button),
6951
                        array('class'=>'exercise_save_now_button')
6952
                    );
6953
                    break;
6954
            }
6955
6956
            if (!empty($questions_in_media)) {
6957
                $count_of_questions_inside_media = count($questions_in_media);