Reason text for evaluation is mandatory
This commit is contained in:
parent
720342f5b9
commit
0401298f85
|
|
@ -6,22 +6,25 @@
|
||||||
class="h-40 w-full border-gray-500"
|
class="h-40 w-full border-gray-500"
|
||||||
:data-cy="`it-textarea-${cyKey}`"
|
:data-cy="`it-textarea-${cyKey}`"
|
||||||
:disabled="disabled"
|
:disabled="disabled"
|
||||||
|
:placeholder="placeholder"
|
||||||
@input="onInput"
|
@input="onInput"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
interface Props {
|
export interface Props {
|
||||||
modelValue: string;
|
modelValue: string;
|
||||||
label: string | undefined;
|
label?: string;
|
||||||
|
placeholder?: string;
|
||||||
cyKey?: string;
|
cyKey?: string;
|
||||||
disabled?: boolean;
|
disabled?: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
withDefaults(defineProps<Props>(), {
|
const props = withDefaults(defineProps<Props>(), {
|
||||||
label: undefined,
|
label: undefined,
|
||||||
cyKey: "",
|
cyKey: "",
|
||||||
|
placeholder: "",
|
||||||
});
|
});
|
||||||
const emit = defineEmits(["update:modelValue"]);
|
const emit = defineEmits(["update:modelValue"]);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,7 @@ import EvaluationIntro from "@/pages/cockpit/assignmentEvaluationPage/Evaluation
|
||||||
import EvaluationSummary from "@/pages/cockpit/assignmentEvaluationPage/EvaluationSummary.vue";
|
import EvaluationSummary from "@/pages/cockpit/assignmentEvaluationPage/EvaluationSummary.vue";
|
||||||
import EvaluationTask from "@/pages/cockpit/assignmentEvaluationPage/EvaluationTask.vue";
|
import EvaluationTask from "@/pages/cockpit/assignmentEvaluationPage/EvaluationTask.vue";
|
||||||
import { calcAssignmentLearningContents } from "@/services/assignmentService";
|
import { calcAssignmentLearningContents } from "@/services/assignmentService";
|
||||||
|
import { useAssignmentStore } from "@/stores/assignmentStore";
|
||||||
import { useCourseSessionsStore } from "@/stores/courseSessions";
|
import { useCourseSessionsStore } from "@/stores/courseSessions";
|
||||||
import { useLearningPathStore } from "@/stores/learningPath";
|
import { useLearningPathStore } from "@/stores/learningPath";
|
||||||
import { useUserStore } from "@/stores/user";
|
import { useUserStore } from "@/stores/user";
|
||||||
|
|
@ -35,6 +36,7 @@ const state: StateInterface = reactive({
|
||||||
});
|
});
|
||||||
|
|
||||||
const courseSessionStore = useCourseSessionsStore();
|
const courseSessionStore = useCourseSessionsStore();
|
||||||
|
const assignmentStore = useAssignmentStore();
|
||||||
|
|
||||||
const numTasks = computed(() => props.assignment.evaluation_tasks?.length ?? 0);
|
const numTasks = computed(() => props.assignment.evaluation_tasks?.length ?? 0);
|
||||||
const evaluationSubmitted = computed(
|
const evaluationSubmitted = computed(
|
||||||
|
|
@ -95,6 +97,29 @@ const assignmentDetail = computed(() => findAssignmentDetail());
|
||||||
const dueDate = computed(() =>
|
const dueDate = computed(() =>
|
||||||
dayjs(assignmentDetail.value?.evaluationDeadlineDateTimeUtc)
|
dayjs(assignmentDetail.value?.evaluationDeadlineDateTimeUtc)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
const inEvaluationTask = computed(
|
||||||
|
() => state.pageIndex >= 1 && state.pageIndex <= numTasks.value
|
||||||
|
);
|
||||||
|
const taskIndex = computed(() => state.pageIndex - 1);
|
||||||
|
const task = computed(() => props.assignment.evaluation_tasks[taskIndex.value]);
|
||||||
|
|
||||||
|
const taskExpertDataText = computed(() => {
|
||||||
|
let result = "";
|
||||||
|
if (inEvaluationTask.value) {
|
||||||
|
result =
|
||||||
|
assignmentStore.assignmentCompletion?.completion_data?.[task.value.id]
|
||||||
|
?.expert_data?.text ?? "";
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
});
|
||||||
|
|
||||||
|
function nextButtonEnabled() {
|
||||||
|
if (inEvaluationTask.value) {
|
||||||
|
return taskExpertDataText.value ?? false;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
|
|
@ -110,7 +135,7 @@ const dueDate = computed(() =>
|
||||||
@start-evaluation="nextPage"
|
@start-evaluation="nextPage"
|
||||||
></EvaluationIntro>
|
></EvaluationIntro>
|
||||||
<EvaluationTask
|
<EvaluationTask
|
||||||
v-else-if="state.pageIndex >= 1 && state.pageIndex <= numTasks"
|
v-else-if="inEvaluationTask"
|
||||||
:assignment-user="props.assignmentUser"
|
:assignment-user="props.assignmentUser"
|
||||||
:assignment="props.assignment"
|
:assignment="props.assignment"
|
||||||
:task-index="state.pageIndex - 1"
|
:task-index="state.pageIndex - 1"
|
||||||
|
|
@ -141,7 +166,7 @@ const dueDate = computed(() =>
|
||||||
{{ $t("general.backCapitalized") }}
|
{{ $t("general.backCapitalized") }}
|
||||||
</button>
|
</button>
|
||||||
<button
|
<button
|
||||||
v-if="true"
|
:disabled="!nextButtonEnabled()"
|
||||||
class="btn-secondary z-10 flex items-center"
|
class="btn-secondary z-10 flex items-center"
|
||||||
data-cy="next-step"
|
data-cy="next-step"
|
||||||
@click="nextPage()"
|
@click="nextPage()"
|
||||||
|
|
|
||||||
|
|
@ -68,7 +68,7 @@ async function evaluateAssignmentCompletion(completionData: AssignmentCompletion
|
||||||
|
|
||||||
const evaluateAssignmentCompletionDebounced = useDebounceFn(
|
const evaluateAssignmentCompletionDebounced = useDebounceFn(
|
||||||
evaluateAssignmentCompletion,
|
evaluateAssignmentCompletion,
|
||||||
500
|
300
|
||||||
);
|
);
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
@ -114,6 +114,7 @@ const evaluateAssignmentCompletionDebounced = useDebounceFn(
|
||||||
class="mt-8"
|
class="mt-8"
|
||||||
:model-value="expertData.text ?? ''"
|
:model-value="expertData.text ?? ''"
|
||||||
label="Begründung"
|
label="Begründung"
|
||||||
|
placeholder="Hier muss zwingend eine Begründung erfasst werden."
|
||||||
@update:model-value="onUpdateText($event)"
|
@update:model-value="onUpdateText($event)"
|
||||||
></ItTextarea>
|
></ItTextarea>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue