Code Duplication    Length = 10-10 lines in 2 locations

main/exercice/exercise.class.php 1 location

@@ 6737-6746 (lines=10) @@
6734
            echo $this->showQuestion($question_obj, false, $origin, $i, $showTitle, false, $user_choice, false, null, false, $this->getModelType(), $this->categoryMinusOne);
6735
6736
            // Button save and continue
6737
            switch ($this->type) {
6738
                case ONE_PER_PAGE:
6739
                    $exercise_actions .= $this->show_button($questionId, $current_question, null, $remindList);
6740
                    break;
6741
                case ALL_ON_ONE_PAGE:
6742
                    $button  = '<a href="javascript://" class="btn" onclick="save_now(\''.$questionId.'\', null, true, 1); ">'.get_lang('SaveForNow').'</a>';
6743
                    $button .= '<span id="save_for_now_'.$questionId.'" class="exercise_save_mini_message"></span>&nbsp;';
6744
                    $exercise_actions .= Display::div($button, array('class'=>'exercise_save_now_button'));
6745
                    break;
6746
            }
6747
6748
            if (!empty($questions_in_media)) {
6749
                $count_of_questions_inside_media = count($questions_in_media);

main/exercice/exercise_submit.php 1 location

@@ 1174-1183 (lines=10) @@
1171
        );
1172
1173
        // Button save and continue
1174
        switch ($objExercise->type) {
1175
            case ONE_PER_PAGE:
1176
                $exercise_actions .= $objExercise->show_button($questionId, $current_question);
1177
                break;
1178
            case ALL_ON_ONE_PAGE :
1179
                $button  = '<a href="javascript://" class="btn btn-info" onclick="save_now(\''.$questionId.'\'); ">'.get_lang('SaveForNow').'</a>';
1180
                $button .= '<span id="save_for_now_'.$questionId.'"></span>&nbsp;';
1181
                $exercise_actions  .= Display::div($button, array('class'=>'exercise_save_now_button'));
1182
                break;
1183
        }
1184
1185
        // Checkbox review answers
1186
        if ($objExercise->review_answers) {