From e688cf2fc8c4d56d5f1facb11b7316e9a0316ba9 Mon Sep 17 00:00:00 2001 From: Daniel Egger Date: Fri, 5 May 2023 16:51:03 +0200 Subject: [PATCH] Improve display --- .../EvaluationContainer.vue | 21 ++++++++-- .../EvaluationIntro.vue | 15 +++++++- .../EvaluationSummary.vue | 38 ++++++++++++++++--- 3 files changed, 62 insertions(+), 12 deletions(-) diff --git a/client/src/pages/cockpit/assignmentEvaluationPage/EvaluationContainer.vue b/client/src/pages/cockpit/assignmentEvaluationPage/EvaluationContainer.vue index 9ece8653..317591c7 100644 --- a/client/src/pages/cockpit/assignmentEvaluationPage/EvaluationContainer.vue +++ b/client/src/pages/cockpit/assignmentEvaluationPage/EvaluationContainer.vue @@ -15,7 +15,7 @@ import type { import dayjs from "dayjs"; import { findIndex } from "lodash"; import * as log from "loglevel"; -import { computed, reactive } from "vue"; +import { computed, onMounted, reactive } from "vue"; const props = defineProps<{ assignmentUser: CourseSessionUser; @@ -31,12 +31,23 @@ interface StateInterface { } const state: StateInterface = reactive({ - pageIndex: 6, + pageIndex: 0, }); const courseSessionStore = useCourseSessionsStore(); const numTasks = computed(() => props.assignment.evaluation_tasks?.length ?? 0); +const evaluationSubmitted = computed( + () => props.assignmentCompletion.completion_status === "evaluation_submitted" +); + +onMounted(() => { + if (evaluationSubmitted.value) { + state.pageIndex = props.assignment.evaluation_tasks?.length + 1 ?? 0; + } else { + state.pageIndex = 0; + } +}); function previousPage() { log.debug("previousTask"); @@ -110,12 +121,14 @@ const dueDate = computed(() => :assignment="props.assignment" :assignment-completion="props.assignmentCompletion" :due-date="dueDate" - @edit-task="editTask($event)" > -