Code Duplication    Length = 10-10 lines in 2 locations

main/exercise/exercise.class.php 1 location

@@ 6873-6882 (lines=10) @@
6870
            echo $this->showQuestion($question_obj, false, $origin, $i, $showTitle, false, $user_choice, false, null, false, $this->getModelType(), $this->categoryMinusOne);
6871
6872
            // Button save and continue
6873
            switch ($this->type) {
6874
                case ONE_PER_PAGE:
6875
                    $exercise_actions .= $this->show_button($questionId, $current_question, null, $remindList);
6876
                    break;
6877
                case ALL_ON_ONE_PAGE:
6878
                    $button  = '<a href="javascript://" class="btn" onclick="save_now(\''.$questionId.'\', null, true, 1); ">'.get_lang('SaveForNow').'</a>';
6879
                    $button .= '<span id="save_for_now_'.$questionId.'" class="exercise_save_mini_message"></span>&nbsp;';
6880
                    $exercise_actions .= Display::div($button, array('class'=>'exercise_save_now_button'));
6881
                    break;
6882
            }
6883
6884
            if (!empty($questions_in_media)) {
6885
                $count_of_questions_inside_media = count($questions_in_media);

main/exercise/exercise_submit.php 1 location

@@ 1229-1238 (lines=10) @@
1226
        );
1227
1228
        // Button save and continue
1229
        switch ($objExercise->type) {
1230
            case ONE_PER_PAGE:
1231
                $exercise_actions .= $objExercise->show_button($questionId, $current_question);
1232
                break;
1233
            case ALL_ON_ONE_PAGE :
1234
                $button  = '<a href="javascript://" class="btn btn-info" onclick="save_now(\''.$questionId.'\'); ">'.get_lang('SaveForNow').'</a>';
1235
                $button .= '<span id="save_for_now_'.$questionId.'"></span>&nbsp;';
1236
                $exercise_actions  .= Display::div($button, array('class'=>'exercise_save_now_button'));
1237
                break;
1238
        }
1239
1240
        // Checkbox review answers
1241
        if ($objExercise->review_answers) {