Code Duplication    Length = 19-19 lines in 2 locations

main/exercise/exercise.class.php 1 location

@@ 7060-7078 (lines=19) @@
7057
            echo $this->showQuestion($question_obj, false, $origin, $i, $showTitle, false, $user_choice, false, null, false, $this->getModelType(), $this->categoryMinusOne);
7058
7059
            // Button save and continue
7060
            switch ($this->type) {
7061
                case ONE_PER_PAGE:
7062
                    $exercise_actions .= $this->show_button($questionId, $current_question, null, $remindList);
7063
                    break;
7064
                case ALL_ON_ONE_PAGE:
7065
                    $button = [
7066
                        Display::button(
7067
                            'save_now',
7068
                            get_lang('SaveForNow'),
7069
                            ['type' => 'button', 'class' => 'btn btn-primary', 'data-question' => $questionId]
7070
                        ),
7071
                        '<span id="save_for_now_'.$questionId.'" class="exercise_save_mini_message"></span>'
7072
                    ];
7073
                    $exercise_actions .= Display::div(
7074
                        implode(PHP_EOL, $button),
7075
                        array('class'=>'exercise_save_now_button')
7076
                    );
7077
                    break;
7078
            }
7079
7080
            if (!empty($questions_in_media)) {
7081
                $count_of_questions_inside_media = count($questions_in_media);

main/exercise/exercise_submit.php 1 location

@@ 1326-1344 (lines=19) @@
1323
        );
1324
1325
        // Button save and continue
1326
        switch ($objExercise->type) {
1327
            case ONE_PER_PAGE:
1328
                $exercise_actions .= $objExercise->show_button($questionId, $current_question);
1329
                break;
1330
            case ALL_ON_ONE_PAGE :
1331
                $button = [
1332
                    Display::button(
1333
                        'save_now',
1334
                        get_lang('SaveForNow'),
1335
                        ['type' => 'button', 'class' => 'btn btn-info', 'data-question' => $questionId]
1336
                    ),
1337
                    '<span id="save_for_now_'.$questionId.'"></span>&nbsp;'
1338
                ];
1339
                $exercise_actions .= Display::div(
1340
                    implode(PHP_EOL, $button),
1341
                    array('class'=>'exercise_save_now_button')
1342
                );
1343
                break;
1344
        }
1345
1346
        // Checkbox review answers
1347
        if ($objExercise->review_answers) {