diff --git a/assets/vue/components/layout/SectionHeader.vue b/assets/vue/components/layout/SectionHeader.vue
index f4c66b20ce3..621f2af47f8 100644
--- a/assets/vue/components/layout/SectionHeader.vue
+++ b/assets/vue/components/layout/SectionHeader.vue
@@ -1,4 +1,6 @@
+function isTruthyQueryValue(value) {
+ return ["1", "true", "yes", "on"].includes(String(value || "").toLowerCase())
+}
+
+const isEmbeddedStudentView = computed(
+ () =>
+ "learnpath" === String(route.query.origin || "").toLowerCase() &&
+ isTruthyQueryValue(route.query.embedded) &&
+ isTruthyQueryValue(route.query.isStudentView),
+)
+
diff --git a/assets/vue/composables/userPermissions.js b/assets/vue/composables/userPermissions.js
index a5f351b96f8..63f57aaf8ad 100644
--- a/assets/vue/composables/userPermissions.js
+++ b/assets/vue/composables/userPermissions.js
@@ -4,6 +4,7 @@ import api from "../config/api"
import { computed, reactive, ref, unref, watch } from "vue"
import { useSecurityStore } from "../store/securityStore"
import { usePlatformConfig } from "../store/platformConfig"
+import { useRoute } from "vue-router"
// ─── Shared reactive cache ────────────────────────────────────────────────────
// Keyed by buildCacheKey(); invalidated when student view is toggled.
@@ -78,13 +79,25 @@ export function useIsAllowedToEdit({
} = {}) {
const cidReqStore = useCidReqStore()
const platformConfigStore = usePlatformConfig()
+ const route = useRoute()
const { course, session } = storeToRefs(cidReqStore)
+ const isEmbeddedStudentView = computed(() => {
+ const truthyValues = ["1", "true", "yes", "on"]
+ const origin = String(route.query.origin || "").toLowerCase()
+ const embedded = truthyValues.includes(String(route.query.embedded || "").toLowerCase())
+ const studentView = truthyValues.includes(String(route.query.isStudentView || "").toLowerCase())
+
+ return origin === "learnpath" && embedded && studentView
+ })
+
const key = computed(() =>
buildCacheKey(tutor, coach, sessionCoach, checkStudentView, course.value?.id, session.value?.id),
)
- const isAllowedToEdit = computed(() => permissionCache.get(key.value) ?? false)
+ const isAllowedToEdit = computed(() =>
+ isEmbeddedStudentView.value ? false : (permissionCache.get(key.value) ?? false),
+ )
// Trigger initial fetch (no-op if a result is already cached or pending)
void fetchPermission(tutor, coach, sessionCoach, checkStudentView, course.value?.id, session.value?.id)
diff --git a/assets/vue/services/forumService.js b/assets/vue/services/forumService.js
index fff8f80ff8e..a4edc793db4 100644
--- a/assets/vue/services/forumService.js
+++ b/assets/vue/services/forumService.js
@@ -1,9 +1,21 @@
import baseService from "./baseService"
+function getRuntimeViewParams() {
+ if (typeof window === "undefined") {
+ return {}
+ }
+
+ const searchParams = new URLSearchParams(window.location.search)
+ const isStudentView = searchParams.get("isStudentView")
+
+ return isStudentView === null ? {} : { isStudentView }
+}
+
function cleanParams(params = {}) {
const query = {}
+ const mergedParams = { ...getRuntimeViewParams(), ...params }
- for (const [key, value] of Object.entries(params)) {
+ for (const [key, value] of Object.entries(mergedParams)) {
if (value !== undefined && value !== null && String(value) !== "") {
query[key] = value
}
diff --git a/assets/vue/views/assignments/AssignmentDetail.vue b/assets/vue/views/assignments/AssignmentDetail.vue
index d799b3cf2c2..9d2357e3344 100644
--- a/assets/vue/views/assignments/AssignmentDetail.vue
+++ b/assets/vue/views/assignments/AssignmentDetail.vue
@@ -8,7 +8,6 @@
>
{{ t("Loading...") }}
-
-
-
-
+
-
-
-
-
+ 0 ? (int) $id_parent : (int) $idPage;
+$cstudioLpId = 0;
+$cstudioCourseId = isset($_GET['cid']) ? (int) $_GET['cid'] : 0;
+$cstudioSessionId = isset($_GET['sid']) ? (int) $_GET['sid'] : 0;
+$cstudioGroupId = isset($_GET['gid']) ? (int) $_GET['gid'] : 0;
+
+if ($cstudioProjectId > 0) {
+ $cstudioLpId = (int) $VDB->get_value_by_query(
+ 'SELECT lp_id FROM plugin_oel_tools_teachdoc WHERE id = '.(int) $cstudioProjectId,
+ 'lp_id'
+ );
+}
+
+if ($cstudioLpId > 0) {
+ $cstudioLp = Container::getLpRepository()->find($cstudioLpId);
+ $cstudioResourceLink = $cstudioLp?->getFirstResourceLink();
+
+ if ($cstudioCourseId <= 0) {
+ $cstudioCourseId = (int) ($cstudioResourceLink?->getCourse()?->getId() ?? 0);
+ }
+ if (!isset($_GET['sid'])) {
+ $cstudioSessionId = (int) ($cstudioResourceLink?->getSession()?->getId() ?? 0);
+ }
+ if (!isset($_GET['gid'])) {
+ $cstudioGroupId = (int) ($cstudioResourceLink?->getGroup()?->getIid() ?? 0);
+ }
+}
+?>
+