diff --git a/client/src/pages/learningPath/learningContentPage/assignment/AssignmentSubmissionView.vue b/client/src/pages/learningPath/learningContentPage/assignment/AssignmentSubmissionView.vue
index dcf17ac1..306f1ae1 100644
--- a/client/src/pages/learningPath/learningContentPage/assignment/AssignmentSubmissionView.vue
+++ b/client/src/pages/learningPath/learningContentPage/assignment/AssignmentSubmissionView.vue
@@ -39,6 +39,10 @@ const circleExpertName = computed(() => {
return `${circleExpert.value?.first_name} ${circleExpert.value?.last_name}`;
});
+const completionStatus = computed(() => {
+ return assignmentStore.assignmentCompletion?.completion_status ?? "in_progress";
+});
+
const onEditTask = (task: AssignmentTask) => {
emit("editTask", task);
};
@@ -67,7 +71,7 @@ const onSubmit = async () => {
{{ $t("assignment.acceptConditionsDisclaimer") }}
-
+
@@ -129,7 +133,7 @@ const onSubmit = async () => {
diff --git a/client/src/pages/learningPath/learningContentPage/assignment/AssignmentTaskView.vue b/client/src/pages/learningPath/learningContentPage/assignment/AssignmentTaskView.vue
index 102424fe..31224d3a 100644
--- a/client/src/pages/learningPath/learningContentPage/assignment/AssignmentTaskView.vue
+++ b/client/src/pages/learningPath/learningContentPage/assignment/AssignmentTaskView.vue
@@ -11,7 +11,7 @@ import type {
} from "@/types";
import { useDebounceFn } from "@vueuse/core";
import dayjs from "dayjs";
-import { reactive, ref } from "vue";
+import { computed, reactive, ref } from "vue";
const props = defineProps<{
assignmentId: number;
@@ -87,6 +87,10 @@ const onToggleCheckbox = (id: string) => {
checkboxState[id] = !checkboxState[id];
onUpdateConfirmation(id, checkboxState[id]);
};
+
+const completionStatus = computed(() => {
+ return assignmentStore.assignmentCompletion?.completion_status ?? "in_progress";
+});
@@ -95,6 +99,7 @@ const onToggleCheckbox = (id: string) => {
+
@@ -111,7 +116,7 @@ const onToggleCheckbox = (id: string) => {
diff --git a/client/src/pages/learningPath/learningContentPage/assignment/AssignmentView.vue b/client/src/pages/learningPath/learningContentPage/assignment/AssignmentView.vue
index 4d40e3d4..f7533084 100644
--- a/client/src/pages/learningPath/learningContentPage/assignment/AssignmentView.vue
+++ b/client/src/pages/learningPath/learningContentPage/assignment/AssignmentView.vue
@@ -38,6 +38,11 @@ const props = defineProps<{
learningContent: LearningContent;
}>();
+const assignmentCompletion = computed(() => assignmentStore.assignmentCompletion);
+const completionStatus = computed(() => {
+ return assignmentCompletion.value?.completion_status ?? "in_progress";
+});
+
onMounted(async () => {
log.debug("AssignmentView mounted", props.assignmentId, props.learningContent);
@@ -52,7 +57,12 @@ onMounted(async () => {
props.assignmentId,
courseSessionId.value
);
- log.debug(state.assignment, state.courseSessionAssignmentDetails);
+
+ if (completionStatus.value === "in_progress") {
+ state.pageIndex = 0;
+ } else {
+ state.pageIndex = numPages.value - 1;
+ }
} catch (error) {
log.error(error);
}
@@ -60,7 +70,9 @@ onMounted(async () => {
const numTasks = computed(() => state.assignment?.tasks?.length ?? 0);
const numPages = computed(() => numTasks.value + 2);
-const showPreviousButton = computed(() => state.pageIndex != 0);
+const showPreviousButton = computed(
+ () => state.pageIndex != 0 && completionStatus.value === "in_progress"
+);
const showNextButton = computed(() => state.pageIndex + 1 < numPages.value);
const showExitButton = computed(() => numPages.value === state.pageIndex + 1);
const dueDate = computed(() =>
@@ -75,7 +87,6 @@ const currentTask = computed(() => {
}
return undefined;
});
-const assignmentCompletion = computed(() => assignmentStore.assignmentCompletion);
const handleBack = () => {
log.debug("handleBack");