fix: sample solution praxis assignment w/o mentor
This commit is contained in:
parent
6a787fc44b
commit
df441d57a2
|
|
@ -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 { useLearningMentors } from "@/composables";
|
||||
import NoMentorInformationPanel from "@/components/mentor/NoMentorInformationPanel.vue";
|
||||
import SampleSolution from "@/components/assignment/SampleSolution.vue";
|
||||
|
||||
const props = defineProps<{
|
||||
submissionDeadlineStart?: string | null;
|
||||
|
|
@ -98,4 +99,5 @@ const onSubmit = async () => {
|
|||
>
|
||||
<p>{{ $t("a.Ergebnisse teilen") }}</p>
|
||||
</ItButton>
|
||||
<SampleSolution class="pt-8" :assignment="assignment" />
|
||||
</template>
|
||||
|
|
|
|||
|
|
@ -1,5 +1,4 @@
|
|||
<script setup lang="ts">
|
||||
import ItButton from "@/components/ui/ItButton.vue";
|
||||
import ItSuccessAlert from "@/components/ui/ItSuccessAlert.vue";
|
||||
import {
|
||||
useCourseData,
|
||||
|
|
@ -14,6 +13,7 @@ import type { AssignmentAssignmentAssignmentTypeChoices } from "@/gql/graphql";
|
|||
import CaseWorkSubmit from "@/components/learningPath/assignment/CaseWorkSubmit.vue";
|
||||
import SimpleSubmit from "@/components/learningPath/assignment/SimpleSubmit.vue";
|
||||
import PraxisAssignmentSubmit from "@/components/learningPath/assignment/PraxisAssignmentSubmit.vue";
|
||||
import SampleSolution from "@/components/assignment/SampleSolution.vue";
|
||||
|
||||
const props = defineProps<{
|
||||
assignment: Assignment;
|
||||
|
|
@ -78,14 +78,6 @@ const isPraxisAssignment = computed(() => checkAssignmentType(["PRAXIS_ASSIGNMEN
|
|||
const onEditTask = (task: AssignmentTask) => {
|
||||
emit("editTask", task);
|
||||
};
|
||||
|
||||
const openSolutionSample = () => {
|
||||
const url = props.assignment.solution_sample?.url ?? "";
|
||||
|
||||
if (props.assignment.solution_sample) {
|
||||
window.open(url, "_blank");
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<template>
|
||||
<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 })
|
||||
}}
|
||||
</p>
|
||||
<div
|
||||
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>
|
||||
<SampleSolution class="pt-2" :assignment="assignment" />
|
||||
</div>
|
||||
</div>
|
||||
<AssignmentSubmissionResponses
|
||||
|
|
|
|||
Loading…
Reference in New Issue