CLASSROOMIO-T-180: Make exercise answerable
This commit is contained in:
@@ -166,7 +166,7 @@
|
||||
if (data.isOrgSite) {
|
||||
if (params.has('redirect')) {
|
||||
goto(params.get('redirect') || '');
|
||||
} else if (!path.includes('lms')) {
|
||||
} else if (shouldRedirectOnAuth(path)) {
|
||||
goto('/lms');
|
||||
}
|
||||
} else {
|
||||
|
||||
@@ -30,10 +30,10 @@
|
||||
import TextChip from '$lib/components/Chip/Text.svelte';
|
||||
import Avatar from '$lib/components/Apps/components/Poll/components/Avatar.svelte';
|
||||
import AddLessonModal from '$lib/components/Course/components/Lesson/AddLessonModal.svelte';
|
||||
import { exerciseMode } from '$lib/components/Course/components/Lesson/Exercise/store';
|
||||
|
||||
export let data;
|
||||
const { courseId } = data;
|
||||
|
||||
let lessonEditing;
|
||||
let isStudent = true;
|
||||
let openModal = false;
|
||||
@@ -99,10 +99,6 @@
|
||||
isStudent = user.role_id === 3;
|
||||
}
|
||||
}
|
||||
$: {
|
||||
console.log('isStudent', isStudent);
|
||||
$exerciseMode.editMode = !isStudent;
|
||||
}
|
||||
</script>
|
||||
|
||||
<AddLessonModal {isStudent} bind:openModal />
|
||||
|
||||
@@ -39,6 +39,7 @@
|
||||
let isMarkingComplete = false;
|
||||
let isLoading = false;
|
||||
let isSaving = false;
|
||||
let isStudent = true;
|
||||
|
||||
function getLessonOrder(id: string) {
|
||||
const index = $lessons.findIndex((lesson) => lesson.id === id);
|
||||
@@ -200,7 +201,11 @@
|
||||
}
|
||||
</script>
|
||||
|
||||
<CourseContainer {path} isExercisePage={!data.isMaterialsTabActive && data.exerciseId}>
|
||||
<CourseContainer
|
||||
bind:isStudent
|
||||
{path}
|
||||
isExercisePage={!data.isMaterialsTabActive && data.exerciseId}
|
||||
>
|
||||
<PageNav
|
||||
navItems={[
|
||||
{
|
||||
@@ -256,7 +261,12 @@
|
||||
</PageNav>
|
||||
|
||||
{#if !data.isMaterialsTabActive}
|
||||
<Exercises lessonId={data.lessonId} exerciseId={data.exerciseId} path={`${path}/exercises`} />
|
||||
<Exercises
|
||||
bind:isStudent
|
||||
lessonId={data.lessonId}
|
||||
exerciseId={data.exerciseId}
|
||||
path={`${path}/exercises`}
|
||||
/>
|
||||
{:else if !!data.lessonId}
|
||||
<PageBody
|
||||
onClick={() => {
|
||||
|
||||
Reference in New Issue
Block a user