Code Duplication    Length = 7-7 lines in 2 locations

main/exercise/exercise.class.php 2 locations

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