chore: move AssignmentEvaluationPage.vue out of cockpit (shared)

This commit is contained in:
Livio Bieri 2024-03-13 15:37:15 +01:00
parent 767885bbb1
commit 9e30efd59d
9 changed files with 25 additions and 26 deletions

View File

@ -1,7 +1,7 @@
<script setup lang="ts"> <script setup lang="ts">
import EvaluationIntro from "@/pages/cockpit/assignmentEvaluationPage/EvaluationIntro.vue"; import EvaluationIntro from "@/components/assignmentEvaluation/EvaluationIntro.vue";
import EvaluationSummary from "@/pages/cockpit/assignmentEvaluationPage/EvaluationSummary.vue"; import EvaluationSummary from "@/components/assignmentEvaluation/EvaluationSummary.vue";
import EvaluationTask from "@/pages/cockpit/assignmentEvaluationPage/EvaluationTask.vue"; import EvaluationTask from "@/components/assignmentEvaluation/EvaluationTask.vue";
import type { import type {
Assignment, Assignment,
AssignmentCompletion, AssignmentCompletion,

View File

@ -30,12 +30,10 @@ const courseSession = useCurrentCourseSession();
const task = computed(() => props.assignment.evaluation_tasks[props.taskIndex]); const task = computed(() => props.assignment.evaluation_tasks[props.taskIndex]);
const expertData = computed(() => { const expertData = computed(() => {
const data = (props.assignmentCompletion?.completion_data?.[task.value.id] return (props.assignmentCompletion?.completion_data?.[task.value.id]?.expert_data ?? {
?.expert_data ?? {
points: 0, points: 0,
text: "", text: "",
}) as ExpertData; }) as ExpertData;
return data;
}); });
const text = computed(() => { const text = computed(() => {

View File

@ -1,7 +1,7 @@
<script setup lang="ts"> <script setup lang="ts">
import { useCurrentCourseSession } from "@/composables"; import { useCurrentCourseSession } from "@/composables";
import { ASSIGNMENT_COMPLETION_QUERY } from "@/graphql/queries"; import { ASSIGNMENT_COMPLETION_QUERY } from "@/graphql/queries";
import EvaluationContainer from "@/pages/cockpit/assignmentEvaluationPage/EvaluationContainer.vue"; import EvaluationContainer from "@/components/assignmentEvaluation/EvaluationContainer.vue";
import AssignmentSubmissionResponses from "@/pages/learningPath/learningContentPage/assignment/AssignmentSubmissionResponses.vue"; import AssignmentSubmissionResponses from "@/pages/learningPath/learningContentPage/assignment/AssignmentSubmissionResponses.vue";
import type { Assignment, AssignmentCompletion, CourseSessionUser } from "@/types"; import type { Assignment, AssignmentCompletion, CourseSessionUser } from "@/types";
import { useQuery } from "@urql/vue"; import { useQuery } from "@urql/vue";
@ -9,7 +9,7 @@ import log from "loglevel";
import { computed, onMounted } from "vue"; import { computed, onMounted } from "vue";
import { useRouter } from "vue-router"; import { useRouter } from "vue-router";
import { getPreviousRoute } from "@/router/history"; import { getPreviousRoute } from "@/router/history";
import { getAssignmentTypeTitle } from "../../../utils/utils"; import { getAssignmentTypeTitle } from "../../utils/utils";
const props = defineProps<{ const props = defineProps<{
courseSlug: string; courseSlug: string;
@ -42,9 +42,15 @@ function close() {
if (previousRoute) { if (previousRoute) {
router.push(previousRoute); router.push(previousRoute);
} else { } else {
router.push({ if (assignment.value?.assignment_type === "PRAXIS_ASSIGNMENT") {
path: `/course/${props.courseSlug}/cockpit`, router.push({
}); path: `/course/${props.courseSlug}/learning-mentor`,
});
} else {
router.push({
path: `/course/${props.courseSlug}/cockpit`,
});
}
} }
} }

View File

@ -15,7 +15,7 @@ const dashboardStore = useDashboardStore();
class="btn-blue" class="btn-blue"
:to="getLearningMentorUrl(dashboardStore.currentDashboardConfig.slug)" :to="getLearningMentorUrl(dashboardStore.currentDashboardConfig.slug)"
> >
{{ $t("a.Zur Lernbegleitung") }} {{ $t("a.Übersicht anschauen") }}
</router-link> </router-link>
</div> </div>
</div> </div>

View File

@ -19,7 +19,7 @@ import * as log from "loglevel";
import { computed, onMounted, ref, watchEffect } from "vue"; import { computed, onMounted, ref, watchEffect } from "vue";
import { useTranslation } from "i18next-vue"; import { useTranslation } from "i18next-vue";
import { learningContentTypeData } from "@/utils/typeMaps"; import { learningContentTypeData } from "@/utils/typeMaps";
import EvaluationSummary from "@/pages/cockpit/assignmentEvaluationPage/EvaluationSummary.vue"; import EvaluationSummary from "@/components/assignmentEvaluation/EvaluationSummary.vue";
import { bustItGetCache } from "@/fetchHelpers"; import { bustItGetCache } from "@/fetchHelpers";
const { t } = useTranslation(); const { t } = useTranslation();

View File

@ -226,6 +226,12 @@ const router = createRouter({
}, },
], ],
}, },
{
path: "/course/:courseSlug/assignment-evaluation/:assignmentId/:userId",
component: () =>
import("@/pages/assignmentEvaluation/AssignmentEvaluationPage.vue"),
props: true,
},
{ {
path: "/course/:courseSlug/cockpit", path: "/course/:courseSlug/cockpit",
component: () => import("@/pages/cockpit/cockpitPage/CockpitExpertPage.vue"), component: () => import("@/pages/cockpit/cockpitPage/CockpitExpertPage.vue"),
@ -248,14 +254,6 @@ const router = createRouter({
import("@/pages/cockpit/assignmentsPage/AssignmentsPage.vue"), import("@/pages/cockpit/assignmentsPage/AssignmentsPage.vue"),
props: true, props: true,
}, },
{
path: "assignment/:assignmentId/:userId",
component: () =>
import(
"@/pages/cockpit/assignmentEvaluationPage/AssignmentEvaluationPage.vue"
),
props: true,
},
{ {
path: "attendance", path: "attendance",
component: () => component: () =>

View File

@ -377,11 +377,8 @@ class AssignmentCompletion(models.Model):
] ]
def get_assignment_evaluation_frontend_url(self): def get_assignment_evaluation_frontend_url(self):
""" """Used by the expert to evaluate the assignment"""
Used by the expert to evaluate the assignment return f"{self.course_session.course.get_course_url()}/assignment-evaluation/{self.assignment.id}/{self.assignment_user.id}"
Example: /course/überbetriebliche-kurse/cockpit/assignment/371/18
"""
return f"{self.course_session.course.get_cockpit_url()}/assignment/{self.assignment.id}/{self.assignment_user.id}"
@property @property
def task_completion_data(self): def task_completion_data(self):