New setting added "exercises_disable_new_attempts" see BT#15091

Disable all new exercise attempts in all the platform
pull/2757/head
Julio Montoya 7 years ago
parent 2001098b7c
commit ed38dc279e
  1. 5
      main/exercise/exercise_submit.php
  2. 8
      main/exercise/overview.php
  3. 3
      main/install/configuration.dist.php

@ -331,6 +331,11 @@ $questionListUncompressed = $objExercise->getQuestionListWithMediasUncompressed(
Session::write('question_list_uncompressed', $questionListUncompressed);
$clock_expired_time = null;
if (empty($exercise_stat_info)) {
$disable = api_get_configuration_value('exercises_disable_new_attempts');
if ($disable) {
api_not_allowed(true);
}
if ($debug) {
error_log('5 $exercise_stat_info is empty ');
}

@ -106,7 +106,7 @@ if (api_get_configuration_value('save_titles_as_html')) {
);
}
//Exercise description
// Exercise description
if (!empty($objExercise->description)) {
$html .= Display::div($objExercise->description, ['class' => 'exercise_description']);
}
@ -345,6 +345,12 @@ if ($time_control) {
$html .= $message;
$disable = api_get_configuration_value('exercises_disable_new_attempts');
if ($disable && empty($exercise_stat_info)) {
$exercise_url_button = Display::return_message(get_lang('NewExerciseAttemptDisabled'));
}
if (!empty($exercise_url_button)) {
$html .= Display::div(
Display::div(

@ -1032,6 +1032,9 @@ VALUES (2, 13, 'session_courses_read_only_mode', 'Lock Course In Session', 1, 1,
]
];*/
// Disable all new exercise attempts in all the platform
// $_configuration['exercises_disable_new_attempts'] = false;
// ------ Custom DB changes (keep this at the end)
// Add user activation by confirmation email
// This option prevents the new user to login in the platform if your account is not confirmed via email

Loading…
Cancel
Save