wip: Update trainer text
This commit is contained in:
parent
8fafba755d
commit
38fb7bb7a6
|
|
@ -84,6 +84,18 @@ const taskExpertDataText = computed(() => {
|
|||
return result;
|
||||
});
|
||||
|
||||
const text = computed(() => {
|
||||
if (props.assignment.assignment_type === "CASEWORK") {
|
||||
return {
|
||||
evaluationFinish: "a.Bewertung abschliessen",
|
||||
};
|
||||
} else {
|
||||
return {
|
||||
evaluationFinish: "a.Feedback abschliessen",
|
||||
};
|
||||
}
|
||||
});
|
||||
|
||||
function nextButtonEnabled() {
|
||||
if (inEvaluationTask.value) {
|
||||
return taskExpertDataText.value ?? false;
|
||||
|
|
@ -159,7 +171,7 @@ function finishButtonEnabled() {
|
|||
@click="emit('close')"
|
||||
>
|
||||
<span class="flex items-center">
|
||||
{{ $t("a.Bewertung abschliessen") }}
|
||||
{{ $t(text.evaluationFinish) }}
|
||||
<it-icon-check class="ml-2 h-6 w-6"></it-icon-check>
|
||||
</span>
|
||||
</button>
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ import { useCurrentCourseSession } from "@/composables";
|
|||
import { UPSERT_ASSIGNMENT_COMPLETION_MUTATION } from "@/graphql/mutations";
|
||||
import type { Assignment, AssignmentCompletion, CourseSessionUser } from "@/types";
|
||||
import { useMutation } from "@urql/vue";
|
||||
import { computed } from "vue";
|
||||
import dayjs, { Dayjs } from "dayjs";
|
||||
import * as log from "loglevel";
|
||||
|
||||
|
|
@ -17,6 +18,26 @@ const emit = defineEmits(["startEvaluation"]);
|
|||
|
||||
log.debug("EvaluationIntro setup");
|
||||
|
||||
const text = computed(() => {
|
||||
if (props.assignment.assignment_type === "CASEWORK") {
|
||||
return {
|
||||
evaluationTitle: "a.Bewertung",
|
||||
evaluationInstruction: "assignment.evaluationInstrumentDescriptionText",
|
||||
evaluationStart: "a.Bewertung starten",
|
||||
evaluationContinue: "a.Bewertung fortsetzen",
|
||||
evaluationView: "a.Bewertung ansehen",
|
||||
};
|
||||
} else {
|
||||
return {
|
||||
evaluationTitle: "Feedback",
|
||||
evaluationInstruction: "assignment.evaluationInstrumentDescriptionTextFeedback",
|
||||
evaluationStart: "a.Feedback geben",
|
||||
evaluationContinue: "a.Feedback fortsetzen",
|
||||
evaluationView: "a.Feedback ansehen",
|
||||
};
|
||||
}
|
||||
});
|
||||
|
||||
const courseSession = useCurrentCourseSession();
|
||||
|
||||
const upsertAssignmentCompletionMutation = useMutation(
|
||||
|
|
@ -57,7 +78,7 @@ async function startEvaluation() {
|
|||
}}
|
||||
</div>
|
||||
|
||||
<h3>{{ $t("a.Bewertung") }}</h3>
|
||||
<h3>{{ $t(text.evaluationTitle) }}</h3>
|
||||
|
||||
<p v-if="props.dueDate" class="my-4">
|
||||
{{
|
||||
|
|
@ -72,10 +93,10 @@ async function startEvaluation() {
|
|||
</p>
|
||||
|
||||
<p class="my-4">
|
||||
{{ $t("assignment.evaluationInstrumentDescriptionText") }}
|
||||
{{ $t(text.evaluationInstruction) }}
|
||||
</p>
|
||||
|
||||
<p class="my-4">
|
||||
<p v-if="props.assignment.assignment_type === 'CASEWORK'" class="my-4">
|
||||
<a :href="props.assignment.evaluation_document_url" class="link" target="_blank">
|
||||
{{ $t("a.Beurteilungsinstrument anzeigen") }}
|
||||
</a>
|
||||
|
|
@ -92,16 +113,16 @@ async function startEvaluation() {
|
|||
props.assignmentCompletion.completion_status === 'EVALUATION_IN_PROGRESS'
|
||||
"
|
||||
>
|
||||
{{ $t("a.Bewertung fortsetzen") }}
|
||||
{{ $t(text.evaluationContinue) }}
|
||||
</span>
|
||||
<span
|
||||
v-else-if="
|
||||
props.assignmentCompletion.completion_status === 'EVALUATION_SUBMITTED'
|
||||
"
|
||||
>
|
||||
{{ $t("a.Bewertung ansehen") }}
|
||||
{{ $t(text.evaluationView) }}
|
||||
</span>
|
||||
<span v-else>{{ $t("a.Bewertung starten") }}</span>
|
||||
<span v-else>{{ $t(text.evaluationStart) }}</span>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -40,6 +40,30 @@ const upsertAssignmentCompletionMutation = useMutation(
|
|||
UPSERT_ASSIGNMENT_COMPLETION_MUTATION
|
||||
);
|
||||
|
||||
const text = computed(() => {
|
||||
if (props.assignment.assignment_type === "CASEWORK") {
|
||||
return {
|
||||
evaluationCriteria: "a.Beurteilungskriterium",
|
||||
evaluationReason: "assignment.evaluationReason",
|
||||
evaluationDescription: "assignment.evaluationInstrumentDescriptionText",
|
||||
evaluationSubmit: "a.Bewertung freigeben",
|
||||
evaluationSubmission: "a.Bewertung Freigabe",
|
||||
evaluationForUser: "a.Bewertung von x y",
|
||||
evaluationSuccess: "a.Deine Bewertung für x y wurde freigegeben.",
|
||||
};
|
||||
} else {
|
||||
return {
|
||||
evaluationCriteria: "Feedback",
|
||||
evaluationReason: "assignment.evaluationFeedback",
|
||||
evaluationDescription: "a.assignment.evaluationFeedbackDescriptionText",
|
||||
evaluationSubmit: "a.Feedback freigeben",
|
||||
evaluationSubmission: "a.Feedback Freigabe",
|
||||
evaluationForUser: "a.Feedback von x y",
|
||||
evaluationSuccess: "a.Dein Feedback für x y wurde freigegeben.",
|
||||
};
|
||||
}
|
||||
});
|
||||
|
||||
async function submitEvaluation() {
|
||||
upsertAssignmentCompletionMutation.executeMutation({
|
||||
assignmentId: props.assignment.id,
|
||||
|
|
@ -93,12 +117,20 @@ const evaluationUser = computed(() => {
|
|||
<!-- eslint-disable vue/no-v-html -->
|
||||
<div>
|
||||
<h3 v-if="evaluationUser && props.showEvaluationUser" class="mb-6">
|
||||
Bewertung von {{ evaluationUser.first_name }} {{ evaluationUser.last_name }}
|
||||
{{
|
||||
$t(text.evaluationForUser, {
|
||||
x: evaluationUser.first_name,
|
||||
y: evaluationUser.last_name,
|
||||
})
|
||||
}}
|
||||
</h3>
|
||||
<h3 v-else class="mb-6" data-cy="sub-title">{{ $t("a.Bewertung Freigabe") }}</h3>
|
||||
<h3 v-else class="mb-6" data-cy="sub-title">{{ $t(text.evaluationSubmission) }}</h3>
|
||||
|
||||
<section class="mb-6 border p-6" data-cy="result-section">
|
||||
<section class="flex items-center">
|
||||
<section
|
||||
v-if="props.assignment.assignment_type === 'CASEWORK'"
|
||||
class="flex items-center"
|
||||
>
|
||||
<div class="heading-1 py-4" data-cy="user-points">
|
||||
{{ userPoints }}
|
||||
</div>
|
||||
|
|
@ -116,6 +148,7 @@ const evaluationUser = computed(() => {
|
|||
|
||||
<div
|
||||
v-if="
|
||||
props.assignment.assignment_type === 'CASEWORK' &&
|
||||
props.assignmentCompletion.completion_status === 'EVALUATION_SUBMITTED' &&
|
||||
!props.assignmentCompletion.evaluation_passed
|
||||
"
|
||||
|
|
@ -126,10 +159,10 @@ const evaluationUser = computed(() => {
|
|||
</div>
|
||||
|
||||
<p class="my-4">
|
||||
{{ $t("assignment.evaluationInstrumentDescriptionText") }}
|
||||
{{ $t(text.evaluationDescription) }}
|
||||
</p>
|
||||
|
||||
<p class="my-4">
|
||||
<p v-if="props.assignment.assignment_type === 'CASEWORK'" class="my-4">
|
||||
<a
|
||||
:href="props.assignment.evaluation_document_url"
|
||||
class="link"
|
||||
|
|
@ -156,13 +189,18 @@ const evaluationUser = computed(() => {
|
|||
data-cy="submit-evaluation"
|
||||
@click="submitEvaluation()"
|
||||
>
|
||||
{{ $t("a.Bewertung freigeben") }}
|
||||
{{ $t(text.evaluationSubmit) }}
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<div v-if="state.showSuccessInfo" class="mt-4">
|
||||
<ItSuccessAlert
|
||||
:text="`Deine Bewertung für ${props.assignmentUser.first_name} ${props.assignmentUser.last_name} wurde freigegeben.`"
|
||||
:text="
|
||||
$t(text.evaluationSuccess, {
|
||||
x: evaluationUser?.first_name,
|
||||
y: evaluationUser?.last_name,
|
||||
})
|
||||
"
|
||||
></ItSuccessAlert>
|
||||
</div>
|
||||
</section>
|
||||
|
|
@ -172,7 +210,7 @@ const evaluationUser = computed(() => {
|
|||
<article class="border-t py-4">
|
||||
<div class="flex flex-row justify-between">
|
||||
<div class="mb-4 text-gray-900">
|
||||
{{ $t("a.Beurteilungskriterium") }} {{ index + 1 }}:
|
||||
{{ $t(text.evaluationCriteria) }} {{ index + 1 }}:
|
||||
{{ task.value.title }}
|
||||
</div>
|
||||
<div
|
||||
|
|
@ -209,13 +247,16 @@ const evaluationUser = computed(() => {
|
|||
open-links-in-new-tab
|
||||
/>
|
||||
|
||||
<div class="text-sm text-gray-800">
|
||||
<div
|
||||
v-if="assignment.assignment_type === 'CASEWORK'"
|
||||
class="text-sm text-gray-800"
|
||||
>
|
||||
{{ evaluationForTask(task).points }} Punkte
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<div>
|
||||
<span class="font-bold">{{ $t("a.Begründung") }}:</span>
|
||||
<span class="font-bold">{{ $t(text.evaluationReason) }}:</span>
|
||||
{{ evaluationForTask(task).text }}
|
||||
</div>
|
||||
</article>
|
||||
|
|
|
|||
|
|
@ -38,6 +38,22 @@ const expertData = computed(() => {
|
|||
return data;
|
||||
});
|
||||
|
||||
const text = computed(() => {
|
||||
if (props.assignment.assignment_type === "CASEWORK") {
|
||||
return {
|
||||
evaluationCriteria: "a.Beurteilungskriterium",
|
||||
evaluationReason: "assignment.evaluationReason",
|
||||
evaluationReasonPlaceholder: "assignment.justificationRequiredText",
|
||||
};
|
||||
} else {
|
||||
return {
|
||||
evaluationCriteria: "Feedback",
|
||||
evaluationReason: "assignment.evaluationFeedback",
|
||||
evaluationReasonPlaceholder: "assignment.feedbackRequiredText",
|
||||
};
|
||||
}
|
||||
});
|
||||
|
||||
function changePoints(points: number) {
|
||||
log.debug("changePoints", points);
|
||||
evaluateAssignmentCompletion({
|
||||
|
|
@ -88,7 +104,7 @@ const evaluateAssignmentCompletionDebounced = useDebounceFn(
|
|||
<!-- eslint-disable vue/no-v-html -->
|
||||
<div data-cy="evaluation-task">
|
||||
<div class="text-bold mb-4 text-sm">
|
||||
{{ $t("a.Beurteilungskriterium") }} {{ taskIndex + 1 }} /
|
||||
{{ $t(text.evaluationCriteria) }} {{ taskIndex + 1 }} /
|
||||
{{ props.assignment.evaluation_tasks.length }}
|
||||
{{ task.value.title }}
|
||||
</div>
|
||||
|
|
@ -127,9 +143,9 @@ const evaluateAssignmentCompletionDebounced = useDebounceFn(
|
|||
<ItTextarea
|
||||
class="mt-8"
|
||||
:model-value="expertData.text ?? ''"
|
||||
:label="$t('a.Begründung')"
|
||||
:label="$t(text.evaluationReason)"
|
||||
:disabled="!props.allowEdit"
|
||||
:placeholder="$t('assignment.justificationRequiredText')"
|
||||
:placeholder="$t(text.evaluationReasonPlaceholder)"
|
||||
data-cy="reason-text"
|
||||
@update:model-value="onUpdateText($event)"
|
||||
></ItTextarea>
|
||||
|
|
|
|||
|
|
@ -41,9 +41,9 @@ export function getAssignmentTypeTitle(assignmentType: AssignmentType): string {
|
|||
|
||||
switch (assignmentType) {
|
||||
case "CASEWORK":
|
||||
return t("learningContentTypes.mandatory_casework");
|
||||
return t("learningContentTypes.casework");
|
||||
case "PRAXIS_ASSIGNMENT":
|
||||
return t("learningContentTypes.voluntary_casework");
|
||||
return t("learningContentTypes.praxisAssignment");
|
||||
case "PREP_ASSIGNMENT":
|
||||
return t("learningContentTypes.prepAssignment");
|
||||
case "REFLECTION":
|
||||
|
|
|
|||
|
|
@ -4208,6 +4208,7 @@ def create_vv_gewinnen_casework(course_id=COURSE_VERSICHERUNGSVERMITTLERIN_ID):
|
|||
parent=assignment_list_page,
|
||||
title="Mein Kundenstamm",
|
||||
effort_required="60 bis 90 Minuten",
|
||||
assignment_type=AssignmentType.PRAXIS_ASSIGNMENT.name,
|
||||
intro_text=replace_whitespace(
|
||||
"""
|
||||
<h3>Thema</h3>
|
||||
|
|
@ -4588,6 +4589,7 @@ def create_vv_einkommenssicherung_casework(
|
|||
parent=assignment_list_page,
|
||||
title="Heirat: Was ändert sich",
|
||||
effort_required="45 bis 90 Minuten",
|
||||
assignment_type=AssignmentType.PRAXIS_ASSIGNMENT.name,
|
||||
intro_text=replace_whitespace(
|
||||
"""
|
||||
<h3>Thema</h3>
|
||||
|
|
@ -4826,6 +4828,7 @@ def create_vv_gesundheit_casework(course_id=COURSE_VERSICHERUNGSVERMITTLERIN_ID)
|
|||
parent=assignment_list_page,
|
||||
title="Krankenversicherung: Passt die Lösung noch?",
|
||||
effort_required="60 bis 90 Minuten",
|
||||
assignment_type=AssignmentType.PRAXIS_ASSIGNMENT.name,
|
||||
intro_text=replace_whitespace(
|
||||
"""
|
||||
<h3>Ausgangslage</h3>
|
||||
|
|
|
|||
|
|
@ -261,7 +261,7 @@ class UpdateAssignmentCompletionTestCase(TestCase):
|
|||
user_text_input = find_first(
|
||||
subtasks,
|
||||
pred=lambda x: (value := x.get("value"))
|
||||
and value.get("text", "").startswith(
|
||||
and value.get("text", "").startswith(
|
||||
"Gibt es zusätzliche Deckungen, die du der Person empfehlen würdest?"
|
||||
),
|
||||
)
|
||||
|
|
@ -344,7 +344,7 @@ class UpdateAssignmentCompletionTestCase(TestCase):
|
|||
user_text_input = find_first(
|
||||
subtasks,
|
||||
pred=lambda x: (value := x.get("value"))
|
||||
and value.get("text", "").startswith(
|
||||
and value.get("text", "").startswith(
|
||||
"Gibt es zusätzliche Deckungen, die du der Person empfehlen würdest?"
|
||||
),
|
||||
)
|
||||
|
|
@ -396,7 +396,7 @@ class UpdateAssignmentCompletionTestCase(TestCase):
|
|||
user_text_input = find_first(
|
||||
subtasks,
|
||||
pred=lambda x: (value := x.get("value"))
|
||||
and value.get("text", "").startswith(
|
||||
and value.get("text", "").startswith(
|
||||
"Gibt es zusätzliche Deckungen, die du der Person empfehlen würdest?"
|
||||
),
|
||||
)
|
||||
|
|
@ -437,7 +437,7 @@ class UpdateAssignmentCompletionTestCase(TestCase):
|
|||
user_text_input = find_first(
|
||||
subtasks,
|
||||
pred=lambda x: (value := x.get("value"))
|
||||
and value.get("text", "").startswith(
|
||||
and value.get("text", "").startswith(
|
||||
"Gibt es zusätzliche Deckungen, die du der Person empfehlen würdest?"
|
||||
),
|
||||
)
|
||||
|
|
|
|||
|
|
@ -459,8 +459,7 @@ def create_or_update_course_session_assignment(
|
|||
csa.submission_deadline.save()
|
||||
|
||||
elif (
|
||||
csa.learning_content.assignment_type
|
||||
== AssignmentType.CASEWORK.value
|
||||
csa.learning_content.assignment_type == AssignmentType.CASEWORK.value
|
||||
and start
|
||||
):
|
||||
csa.submission_deadline.start = timezone.make_aware(
|
||||
|
|
|
|||
Loading…
Reference in New Issue