Code Duplication    Length = 7-7 lines in 2 locations

main/exercice/exercise.class.php 2 locations

@@ 2932-2938 (lines=7) @@
2929
            // User
2930
            if (api_is_allowed_to_session_edit()) {
2931
                if ($this->type == ALL_ON_ONE_PAGE || $nbrQuestions == $questionNum) {
2932
                    if ($this->review_answers) {
2933
                        $label = get_lang('ReviewQuestions');
2934
                        $class = 'btn btn-success';
2935
                    } else {
2936
                        $label = get_lang('EndTest');
2937
                        $class = 'btn btn-warning';
2938
                    }
2939
                } else {
2940
                    $label = get_lang('NextQuestion');
2941
                    $class = 'btn btn-primary';
@@ 2961-2967 (lines=7) @@
2958
2959
                    $html .= $all_button;
2960
                } else {
2961
                    if ($this->review_answers) {
2962
                        $all_label = get_lang('ReviewQuestions');
2963
                        $class = 'btn btn-success';
2964
                    } else {
2965
                        $all_label = get_lang('EndTest');
2966
                        $class = 'btn btn-warning';
2967
                    }
2968
					$class .= ' question-validate-btn'; // used to select it with jquery
2969
                    $all_button = '&nbsp;<a href="javascript://" class="'.$class.'" onclick="validate_all(); ">'.$all_label.'</a>';
2970
                    $all_button .= '&nbsp;' . Display::span(null, ['id' => 'save_all_reponse']);