Merged in fix/musterlosung (pull request #312)
fix: sample solution praxis assignment w/o mentor Approved-by: Christian Cueni
This commit is contained in:
commit
2a24d9923e
|
|
@ -0,0 +1,36 @@
|
||||||
|
<script setup lang="ts">
|
||||||
|
import ItButton from "@/components/ui/ItButton.vue";
|
||||||
|
import type { Assignment } from "@/types";
|
||||||
|
|
||||||
|
const props = defineProps<{
|
||||||
|
assignment: Assignment;
|
||||||
|
}>();
|
||||||
|
|
||||||
|
const openSolutionSample = () => {
|
||||||
|
const url = props.assignment.solution_sample?.url;
|
||||||
|
if (url) {
|
||||||
|
window.open(url, "_blank");
|
||||||
|
}
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<div v-if="assignment.solution_sample" data-cy="show-sample-solution">
|
||||||
|
<p>
|
||||||
|
{{ $t("assignment.submissionShowSampleSolutionText") }}
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<ItButton
|
||||||
|
class="mt-6"
|
||||||
|
variant="primary"
|
||||||
|
size="normal"
|
||||||
|
:disabled="false"
|
||||||
|
data-cy="show-sample-solution-button"
|
||||||
|
@click="openSolutionSample"
|
||||||
|
>
|
||||||
|
<p>{{ $t("assignment.submissionShowSampleSolution") }}</p>
|
||||||
|
</ItButton>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<style scoped></style>
|
||||||
|
|
@ -14,6 +14,7 @@ import type { Assignment } from "@/types";
|
||||||
import DateEmbedding from "@/components/dueDates/DateEmbedding.vue";
|
import DateEmbedding from "@/components/dueDates/DateEmbedding.vue";
|
||||||
import { useLearningMentors } from "@/composables";
|
import { useLearningMentors } from "@/composables";
|
||||||
import NoMentorInformationPanel from "@/components/mentor/NoMentorInformationPanel.vue";
|
import NoMentorInformationPanel from "@/components/mentor/NoMentorInformationPanel.vue";
|
||||||
|
import SampleSolution from "@/components/assignment/SampleSolution.vue";
|
||||||
|
|
||||||
const props = defineProps<{
|
const props = defineProps<{
|
||||||
submissionDeadlineStart?: string | null;
|
submissionDeadlineStart?: string | null;
|
||||||
|
|
@ -98,4 +99,9 @@ const onSubmit = async () => {
|
||||||
>
|
>
|
||||||
<p>{{ $t("a.Ergebnisse teilen") }}</p>
|
<p>{{ $t("a.Ergebnisse teilen") }}</p>
|
||||||
</ItButton>
|
</ItButton>
|
||||||
|
<SampleSolution
|
||||||
|
v-if="learningMentors?.length == 0"
|
||||||
|
class="pt-8"
|
||||||
|
:assignment="assignment"
|
||||||
|
/>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,4 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import ItButton from "@/components/ui/ItButton.vue";
|
|
||||||
import ItSuccessAlert from "@/components/ui/ItSuccessAlert.vue";
|
import ItSuccessAlert from "@/components/ui/ItSuccessAlert.vue";
|
||||||
import {
|
import {
|
||||||
useCourseData,
|
useCourseData,
|
||||||
|
|
@ -14,6 +13,7 @@ import type { AssignmentAssignmentAssignmentTypeChoices } from "@/gql/graphql";
|
||||||
import CaseWorkSubmit from "@/components/learningPath/assignment/CaseWorkSubmit.vue";
|
import CaseWorkSubmit from "@/components/learningPath/assignment/CaseWorkSubmit.vue";
|
||||||
import SimpleSubmit from "@/components/learningPath/assignment/SimpleSubmit.vue";
|
import SimpleSubmit from "@/components/learningPath/assignment/SimpleSubmit.vue";
|
||||||
import PraxisAssignmentSubmit from "@/components/learningPath/assignment/PraxisAssignmentSubmit.vue";
|
import PraxisAssignmentSubmit from "@/components/learningPath/assignment/PraxisAssignmentSubmit.vue";
|
||||||
|
import SampleSolution from "@/components/assignment/SampleSolution.vue";
|
||||||
|
|
||||||
const props = defineProps<{
|
const props = defineProps<{
|
||||||
assignment: Assignment;
|
assignment: Assignment;
|
||||||
|
|
@ -78,14 +78,6 @@ const isPraxisAssignment = computed(() => checkAssignmentType(["PRAXIS_ASSIGNMEN
|
||||||
const onEditTask = (task: AssignmentTask) => {
|
const onEditTask = (task: AssignmentTask) => {
|
||||||
emit("editTask", task);
|
emit("editTask", task);
|
||||||
};
|
};
|
||||||
|
|
||||||
const openSolutionSample = () => {
|
|
||||||
const url = props.assignment.solution_sample?.url ?? "";
|
|
||||||
|
|
||||||
if (props.assignment.solution_sample) {
|
|
||||||
window.open(url, "_blank");
|
|
||||||
}
|
|
||||||
};
|
|
||||||
</script>
|
</script>
|
||||||
<template>
|
<template>
|
||||||
<div class="w-full border border-gray-400 p-8" data-cy="confirm-container">
|
<div class="w-full border border-gray-400 p-8" data-cy="confirm-container">
|
||||||
|
|
@ -134,26 +126,7 @@ const openSolutionSample = () => {
|
||||||
$t("assignment.submissionNotificationDisclaimer", { name: circleExpertName })
|
$t("assignment.submissionNotificationDisclaimer", { name: circleExpertName })
|
||||||
}}
|
}}
|
||||||
</p>
|
</p>
|
||||||
<div
|
<SampleSolution class="pt-2" :assignment="assignment" />
|
||||||
v-if="assignment.solution_sample"
|
|
||||||
class="pt-2"
|
|
||||||
data-cy="show-sample-solution"
|
|
||||||
>
|
|
||||||
<p>
|
|
||||||
{{ $t("assignment.submissionShowSampleSolutionText") }}
|
|
||||||
</p>
|
|
||||||
|
|
||||||
<ItButton
|
|
||||||
class="mt-6"
|
|
||||||
variant="primary"
|
|
||||||
size="normal"
|
|
||||||
:disabled="false"
|
|
||||||
data-cy="show-sample-solution-button"
|
|
||||||
@click="openSolutionSample"
|
|
||||||
>
|
|
||||||
<p>{{ $t("assignment.submissionShowSampleSolution") }}</p>
|
|
||||||
</ItButton>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<AssignmentSubmissionResponses
|
<AssignmentSubmissionResponses
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue