Code Duplication    Length = 7-7 lines in 2 locations

main/exercise/exercise.class.php 2 locations

@@ 2947-2953 (lines=7) @@
2944
            // User
2945
            if (api_is_allowed_to_session_edit()) {
2946
                if ($this->type == ALL_ON_ONE_PAGE || $nbrQuestions == $questionNum) {
2947
                    if ($this->review_answers) {
2948
                        $label = get_lang('ReviewQuestions');
2949
                        $class = 'btn btn-success';
2950
                    } else {
2951
                        $label = get_lang('EndTest');
2952
                        $class = 'btn btn-warning';
2953
                    }
2954
                } else {
2955
                    $label = get_lang('NextQuestion');
2956
                    $class = 'btn btn-primary';
@@ 2976-2982 (lines=7) @@
2973
2974
                    $html .= $all_button;
2975
                } else {
2976
                    if ($this->review_answers) {
2977
                        $all_label = get_lang('ReviewQuestions');
2978
                        $class = 'btn btn-success';
2979
                    } else {
2980
                        $all_label = get_lang('EndTest');
2981
                        $class = 'btn btn-warning';
2982
                    }
2983
					$class .= ' question-validate-btn'; // used to select it with jquery
2984
                    $all_button = '&nbsp;<a href="javascript://" class="'.$class.'" onclick="validate_all(); ">'.$all_label.'</a>';
2985
                    $all_button .= '&nbsp;' . Display::span(null, ['id' => 'save_all_reponse']);