Add new learning content type
This commit is contained in:
parent
5850321776
commit
1d2aa38896
|
|
@ -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 } }
|
||||
|
|
|
|||
|
|
@ -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!
|
||||
|
|
|
|||
|
|
@ -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";
|
||||
|
|
|
|||
|
|
@ -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(
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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>
|
||||
|
|
@ -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();
|
||||
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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 {
|
||||
|
|
|
|||
|
|
@ -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
|
||||
)
|
||||
|
|
|
|||
|
|
@ -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()
|
||||
|
|
|
|||
|
|
@ -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",),
|
||||
),
|
||||
]
|
||||
|
|
@ -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 = []
|
||||
|
|
|
|||
Loading…
Reference in New Issue