diff --git a/client/src/components/FeedbackForm.vue b/client/src/components/FeedbackForm.vue index e9b7596e..c53f4c97 100644 --- a/client/src/components/FeedbackForm.vue +++ b/client/src/components/FeedbackForm.vue @@ -103,7 +103,7 @@ const sendFeedback = () => { preparation_task_clarity: preparationTaskClarity, course_negative_feedback: courseNegativeFeedback, course_positive_feedback: coursePositiveFeedback, - goald_attainment: goalAttainment, + goal_attainment: goalAttainment, instructor_competence: instructorCompetence, instructor_respect: instructorRespect, instructor_open_feedback: instructorOpenFeedback, @@ -119,9 +119,8 @@ const sendFeedback = () => { }); log.debug(variables); executeMutation(variables) - .then(({ data, error }) => { + .then(({ data }) => { log.debug(data); - log.error(error); mutationResult.value = data; }) .catch((e) => log.error(e)); @@ -142,6 +141,7 @@ const sendFeedback = () => { :start-badge-text="$t('general.introduction')" :end-badge-text="$t('general.submission')" :base-url="props.page.frontend_url" + close-button-variant="close" @previous="previousStep()" @next="nextStep()" > diff --git a/client/src/pages/cockpit/cockpitPage/AssignmentSubmissionProgress.vue b/client/src/pages/cockpit/cockpitPage/AssignmentSubmissionProgress.vue index 43349f10..3cf25ea7 100644 --- a/client/src/pages/cockpit/cockpitPage/AssignmentSubmissionProgress.vue +++ b/client/src/pages/cockpit/cockpitPage/AssignmentSubmissionProgress.vue @@ -83,7 +83,9 @@ const totalCount = (status: StatusCount) => {
{{ $t("assignment.assessmentDocumentDisclaimer") }}
{{ $t("assignment.showAssessmentDocument") }}+
{{ $t("assignment.dueDateSubmission") }}
+
{{
$t("assignment.submissionNotificationDisclaimer", { name: circleExpertName })
}}
diff --git a/client/src/pages/learningPath/learningContentPage/assignment/AssignmentView.vue b/client/src/pages/learningPath/learningContentPage/assignment/AssignmentView.vue
index 591958b0..db6f13a1 100644
--- a/client/src/pages/learningPath/learningContentPage/assignment/AssignmentView.vue
+++ b/client/src/pages/learningPath/learningContentPage/assignment/AssignmentView.vue
@@ -12,6 +12,7 @@ import { useUserStore } from "@/stores/user";
import type {
Assignment,
AssignmentCompletion,
+ AssignmentCompletionStatus,
AssignmentTask,
CourseSessionAssignment,
CourseSessionUser,
@@ -23,6 +24,7 @@ import dayjs from "dayjs";
import * as log from "loglevel";
import { computed, onMounted, reactive } from "vue";
import { useTranslation } from "i18next-vue";
+import { bustItGetCache } from "@/fetchHelpers";
import { learningContentTypeData } from "@/utils/typeMaps";
const { t } = useTranslation();
@@ -87,16 +89,7 @@ onMounted(async () => {
// create initial `AssignmentCompletion` first, so that it exists and we don't
// have reactivity problem accessing it.
- await upsertAssignmentCompletionMutation.executeMutation({
- assignmentId: props.learningContent.content_assignment_id.toString(),
- courseSessionId: courseSession.value.id.toString(),
- learningContentId: props.learningContent.id.toString(),
- completionDataString: JSON.stringify({}),
- completionStatus: "IN_PROGRESS",
- // eslint-disable-next-line @typescript-eslint/ban-ts-comment
- // @ts-ignore
- id: assignmentCompletion.value?.id,
- });
+ await upsertAssignmentCompletion("IN_PROGRESS");
queryResult.resume();
try {
@@ -113,16 +106,10 @@ onMounted(async () => {
const numTasks = computed(() => assignment.value?.tasks?.length ?? 0);
const numPages = computed(() => {
- if (assignmentType.value === "CASEWORK") {
- // casework has extra submission page
- return numTasks.value + 2;
- }
-
- return numTasks.value + 1;
+ return numTasks.value + 2;
});
const showPreviousButton = computed(() => stepIndex.value != 0);
const showNextButton = computed(() => stepIndex.value + 1 < numPages.value);
-const showExitButton = computed(() => numPages.value === stepIndex.value + 1);
const dueDate = computed(() =>
dayjs(state.courseSessionAssignment?.submission_deadline_start)
);
@@ -133,6 +120,26 @@ const currentTask = computed(() => {
return undefined;
});
+const upsertAssignmentCompletion = async (status: AssignmentCompletionStatus) => {
+ try {
+ await upsertAssignmentCompletionMutation.executeMutation({
+ assignmentId: props.learningContent.content_assignment_id.toString(),
+ courseSessionId: courseSession.value.id.toString(),
+ learningContentId: props.learningContent.id.toString(),
+ completionDataString: JSON.stringify({}),
+ completionStatus: status,
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
+ // @ts-ignore
+ id: assignmentCompletion.value?.id,
+ });
+ bustItGetCache(
+ `/api/course/completion/${courseSession.value.id}/${useUserStore().id}/`
+ );
+ } catch (error) {
+ log.error("Could not submit assignment", error);
+ }
+};
+
const handleBack = () => {
log.debug("handleBack");
if (stepIndex.value > 0) {
@@ -161,19 +168,12 @@ const jumpToTask = (task: AssignmentTask) => {
const getTitle = () => {
if (0 === stepIndex.value) {
return t("general.introduction");
- } else if (
- assignmentType.value === "CASEWORK" &&
- stepIndex.value === numPages.value - 1
- ) {
+ } else if (stepIndex.value === numPages.value - 1) {
return t("general.submission");
}
return currentTask?.value?.value.title ?? "Unknown";
};
-const assignmentType = computed(() => {
- return assignment.value?.assignment_type ?? "CASEWORK";
-});
-
const subTitle = computed(() => {
if (assignment.value) {
const prefix = learningContentTypeData(props.learningContent).title;
@@ -187,19 +187,6 @@ const assignmentUser = computed(() => {
(user) => user.user_id === userStore.id
) as CourseSessionUser;
});
-
-const endBadgeText = computed(() => {
- if (assignmentType.value === "PREP_ASSIGNMENT") {
- return t("Aufgaben");
- } else if (assignmentType.value === "CASEWORK") {
- return t("Abgabe");
- } else if (assignmentType.value === "CONDITION_ACCEPTANCE") {
- return t("Akzeptieren");
- }
-
- // just return the number of tasks as default
- return (assignment.value?.tasks.length ?? 0).toString();
-});
@@ -215,13 +202,13 @@ const endBadgeText = computed(() => {
:learning-content="props.learningContent"
:steps-count="numPages"
:show-next-button="showNextButton && stepIndex !== 0"
- :show-exit-button="showExitButton"
+ :show-exit-button="false"
:show-start-button="showNextButton && stepIndex === 0"
:show-previous-button="showPreviousButton"
:base-url="props.learningContent.frontend_url"
step-query-param="step"
start-badge-text="Einleitung"
- :end-badge-text="endBadgeText"
+ :end-badge-text="$t('Abgabe')"
close-button-variant="close"
@previous="handleBack()"
@next="handleContinue()"
@@ -241,7 +228,7 @@ const endBadgeText = computed(() => {
:learning-content-id="props.learningContent.id"
>