Merged in feature/VBV-774-course-autogewerbe (pull request #418)

Feature/VBV-774 course autogewerbe

Approved-by: Daniel Egger
This commit is contained in:
Christian Cueni 2024-11-04 08:24:23 +00:00
commit c99fd7b17a
31 changed files with 855 additions and 156 deletions

View File

@ -36,8 +36,8 @@ async function changeLocale(language: AvailableLanguages) {
</a>
</div>
<router-link
class="lg:ml-8"
v-if="isVVLearningMentor(courseSessionsStore.currentCourseSession)"
class="lg:ml-8"
:to="vvBuyLink.href.value"
data-cy="buy-vv-link"
>

View File

@ -55,6 +55,7 @@ const submittables = computed(() => {
lc.content_type === "learnpath.LearningContentAssignment" ||
lc.content_type === "learnpath.LearningContentFeedbackUK" ||
lc.content_type === "learnpath.LearningContentFeedbackVV" ||
lc.content_type === "learnpath.LearningContentFeedbackAutomobilGewerbe" ||
lc.content_type === "learnpath.LearningContentEdoniqTest"
);
@ -76,7 +77,8 @@ const submittables = computed(() => {
const isFeedback = (lc: LearningContent) => {
return (
lc.content_type === "learnpath.LearningContentFeedbackUK" ||
lc.content_type === "learnpath.LearningContentFeedbackVV"
lc.content_type === "learnpath.LearningContentFeedbackVV" ||
lc.content_type === "learnpath.LearningContentFeedbackAutomobilGewerbe"
);
};

View File

@ -662,6 +662,23 @@ export type LearningContentEdoniqTestObjectType = CoursePageInterface & Learning
translation_key: Scalars['String']['output'];
};
export type LearningContentFeedbackAutomobilGewerbeObjectType = CoursePageInterface & LearningContentInterface & {
__typename?: 'LearningContentFeedbackAutomobilGewerbeObjectType';
can_user_self_toggle_course_completion: Scalars['Boolean']['output'];
circle?: Maybe<CircleLightObjectType>;
content_type: Scalars['String']['output'];
content_url: Scalars['String']['output'];
course?: Maybe<CourseObjectType>;
description: Scalars['String']['output'];
frontend_url: Scalars['String']['output'];
id: Scalars['ID']['output'];
live: Scalars['Boolean']['output'];
minutes?: Maybe<Scalars['Int']['output']>;
slug: Scalars['String']['output'];
title: Scalars['String']['output'];
translation_key: Scalars['String']['output'];
};
export type LearningContentFeedbackUkObjectType = CoursePageInterface & LearningContentInterface & {
__typename?: 'LearningContentFeedbackUKObjectType';
can_user_self_toggle_course_completion: Scalars['Boolean']['output'];
@ -973,6 +990,7 @@ export type Query = {
learning_content_assignment?: Maybe<LearningContentAssignmentObjectType>;
learning_content_attendance_course?: Maybe<LearningContentAttendanceCourseObjectType>;
learning_content_document_list?: Maybe<LearningContentDocumentListObjectType>;
learning_content_feedback_automobil_gewerbe?: Maybe<LearningContentFeedbackAutomobilGewerbeObjectType>;
learning_content_feedback_uk?: Maybe<LearningContentFeedbackUkObjectType>;
learning_content_feedback_vv?: Maybe<LearningContentFeedbackVvObjectType>;
learning_content_knowledge_assessment?: Maybe<LearningContentKnowledgeAssessmentObjectType>;
@ -1206,6 +1224,8 @@ type CoursePageFieldsLearningContentDocumentListObjectTypeFragment = { __typenam
type CoursePageFieldsLearningContentEdoniqTestObjectTypeFragment = { __typename?: 'LearningContentEdoniqTestObjectType', title: string, id: string, slug: string, content_type: string, frontend_url: string } & { ' $fragmentName'?: 'CoursePageFieldsLearningContentEdoniqTestObjectTypeFragment' };
type CoursePageFieldsLearningContentFeedbackAutomobilGewerbeObjectTypeFragment = { __typename?: 'LearningContentFeedbackAutomobilGewerbeObjectType', title: string, id: string, slug: string, content_type: string, frontend_url: string } & { ' $fragmentName'?: 'CoursePageFieldsLearningContentFeedbackAutomobilGewerbeObjectTypeFragment' };
type CoursePageFieldsLearningContentFeedbackUkObjectTypeFragment = { __typename?: 'LearningContentFeedbackUKObjectType', title: string, id: string, slug: string, content_type: string, frontend_url: string } & { ' $fragmentName'?: 'CoursePageFieldsLearningContentFeedbackUkObjectTypeFragment' };
type CoursePageFieldsLearningContentFeedbackVvObjectTypeFragment = { __typename?: 'LearningContentFeedbackVVObjectType', title: string, id: string, slug: string, content_type: string, frontend_url: string } & { ' $fragmentName'?: 'CoursePageFieldsLearningContentFeedbackVvObjectTypeFragment' };
@ -1232,7 +1252,7 @@ type CoursePageFieldsPerformanceCriteriaObjectTypeFragment = { __typename?: 'Per
type CoursePageFieldsTopicObjectTypeFragment = { __typename?: 'TopicObjectType', title: string, id: string, slug: string, content_type: string, frontend_url: string } & { ' $fragmentName'?: 'CoursePageFieldsTopicObjectTypeFragment' };
export type CoursePageFieldsFragment = CoursePageFieldsActionCompetenceObjectTypeFragment | CoursePageFieldsAssignmentObjectTypeFragment | CoursePageFieldsCircleObjectTypeFragment | CoursePageFieldsCompetenceCertificateListObjectTypeFragment | CoursePageFieldsCompetenceCertificateObjectTypeFragment | CoursePageFieldsLearningContentAssignmentObjectTypeFragment | CoursePageFieldsLearningContentAttendanceCourseObjectTypeFragment | CoursePageFieldsLearningContentDocumentListObjectTypeFragment | CoursePageFieldsLearningContentEdoniqTestObjectTypeFragment | CoursePageFieldsLearningContentFeedbackUkObjectTypeFragment | CoursePageFieldsLearningContentFeedbackVvObjectTypeFragment | CoursePageFieldsLearningContentKnowledgeAssessmentObjectTypeFragment | CoursePageFieldsLearningContentLearningModuleObjectTypeFragment | CoursePageFieldsLearningContentMediaLibraryObjectTypeFragment | CoursePageFieldsLearningContentPlaceholderObjectTypeFragment | CoursePageFieldsLearningContentRichTextObjectTypeFragment | CoursePageFieldsLearningContentVideoObjectTypeFragment | CoursePageFieldsLearningPathObjectTypeFragment | CoursePageFieldsLearningSequenceObjectTypeFragment | CoursePageFieldsLearningUnitObjectTypeFragment | CoursePageFieldsPerformanceCriteriaObjectTypeFragment | CoursePageFieldsTopicObjectTypeFragment;
export type CoursePageFieldsFragment = CoursePageFieldsActionCompetenceObjectTypeFragment | CoursePageFieldsAssignmentObjectTypeFragment | CoursePageFieldsCircleObjectTypeFragment | CoursePageFieldsCompetenceCertificateListObjectTypeFragment | CoursePageFieldsCompetenceCertificateObjectTypeFragment | CoursePageFieldsLearningContentAssignmentObjectTypeFragment | CoursePageFieldsLearningContentAttendanceCourseObjectTypeFragment | CoursePageFieldsLearningContentDocumentListObjectTypeFragment | CoursePageFieldsLearningContentEdoniqTestObjectTypeFragment | CoursePageFieldsLearningContentFeedbackAutomobilGewerbeObjectTypeFragment | CoursePageFieldsLearningContentFeedbackUkObjectTypeFragment | CoursePageFieldsLearningContentFeedbackVvObjectTypeFragment | CoursePageFieldsLearningContentKnowledgeAssessmentObjectTypeFragment | CoursePageFieldsLearningContentLearningModuleObjectTypeFragment | CoursePageFieldsLearningContentMediaLibraryObjectTypeFragment | CoursePageFieldsLearningContentPlaceholderObjectTypeFragment | CoursePageFieldsLearningContentRichTextObjectTypeFragment | CoursePageFieldsLearningContentVideoObjectTypeFragment | CoursePageFieldsLearningPathObjectTypeFragment | CoursePageFieldsLearningSequenceObjectTypeFragment | CoursePageFieldsLearningUnitObjectTypeFragment | CoursePageFieldsPerformanceCriteriaObjectTypeFragment | CoursePageFieldsTopicObjectTypeFragment;
export type AttendanceCheckQueryQueryVariables = Exact<{
courseSessionId: Scalars['ID']['input'];
@ -1276,6 +1296,9 @@ export type CompetenceCertificateQueryQuery = { __typename?: 'Query', competence
) | (
{ __typename?: 'LearningContentEdoniqTestObjectType', circle?: { __typename?: 'CircleLightObjectType', id: string, title: string, slug: string } | null }
& { ' $fragmentRefs'?: { 'CoursePageFieldsLearningContentEdoniqTestObjectTypeFragment': CoursePageFieldsLearningContentEdoniqTestObjectTypeFragment } }
) | (
{ __typename?: 'LearningContentFeedbackAutomobilGewerbeObjectType', circle?: { __typename?: 'CircleLightObjectType', id: string, title: string, slug: string } | null }
& { ' $fragmentRefs'?: { 'CoursePageFieldsLearningContentFeedbackAutomobilGewerbeObjectTypeFragment': CoursePageFieldsLearningContentFeedbackAutomobilGewerbeObjectTypeFragment } }
) | (
{ __typename?: 'LearningContentFeedbackUKObjectType', circle?: { __typename?: 'CircleLightObjectType', id: string, title: string, slug: string } | null }
& { ' $fragmentRefs'?: { 'CoursePageFieldsLearningContentFeedbackUkObjectTypeFragment': CoursePageFieldsLearningContentFeedbackUkObjectTypeFragment } }
@ -1330,6 +1353,9 @@ export type CompetenceCertificateForUserQueryQuery = { __typename?: 'Query', com
) | (
{ __typename?: 'LearningContentEdoniqTestObjectType', circle?: { __typename?: 'CircleLightObjectType', id: string, title: string, slug: string } | null }
& { ' $fragmentRefs'?: { 'CoursePageFieldsLearningContentEdoniqTestObjectTypeFragment': CoursePageFieldsLearningContentEdoniqTestObjectTypeFragment } }
) | (
{ __typename?: 'LearningContentFeedbackAutomobilGewerbeObjectType', circle?: { __typename?: 'CircleLightObjectType', id: string, title: string, slug: string } | null }
& { ' $fragmentRefs'?: { 'CoursePageFieldsLearningContentFeedbackAutomobilGewerbeObjectTypeFragment': CoursePageFieldsLearningContentFeedbackAutomobilGewerbeObjectTypeFragment } }
) | (
{ __typename?: 'LearningContentFeedbackUKObjectType', circle?: { __typename?: 'CircleLightObjectType', id: string, title: string, slug: string } | null }
& { ' $fragmentRefs'?: { 'CoursePageFieldsLearningContentFeedbackUkObjectTypeFragment': CoursePageFieldsLearningContentFeedbackUkObjectTypeFragment } }
@ -1407,6 +1433,9 @@ export type CourseQueryQuery = { __typename?: 'Query', course?: { __typename?: '
& { ' $fragmentRefs'?: { 'CoursePageFieldsCompetenceCertificateObjectTypeFragment': CoursePageFieldsCompetenceCertificateObjectTypeFragment } }
) | null }
& { ' $fragmentRefs'?: { 'CoursePageFieldsLearningContentEdoniqTestObjectTypeFragment': CoursePageFieldsLearningContentEdoniqTestObjectTypeFragment } }
) | (
{ __typename?: 'LearningContentFeedbackAutomobilGewerbeObjectType', can_user_self_toggle_course_completion: boolean, content_url: string, minutes?: number | null, description: string }
& { ' $fragmentRefs'?: { 'CoursePageFieldsLearningContentFeedbackAutomobilGewerbeObjectTypeFragment': CoursePageFieldsLearningContentFeedbackAutomobilGewerbeObjectTypeFragment } }
) | (
{ __typename?: 'LearningContentFeedbackUKObjectType', can_user_self_toggle_course_completion: boolean, content_url: string, minutes?: number | null, description: string }
& { ' $fragmentRefs'?: { 'CoursePageFieldsLearningContentFeedbackUkObjectTypeFragment': CoursePageFieldsLearningContentFeedbackUkObjectTypeFragment } }

View File

@ -13,6 +13,7 @@ type Query {
learning_content_attendance_course: LearningContentAttendanceCourseObjectType
learning_content_feedback_uk: LearningContentFeedbackUKObjectType
learning_content_feedback_vv: LearningContentFeedbackVVObjectType
learning_content_feedback_automobil_gewerbe: LearningContentFeedbackAutomobilGewerbeObjectType
learning_content_learning_module: LearningContentLearningModuleObjectType
learning_content_knowledge_assessment: LearningContentKnowledgeAssessmentObjectType
learning_content_placeholder: LearningContentPlaceholderObjectType
@ -819,6 +820,22 @@ type LearningContentFeedbackVVObjectType implements CoursePageInterface & Learni
circle: CircleLightObjectType
}
type LearningContentFeedbackAutomobilGewerbeObjectType implements CoursePageInterface & LearningContentInterface {
id: ID!
title: String!
slug: String!
content_type: String!
live: Boolean!
translation_key: String!
frontend_url: String!
course: CourseObjectType
minutes: Int
description: String!
content_url: String!
can_user_self_toggle_course_completion: Boolean!
circle: CircleLightObjectType
}
type LearningContentLearningModuleObjectType implements CoursePageInterface & LearningContentInterface {
id: ID!
title: String!

View File

@ -59,6 +59,7 @@ export const LearningContentAssignmentObjectType = "LearningContentAssignmentObj
export const LearningContentAttendanceCourseObjectType = "LearningContentAttendanceCourseObjectType";
export const LearningContentDocumentListObjectType = "LearningContentDocumentListObjectType";
export const LearningContentEdoniqTestObjectType = "LearningContentEdoniqTestObjectType";
export const LearningContentFeedbackAutomobilGewerbeObjectType = "LearningContentFeedbackAutomobilGewerbeObjectType";
export const LearningContentFeedbackUKObjectType = "LearningContentFeedbackUKObjectType";
export const LearningContentFeedbackVVObjectType = "LearningContentFeedbackVVObjectType";
export const LearningContentInterface = "LearningContentInterface";

View File

@ -34,6 +34,10 @@
v-else-if="feedbackType === 'uk'"
:feedback-data="feedbackData"
/>
<FeedbackPageAutomobilgewerbe
v-else-if="feedbackType === 'automobilgewerbe'"
:feedback-data="feedbackData"
/>
</main>
</div>
</div>
@ -42,6 +46,7 @@
<script setup lang="ts">
import { useCurrentCourseSession } from "@/composables";
import { itGet } from "@/fetchHelpers";
import FeedbackPageAutomobilgewerbe from "@/pages/cockpit/FeedbackPageAutomobilgewerbe.vue";
import FeedbackPageUK from "@/pages/cockpit/FeedbackPageUK.vue";
import FeedbackPageVV from "@/pages/cockpit/FeedbackPageVV.vue";
import { useExpertCockpitPageData } from "@/pages/cockpit/cockpitPage/composables";
@ -84,7 +89,7 @@ onMounted(async () => {
log.debug("FeedbackPage feedbackData", feedbackData.value);
if (
feedbackData.value &&
["uk", "vv"].includes(feedbackData.value?.feedbackType ?? "")
["uk", "vv", "automobilgewerbe"].includes(feedbackData.value?.feedbackType ?? "")
) {
feedbackType.value = feedbackData.value.feedbackType;
}

View File

@ -0,0 +1,59 @@
<template>
<FeedbackResults
:ordered-questions="orderedQuestions"
:feedback-data="feedbackData"
:rating-keys="ratingKeys"
:vertical-chart-keys="verticalChartKeys"
:horizontal-chart-keys="horizontalChartKeys"
:open-keys="openKeys"
/>
</template>
<script setup lang="ts">
import FeedbackResults from "@/pages/cockpit/FeedbackResults.vue";
import type { FeedbackData } from "@/types";
import { useTranslation } from "i18next-vue";
import * as log from "loglevel";
defineProps<{
feedbackData: FeedbackData;
}>();
log.debug("FeedbackPageVV created");
const { t } = useTranslation();
const orderedQuestions = [
{
key: "satisfaction",
question: t("feedback.satisfactionLabel"),
},
{
key: "goal_attainment",
question: t("feedback.goalAttainmentLabel"),
},
{
key: "proficiency",
question: t("feedback.proficiencyLabelVV"),
},
{
key: "would_recommend",
question: t("feedback.recommendLabelVV"),
},
{
key: "course_negative_feedback",
question: t("feedback.courseNegativeFeedbackLabel"),
},
{
key: "course_positive_feedback",
question: t("feedback.coursePositiveFeedbackLabel"),
},
];
const ratingKeys = ["satisfaction", "goal_attainment"];
const verticalChartKeys = ["preparation_task_clarity", "would_recommend"];
const horizontalChartKeys = ["proficiency"];
const openKeys = ["course_negative_feedback", "course_positive_feedback"];
</script>
<style scoped></style>

View File

@ -242,7 +242,13 @@ watch(
</button>
</div>
<DocumentSection v-if="showDocumentSection" :circle="circle" />
<div v-if="!props.readonly" class="expert mt-8 border p-6">
<div
v-if="
!props.readonly &&
lpQueryResult.course.value?.configuration.enable_learning_mentor
"
class="expert mt-8 border p-6"
>
<h3 class="text-blue-dark">{{ $t("circlePage.gotQuestions") }}</h3>
<div
class="mt-4 leading-relaxed"

View File

@ -23,6 +23,7 @@ import MediaLibraryBlock from "./blocks/MediaLibraryBlock.vue";
import PlaceholderBlock from "./blocks/PlaceholderBlock.vue";
import RichTextBlock from "./blocks/RichTextBlock.vue";
import VideoBlock from "./blocks/VideoBlock.vue";
import FeedbackBlockAutomobilGewerbe from "./feedback/FeedbackBlockAutomobilGewerbe.vue";
import FeedbackBlockUK from "./feedback/FeedbackBlockUK.vue";
import FeedbackBlockVV from "./feedback/FeedbackBlockVV.vue";
@ -45,6 +46,7 @@ const COMPONENTS: Record<LearningContentContentType, Component> = {
"learnpath.LearningContentDocumentList": DocumentListBlock,
"learnpath.LearningContentFeedbackUK": FeedbackBlockUK,
"learnpath.LearningContentFeedbackVV": FeedbackBlockVV,
"learnpath.LearningContentFeedbackAutomobilGewerbe": FeedbackBlockAutomobilGewerbe,
"learnpath.LearningContentLearningModule": IframeBlock,
"learnpath.LearningContentKnowledgeAssessment": IframeBlock,
"learnpath.LearningContentMediaLibrary": MediaLibraryBlock,
@ -58,6 +60,7 @@ const DEFAULT_BLOCK = PlaceholderBlock;
const component = computed(() => {
return COMPONENTS[props.learningContent.content_type] || DEFAULT_BLOCK;
});
console.log("component", component);
function handleFinishedLearningContent() {
circleStore.continueFromLearningContent(

View File

@ -5,14 +5,14 @@ import { graphql } from "@/gql";
import FeedbackCompletition from "@/pages/learningPath/learningContentPage/feedback/FeedbackCompletition.vue";
import LearningContentMultiLayout from "@/pages/learningPath/learningContentPage/layouts/LearningContentMultiLayout.vue";
import { useUserStore } from "@/stores/user";
import type { LearningContentFeedbackUK, LearningContentFeedbackVV } from "@/types";
import type { LearningContentFeedback } from "@/types";
import { useMutation } from "@urql/vue";
import { useRouteQuery } from "@vueuse/router";
import log from "loglevel";
import { computed, onMounted, reactive, ref } from "vue";
const props = defineProps<{
content: LearningContentFeedbackVV | LearningContentFeedbackUK;
content: LearningContentFeedback;
stepLabels: string[];
questionData: any[];
introduction: string;

View File

@ -0,0 +1,73 @@
<script setup lang="ts">
import ItRadioGroup from "@/components/ui/ItRadioGroup.vue";
import ItTextarea from "@/components/ui/ItTextarea.vue";
import {
PERCENTAGES,
RATINGS,
YES_NO,
} from "@/pages/learningPath/learningContentPage/feedback/feedback.constants";
import FeedbackBase from "@/pages/learningPath/learningContentPage/feedback/FeedbackBase.vue";
import type { LearningContentFeedback } from "@/types";
import { useTranslation } from "i18next-vue";
const props = defineProps<{
content: LearningContentFeedback;
}>();
const { t } = useTranslation();
const stepLabels = [
t("general.introduction"),
t("feedback.satisfactionLabel"),
t("feedback.goalAttainmentLabel"),
t("feedback.proficiencyLabelVV"),
t("feedback.recommendLabelVV"),
t("feedback.coursePositiveFeedbackLabel"),
t("feedback.courseNegativeFeedbackLabel"),
t("general.submission"),
];
const questionData = [
{
modelKey: "satisfaction",
items: RATINGS,
component: ItRadioGroup,
},
{
modelKey: "goal_attainment",
items: RATINGS,
component: ItRadioGroup,
},
{
modelKey: "proficiency",
items: PERCENTAGES,
component: ItRadioGroup,
},
{
modelKey: "would_recommend",
items: YES_NO,
component: ItRadioGroup,
},
{
modelKey: "course_positive_feedback",
component: ItTextarea,
},
{
modelKey: "course_negative_feedback",
component: ItTextarea,
},
];
</script>
<template>
<FeedbackBase
:step-labels="stepLabels"
:question-data="questionData"
:content="props.content"
:introduction="$t('a.feedback.introductionVV')"
:title="$t('Feedback')"
:completion-title="$t('feedback.sendFeedback')"
:completion-description="$t('feedback.completionDescriptionVV')"
:show-avatar="false"
/>
</template>

View File

@ -8,12 +8,12 @@ import {
YES_NO,
} from "@/pages/learningPath/learningContentPage/feedback/feedback.constants";
import FeedbackBase from "@/pages/learningPath/learningContentPage/feedback/FeedbackBase.vue";
import type { LearningContentFeedbackUK, LearningContentFeedbackVV } from "@/types";
import type { LearningContentFeedback } from "@/types";
import { useTranslation } from "i18next-vue";
import { computed } from "vue";
const props = defineProps<{
content: LearningContentFeedbackVV | LearningContentFeedbackUK;
content: LearningContentFeedback;
}>();
const courseSessionDetailResult = useCourseSessionDetailQuery();

View File

@ -7,11 +7,11 @@ import {
YES_NO,
} from "@/pages/learningPath/learningContentPage/feedback/feedback.constants";
import FeedbackBase from "@/pages/learningPath/learningContentPage/feedback/FeedbackBase.vue";
import type { LearningContentFeedbackUK, LearningContentFeedbackVV } from "@/types";
import type { LearningContentFeedback } from "@/types";
import { useTranslation } from "i18next-vue";
const props = defineProps<{
content: LearningContentFeedbackVV | LearningContentFeedbackUK;
content: LearningContentFeedback;
}>();
const { t } = useTranslation();

View File

@ -11,6 +11,7 @@ import type {
LearningContentAttendanceCourseObjectType,
LearningContentDocumentListObjectType,
LearningContentEdoniqTestObjectType,
LearningContentFeedbackAutomobilGewerbeObjectType,
LearningContentFeedbackUkObjectType,
LearningContentFeedbackVvObjectType,
LearningContentKnowledgeAssessmentObjectType,
@ -77,6 +78,11 @@ export type LearningContentFeedbackUK = LearningContentFeedbackUkObjectType & {
readonly content_type: "learnpath.LearningContentFeedbackUK";
};
export type LearningContentFeedbackAutomobilGewerbe =
LearningContentFeedbackAutomobilGewerbeObjectType & {
readonly content_type: "learnpath.LearningContentFeedbackAutomobilGewerbe";
};
export type LearningContentLearningModule = LearningContentLearningModuleObjectType & {
readonly content_type: "learnpath.LearningContentLearningModule";
};
@ -109,6 +115,7 @@ export type LearningContent =
| LearningContentEdoniqTest
| LearningContentFeedbackUK
| LearningContentFeedbackVV
| LearningContentFeedbackAutomobilGewerbe
| LearningContentLearningModule
| LearningContentKnowledgeAssessment
| LearningContentMediaLibrary
@ -116,6 +123,11 @@ export type LearningContent =
| LearningContentRichText
| LearningContentVideo;
export type LearningContentFeedback =
| LearningContentFeedbackUK
| LearningContentFeedbackVV
| LearningContentFeedbackAutomobilGewerbe;
export type LearningContentWithCompletion = LearningContent &
Completable & {
continueUrl?: string;

View File

@ -51,6 +51,7 @@ export function learningContentTypeData(
return { title: t("learningContentTypes.text"), icon: "it-icon-lc-resource" };
case "learnpath.LearningContentFeedbackUK":
case "learnpath.LearningContentFeedbackVV":
case "learnpath.LearningContentFeedbackAutomobilGewerbe":
return { title: t("learningContentTypes.feedback"), icon: "it-icon-lc-feedback" };
case "learnpath.LearningContentPlaceholder":
return {

View File

@ -26,7 +26,7 @@ describe("selfEvaluation.cy.js", () => {
cy.visit("/course/test-lehrgang/competence");
cy.get('[data-cy="self-evaluation-fail"]').should("have.text", "0");
cy.get('[data-cy="self-evaluation-success"]').should("have.text", "0");
cy.get('[data-cy="self-evaluation-unknown"]').should("have.text", "4");
cy.get('[data-cy="self-evaluation-unknown"]').should("have.text", "6");
// learning unit id = 692 also known as:
// Bedarfsanalyse, Ist- und Soll-Situation <<Reisen>>
@ -45,7 +45,7 @@ describe("selfEvaluation.cy.js", () => {
cy.makeSelfEvaluation([true, false]);
cy.url().should(
"include",
"/course/test-lehrgang/competence/self-evaluation-and-feedback"
"/course/test-lehrgang/competence/self-evaluation-and-feedback",
);
// check data again on KompetenzNavi
@ -57,7 +57,7 @@ describe("selfEvaluation.cy.js", () => {
cy.visit("/course/test-lehrgang/competence");
cy.get('[data-cy="self-evaluation-fail"]').should("have.text", "1");
cy.get('[data-cy="self-evaluation-success"]').should("have.text", "1");
cy.get('[data-cy="self-evaluation-unknown"]').should("have.text", "2");
cy.get('[data-cy="self-evaluation-unknown"]').should("have.text", "4");
});
it("should be able to make a happy self evaluation", () => {

View File

@ -16,7 +16,7 @@ describe("dashboardSupervisor.cy.js", () => {
describe("with data", () => {
beforeEach(() => {
cy.manageCommand(
"cypress_reset --create-assignment-evaluation --create-feedback-responses --create-course-completion-performance-criteria --create-attendance-days"
"cypress_reset --create-assignment-evaluation --create-feedback-responses --create-course-completion-performance-criteria --create-attendance-days",
);
login("test-supervisor1@example.com", "test");
cy.visit("/");
@ -28,7 +28,7 @@ describe("dashboardSupervisor.cy.js", () => {
// -> makes sure that the numbers are correct
getDashboardStatistics("assignments.completed").should(
"have.text",
"1"
"1",
);
getDashboardStatistics("assignments.passed").should("have.text", "34%");
});
@ -48,11 +48,11 @@ describe("dashboardSupervisor.cy.js", () => {
it("contains correct numbers", () => {
getDashboardStatistics("attendance.dayCompleted").should(
"have.text",
"1"
"1",
);
getDashboardStatistics("attendance.participantsPresent").should(
"have.text",
"34%"
"34%",
);
});
it("contains correct details link", () => {
@ -70,7 +70,7 @@ describe("dashboardSupervisor.cy.js", () => {
describe("feedback summary box", () => {
it("contains correct numbers", () => {
getDashboardStatistics("feedback.average").should("have.text", "3.3");
getDashboardStatistics("feedback.count").should("have.text", "6");
getDashboardStatistics("feedback.count").should("have.text", "9");
});
it("contains correct details link", () => {
clickOnDetailsLink("feedback");
@ -106,7 +106,7 @@ describe("dashboardSupervisor.cy.js", () => {
describe("with deducted points", () => {
beforeEach(() => {
cy.manageCommand(
"cypress_reset --create-assignment-evaluation --assignment-evaluation-scores 6,6,6,3,3 --assignment-points-deducted 14 --create-edoniq-test-results 19 24 8"
"cypress_reset --create-assignment-evaluation --assignment-evaluation-scores 6,6,6,3,3 --assignment-points-deducted 14 --create-edoniq-test-results 19 24 8",
);
login("test-supervisor1@example.com", "test");
cy.visit("/");
@ -120,14 +120,14 @@ describe("dashboardSupervisor.cy.js", () => {
// check data on the details page
cy.get(
'[data-cy="dashboard.stats.assignments"] [data-cy="basebox.detailsLink"]'
'[data-cy="dashboard.stats.assignments"] [data-cy="basebox.detailsLink"]',
).click();
cy.get(
'[data-cy="Edoniq Wissens- und Verständisfragen - Circle Fahrzeug (Demo)@-1"]'
'[data-cy="Edoniq Wissens- und Verständisfragen - Circle Fahrzeug (Demo)@-1"]',
).should("contain", "0 von 3 bestanden");
cy.get(
'[data-cy="Überprüfen einer Motorfahrzeugs-Versicherungspolice@-1"]'
'[data-cy="Überprüfen einer Motorfahrzeugs-Versicherungspolice@-1"]',
).should("contain", "0 von 3 bestanden");
});
});

View File

@ -30,93 +30,93 @@ describe("feedbackStudent.cy.js", () => {
// fill feedback form
// step 1
cy.url().should("include", "step=1");
cy.get("[data-cy=\"question-1\"]").should(
cy.get('[data-cy="question-1"]').should(
"contain",
"Zufriedenheit insgesamt"
"Zufriedenheit insgesamt",
);
cy.get("[data-cy=\"next-step\"]").should("be.disabled");
cy.get("[data-cy=\"radio-4\"]").click();
cy.get('[data-cy="next-step"]').should("be.disabled");
cy.get('[data-cy="radio-4"]').click();
cy.wait(200);
cy.learningContentMultiLayoutNextStep();
cy.wait(200);
// step 2
cy.url().should("include", "step=2");
cy.get("[data-cy=\"question-2\"]").should(
cy.get('[data-cy="question-2"]').should(
"contain",
"Zielerreichung insgesamt"
"Zielerreichung insgesamt",
);
cy.get("[data-cy=\"next-step\"]").should("be.disabled");
cy.get('[data-cy="next-step"]').should("be.disabled");
// the system should store after every step -> check stored data
cy.loadFeedbackResponse("feedback_user_id", TEST_STUDENT1_USER_ID).then(
(ac) => {
expect(ac.submitted).to.be.false;
expect(ac.data.satisfaction).to.equal(4);
expect(ac.data.instructor_competence).to.equal(null);
}
},
);
cy.get("[data-cy=\"radio-3\"]").click();
cy.get('[data-cy="radio-3"]').click();
cy.wait(200);
cy.learningContentMultiLayoutNextStep();
cy.wait(200);
// step 3
cy.url().should("include", "step=3");
cy.get("[data-cy=\"question-3\"]").should(
cy.get('[data-cy="question-3"]').should(
"contain",
"Wie beurteilst du deine Sicherheit bezüglichen den Themen nach dem Kurs?"
"Wie beurteilst du deine Sicherheit bezüglichen den Themen nach dem Kurs?",
);
cy.get("[data-cy=\"next-step\"]").should("be.disabled");
cy.get("[data-cy=\"radio-80\"]").click();
cy.get('[data-cy="next-step"]').should("be.disabled");
cy.get('[data-cy="radio-80"]').click();
cy.wait(200);
cy.learningContentMultiLayoutNextStep();
cy.wait(200);
// step 4
cy.url().should("include", "step=4");
cy.get("[data-cy=\"question-4\"]").should(
cy.get('[data-cy="question-4"]').should(
"contain",
"Waren die Vorbereitungsaufträge klar und verständlich?"
"Waren die Vorbereitungsaufträge klar und verständlich?",
);
cy.get("[data-cy=\"next-step\"]").should("be.disabled");
cy.get("[data-cy=\"radio-false\"]").click();
cy.get('[data-cy="next-step"]').should("be.disabled");
cy.get('[data-cy="radio-false"]').click();
cy.wait(200);
cy.learningContentMultiLayoutNextStep();
cy.wait(200);
// step 5
cy.url().should("include", "step=5");
cy.get("[data-cy=\"question-5\"]").should(
cy.get('[data-cy="question-5"]').should(
"contain",
"Wie beurteilst du die Themensicherheit und Fachkompetenz des Kursleiters/der Kursleiterin?"
"Wie beurteilst du die Themensicherheit und Fachkompetenz des Kursleiters/der Kursleiterin?",
);
cy.get("[data-cy=\"next-step\"]").should("be.disabled");
cy.get("[data-cy=\"radio-2\"]").click();
cy.get('[data-cy="next-step"]').should("be.disabled");
cy.get('[data-cy="radio-2"]').click();
cy.wait(200);
cy.learningContentMultiLayoutNextStep();
cy.wait(200);
// step 6
cy.url().should("include", "step=6");
cy.get("[data-cy=\"question-6\"]").should(
cy.get('[data-cy="question-6"]').should(
"contain",
"Wurden Fragen und Anregungen der Kursteilnehmenden ernst genommen und aufgegriffen?"
"Wurden Fragen und Anregungen der Kursteilnehmenden ernst genommen und aufgegriffen?",
);
cy.get("[data-cy=\"next-step\"]").should("be.disabled");
cy.get("[data-cy=\"radio-1\"]").click();
cy.get('[data-cy="next-step"]').should("be.disabled");
cy.get('[data-cy="radio-1"]').click();
cy.wait(200);
cy.learningContentMultiLayoutNextStep();
cy.wait(200);
// step 7
cy.url().should("include", "step=7");
cy.get("[data-cy=\"question-7\"]").should(
cy.get('[data-cy="question-7"]').should(
"contain",
"Was möchtest du dem Kursleiter/der Kursleiterin sonst noch sagen?"
"Was möchtest du dem Kursleiter/der Kursleiterin sonst noch sagen?",
);
cy.get("[data-cy=\"next-step\"]").should("be.disabled");
cy.get("[data-cy=\"it-textarea-instructor_open_feedback\"]").type(
"Der Kursleiter ist eigentlich ganz nett."
cy.get('[data-cy="next-step"]').should("be.disabled");
cy.get('[data-cy="it-textarea-instructor_open_feedback"]').type(
"Der Kursleiter ist eigentlich ganz nett.",
);
cy.wait(200);
cy.learningContentMultiLayoutNextStep();
@ -124,26 +124,26 @@ describe("feedbackStudent.cy.js", () => {
// step 8
cy.url().should("include", "step=8");
cy.get("[data-cy=\"question-8\"]").should(
cy.get('[data-cy="question-8"]').should(
"contain",
"Würdest du den Kurs weiterempfehlen?"
"Würdest du den Kurs weiterempfehlen?",
);
cy.get("[data-cy=\"next-step\"]").should("be.disabled");
cy.get("[data-cy=\"radio-true\"]").click();
cy.get('[data-cy="next-step"]').should("be.disabled");
cy.get('[data-cy="radio-true"]').click();
cy.wait(200);
cy.learningContentMultiLayoutNextStep();
cy.wait(200);
// step 9
cy.url().should("include", "step=9");
cy.get("[data-cy=\"question-9\"]").should(
cy.get('[data-cy="question-9"]').should(
"contain",
"Was hat dir besonders gut gefallen?"
"Was hat dir besonders gut gefallen?",
);
cy.get("[data-cy=\"next-step\"]").should("be.disabled");
cy.get("[data-cy=\"it-textarea-course_positive_feedback\"]").type(
"Ich bin zufrieden mit den meisten Dingen."
cy.get('[data-cy="next-step"]').should("be.disabled");
cy.get('[data-cy="it-textarea-course_positive_feedback"]').type(
"Ich bin zufrieden mit den meisten Dingen.",
);
cy.wait(200);
cy.learningContentMultiLayoutNextStep();
@ -151,21 +151,21 @@ describe("feedbackStudent.cy.js", () => {
// step 10
cy.url().should("include", "step=10");
cy.get("[data-cy=\"question-10\"]").should(
cy.get('[data-cy="question-10"]').should(
"contain",
"Wo siehst du Verbesserungspotential?"
"Wo siehst du Verbesserungspotential?",
);
cy.get("[data-cy=\"next-step\"]").should("be.disabled");
cy.get("[data-cy=\"it-textarea-course_negative_feedback\"]").type(
"Ich bin unzufrieden mit einigen Sachen."
cy.get('[data-cy="next-step"]').should("be.disabled");
cy.get('[data-cy="it-textarea-course_negative_feedback"]').type(
"Ich bin unzufrieden mit einigen Sachen.",
);
cy.wait(200);
cy.learningContentMultiLayoutNextStep();
cy.wait(200);
cy.url().should("include", "step=11");
cy.get("[data-cy=\"sendFeedbackButton\"]").click();
cy.get("[data-cy=\"complete-and-continue\"]").click({ force: true });
cy.get('[data-cy="sendFeedbackButton"]').click();
cy.get('[data-cy="complete-and-continue"]').click({ force: true });
// marked complete in circle
cy.url().should((url) => {
@ -173,7 +173,7 @@ describe("feedbackStudent.cy.js", () => {
});
cy.reload();
cy.get(
"[data-cy=\"test-lehrgang-lp-circle-fahrzeug-lc-feedback-status\"]"
'[data-cy="test-lehrgang-lp-circle-fahrzeug-lc-feedback-status"]',
).should("have.attr", "aria-checked", "true");
// reopening page should get directly to last step
@ -197,9 +197,9 @@ describe("feedbackStudent.cy.js", () => {
proficiency: 80,
satisfaction: 4,
would_recommend: true,
feedback_type: "uk"
feedback_type: "uk",
});
}
},
);
});
});
@ -219,8 +219,8 @@ describe("feedbackStudent.cy.js", () => {
cy.url().should((url) => {
expect(url).to.match(/\/reisen\/feedback(\?step=0)?$/);
});
cy.get("[data-cy=\"introduction\"]").contains(
"Wir bitten dich um dein Feedback. Es hilft uns, damit wir deine Lernerlebnisse verbessern können."
cy.get('[data-cy="introduction"]').contains(
"Wir bitten dich um dein Feedback. Es hilft uns, damit wir deine Lernerlebnisse verbessern können.",
);
cy.wait(200);
@ -230,82 +230,82 @@ describe("feedbackStudent.cy.js", () => {
// fill feedback form
// step 1
cy.url().should("include", "step=1");
cy.get("[data-cy=\"question-1\"]").should(
cy.get('[data-cy="question-1"]').should(
"contain",
"Zufriedenheit insgesamt"
"Zufriedenheit insgesamt",
);
cy.get("[data-cy=\"next-step\"]").should("be.disabled");
cy.get("[data-cy=\"radio-4\"]").click();
cy.get('[data-cy="next-step"]').should("be.disabled");
cy.get('[data-cy="radio-4"]').click();
cy.wait(200);
cy.learningContentMultiLayoutNextStep();
cy.wait(200);
// step 2
cy.url().should("include", "step=2");
cy.get("[data-cy=\"question-2\"]").should(
cy.get('[data-cy="question-2"]').should(
"contain",
"Zielerreichung insgesamt"
"Zielerreichung insgesamt",
);
cy.get("[data-cy=\"next-step\"]").should("be.disabled");
cy.get('[data-cy="next-step"]').should("be.disabled");
// the system should store after every step -> check stored data
cy.loadFeedbackResponse("feedback_user_id", TEST_STUDENT1_USER_ID).then(
(ac) => {
expect(ac.submitted).to.be.false;
expect(ac.data.satisfaction).to.equal(4);
expect(ac.data.course_positive_feedback).to.equal(null);
}
},
);
cy.get("[data-cy=\"radio-3\"]").click();
cy.get('[data-cy="radio-3"]').click();
cy.wait(200);
cy.learningContentMultiLayoutNextStep();
cy.wait(200);
// step 3
cy.url().should("include", "step=3");
cy.get("[data-cy=\"question-3\"]").should(
cy.get('[data-cy="question-3"]').should(
"contain",
"Wie beurteilst du deine Sicherheit bezüglichen den Themen nach dem Circle?"
"Wie beurteilst du deine Sicherheit bezüglichen den Themen nach dem Circle?",
);
cy.get("[data-cy=\"next-step\"]").should("be.disabled");
cy.get("[data-cy=\"radio-80\"]").click();
cy.get('[data-cy="next-step"]').should("be.disabled");
cy.get('[data-cy="radio-80"]').click();
cy.wait(200);
cy.learningContentMultiLayoutNextStep();
cy.wait(200);
// step 4
cy.url().should("include", "step=4");
cy.get("[data-cy=\"question-4\"]").should(
cy.get('[data-cy="question-4"]').should(
"contain",
"Waren die Praxisaufträge klar und verständlich?"
"Waren die Praxisaufträge klar und verständlich?",
);
cy.get("[data-cy=\"next-step\"]").should("be.disabled");
cy.get("[data-cy=\"radio-false\"]").click();
cy.get('[data-cy="next-step"]').should("be.disabled");
cy.get('[data-cy="radio-false"]').click();
cy.wait(200);
cy.learningContentMultiLayoutNextStep();
cy.wait(200);
// step 5
cy.url().should("include", "step=5");
cy.get("[data-cy=\"question-5\"]").should(
cy.get('[data-cy="question-5"]').should(
"contain",
"Würdest du den Circle weiterempfehlen?"
"Würdest du den Circle weiterempfehlen?",
);
cy.get("[data-cy=\"next-step\"]").should("be.disabled");
cy.get("[data-cy=\"radio-false\"]").click();
cy.get('[data-cy="next-step"]').should("be.disabled");
cy.get('[data-cy="radio-false"]').click();
cy.wait(200);
cy.learningContentMultiLayoutNextStep();
cy.wait(200);
// step 6
cy.url().should("include", "step=6");
cy.get("[data-cy=\"question-6\"]").should(
cy.get('[data-cy="question-6"]').should(
"contain",
"Was hat dir besonders gut gefallen?"
"Was hat dir besonders gut gefallen?",
);
cy.get("[data-cy=\"next-step\"]").should("be.disabled");
cy.get("[data-cy=\"it-textarea-course_positive_feedback\"]").type(
"Der Circle ist eigentlich ganz nett."
cy.get('[data-cy="next-step"]').should("be.disabled");
cy.get('[data-cy="it-textarea-course_positive_feedback"]').type(
"Der Circle ist eigentlich ganz nett.",
);
cy.wait(200);
cy.learningContentMultiLayoutNextStep();
@ -313,21 +313,21 @@ describe("feedbackStudent.cy.js", () => {
// step 7
cy.url().should("include", "step=7");
cy.get("[data-cy=\"question-7\"]").should(
cy.get('[data-cy="question-7"]').should(
"contain",
"Wo siehst du Verbesserungspotential?"
"Wo siehst du Verbesserungspotential?",
);
cy.get("[data-cy=\"next-step\"]").should("be.disabled");
cy.get("[data-cy=\"it-textarea-course_negative_feedback\"]").type(
"Ich bin unzufrieden mit einigen Sachen."
cy.get('[data-cy="next-step"]').should("be.disabled");
cy.get('[data-cy="it-textarea-course_negative_feedback"]').type(
"Ich bin unzufrieden mit einigen Sachen.",
);
cy.wait(200);
cy.learningContentMultiLayoutNextStep();
cy.wait(200);
cy.url().should("include", "step=8");
cy.get("[data-cy=\"sendFeedbackButton\"]").click();
cy.get("[data-cy=\"complete-and-continue\"]").click({ force: true });
cy.get('[data-cy="sendFeedbackButton"]').click();
cy.get('[data-cy="complete-and-continue"]').click({ force: true });
// marked complete in circle
cy.url().should((url) => {
@ -335,7 +335,7 @@ describe("feedbackStudent.cy.js", () => {
});
cy.reload();
cy.get(
"[data-cy=\"test-lehrgang-lp-circle-reisen-lc-feedback-status\"]"
'[data-cy="test-lehrgang-lp-circle-reisen-lc-feedback-status"]',
).should("have.attr", "aria-checked", "true");
// reopening page should get directly to last step
@ -354,9 +354,155 @@ describe("feedbackStudent.cy.js", () => {
proficiency: 80,
satisfaction: 4,
would_recommend: false,
feedback_type: "vv"
feedback_type: "vv",
});
}
},
);
});
});
describe("Feedback Automobilgewerbe", () => {
beforeEach(() => {
cy.visit("/course/test-lehrgang/learn/automobilgewerbe/feedback");
});
it("can open feedback page", () => {
cy.testLearningContentTitle("Feedback");
cy.testLearningContentSubtitle("Feedback");
});
it("can create feedback by giving answers to all steps", () => {
// initial wait for step 0 (or none with step==0) is required for pipelines
cy.url().should((url) => {
expect(url).to.match(/\/automobilgewerbe\/feedback(\?step=0)?$/);
});
cy.get('[data-cy="introduction"]').contains(
"Wir bitten dich um dein Feedback. Es hilft uns, damit wir deine Lernerlebnisse verbessern können.",
);
cy.wait(200);
cy.learningContentMultiLayoutNextStep();
cy.wait(200);
// fill feedback form
// step 1
cy.url().should("include", "step=1");
cy.get('[data-cy="question-1"]').should(
"contain",
"Zufriedenheit insgesamt",
);
cy.get('[data-cy="next-step"]').should("be.disabled");
cy.get('[data-cy="radio-4"]').click();
cy.wait(200);
cy.learningContentMultiLayoutNextStep();
cy.wait(200);
// step 2
cy.url().should("include", "step=2");
cy.get('[data-cy="question-2"]').should(
"contain",
"Zielerreichung insgesamt",
);
cy.get('[data-cy="next-step"]').should("be.disabled");
// the system should store after every step -> check stored data
cy.loadFeedbackResponse("feedback_user_id", TEST_STUDENT1_USER_ID).then(
(ac) => {
expect(ac.submitted).to.be.false;
expect(ac.data.satisfaction).to.equal(4);
expect(ac.data.course_positive_feedback).to.equal(null);
},
);
cy.get('[data-cy="radio-3"]').click();
cy.wait(200);
cy.learningContentMultiLayoutNextStep();
cy.wait(200);
// step 3
cy.url().should("include", "step=3");
cy.get('[data-cy="question-3"]').should(
"contain",
"Wie beurteilst du deine Sicherheit bezüglichen den Themen nach dem Circle?",
);
cy.get('[data-cy="next-step"]').should("be.disabled");
cy.get('[data-cy="radio-80"]').click();
cy.wait(200);
cy.learningContentMultiLayoutNextStep();
cy.wait(200);
// step 4
cy.url().should("include", "step=4");
cy.get('[data-cy="question-4"]').should(
"contain",
"Würdest du den Circle weiterempfehlen?",
);
cy.get('[data-cy="next-step"]').should("be.disabled");
cy.get('[data-cy="radio-false"]').click();
cy.wait(200);
cy.learningContentMultiLayoutNextStep();
cy.wait(200);
// step 5
cy.url().should("include", "step=5");
cy.get('[data-cy="question-5"]').should(
"contain",
"Was hat dir besonders gut gefallen?",
);
cy.get('[data-cy="next-step"]').should("be.disabled");
cy.get('[data-cy="it-textarea-course_positive_feedback"]').type(
"Der Circle ist eigentlich ganz nett.",
);
cy.wait(200);
cy.learningContentMultiLayoutNextStep();
cy.wait(200);
// step 6
cy.url().should("include", "step=6");
cy.get('[data-cy="question-6"]').should(
"contain",
"Wo siehst du Verbesserungspotential?",
);
cy.get('[data-cy="next-step"]').should("be.disabled");
cy.get('[data-cy="it-textarea-course_negative_feedback"]').type(
"Ich bin unzufrieden mit einigen Sachen.",
);
cy.wait(200);
cy.learningContentMultiLayoutNextStep();
cy.wait(200);
cy.url().should("include", "step=7");
cy.get('[data-cy="sendFeedbackButton"]').click();
cy.get('[data-cy="complete-and-continue"]').click({ force: true });
// marked complete in circle
cy.url().should((url) => {
expect(url).to.match(
/\/automobilgewerbe#lu-transfer-reflexion-feedback?$/,
);
});
cy.reload();
cy.get(
'[data-cy="test-lehrgang-lp-circle-automobilgewerbe-lc-feedback-status"]',
).should("have.attr", "aria-checked", "true");
// reopening page should get directly to last step
cy.visit("/course/test-lehrgang/learn/automobilgewerbe/feedback");
cy.url().should("include", "step=7");
// check stored data
cy.loadFeedbackResponse("feedback_user_id", TEST_STUDENT1_USER_ID).then(
(ac) => {
expect(ac.submitted).to.be.true;
expect(ac.data).to.deep.equal({
course_negative_feedback: "Ich bin unzufrieden mit einigen Sachen.",
course_positive_feedback: "Der Circle ist eigentlich ganz nett.",
goal_attainment: 3,
proficiency: 80,
satisfaction: 4,
would_recommend: false,
feedback_type: "automobilgewerbe",
});
},
);
});
});

View File

@ -1,4 +1,4 @@
import {EXPERT_COCKPIT_URL, login} from "../helpers";
import { EXPERT_COCKPIT_URL, login } from "../helpers";
describe("feedbackTrainer.cy.js", () => {
beforeEach(() => {
@ -10,7 +10,7 @@ describe("feedbackTrainer.cy.js", () => {
login("test-trainer1@example.com", "test");
cy.visit(EXPERT_COCKPIT_URL);
cy.get(
'[data-cy="show-feedback-btn-test-lehrgang-lp-circle-fahrzeug-lc-feedback"]'
'[data-cy="show-feedback-btn-test-lehrgang-lp-circle-fahrzeug-lc-feedback"]',
).click();
cy.get('[data-cy="feedback-data-amount"]').should("contain", "0");
@ -22,7 +22,7 @@ describe("feedbackTrainer.cy.js", () => {
login("test-trainer1@example.com", "test");
cy.visit(EXPERT_COCKPIT_URL);
cy.get(
'[data-cy="show-feedback-btn-test-lehrgang-lp-circle-fahrzeug-lc-feedback"]'
'[data-cy="show-feedback-btn-test-lehrgang-lp-circle-fahrzeug-lc-feedback"]',
).click();
cy.get('[data-cy="feedback-data-amount"]').should("contain", "3");
@ -30,43 +30,43 @@ describe("feedbackTrainer.cy.js", () => {
// check titles of questions
cy.get('[data-cy="question-1"]').should(
"contain",
"Zufriedenheit insgesamt"
"Zufriedenheit insgesamt",
);
cy.get('[data-cy="question-2"]').should(
"contain",
"Zielerreichung insgesamt"
"Zielerreichung insgesamt",
);
cy.get('[data-cy="question-3"]').should(
"contain",
"Wie beurteilst du deine Sicherheit bezüglichen den Themen nach dem Kurs?"
"Wie beurteilst du deine Sicherheit bezüglichen den Themen nach dem Kurs?",
);
cy.get('[data-cy="question-4"]').should(
"contain",
"Waren die Vorbereitungsaufträge klar und verständlich?"
"Waren die Vorbereitungsaufträge klar und verständlich?",
);
cy.get('[data-cy="question-5"]').should(
"contain",
"Wie beurteilst du die Themensicherheit und Fachkompetenz des Kursleiters/der Kursleiterin?"
"Wie beurteilst du die Themensicherheit und Fachkompetenz des Kursleiters/der Kursleiterin?",
);
cy.get('[data-cy="question-6"]').should(
"contain",
"Wurden Fragen und Anregungen der Kursteilnehmenden ernst genommen und aufgegriffen?"
"Wurden Fragen und Anregungen der Kursteilnehmenden ernst genommen und aufgegriffen?",
);
cy.get('[data-cy="question-7"]').should(
"contain",
"Was möchtest du dem Kursleiter/der Kursleiterin sonst noch sagen?"
"Was möchtest du dem Kursleiter/der Kursleiterin sonst noch sagen?",
);
cy.get('[data-cy="question-8"]').should(
"contain",
"Würdest du den Kurs weiterempfehlen?"
"Würdest du den Kurs weiterempfehlen?",
);
cy.get('[data-cy="question-9"]').should(
"contain",
"Wo siehst du Verbesserungspotential?"
"Wo siehst du Verbesserungspotential?",
);
cy.get('[data-cy="question-10"]').should(
"contain",
"Was hat dir besonders gut gefallen?"
"Was hat dir besonders gut gefallen?",
);
cy.get('[data-cy="question-1"]')
@ -142,7 +142,7 @@ describe("feedbackTrainer.cy.js", () => {
cy.get('[data-cy="dropdown-select"]').click();
cy.get('[data-cy="dropdown-select-option-Reisen"]').click();
cy.get(
'[data-cy="show-feedback-btn-test-lehrgang-lp-circle-reisen-lc-feedback"]'
'[data-cy="show-feedback-btn-test-lehrgang-lp-circle-reisen-lc-feedback"]',
).click();
cy.get('[data-cy="feedback-data-amount"]').should("contain", "3");
@ -150,31 +150,31 @@ describe("feedbackTrainer.cy.js", () => {
// check titles of questions
cy.get('[data-cy="question-1"]').should(
"contain",
"Zufriedenheit insgesamt"
"Zufriedenheit insgesamt",
);
cy.get('[data-cy="question-2"]').should(
"contain",
"Zielerreichung insgesamt"
"Zielerreichung insgesamt",
);
cy.get('[data-cy="question-3"]').should(
"contain",
"Wie beurteilst du deine Sicherheit bezüglichen den Themen nach dem Circle?"
"Wie beurteilst du deine Sicherheit bezüglichen den Themen nach dem Circle?",
);
cy.get('[data-cy="question-4"]').should(
"contain",
"Waren die Praxisaufträge klar und verständlich?"
"Waren die Praxisaufträge klar und verständlich?",
);
cy.get('[data-cy="question-5"]').should(
"contain",
"Würdest du den Circle weiterempfehlen?"
"Würdest du den Circle weiterempfehlen?",
);
cy.get('[data-cy="question-6"]').should(
"contain",
"Wo siehst du Verbesserungspotential?"
"Wo siehst du Verbesserungspotential?",
);
cy.get('[data-cy="question-7"]').should(
"contain",
"Was hat dir besonders gut gefallen?"
"Was hat dir besonders gut gefallen?",
);
cy.get('[data-cy="question-1"]')
@ -228,4 +228,87 @@ describe("feedbackTrainer.cy.js", () => {
.should("contain", "Die Präsentation war super");
});
});
describe("FeedbackAutomobilGewerbe", function () {
it("can open feedback results page with results", () => {
cy.manageCommand("cypress_reset --create-feedback-responses");
login("test-trainer1@example.com", "test");
cy.visit(EXPERT_COCKPIT_URL);
cy.get('[data-cy="dropdown-select"]').click();
cy.get('[data-cy="dropdown-select-option-Automobilgewerbe"]').click();
cy.get(
'[data-cy="show-feedback-btn-test-lehrgang-lp-circle-automobilgewerbe-lc-feedback"]',
).click();
cy.get('[data-cy="feedback-data-amount"]').should("contain", "3");
// check titles of questions
cy.get('[data-cy="question-1"]').should(
"contain",
"Zufriedenheit insgesamt",
);
cy.get('[data-cy="question-2"]').should(
"contain",
"Zielerreichung insgesamt",
);
cy.get('[data-cy="question-3"]').should(
"contain",
"Wie beurteilst du deine Sicherheit bezüglichen den Themen nach dem Circle?",
);
cy.get('[data-cy="question-4"]').should(
"contain",
"Würdest du den Circle weiterempfehlen?",
);
cy.get('[data-cy="question-5"]').should(
"contain",
"Wo siehst du Verbesserungspotential?",
);
cy.get('[data-cy="question-6"]').should(
"contain",
"Was hat dir besonders gut gefallen?",
);
cy.get('[data-cy="question-1"]')
.find('[data-cy="rating-scale-average"]')
.should("contain", "3.3");
cy.get('[data-cy="question-2"]')
.find('[data-cy="rating-scale-average"]')
.should("contain", "3.0");
cy.get('[data-cy="question-3"]')
.find('[data-cy="percentage-value-40%"]')
.should("contain", "33.3");
cy.get('[data-cy="question-3"]')
.find('[data-cy="percentage-value-80%"]')
.should("contain", "33.3");
cy.get('[data-cy="question-3"]')
.find('[data-cy="percentage-value-100%"]')
.should("contain", "33.3");
cy.get('[data-cy="question-4"]')
.find('[data-cy="popover-yes"]')
.click()
.find('[data-cy="num-yes"]')
.should("contain", "2");
cy.get('[data-cy="question-4"]')
.find('[data-cy="popover-no"]')
.click()
.find('[data-cy="num-no"]')
.should("contain", "1");
cy.get('[data-cy="question-5"]')
.should("contain", "Nichts Schlechtes")
.should("contain", "Es wäre praktisch, Zugang zu einer FAQ zu haben.")
.should("contain", "Mehr Videos wären schön.");
cy.get('[data-cy="question-6"]')
.should("contain", "Nur Gutes.")
.should(
"contain",
"Das Beispiel mit der Katze fand ich sehr gut veranschaulicht!",
)
.should("contain", "Die Präsentation war super");
});
});
});

View File

@ -8,57 +8,61 @@ describe("learningPath.cy.js", () => {
});
it("can open learningPath page", () => {
cy.get("[data-cy=\"learning-path-title\"]").should(
cy.get('[data-cy="learning-path-title"]').should(
"contain",
"Test Lehrgang"
"Test Lehrgang",
);
});
it("can click on circle to open it", () => {
cy.get("[data-cy=\"circle-Fahrzeug\"]").click({ force: true });
cy.get('[data-cy="circle-Fahrzeug"]').click({ force: true });
cy.url().should("include", "/course/test-lehrgang/learn/fahrzeug");
cy.get("[data-cy=\"circle-title\"]").should("contain", "Fahrzeug");
cy.get('[data-cy="circle-title"]').should("contain", "Fahrzeug");
});
it("switch between list and path view", () => {
cy.get("[data-cy=\"lp-path-view\"]").should("be.visible");
cy.get("[data-cy=\"view-switch\"]").click();
cy.get("[data-cy=\"lp-list-view\"]").should("be.visible");
cy.get("[data-cy=\"view-switch\"]").click();
cy.get("[data-cy=\"lp-path-view\"]").should("be.visible");
cy.get('[data-cy="lp-path-view"]').should("be.visible");
cy.get('[data-cy="view-switch"]').click();
cy.get('[data-cy="lp-list-view"]').should("be.visible");
cy.get('[data-cy="view-switch"]').click();
cy.get('[data-cy="lp-path-view"]').should("be.visible");
});
it("weiter gehts button will open next circle", () => {
// first click will open first circle
cy.get("[data-cy=\"lp-continue-button\"]")
cy.get('[data-cy="lp-continue-button"]')
.filter(":visible")
.should("contain", "Los geht's")
.click();
cy.get("[data-cy=\"circle-title\"]").should("contain", "Fahrzeug");
cy.get("[data-cy=\"back-to-learning-path-button\"]").click();
cy.get('[data-cy="circle-title"]').should("contain", "Fahrzeug");
cy.get('[data-cy="back-to-learning-path-button"]').click();
// mark a learning content in second circle
cy.get("[data-cy=\"circle-Reisen\"]").click({ force: true });
cy.get("[data-cy=\"ls-continue-button\"]").click();
cy.get("[data-cy=\"complete-and-continue\"]").click({ force: true });
cy.get("[data-cy=\"back-to-learning-path-button\"]").click();
cy.get('[data-cy="circle-Reisen"]').click({ force: true });
cy.get('[data-cy="ls-continue-button"]').click();
cy.get('[data-cy="complete-and-continue"]').click({ force: true });
cy.get('[data-cy="back-to-learning-path-button"]').click();
// click on continue should go to unit-test-circle
cy.get("[data-cy=\"lp-continue-button\"]")
cy.get('[data-cy="lp-continue-button"]')
.filter(":visible")
.should("contain", "Weiter geht's")
.click();
cy.get("[data-cy=\"circle-title\"]").should("contain", "Reisen");
cy.get('[data-cy="circle-title"]').should("contain", "Reisen");
});
it("checks contents", () => {
cy.get("[data-cy=\"lp-topic\"]").should("have.length", 2);
cy.get("[data-cy=\"lp-topic\"]").first().should("contain", "Circle ÜK");
cy.get("[data-cy=\"lp-topic\"]").eq(1).should("contain", "Circle VV");
cy.get('[data-cy="lp-topic"]').should("have.length", 3);
cy.get('[data-cy="lp-topic"]').first().should("contain", "Circle ÜK");
cy.get('[data-cy="lp-topic"]').eq(1).should("contain", "Circle VV");
cy.get('[data-cy="lp-topic"]')
.eq(2)
.should("contain", "Circle Automobilgewerbe");
cy.get(".cy-lp-circle").should("have.length", 2);
cy.get(".cy-lp-circle").should("have.length", 3);
cy.get(".cy-lp-circle").first().should("contain", "Fahrzeug");
cy.get(".cy-lp-circle").eq(1).should("contain", "Reisen");
cy.get(".cy-lp-circle").eq(2).should("contain", "Automobilgewerbe");
});
});

View File

@ -53,6 +53,7 @@ from vbv_lernwelt.learning_mentor.models import (
)
from vbv_lernwelt.learnpath.models import (
LearningContentAttendanceCourse,
LearningContentFeedbackAutomobilGewerbe,
LearningContentFeedbackUK,
LearningContentFeedbackVV,
)
@ -404,6 +405,60 @@ def command(
},
)
# feedback automobilgewerbe
learning_content_feedback_page = (
LearningContentFeedbackAutomobilGewerbe.objects.get(
slug="test-lehrgang-lp-circle-automobilgewerbe-lc-feedback"
)
)
create_feedback_response_data(
feedback_user=User.objects.get(id=TEST_STUDENT1_USER_ID),
course_session=course_session,
learning_content_feedback_page=learning_content_feedback_page,
submitted=True,
feedback_data={
"satisfaction": 4,
"goal_attainment": 3,
"proficiency": 80,
"would_recommend": True,
"course_negative_feedback": "Nichts Schlechtes",
"course_positive_feedback": "Nur Gutes.",
"feedback_type": "automobilgewerbe",
},
)
create_feedback_response_data(
feedback_user=User.objects.get(id=TEST_STUDENT2_USER_ID),
course_session=course_session,
learning_content_feedback_page=learning_content_feedback_page,
submitted=True,
feedback_data={
"satisfaction": 4,
"goal_attainment": 4,
"proficiency": 100,
"would_recommend": True,
"course_negative_feedback": "Es wäre praktisch, Zugang zu einer FAQ zu haben.",
"course_positive_feedback": "Das Beispiel mit der Katze fand ich sehr gut veranschaulicht!",
"feedback_type": "automobilgewerbe",
},
)
create_feedback_response_data(
feedback_user=User.objects.get(id=TEST_STUDENT3_USER_ID),
course_session=course_session,
learning_content_feedback_page=learning_content_feedback_page,
submitted=True,
feedback_data={
"satisfaction": 2,
"goal_attainment": 2,
"proficiency": 40,
"would_recommend": False,
"course_negative_feedback": "Mehr Videos wären schön.",
"course_positive_feedback": "Die Präsentation war super",
"feedback_type": "automobilgewerbe",
},
)
if create_course_completion_performance_criteria:
member = User.objects.get(id=TEST_STUDENT1_USER_ID)
course_session = CourseSession.objects.get(id=TEST_COURSE_SESSION_BERN_ID)

View File

@ -80,6 +80,7 @@ from vbv_lernwelt.learnpath.tests.learning_path_factories import (
LearningContentAssignmentFactory,
LearningContentAttendanceCourseFactory,
LearningContentEdoniqTestFactory,
LearningContentFeedbackAutomobilGewerbeFactory,
LearningContentFeedbackUKFactory,
LearningContentFeedbackVVFactory,
LearningContentKnowledgeAssessmentFactory,
@ -108,7 +109,11 @@ from vbv_lernwelt.media_library.tests.media_library_factories import (
def create_test_course(
include_uk=True, include_vv=True, with_sessions=False, with_documents=False
include_uk=True,
include_vv=True,
include_automobilgewerbe=True,
with_sessions=False,
with_documents=False,
):
# create_locales_for_wagtail()
create_default_collections()
@ -331,6 +336,11 @@ def create_test_course(
if include_vv:
csu.expert.add(Circle.objects.get(slug="test-lehrgang-lp-circle-reisen"))
if include_automobilgewerbe:
csu.expert.add(
Circle.objects.get(slug="test-lehrgang-lp-circle-automobilgewerbe")
)
trainer2 = User.objects.get(email="test-trainer2@example.com")
csu = CourseSessionUser.objects.create(
course_session=cs_zurich,
@ -594,7 +604,12 @@ def create_test_course_with_categories(apps=None, schema_editor=None):
return course
def create_test_learning_path(include_uk=True, include_vv=True, with_documents=False):
def create_test_learning_path(
include_uk=True,
include_vv=True,
include_automobil_gewerbe=True,
with_documents=False,
):
course_page = CoursePage.objects.get(course_id=COURSE_TEST_ID)
lp = LearningPathFactory(title="Test Lernpfad", parent=course_page)
@ -608,6 +623,10 @@ def create_test_learning_path(include_uk=True, include_vv=True, with_documents=F
TopicFactory(title="Circle VV", is_visible=False, parent=lp)
create_test_circle_reisen(lp)
if include_automobil_gewerbe:
TopicFactory(title="Circle Automobilgewerbe", is_visible=False, parent=lp)
create_test_circle_automobilgewerbe(lp)
def create_test_uk_circle_fahrzeug(lp, title="Fahrzeug", with_documents=False):
circle = CircleFactory(
@ -843,6 +862,76 @@ def create_test_circle_reisen(lp):
)
def create_test_circle_automobilgewerbe(lp):
circle = CircleFactory(
title="Automobilgewerbe",
parent=lp,
)
LearningSequenceFactory(title="Starten", parent=circle, icon="it-icon-ls-start")
LearningUnitFactory(title="Einführung", parent=circle)
LearningContentVideoFactory(
title="Verschaff dir einen Überblick",
parent=circle,
content_url="https://player.vimeo.com/video/772512710?h=30f912f15a",
description="Willkommen im Lehrgang Automobilgewerbe",
)
LearningSequenceFactory(title="Training", parent=circle)
LearningUnitFactory(title="Unterlagen", parent=circle)
LearningContentPlaceholderFactory(
title="Unterlagen für den Unterricht",
parent=circle,
)
LearningSequenceFactory(title="Analyse", parent=circle)
# analyse
lu = LearningUnitFactory(
title="Bedarfsanalyse, Ist- und Soll-Situation",
parent=circle,
course_category=CourseCategory.objects.get(
course_id=COURSE_TEST_ID, title="Reisen"
),
)
LearningContentLearningModuleFactory(
title="Emma und Ayla campen durch Amerika - Analyse",
parent=circle,
content_url="https://s3.eu-central-1.amazonaws.com/myvbv-wbt.iterativ.ch/emma-und-ayla-campen-durch-amerika-analyse-xapi-FZoZOP9y/index.html",
)
PerformanceCriteriaFactory(
parent=ActionCompetence.objects.get(competence_id="Y1"),
competence_id="Y1.1",
title="Ich bin fähig zu Reisen eine Gesprächsführung zu machen",
learning_unit=lu,
)
PerformanceCriteriaFactory(
parent=ActionCompetence.objects.get(competence_id="Y2"),
competence_id="Y2.1",
title="Ich bin fähig zu Reisen eine Analyse zu machen",
learning_unit=lu,
)
# transfer
parent = circle
LearningSequenceFactory(title="Transfer", parent=parent, icon="it-icon-ls-end")
LearningUnitFactory(title="Transfer, Reflexion, Feedback", parent=parent)
LearningContentKnowledgeAssessmentFactory(
title="Wissens- und Verständnisfragen",
parent=parent,
content_url="https://s3.eu-central-1.amazonaws.com/myvbv-wbt.iterativ.ch/emma-und-ayla-campen-durch-amerika-analyse-xapi-FZoZOP9y/index.html",
)
LearningContentPlaceholderFactory(
title="Reflexion",
parent=parent,
)
LearningContentFeedbackAutomobilGewerbeFactory(
title="Feedback",
parent=parent,
)
def create_test_competence_navi():
course_page = CoursePage.objects.get(course_id=COURSE_TEST_ID)

View File

@ -10,6 +10,7 @@ from vbv_lernwelt.learnpath.graphql.types import (
LearningContentAttendanceCourseObjectType,
LearningContentDocumentListObjectType,
LearningContentEdoniqTestObjectType,
LearningContentFeedbackAutomobilGewerbeObjectType,
LearningContentFeedbackUKObjectType,
LearningContentFeedbackVVObjectType,
LearningContentKnowledgeAssessmentObjectType,
@ -53,6 +54,9 @@ class CourseQuery(graphene.ObjectType):
)
learning_content_feedback_uk = graphene.Field(LearningContentFeedbackUKObjectType)
learning_content_feedback_vv = graphene.Field(LearningContentFeedbackVVObjectType)
learning_content_feedback_automobil_gewerbe = graphene.Field(
LearningContentFeedbackAutomobilGewerbeObjectType
)
learning_content_learning_module = graphene.Field(
LearningContentLearningModuleObjectType
)

View File

@ -8,12 +8,14 @@ from vbv_lernwelt.feedback.graphql.types import (
FeedbackResponseObjectType as FeedbackResponseType,
)
from vbv_lernwelt.feedback.serializers import (
CourseFeedbackSerializerAutomobilGewerbe,
CourseFeedbackSerializerUK,
CourseFeedbackSerializerVV,
)
from vbv_lernwelt.feedback.services import update_feedback_response
from vbv_lernwelt.iam.permissions import has_course_session_access
from vbv_lernwelt.learnpath.models import (
LearningContentFeedbackAutomobilGewerbe,
LearningContentFeedbackUK,
LearningContentFeedbackVV,
)
@ -56,6 +58,12 @@ class SendFeedbackMutation(graphene.Mutation):
learningContentFeedbackModel = LearningContentFeedbackUK
serializerClass = CourseFeedbackSerializerUK
data["feedback_type"] = "uk"
elif (
learning_content_type == "learnpath.LearningContentFeedbackAutomobilGewerbe"
):
learningContentFeedbackModel = LearningContentFeedbackAutomobilGewerbe
serializerClass = CourseFeedbackSerializerAutomobilGewerbe
data["feedback_type"] = "automobilgewerbe"
else:
errors = [
ErrorType(

View File

@ -8,6 +8,7 @@ logger = structlog.get_logger(__name__)
FEEDBACK_TYPES = (
("uk", "Feedback UK"),
("vv", "Feedback VV"),
("automobilgewerbe", "Feedback Automobilgewerbe"),
)
@ -55,6 +56,21 @@ class CourseFeedbackSerializerVV(serializers.Serializer):
)
class CourseFeedbackSerializerAutomobilGewerbe(serializers.Serializer):
feedback_type = serializers.ChoiceField(choices=FEEDBACK_TYPES)
satisfaction = FeedbackIntegerField()
goal_attainment = FeedbackIntegerField()
proficiency = serializers.IntegerField(required=False, allow_null=True)
materials_rating = FeedbackIntegerField()
would_recommend = serializers.BooleanField(required=False, allow_null=True)
course_positive_feedback = serializers.CharField(
required=False, allow_null=True, allow_blank=True
)
course_negative_feedback = serializers.CharField(
required=False, allow_null=True, allow_blank=True
)
class CypressFeedbackResponseSerializer(serializers.ModelSerializer):
class Meta:
model = FeedbackResponse

View File

@ -104,6 +104,18 @@ def initial_data_for_feedback_page(
"course_positive_feedback": "",
"feedback_type": "vv",
}
if hasattr(
learning_content_feedback_page, "learningcontentfeedbackautomobilgewerbe"
):
return {
"satisfaction": None,
"goal_attainment": None,
"proficiency": None,
"would_recommend": None,
"course_negative_feedback": "",
"course_positive_feedback": "",
"feedback_type": "vv",
}
return {}

View File

@ -10,6 +10,7 @@ from vbv_lernwelt.learnpath.models import (
LearningContentAttendanceCourse,
LearningContentDocumentList,
LearningContentEdoniqTest,
LearningContentFeedbackAutomobilGewerbe,
LearningContentFeedbackUK,
LearningContentFeedbackVV,
LearningContentKnowledgeAssessment,
@ -54,6 +55,8 @@ class LearningContentInterface(CoursePageInterface):
return LearningContentFeedbackUKObjectType
elif isinstance(instance, LearningContentFeedbackVV):
return LearningContentFeedbackVVObjectType
elif isinstance(instance, LearningContentFeedbackAutomobilGewerbe):
return LearningContentFeedbackAutomobilGewerbeObjectType
elif isinstance(instance, LearningContentLearningModule):
return LearningContentLearningModuleObjectType
elif isinstance(instance, LearningContentKnowledgeAssessment):
@ -128,6 +131,16 @@ class LearningContentFeedbackVVObjectType(DjangoObjectType):
fields = []
class LearningContentFeedbackAutomobilGewerbeObjectType(DjangoObjectType):
class Meta:
model = LearningContentFeedbackAutomobilGewerbe
interfaces = (
CoursePageInterface,
LearningContentInterface,
)
fields = []
class LearningContentLearningModuleObjectType(DjangoObjectType):
class Meta:
model = LearningContentLearningModule

View File

@ -0,0 +1,43 @@
# Generated by Django 4.2.13 on 2024-10-28 09:59
import django.db.models.deletion
import wagtail.fields
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("wagtailcore", "0089_log_entry_data_json_null_to_object"),
("learnpath", "0020_auto_20240730_0905"),
]
operations = [
migrations.CreateModel(
name="LearningContentFeedbackAutomobilGewerbe",
fields=[
(
"page_ptr",
models.OneToOneField(
auto_created=True,
on_delete=django.db.models.deletion.CASCADE,
parent_link=True,
primary_key=True,
serialize=False,
to="wagtailcore.page",
),
),
("minutes", models.PositiveIntegerField(default=15)),
("description", wagtail.fields.RichTextField(blank=True)),
("content_url", models.TextField(blank=True)),
("has_course_completion_status", models.BooleanField(default=True)),
(
"can_user_self_toggle_course_completion",
models.BooleanField(default=False),
),
],
options={
"abstract": False,
},
bases=("wagtailcore.page",),
),
]

View File

@ -95,6 +95,7 @@ class Circle(CourseBasePage):
"learnpath.LearningContentAttendanceCourse",
"learnpath.LearningContentFeedbackUK",
"learnpath.LearningContentFeedbackVV",
"learnpath.LearningContentFeedbackAutomobilGewerbe",
"learnpath.LearningContentLearningModule",
"learnpath.LearningContentKnowledgeAssessment",
"learnpath.LearningContentMediaLibrary",
@ -373,6 +374,12 @@ class LearningContentFeedbackVV(LearningContent):
can_user_self_toggle_course_completion = models.BooleanField(default=False)
class LearningContentFeedbackAutomobilGewerbe(LearningContent):
parent_page_types = ["learnpath.Circle"]
subpage_types = []
can_user_self_toggle_course_completion = models.BooleanField(default=False)
class LearningContentLearningModule(LearningContent):
parent_page_types = ["learnpath.Circle"]
subpage_types = []

View File

@ -7,6 +7,7 @@ from vbv_lernwelt.learnpath.models import (
LearningContentAttendanceCourse,
LearningContentDocumentList,
LearningContentEdoniqTest,
LearningContentFeedbackAutomobilGewerbe,
LearningContentFeedbackUK,
LearningContentFeedbackVV,
LearningContentKnowledgeAssessment,
@ -141,6 +142,16 @@ class LearningContentFeedbackUKFactory(wagtail_factories.PageFactory):
model = LearningContentFeedbackUK
class LearningContentFeedbackAutomobilGewerbeFactory(wagtail_factories.PageFactory):
title = "FeedbackAutomobilGewerbe"
minutes = 0
content_url = ""
description = RichText("")
class Meta:
model = LearningContentFeedbackAutomobilGewerbe
class LearningContentLearningModuleFactory(wagtail_factories.PageFactory):
title = "Beispiel Lernmodul"
minutes = 0

View File

@ -26,7 +26,7 @@ class TestRetrieveLearingPathContents(APITestCase):
self.assertEqual(self.learning_path.title, data["title"])
# topics and circles
self.assertEqual(4, len(data["children"]))
self.assertEqual(6, len(data["children"]))
# circle "analyse" contents
self.assertEqual(20, len(data["children"][3]["children"]))