Course: Remove obsolete 'Allow tests auto-launch' parameter and simplify logic - refs BT#22104

pull/5996/head
Christian Beeznest 9 months ago
parent e3176390bb
commit 2f2a83ab8a
  1. 5
      assets/vue/router/index.js
  2. 8
      public/main/exercise/exercise.class.php
  3. 2
      src/CoreBundle/Controller/CourseController.php
  4. 1
      src/CoreBundle/Controller/PlatformConfigurationController.php
  5. 5
      src/CoreBundle/DataFixtures/SettingsCurrentFixtures.php
  6. 2
      src/CoreBundle/Settings/ExerciseSettingsSchema.php

@ -140,10 +140,6 @@ const router = createRouter({
}
// Exercise auto-launch
const platformConfigStore = usePlatformConfig()
const isExerciseAutoLaunchEnabled =
"true" === platformConfigStore.getSetting("exercise.allow_exercise_auto_launch")
if (isExerciseAutoLaunchEnabled) {
const exerciseAutoLaunch = parseInt(courseSettingsStore.getSetting("enable_exercise_auto_launch"), 10) || 0
if (exerciseAutoLaunch === 2) {
sessionStorage.setItem(autoLaunchKey, "true")
@ -160,7 +156,6 @@ const router = createRouter({
return false
}
}
}
// Learning path auto-launch
const lpAutoLaunch = parseInt(courseSettingsStore.getSetting("enable_lp_auto_launch"), 10) || 0

@ -8810,12 +8810,6 @@ class Exercise
$keyword = Database::escape_string($keyword);
$learnpath_id = isset($_REQUEST['learnpath_id']) ? (int) $_REQUEST['learnpath_id'] : null;
$learnpath_item_id = isset($_REQUEST['learnpath_item_id']) ? (int) $_REQUEST['learnpath_item_id'] : null;
$autoLaunchAvailable = false;
if (1 == api_get_course_setting('enable_exercise_auto_launch') &&
('true' === api_get_setting('exercise.allow_exercise_auto_launch'))
) {
$autoLaunchAvailable = true;
}
$courseId = $course->getId();
$tableRows = [];
@ -9067,7 +9061,6 @@ class Exercise
}
// Auto launch
if ($autoLaunchAvailable) {
$autoLaunch = $exercise->getAutoLaunch();
if (empty($autoLaunch)) {
$actions .= Display::url(
@ -9082,7 +9075,6 @@ class Exercise
).'&action=disable_launch&sec_token='.$token.'&exerciseId='.$exerciseId
);
}
}
// Export
$actions .= Display::url(

@ -894,7 +894,6 @@ class CourseController extends ToolBaseController
}
}
if ('true' === api_get_setting('exercise.allow_exercise_auto_launch')) {
$exerciseAutoLaunch = (int) api_get_course_setting('enable_exercise_auto_launch');
if (2 === $exerciseAutoLaunch) {
if ($allowAutoLaunchForCourseAdmins) {
@ -948,7 +947,6 @@ class CourseController extends ToolBaseController
}
}
}
}
$documentAutoLaunch = (int) api_get_course_setting('enable_document_auto_launch');
if (1 === $documentAutoLaunch) {

@ -91,7 +91,6 @@ class PlatformConfigurationController extends AbstractController
'document.students_download_folders',
'social.hide_social_groups_block',
'course.show_course_duration',
'exercise.allow_exercise_auto_launch',
];
$user = $this->userHelper->getCurrent();

@ -2403,11 +2403,6 @@ class SettingsCurrentFixtures extends Fixture implements FixtureGroupInterface
'title' => 'Allow teachers to edit tests in learning paths',
'comment' => 'By default, Chamilo prevents you from editing tests that are included inside a learning path. This is to avoid changes that would affect learners (past and future) differently regarding the results and/or progress in the learning path. This option allows teachers to bypass this restriction.',
],
[
'name' => 'allow_exercise_auto_launch',
'title' => 'Allow tests auto-launch',
'comment' => 'The auto-launch feature allows the teacher to set an exercise to open immediately upon accessing the course homepage. Enable this option and click on the rocket icon in the list of tests to enable.',
],
[
'name' => 'allow_exercise_categories',
'title' => 'Enable test categories',

@ -44,7 +44,6 @@ class ExerciseSettingsSchema extends AbstractSettingsSchema
'hide_free_question_score' => 'false',
'hide_user_info_in_quiz_result' => 'false',
'exercise_attempts_report_show_username' => 'false',
'allow_exercise_auto_launch' => 'false',
'disable_clean_exercise_results_for_teachers' => 'true',
'show_exercise_question_certainty_ribbon_result' => 'false',
'quiz_results_answers_report' => 'false',
@ -121,7 +120,6 @@ class ExerciseSettingsSchema extends AbstractSettingsSchema
->add('hide_free_question_score', YesNoType::class)
->add('hide_user_info_in_quiz_result', YesNoType::class)
->add('exercise_attempts_report_show_username', YesNoType::class)
->add('allow_exercise_auto_launch', YesNoType::class)
->add('disable_clean_exercise_results_for_teachers', YesNoType::class)
->add('show_exercise_question_certainty_ribbon_result', YesNoType::class)
->add('quiz_results_answers_report', YesNoType::class)

Loading…
Cancel
Save