diff --git a/client/src/gql/graphql.ts b/client/src/gql/graphql.ts index 7d414dad..658be93d 100644 --- a/client/src/gql/graphql.ts +++ b/client/src/gql/graphql.ts @@ -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; + content_type: Scalars['String']['output']; + content_url: Scalars['String']['output']; + course?: Maybe; + description: Scalars['String']['output']; + frontend_url: Scalars['String']['output']; + id: Scalars['ID']['output']; + live: Scalars['Boolean']['output']; + minutes?: Maybe; + 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; learning_content_attendance_course?: Maybe; learning_content_document_list?: Maybe; + learning_content_feedback_automobil_gewerbe?: Maybe; learning_content_feedback_uk?: Maybe; learning_content_feedback_vv?: Maybe; learning_content_knowledge_assessment?: Maybe; @@ -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 } } diff --git a/client/src/gql/schema.graphql b/client/src/gql/schema.graphql index 967e892e..c1dddc04 100644 --- a/client/src/gql/schema.graphql +++ b/client/src/gql/schema.graphql @@ -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! diff --git a/client/src/gql/typenames.ts b/client/src/gql/typenames.ts index d004acc2..407537bc 100644 --- a/client/src/gql/typenames.ts +++ b/client/src/gql/typenames.ts @@ -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"; diff --git a/client/src/pages/learningPath/learningContentPage/LearningContentParent.vue b/client/src/pages/learningPath/learningContentPage/LearningContentParent.vue index 4f0ea8a7..9b82c1ee 100644 --- a/client/src/pages/learningPath/learningContentPage/LearningContentParent.vue +++ b/client/src/pages/learningPath/learningContentPage/LearningContentParent.vue @@ -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 = { "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( diff --git a/client/src/pages/learningPath/learningContentPage/feedback/FeedbackBase.vue b/client/src/pages/learningPath/learningContentPage/feedback/FeedbackBase.vue index bd7a1995..9cec590e 100644 --- a/client/src/pages/learningPath/learningContentPage/feedback/FeedbackBase.vue +++ b/client/src/pages/learningPath/learningContentPage/feedback/FeedbackBase.vue @@ -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; diff --git a/client/src/pages/learningPath/learningContentPage/feedback/FeedbackBlockAutomobilGewerbe.vue b/client/src/pages/learningPath/learningContentPage/feedback/FeedbackBlockAutomobilGewerbe.vue new file mode 100644 index 00000000..bd5829ae --- /dev/null +++ b/client/src/pages/learningPath/learningContentPage/feedback/FeedbackBlockAutomobilGewerbe.vue @@ -0,0 +1,73 @@ + + + diff --git a/client/src/pages/learningPath/learningContentPage/feedback/FeedbackBlockUK.vue b/client/src/pages/learningPath/learningContentPage/feedback/FeedbackBlockUK.vue index c6314068..a25b8c09 100644 --- a/client/src/pages/learningPath/learningContentPage/feedback/FeedbackBlockUK.vue +++ b/client/src/pages/learningPath/learningContentPage/feedback/FeedbackBlockUK.vue @@ -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(); diff --git a/client/src/pages/learningPath/learningContentPage/feedback/FeedbackBlockVV.vue b/client/src/pages/learningPath/learningContentPage/feedback/FeedbackBlockVV.vue index e5d7712d..1cf61f47 100644 --- a/client/src/pages/learningPath/learningContentPage/feedback/FeedbackBlockVV.vue +++ b/client/src/pages/learningPath/learningContentPage/feedback/FeedbackBlockVV.vue @@ -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(); diff --git a/client/src/types.ts b/client/src/types.ts index 1710cacb..59286c61 100644 --- a/client/src/types.ts +++ b/client/src/types.ts @@ -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; diff --git a/client/src/utils/typeMaps.ts b/client/src/utils/typeMaps.ts index 747efa01..45a6dd8b 100644 --- a/client/src/utils/typeMaps.ts +++ b/client/src/utils/typeMaps.ts @@ -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 { diff --git a/server/vbv_lernwelt/course/graphql/queries.py b/server/vbv_lernwelt/course/graphql/queries.py index cc405a72..9ec331fc 100644 --- a/server/vbv_lernwelt/course/graphql/queries.py +++ b/server/vbv_lernwelt/course/graphql/queries.py @@ -1,7 +1,6 @@ import graphene from django.db.models import Q from graphql import GraphQLError - from vbv_lernwelt.course.graphql.types import CourseObjectType, CourseSessionObjectType from vbv_lernwelt.course.models import Course, CourseSession from vbv_lernwelt.iam.permissions import has_course_access @@ -10,6 +9,7 @@ from vbv_lernwelt.learnpath.graphql.types import ( LearningContentAttendanceCourseObjectType, LearningContentDocumentListObjectType, LearningContentEdoniqTestObjectType, + LearningContentFeedbackAutomobilGewerbeObjectType, LearningContentFeedbackUKObjectType, LearningContentFeedbackVVObjectType, LearningContentKnowledgeAssessmentObjectType, @@ -53,6 +53,7 @@ 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 ) diff --git a/server/vbv_lernwelt/learnpath/graphql/types.py b/server/vbv_lernwelt/learnpath/graphql/types.py index ccc79e9f..d5d07731 100644 --- a/server/vbv_lernwelt/learnpath/graphql/types.py +++ b/server/vbv_lernwelt/learnpath/graphql/types.py @@ -1,7 +1,6 @@ import graphene import structlog from graphene_django import DjangoObjectType - from vbv_lernwelt.core.utils import find_first_index from vbv_lernwelt.course.graphql.interfaces import CoursePageInterface from vbv_lernwelt.learnpath.models import ( @@ -10,6 +9,7 @@ from vbv_lernwelt.learnpath.models import ( LearningContentAttendanceCourse, LearningContentDocumentList, LearningContentEdoniqTest, + LearningContentFeedbackAutomobilGewerbe, LearningContentFeedbackUK, LearningContentFeedbackVV, LearningContentKnowledgeAssessment, @@ -54,6 +54,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 +130,16 @@ class LearningContentFeedbackVVObjectType(DjangoObjectType): fields = [] +class LearningContentFeedbackAutomobilGewerbeObjectType(DjangoObjectType): + class Meta: + model = LearningContentFeedbackAutomobilGewerbe + interfaces = ( + CoursePageInterface, + LearningContentInterface, + ) + fields = [] + + class LearningContentLearningModuleObjectType(DjangoObjectType): class Meta: model = LearningContentLearningModule @@ -247,7 +259,7 @@ class LearningUnitObjectType(DjangoObjectType): if hasattr(info.context, "circle_descendants"): circle_descendants = info.context.circle_descendants index = circle_descendants.index(self) - siblings = circle_descendants[index + 1 :] + siblings = circle_descendants[index + 1:] if not siblings: siblings = self.get_siblings().live().specific() @@ -280,7 +292,7 @@ class LearningSequenceObjectType(DjangoObjectType): if hasattr(info.context, "circle_descendants"): circle_descendants = info.context.circle_descendants index = circle_descendants.index(root) - siblings = circle_descendants[index + 1 :] + siblings = circle_descendants[index + 1:] if not siblings: siblings = root.get_siblings().live().specific() @@ -312,7 +324,7 @@ class CircleObjectType(DjangoObjectType): if hasattr(info.context, "learning_path_descendants"): children = info.context.learning_path_descendants circle_start_index = children.index(self) - next_children = children[circle_start_index + 1 :] + next_children = children[circle_start_index + 1:] next_circle_index = find_first_index( next_children, pred=lambda child: child.specific_class == Circle, @@ -355,7 +367,7 @@ class TopicObjectType(DjangoObjectType): if hasattr(info.context, "learning_path_descendants"): learning_path_descendants = info.context.learning_path_descendants index = learning_path_descendants.index(root) - siblings = learning_path_descendants[index + 1 :] + siblings = learning_path_descendants[index + 1:] if not siblings: siblings = root.get_next_siblings().live().specific() diff --git a/server/vbv_lernwelt/learnpath/migrations/0021_learningcontentfeedbackautomobilgewerbe.py b/server/vbv_lernwelt/learnpath/migrations/0021_learningcontentfeedbackautomobilgewerbe.py new file mode 100644 index 00000000..9457b7b4 --- /dev/null +++ b/server/vbv_lernwelt/learnpath/migrations/0021_learningcontentfeedbackautomobilgewerbe.py @@ -0,0 +1,43 @@ +# Generated by Django 4.2.13 on 2024-10-28 09:59 + +from django.db import migrations, models +import django.db.models.deletion +import wagtail.fields + + +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",), + ), + ] diff --git a/server/vbv_lernwelt/learnpath/models.py b/server/vbv_lernwelt/learnpath/models.py index 587c4485..158efebc 100644 --- a/server/vbv_lernwelt/learnpath/models.py +++ b/server/vbv_lernwelt/learnpath/models.py @@ -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 = []