diff --git a/assets/css/app.scss b/assets/css/app.scss index c5d99b6eaae..7f2b5a4152e 100644 --- a/assets/css/app.scss +++ b/assets/css/app.scss @@ -47,15 +47,6 @@ } @layer utilities { - .custom-collapse { - display: none; - } - .custom-collapse.active { - display: block; - } - .collapse { - visibility: inherit !important; - } .border-gray-300 { --tw-border-opacity: 1; border-color: rgba(156, 163, 175, var(--tw-border-opacity)); diff --git a/assets/css/scss/atoms/_progressbar.scss b/assets/css/scss/atoms/_progressbar.scss index 2648d5de08d..c185bf7f9c2 100644 --- a/assets/css/scss/atoms/_progressbar.scss +++ b/assets/css/scss/atoms/_progressbar.scss @@ -1,11 +1,31 @@ .p-progressbar { - @apply bg-gray-30 rounded-full border-none h-1.5; + @apply relative overflow-hidden; + + &-determinate { + .p-progressbar-value { + @apply h-full w-0 absolute border-none flex items-center justify-center overflow-hidden; + + &-animate { + @apply duration-1000 ease-in-out; + + transition-property: width; + } + } + + .p-progressbar-label { + @apply inline-flex; + } + } +} + +.p-progressbar { + @apply bg-gray-30 rounded-lg border-none h-6; &-value { - @apply bg-primary; + @apply border-none m-0 bg-primary; } &-label { - @apply text-white; + @apply text-white leading-normal; } } diff --git a/assets/css/scss/index.scss b/assets/css/scss/index.scss index 63987204861..390b1d9e405 100755 --- a/assets/css/scss/index.scss +++ b/assets/css/scss/index.scss @@ -40,6 +40,7 @@ @import "molecules/empty_state"; @import "molecules/teacher_bar"; @import "molecules/toolbar"; +@import "molecules/legacy_panel"; @import "organisms/cards"; @import "organisms/course_card"; diff --git a/assets/css/scss/molecules/_legacy_panel.scss b/assets/css/scss/molecules/_legacy_panel.scss new file mode 100644 index 00000000000..43d14052dab --- /dev/null +++ b/assets/css/scss/molecules/_legacy_panel.scss @@ -0,0 +1,28 @@ +.display-panel-collapse { + @apply rounded-lg border-gray-25; + + &__header { + @apply relative + before:content-[""] before:absolute before:rounded-l-lg before:bg-secondary before:w-1 before:h-full before:-left-1; + + a { + @apply cursor-pointer p-2 block bg-support-6 rounded-r-lg; + + &[aria-expanded=true] { + @apply rounded-b-none; + } + } + + ::before { + float: right; + } + } + + &__collapsible { + @apply hidden p-3 rounded-b; + + &.active { + @apply block shadow-lg; + } + } +} \ No newline at end of file diff --git a/assets/vue/components/social/UserProfileCard.vue b/assets/vue/components/social/UserProfileCard.vue index 964ff8ca36b..fcc773b7ee5 100644 --- a/assets/vue/components/social/UserProfileCard.vue +++ b/assets/vue/components/social/UserProfileCard.vue @@ -18,7 +18,7 @@ - {{ languageInfo.code }} + {{ t(languageInfo.code) }} @@ -72,8 +72,8 @@ :key="item.variable" >
'.get_lang('No course sessions for this user').'
'; } $courseToolInformationTotal = ''; diff --git a/public/main/exercise/exercise.class.php b/public/main/exercise/exercise.class.php index a166d5f2c99..46efff4b5d8 100644 --- a/public/main/exercise/exercise.class.php +++ b/public/main/exercise/exercise.class.php @@ -9784,7 +9784,7 @@ public function getLpBySession($sessionId) ]; } - public static function saveExerciseInLp($safe_item_id, $safe_exe_id) + public static function saveExerciseInLp($safe_item_id, $safe_exe_id, $course_id = null) { $lp = Session::read('oLP'); @@ -9796,7 +9796,9 @@ public static function saveExerciseInLp($safe_item_id, $safe_exe_id) } $viewId = $lp->get_view_id(); - $course_id = api_get_course_int_id(); + if (!isset($course_id)) { + $course_id = api_get_course_int_id(); + } $userId = (int) api_get_user_id(); $viewId = (int) $viewId; diff --git a/public/main/exercise/overview.php b/public/main/exercise/overview.php index cef730ffa72..4b3141f0723 100644 --- a/public/main/exercise/overview.php +++ b/public/main/exercise/overview.php @@ -19,11 +19,13 @@ // Notice for unauthorized people. api_protect_course_script(true); -$sessionId = api_get_session_id(); -$courseCode = api_get_course_id(); +$courseId = isset($_REQUEST['cid']) ? (int) $_REQUEST['cid'] : api_get_course_int_id(); +$sessionId = isset($_REQUEST['sid']) ? (int) $_REQUEST['sid'] : api_get_session_id(); +$courseInfo = api_get_course_info_by_id($courseId); +$courseCode = $courseInfo['code']; $exercise_id = isset($_REQUEST['exerciseId']) ? (int) $_REQUEST['exerciseId'] : 0; -$objExercise = new Exercise(); +$objExercise = new Exercise($courseId); $result = $objExercise->read($exercise_id, true); if (!$result) { @@ -32,7 +34,7 @@ if ('true' === api_get_plugin_setting('positioning', 'tool_enable')) { $plugin = Positioning::create(); - if ($plugin->blockFinalExercise(api_get_user_id(), $exercise_id, api_get_course_int_id(), $sessionId)) { + if ($plugin->blockFinalExercise(api_get_user_id(), $exercise_id, $courseId, $sessionId)) { api_not_allowed(true); } } @@ -203,8 +205,8 @@ $attempts = Event::getExerciseResultsByUser( api_get_user_id(), $objExercise->id, - api_get_course_int_id(), - api_get_session_id(), + $courseId, + $sessionId, $learnpath_id, $learnpath_item_id, 'desc' @@ -243,7 +245,7 @@ $attempt_result['max_score'], $objExercise, $attempt_result['exe_user_id'], - api_get_course_int_id(), + $courseId, $sessionId ); } @@ -444,8 +446,8 @@ $isLimitReached = ExerciseLib::isQuestionsLimitPerDayReached( api_get_user_id(), count($objExercise->get_validated_question_list()), - api_get_course_int_id(), - api_get_session_id() + $courseId, + $sessionId ); if (!empty($exercise_url_button) && !$isLimitReached) { diff --git a/public/main/inc/lib/api.lib.php b/public/main/inc/lib/api.lib.php index 4e78d1debf6..f8a0ae5f7cc 100644 --- a/public/main/inc/lib/api.lib.php +++ b/public/main/inc/lib/api.lib.php @@ -888,6 +888,9 @@ function api_valid_email($address) function api_protect_course_script($print_headers = false, $allow_session_admins = false, string $checkTool = '', $cid = null): bool { $course_info = api_get_course_info(); + if (empty($course_info) && isset($_REQUEST['cid'])) { + $course_info = api_get_course_info_by_id((int) $_REQUEST['cid']); + } if (isset($cid)) { $course_info = api_get_course_info_by_id($cid); @@ -2049,7 +2052,11 @@ function api_get_cidreq($addSessionId = true, $addGroupId = true, $origin = '') if ($addSessionId) { if (!empty($url)) { - $url .= 0 == api_get_session_id() ? '&sid=0' : '&sid='.api_get_session_id(); + $sessionId = api_get_session_id(); + if (0 === $sessionId && isset($_REQUEST['sid'])) { + $sessionId = (int) $_REQUEST['sid']; + } + $url .= 0 === $sessionId ? '&sid=0' : '&sid='.$sessionId; } } diff --git a/public/main/inc/lib/display.lib.php b/public/main/inc/lib/display.lib.php index 2e06181fd87..6b65b1f3b3a 100644 --- a/public/main/inc/lib/display.lib.php +++ b/public/main/inc/lib/display.lib.php @@ -2458,25 +2458,23 @@ public static function panelCollapse( }); '; $html = ' -