Code Duplication    Length = 7-7 lines in 2 locations

main/exercice/exercise.class.php 2 locations

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