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