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">
import EvaluationIntro from "@/pages/cockpit/assignmentEvaluationPage/EvaluationIntro.vue";
import EvaluationSummary from "@/pages/cockpit/assignmentEvaluationPage/EvaluationSummary.vue";
import EvaluationTask from "@/pages/cockpit/assignmentEvaluationPage/EvaluationTask.vue";
import EvaluationIntro from "@/components/assignmentEvaluation/EvaluationIntro.vue";
import EvaluationSummary from "@/components/assignmentEvaluation/EvaluationSummary.vue";
import EvaluationTask from "@/components/assignmentEvaluation/EvaluationTask.vue";
import type {
Assignment,
AssignmentCompletion,

View File

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

View File

@ -1,7 +1,7 @@
<script setup lang="ts">
import { useCurrentCourseSession } from "@/composables";
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 type { Assignment, AssignmentCompletion, CourseSessionUser } from "@/types";
import { useQuery } from "@urql/vue";
@ -9,7 +9,7 @@ import log from "loglevel";
import { computed, onMounted } from "vue";
import { useRouter } from "vue-router";
import { getPreviousRoute } from "@/router/history";
import { getAssignmentTypeTitle } from "../../../utils/utils";
import { getAssignmentTypeTitle } from "../../utils/utils";
const props = defineProps<{
courseSlug: string;
@ -42,9 +42,15 @@ function close() {
if (previousRoute) {
router.push(previousRoute);
} else {
router.push({
path: `/course/${props.courseSlug}/cockpit`,
});
if (assignment.value?.assignment_type === "PRAXIS_ASSIGNMENT") {
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"
:to="getLearningMentorUrl(dashboardStore.currentDashboardConfig.slug)"
>
{{ $t("a.Zur Lernbegleitung") }}
{{ $t("a.Übersicht anschauen") }}
</router-link>
</div>
</div>

View File

@ -19,7 +19,7 @@ import * as log from "loglevel";
import { computed, onMounted, ref, watchEffect } from "vue";
import { useTranslation } from "i18next-vue";
import { learningContentTypeData } from "@/utils/typeMaps";
import EvaluationSummary from "@/pages/cockpit/assignmentEvaluationPage/EvaluationSummary.vue";
import EvaluationSummary from "@/components/assignmentEvaluation/EvaluationSummary.vue";
import { bustItGetCache } from "@/fetchHelpers";
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",
component: () => import("@/pages/cockpit/cockpitPage/CockpitExpertPage.vue"),
@ -248,14 +254,6 @@ const router = createRouter({
import("@/pages/cockpit/assignmentsPage/AssignmentsPage.vue"),
props: true,
},
{
path: "assignment/:assignmentId/:userId",
component: () =>
import(
"@/pages/cockpit/assignmentEvaluationPage/AssignmentEvaluationPage.vue"
),
props: true,
},
{
path: "attendance",
component: () =>

View File

@ -377,11 +377,8 @@ class AssignmentCompletion(models.Model):
]
def get_assignment_evaluation_frontend_url(self):
"""
Used by the expert to evaluate the assignment
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}"
"""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}"
@property
def task_completion_data(self):