diff --git a/packages/graphql/src/ops.schema.json b/packages/graphql/src/ops.schema.json index 734be1ea84..6601ee5756 100644 --- a/packages/graphql/src/ops.schema.json +++ b/packages/graphql/src/ops.schema.json @@ -5078,12 +5078,6 @@ "isDeprecated": false, "deprecationReason": null }, - { - "name": "LIVE_QUIZ", - "description": null, - "isDeprecated": false, - "deprecationReason": null - }, { "name": "MICROLEARNING", "description": null, @@ -8237,7 +8231,7 @@ "name": null, "ofType": { "kind": "ENUM", - "name": "GroupActivityStatus", + "name": "PublicationStatus", "ofType": null } }, @@ -8937,7 +8931,7 @@ "name": null, "ofType": { "kind": "ENUM", - "name": "GroupActivityStatus", + "name": "PublicationStatus", "ofType": null } }, @@ -9382,48 +9376,6 @@ "enumValues": null, "possibleTypes": null }, - { - "kind": "ENUM", - "name": "GroupActivityStatus", - "description": null, - "isOneOf": null, - "fields": null, - "inputFields": null, - "interfaces": null, - "enumValues": [ - { - "name": "DRAFT", - "description": null, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "ENDED", - "description": null, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "GRADED", - "description": null, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "PUBLISHED", - "description": null, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "SCHEDULED", - "description": null, - "isDeprecated": false, - "deprecationReason": null - } - ], - "possibleTypes": null - }, { "kind": "OBJECT", "name": "GroupActivitySummary", @@ -19422,6 +19374,18 @@ "isDeprecated": false, "deprecationReason": null }, + { + "name": "ENDED", + "description": null, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "GRADED", + "description": null, + "isDeprecated": false, + "deprecationReason": null + }, { "name": "PUBLISHED", "description": null, diff --git a/packages/graphql/src/ops.ts b/packages/graphql/src/ops.ts index f7782355de..6f0546166e 100644 --- a/packages/graphql/src/ops.ts +++ b/packages/graphql/src/ops.ts @@ -496,7 +496,6 @@ export type ElementStackInput = { export enum ElementStackType { GroupActivity = 'GROUP_ACTIVITY', - LiveQuiz = 'LIVE_QUIZ', Microlearning = 'MICROLEARNING', PracticeQuiz = 'PRACTICE_QUIZ' } @@ -799,7 +798,7 @@ export type GroupActivity = { scheduledEndAt: Scalars['Date']['output']; scheduledStartAt: Scalars['Date']['output']; stacks?: Maybe>; - status: GroupActivityStatus; + status: PublicationStatus; }; export type GroupActivityClue = { @@ -865,7 +864,7 @@ export type GroupActivityDetails = { scheduledEndAt?: Maybe; scheduledStartAt?: Maybe; stacks: Array; - status: GroupActivityStatus; + status: PublicationStatus; }; export type GroupActivityGrading = { @@ -913,14 +912,6 @@ export type GroupActivityResults = { points: Scalars['Float']['output']; }; -export enum GroupActivityStatus { - Draft = 'DRAFT', - Ended = 'ENDED', - Graded = 'GRADED', - Published = 'PUBLISHED', - Scheduled = 'SCHEDULED' -} - export type GroupActivitySummary = { __typename?: 'GroupActivitySummary'; numOfStartedInstances: Scalars['Int']['output']; @@ -2099,6 +2090,8 @@ export type PracticeQuiz = { export enum PublicationStatus { Draft = 'DRAFT', + Ended = 'ENDED', + Graded = 'GRADED', Published = 'PUBLISHED', Scheduled = 'SCHEDULED' } @@ -3170,7 +3163,7 @@ export type EndGroupActivityMutationVariables = Exact<{ }>; -export type EndGroupActivityMutation = { __typename?: 'Mutation', endGroupActivity?: { __typename?: 'GroupActivity', id: string, status: GroupActivityStatus, scheduledEndAt: any } | null }; +export type EndGroupActivityMutation = { __typename?: 'Mutation', endGroupActivity?: { __typename?: 'GroupActivity', id: string, status: PublicationStatus, scheduledEndAt: any } | null }; export type EndMicroLearningMutationVariables = Exact<{ id: Scalars['String']['input']; @@ -3212,7 +3205,7 @@ export type FinalizeGroupActivityGradingMutationVariables = Exact<{ }>; -export type FinalizeGroupActivityGradingMutation = { __typename?: 'Mutation', finalizeGroupActivityGrading?: { __typename?: 'GroupActivity', id: string, status: GroupActivityStatus } | null }; +export type FinalizeGroupActivityGradingMutation = { __typename?: 'Mutation', finalizeGroupActivityGrading?: { __typename?: 'GroupActivity', id: string, status: PublicationStatus } | null }; export type FlagElementMutationVariables = Exact<{ elementInstanceId: Scalars['Int']['input']; @@ -3424,7 +3417,7 @@ export type OpenGroupActivityMutationVariables = Exact<{ }>; -export type OpenGroupActivityMutation = { __typename?: 'Mutation', openGroupActivity?: { __typename?: 'GroupActivity', id: string, status: GroupActivityStatus, scheduledStartAt: any } | null }; +export type OpenGroupActivityMutation = { __typename?: 'Mutation', openGroupActivity?: { __typename?: 'GroupActivity', id: string, status: PublicationStatus, scheduledStartAt: any } | null }; export type PinFeedbackMutationVariables = Exact<{ id: Scalars['Int']['input']; @@ -3447,7 +3440,7 @@ export type PublishGroupActivityMutationVariables = Exact<{ }>; -export type PublishGroupActivityMutation = { __typename?: 'Mutation', publishGroupActivity?: { __typename?: 'GroupActivity', id: string, name: string, displayName: string, status: GroupActivityStatus } | null }; +export type PublishGroupActivityMutation = { __typename?: 'Mutation', publishGroupActivity?: { __typename?: 'GroupActivity', id: string, name: string, displayName: string, status: PublicationStatus } | null }; export type PublishMicroLearningMutationVariables = Exact<{ id: Scalars['String']['input']; @@ -3589,7 +3582,7 @@ export type UnpublishGroupActivityMutationVariables = Exact<{ }>; -export type UnpublishGroupActivityMutation = { __typename?: 'Mutation', unpublishGroupActivity?: { __typename?: 'GroupActivity', id: string, name: string, displayName: string, status: GroupActivityStatus } | null }; +export type UnpublishGroupActivityMutation = { __typename?: 'Mutation', unpublishGroupActivity?: { __typename?: 'GroupActivity', id: string, name: string, displayName: string, status: PublicationStatus } | null }; export type UnpublishMicroLearningMutationVariables = Exact<{ id: Scalars['String']['input']; @@ -3761,7 +3754,7 @@ export type GetCourseGroupActivitiesQueryVariables = Exact<{ }>; -export type GetCourseGroupActivitiesQuery = { __typename?: 'Query', groupActivities?: Array<{ __typename?: 'GroupActivity', id: string, displayName: string, status: GroupActivityStatus, description?: string | null, scheduledStartAt: any, scheduledEndAt: any }> | null }; +export type GetCourseGroupActivitiesQuery = { __typename?: 'Query', groupActivities?: Array<{ __typename?: 'GroupActivity', id: string, displayName: string, status: PublicationStatus, description?: string | null, scheduledStartAt: any, scheduledEndAt: any }> | null }; export type GetCourseGroupsQueryVariables = Exact<{ courseId: Scalars['String']['input']; @@ -3803,7 +3796,7 @@ export type GetGradingGroupActivityQueryVariables = Exact<{ }>; -export type GetGradingGroupActivityQuery = { __typename?: 'Query', getGradingGroupActivity?: { __typename?: 'GroupActivity', id: string, name: string, displayName: string, description?: string | null, status: GroupActivityStatus, pointsMultiplier?: number | null, scheduledStartAt: any, scheduledEndAt: any, clues?: Array<{ __typename?: 'GroupActivityClue', id: number, type: ParameterType, name: string, displayName: string, value: string, unit?: string | null }> | null, stacks?: Array<{ __typename?: 'ElementStack', id: number, displayName?: string | null, description?: string | null, elements?: Array<{ __typename?: 'ElementInstance', id: number, type: ElementInstanceType, elementType: ElementType, options?: { __typename?: 'ElementInstanceOptions', pointsMultiplier?: number | null } | null, elementData: { __typename: 'ChoicesElementData', id: string, elementId: number, name: string, type: ElementType, content: string, explanation?: string | null, pointsMultiplier: number, options: { __typename?: 'ChoiceQuestionOptions', hasSampleSolution?: boolean | null, displayMode: ElementDisplayMode, choices: Array<{ __typename?: 'Choice', ix: number, correct?: boolean | null, feedback?: string | null, value: string }> } } | { __typename: 'ContentElementData', id: string, elementId: number, name: string, type: ElementType, content: string, explanation?: string | null, pointsMultiplier: number } | { __typename: 'FlashcardElementData', id: string, elementId: number, name: string, type: ElementType, content: string, explanation?: string | null, pointsMultiplier: number } | { __typename: 'FreeTextElementData', id: string, elementId: number, name: string, type: ElementType, content: string, explanation?: string | null, pointsMultiplier: number, options: { __typename?: 'FreeTextQuestionOptions', hasSampleSolution?: boolean | null, solutions?: Array | null, restrictions?: { __typename?: 'FreeTextRestrictions', maxLength?: number | null } | null } } | { __typename: 'NumericalElementData', id: string, elementId: number, name: string, type: ElementType, content: string, explanation?: string | null, pointsMultiplier: number, options: { __typename?: 'NumericalQuestionOptions', hasSampleSolution?: boolean | null, accuracy?: number | null, placeholder?: string | null, unit?: string | null, restrictions?: { __typename?: 'NumericalRestrictions', min?: number | null, max?: number | null } | null, solutionRanges?: Array<{ __typename?: 'NumericalSolutionRange', min?: number | null, max?: number | null }> | null } } }> | null }> | null, activityInstances?: Array<{ __typename?: 'GroupActivityInstance', id: number, groupActivityId: string, decisionsSubmittedAt?: any | null, resultsComputedAt?: any | null, groupName?: string | null, decisions?: Array<{ __typename?: 'GroupActivityDecision', instanceId: number, type: ElementType, freeTextResponse?: string | null, choicesResponse?: Array | null, numericalResponse?: number | null, contentResponse?: boolean | null }> | null, results?: { __typename?: 'GroupActivityResults', passed: boolean, points: number, comment?: string | null, grading: Array<{ __typename?: 'GroupActivityGrading', instanceId: number, score: number, maxPoints: number, feedback?: string | null }> } | null }> | null } | null }; +export type GetGradingGroupActivityQuery = { __typename?: 'Query', getGradingGroupActivity?: { __typename?: 'GroupActivity', id: string, name: string, displayName: string, description?: string | null, status: PublicationStatus, pointsMultiplier?: number | null, scheduledStartAt: any, scheduledEndAt: any, clues?: Array<{ __typename?: 'GroupActivityClue', id: number, type: ParameterType, name: string, displayName: string, value: string, unit?: string | null }> | null, stacks?: Array<{ __typename?: 'ElementStack', id: number, displayName?: string | null, description?: string | null, elements?: Array<{ __typename?: 'ElementInstance', id: number, type: ElementInstanceType, elementType: ElementType, options?: { __typename?: 'ElementInstanceOptions', pointsMultiplier?: number | null } | null, elementData: { __typename: 'ChoicesElementData', id: string, elementId: number, name: string, type: ElementType, content: string, explanation?: string | null, pointsMultiplier: number, options: { __typename?: 'ChoiceQuestionOptions', hasSampleSolution?: boolean | null, displayMode: ElementDisplayMode, choices: Array<{ __typename?: 'Choice', ix: number, correct?: boolean | null, feedback?: string | null, value: string }> } } | { __typename: 'ContentElementData', id: string, elementId: number, name: string, type: ElementType, content: string, explanation?: string | null, pointsMultiplier: number } | { __typename: 'FlashcardElementData', id: string, elementId: number, name: string, type: ElementType, content: string, explanation?: string | null, pointsMultiplier: number } | { __typename: 'FreeTextElementData', id: string, elementId: number, name: string, type: ElementType, content: string, explanation?: string | null, pointsMultiplier: number, options: { __typename?: 'FreeTextQuestionOptions', hasSampleSolution?: boolean | null, solutions?: Array | null, restrictions?: { __typename?: 'FreeTextRestrictions', maxLength?: number | null } | null } } | { __typename: 'NumericalElementData', id: string, elementId: number, name: string, type: ElementType, content: string, explanation?: string | null, pointsMultiplier: number, options: { __typename?: 'NumericalQuestionOptions', hasSampleSolution?: boolean | null, accuracy?: number | null, placeholder?: string | null, unit?: string | null, restrictions?: { __typename?: 'NumericalRestrictions', min?: number | null, max?: number | null } | null, solutionRanges?: Array<{ __typename?: 'NumericalSolutionRange', min?: number | null, max?: number | null }> | null } } }> | null }> | null, activityInstances?: Array<{ __typename?: 'GroupActivityInstance', id: number, groupActivityId: string, decisionsSubmittedAt?: any | null, resultsComputedAt?: any | null, groupName?: string | null, decisions?: Array<{ __typename?: 'GroupActivityDecision', instanceId: number, type: ElementType, freeTextResponse?: string | null, choicesResponse?: Array | null, numericalResponse?: number | null, contentResponse?: boolean | null }> | null, results?: { __typename?: 'GroupActivityResults', passed: boolean, points: number, comment?: string | null, grading: Array<{ __typename?: 'GroupActivityGrading', instanceId: number, score: number, maxPoints: number, feedback?: string | null }> } | null }> | null } | null }; export type GetGroupActivityQueryVariables = Exact<{ id: Scalars['String']['input']; @@ -3979,7 +3972,7 @@ export type GetSingleCourseQueryVariables = Exact<{ }>; -export type GetSingleCourseQuery = { __typename?: 'Query', course?: { __typename?: 'Course', id: string, isArchived: boolean, isGamificationEnabled: boolean, pinCode?: number | null, name: string, displayName: string, description?: string | null, color: string, numOfParticipants?: number | null, numOfActiveParticipants?: number | null, numOfParticipantGroups?: number | null, averageScore?: number | null, averageActiveScore?: number | null, startDate: any, endDate: any, isGroupCreationEnabled: boolean, groupDeadlineDate?: any | null, maxGroupSize: number, preferredGroupSize: number, randomAssignmentFinalized: boolean, sessions?: Array<{ __typename?: 'Session', id: string, name: string, displayName: string, isGamificationEnabled: boolean, pinCode?: number | null, accessMode: SessionAccessMode, status: SessionStatus, pointsMultiplier: number, createdAt: any, numOfBlocks?: number | null, numOfQuestions?: number | null }> | null, practiceQuizzes?: Array<{ __typename?: 'PracticeQuiz', id: string, name: string, displayName: string, status: PublicationStatus, availableFrom?: any | null, orderType: ElementOrderType, pointsMultiplier: number, resetTimeDays: number, numOfStacks?: number | null }> | null, groupActivities?: Array<{ __typename?: 'GroupActivity', id: string, name: string, displayName: string, status: GroupActivityStatus, scheduledStartAt: any, scheduledEndAt: any, numOfQuestions?: number | null }> | null, microLearnings?: Array<{ __typename?: 'MicroLearning', id: string, name: string, displayName: string, status: PublicationStatus, scheduledStartAt: any, scheduledEndAt: any, pointsMultiplier: number, numOfStacks?: number | null }> | null, leaderboard?: Array<{ __typename?: 'LeaderboardEntry', id: number, score: number, rank: number, username: string, email?: string | null, avatar?: string | null }> | null } | null }; +export type GetSingleCourseQuery = { __typename?: 'Query', course?: { __typename?: 'Course', id: string, isArchived: boolean, isGamificationEnabled: boolean, pinCode?: number | null, name: string, displayName: string, description?: string | null, color: string, numOfParticipants?: number | null, numOfActiveParticipants?: number | null, numOfParticipantGroups?: number | null, averageScore?: number | null, averageActiveScore?: number | null, startDate: any, endDate: any, isGroupCreationEnabled: boolean, groupDeadlineDate?: any | null, maxGroupSize: number, preferredGroupSize: number, randomAssignmentFinalized: boolean, sessions?: Array<{ __typename?: 'Session', id: string, name: string, displayName: string, isGamificationEnabled: boolean, pinCode?: number | null, accessMode: SessionAccessMode, status: SessionStatus, pointsMultiplier: number, createdAt: any, numOfBlocks?: number | null, numOfQuestions?: number | null }> | null, practiceQuizzes?: Array<{ __typename?: 'PracticeQuiz', id: string, name: string, displayName: string, status: PublicationStatus, availableFrom?: any | null, orderType: ElementOrderType, pointsMultiplier: number, resetTimeDays: number, numOfStacks?: number | null }> | null, groupActivities?: Array<{ __typename?: 'GroupActivity', id: string, name: string, displayName: string, status: PublicationStatus, scheduledStartAt: any, scheduledEndAt: any, numOfQuestions?: number | null }> | null, microLearnings?: Array<{ __typename?: 'MicroLearning', id: string, name: string, displayName: string, status: PublicationStatus, scheduledStartAt: any, scheduledEndAt: any, pointsMultiplier: number, numOfStacks?: number | null }> | null, leaderboard?: Array<{ __typename?: 'LeaderboardEntry', id: number, score: number, rank: number, username: string, email?: string | null, avatar?: string | null }> | null } | null }; export type GetSingleLiveSessionQueryVariables = Exact<{ sessionId: Scalars['String']['input']; @@ -4062,7 +4055,7 @@ export type GroupActivityDetailsQueryVariables = Exact<{ }>; -export type GroupActivityDetailsQuery = { __typename?: 'Query', groupActivityDetails?: { __typename?: 'GroupActivityDetails', id: string, displayName: string, status: GroupActivityStatus, description?: string | null, scheduledStartAt?: any | null, scheduledEndAt?: any | null, clues: Array<{ __typename?: 'GroupActivityClue', id: number, displayName: string }>, stacks: Array<{ __typename?: 'ElementStack', id: number, type: ElementStackType, displayName?: string | null, description?: string | null, order?: number | null, elements?: Array<{ __typename?: 'ElementInstance', id: number, type: ElementInstanceType, elementType: ElementType, elementData: { __typename: 'ChoicesElementData', id: string, elementId: number, name: string, type: ElementType, content: string, explanation?: string | null, pointsMultiplier: number, options: { __typename?: 'ChoiceQuestionOptions', displayMode: ElementDisplayMode, choices: Array<{ __typename?: 'Choice', ix: number, value: string }> } } | { __typename: 'ContentElementData', id: string, elementId: number, name: string, type: ElementType, content: string, explanation?: string | null, pointsMultiplier: number } | { __typename?: 'FlashcardElementData', id: string, elementId: number, name: string, type: ElementType, content: string, explanation?: string | null, pointsMultiplier: number } | { __typename: 'FreeTextElementData', id: string, elementId: number, name: string, type: ElementType, content: string, explanation?: string | null, pointsMultiplier: number, options: { __typename?: 'FreeTextQuestionOptions', restrictions?: { __typename?: 'FreeTextRestrictions', maxLength?: number | null } | null } } | { __typename: 'NumericalElementData', id: string, elementId: number, name: string, type: ElementType, content: string, explanation?: string | null, pointsMultiplier: number, options: { __typename?: 'NumericalQuestionOptions', accuracy?: number | null, placeholder?: string | null, unit?: string | null, restrictions?: { __typename?: 'NumericalRestrictions', min?: number | null, max?: number | null } | null } } }> | null }>, course: { __typename?: 'Course', id: string, displayName: string, color: string }, group: { __typename?: 'ParticipantGroup', id: string, name: string, participants?: Array<{ __typename?: 'Participant', id: string, username: string, avatar?: string | null, isSelf?: boolean | null }> | null }, activityInstance?: { __typename?: 'GroupActivityInstance', id: number, decisionsSubmittedAt?: any | null, resultsComputedAt?: any | null, clues?: Array<{ __typename?: 'GroupActivityClueInstance', id: number, displayName: string, type: ParameterType, unit?: string | null, value?: string | null, participant: { __typename?: 'Participant', id: string, username: string, avatar?: string | null, isSelf?: boolean | null } }> | null, decisions?: Array<{ __typename?: 'GroupActivityDecision', instanceId: number, type: ElementType, freeTextResponse?: string | null, choicesResponse?: Array | null, numericalResponse?: number | null, contentResponse?: boolean | null }> | null, results?: { __typename?: 'GroupActivityResults', passed: boolean, points: number, comment?: string | null, grading: Array<{ __typename?: 'GroupActivityGrading', instanceId: number, score: number, maxPoints: number, feedback?: string | null }> } | null } | null } | null }; +export type GroupActivityDetailsQuery = { __typename?: 'Query', groupActivityDetails?: { __typename?: 'GroupActivityDetails', id: string, displayName: string, status: PublicationStatus, description?: string | null, scheduledStartAt?: any | null, scheduledEndAt?: any | null, clues: Array<{ __typename?: 'GroupActivityClue', id: number, displayName: string }>, stacks: Array<{ __typename?: 'ElementStack', id: number, type: ElementStackType, displayName?: string | null, description?: string | null, order?: number | null, elements?: Array<{ __typename?: 'ElementInstance', id: number, type: ElementInstanceType, elementType: ElementType, elementData: { __typename: 'ChoicesElementData', id: string, elementId: number, name: string, type: ElementType, content: string, explanation?: string | null, pointsMultiplier: number, options: { __typename?: 'ChoiceQuestionOptions', displayMode: ElementDisplayMode, choices: Array<{ __typename?: 'Choice', ix: number, value: string }> } } | { __typename: 'ContentElementData', id: string, elementId: number, name: string, type: ElementType, content: string, explanation?: string | null, pointsMultiplier: number } | { __typename?: 'FlashcardElementData', id: string, elementId: number, name: string, type: ElementType, content: string, explanation?: string | null, pointsMultiplier: number } | { __typename: 'FreeTextElementData', id: string, elementId: number, name: string, type: ElementType, content: string, explanation?: string | null, pointsMultiplier: number, options: { __typename?: 'FreeTextQuestionOptions', restrictions?: { __typename?: 'FreeTextRestrictions', maxLength?: number | null } | null } } | { __typename: 'NumericalElementData', id: string, elementId: number, name: string, type: ElementType, content: string, explanation?: string | null, pointsMultiplier: number, options: { __typename?: 'NumericalQuestionOptions', accuracy?: number | null, placeholder?: string | null, unit?: string | null, restrictions?: { __typename?: 'NumericalRestrictions', min?: number | null, max?: number | null } | null } } }> | null }>, course: { __typename?: 'Course', id: string, displayName: string, color: string }, group: { __typename?: 'ParticipantGroup', id: string, name: string, participants?: Array<{ __typename?: 'Participant', id: string, username: string, avatar?: string | null, isSelf?: boolean | null }> | null }, activityInstance?: { __typename?: 'GroupActivityInstance', id: number, decisionsSubmittedAt?: any | null, resultsComputedAt?: any | null, clues?: Array<{ __typename?: 'GroupActivityClueInstance', id: number, displayName: string, type: ParameterType, unit?: string | null, value?: string | null, participant: { __typename?: 'Participant', id: string, username: string, avatar?: string | null, isSelf?: boolean | null } }> | null, decisions?: Array<{ __typename?: 'GroupActivityDecision', instanceId: number, type: ElementType, freeTextResponse?: string | null, choicesResponse?: Array | null, numericalResponse?: number | null, contentResponse?: boolean | null }> | null, results?: { __typename?: 'GroupActivityResults', passed: boolean, points: number, comment?: string | null, grading: Array<{ __typename?: 'GroupActivityGrading', instanceId: number, score: number, maxPoints: number, feedback?: string | null }> } | null } | null } | null }; export type ParticipationsQueryVariables = Exact<{ endpoint?: InputMaybe; @@ -4119,14 +4112,14 @@ export type GroupActivityEndedSubscriptionVariables = Exact<{ }>; -export type GroupActivityEndedSubscription = { __typename?: 'Subscription', groupActivityEnded: { __typename?: 'GroupActivity', id: string, displayName: string, status: GroupActivityStatus, description?: string | null, scheduledStartAt: any, scheduledEndAt: any } }; +export type GroupActivityEndedSubscription = { __typename?: 'Subscription', groupActivityEnded: { __typename?: 'GroupActivity', id: string, displayName: string, status: PublicationStatus, description?: string | null, scheduledStartAt: any, scheduledEndAt: any } }; export type GroupActivityStartedSubscriptionVariables = Exact<{ courseId: Scalars['String']['input']; }>; -export type GroupActivityStartedSubscription = { __typename?: 'Subscription', groupActivityStarted: { __typename?: 'GroupActivity', id: string, displayName: string, status: GroupActivityStatus, description?: string | null, scheduledStartAt: any, scheduledEndAt: any } }; +export type GroupActivityStartedSubscription = { __typename?: 'Subscription', groupActivityStarted: { __typename?: 'GroupActivity', id: string, displayName: string, status: PublicationStatus, description?: string | null, scheduledStartAt: any, scheduledEndAt: any } }; export type MicroLearningEndedSubscriptionVariables = Exact<{ activityId: Scalars['String']['input']; @@ -4147,7 +4140,7 @@ export type SingleGroupActivityEndedSubscriptionVariables = Exact<{ }>; -export type SingleGroupActivityEndedSubscription = { __typename?: 'Subscription', singleGroupActivityEnded: { __typename?: 'GroupActivity', id: string, displayName: string, status: GroupActivityStatus, description?: string | null, scheduledStartAt: any, scheduledEndAt: any } }; +export type SingleGroupActivityEndedSubscription = { __typename?: 'Subscription', singleGroupActivityEnded: { __typename?: 'GroupActivity', id: string, displayName: string, status: PublicationStatus, description?: string | null, scheduledStartAt: any, scheduledEndAt: any } }; export type UpdateParticipantAvatarMutationVariables = Exact<{ avatar: Scalars['String']['input']; diff --git a/packages/graphql/src/public/schema.graphql b/packages/graphql/src/public/schema.graphql index 55b460163a..02aac3e995 100644 --- a/packages/graphql/src/public/schema.graphql +++ b/packages/graphql/src/public/schema.graphql @@ -445,7 +445,6 @@ input ElementStackInput { enum ElementStackType { GROUP_ACTIVITY - LIVE_QUIZ MICROLEARNING PRACTICE_QUIZ } @@ -726,7 +725,7 @@ type GroupActivity { scheduledEndAt: Date! scheduledStartAt: Date! stacks: [ElementStack!] - status: GroupActivityStatus! + status: PublicationStatus! } type GroupActivityClue { @@ -787,7 +786,7 @@ type GroupActivityDetails { scheduledEndAt: Date scheduledStartAt: Date stacks: [ElementStack!]! - status: GroupActivityStatus! + status: PublicationStatus! } type GroupActivityGrading { @@ -831,14 +830,6 @@ type GroupActivityResults { points: Float! } -enum GroupActivityStatus { - DRAFT - ENDED - GRADED - PUBLISHED - SCHEDULED -} - type GroupActivitySummary { numOfStartedInstances: Int! numOfSubmissions: Int! @@ -1318,6 +1309,8 @@ type PracticeQuiz { enum PublicationStatus { DRAFT + ENDED + GRADED PUBLISHED SCHEDULED } diff --git a/packages/graphql/src/schema/groupActivity.ts b/packages/graphql/src/schema/groupActivity.ts index 6f7d4fac33..3595401c6f 100644 --- a/packages/graphql/src/schema/groupActivity.ts +++ b/packages/graphql/src/schema/groupActivity.ts @@ -13,17 +13,17 @@ import { ParticipantGroupRef, ParticipantRef, } from './participant.js' -import { type IElementStack, ElementStackRef } from './practiceQuizzes.js' +import { + type IElementStack, + ElementStackRef, + PublicationStatus, +} from './practiceQuizzes.js' import { ElementType } from './questionData.js' export const ParameterType = builder.enumType('ParameterType', { values: Object.values(DB.ParameterType), }) -export const GroupActivityStatus = builder.enumType('GroupActivityStatus', { - values: Object.values(DB.GroupActivityStatus), -}) - export const ResponseCorrectnessType = builder.enumType( 'ResponseCorrectnessType', { @@ -59,7 +59,7 @@ export const GroupActivity = GroupActivityRef.implement({ name: t.exposeString('name'), displayName: t.exposeString('displayName'), description: t.exposeString('description', { nullable: true }), - status: t.expose('status', { type: GroupActivityStatus }), + status: t.expose('status', { type: PublicationStatus }), numOfQuestions: t.exposeInt('numOfQuestions', { nullable: true }), pointsMultiplier: t.exposeInt('pointsMultiplier', { nullable: true }), @@ -220,7 +220,7 @@ export interface IGroupActivityDetails { id: string name: string displayName: string - status: DB.GroupActivityStatus + status: DB.PublicationStatus description?: string | null scheduledStartAt?: Date scheduledEndAt?: Date @@ -240,7 +240,7 @@ export const GroupActivityDetails = GroupActivityDetailsRef.implement({ name: t.exposeString('name', { nullable: false }), displayName: t.exposeString('displayName', { nullable: false }), description: t.exposeString('description', { nullable: true }), - status: t.expose('status', { type: GroupActivityStatus }), + status: t.expose('status', { type: PublicationStatus }), scheduledStartAt: t.expose('scheduledStartAt', { type: 'Date', diff --git a/packages/graphql/src/services/courses.ts b/packages/graphql/src/services/courses.ts index e4fee7e166..f5fc5490e9 100644 --- a/packages/graphql/src/services/courses.ts +++ b/packages/graphql/src/services/courses.ts @@ -1,6 +1,5 @@ import { ElementOrderType, - GroupActivityStatus, LeaderboardType, type Participant, type ParticipantGroup, @@ -1129,7 +1128,7 @@ export async function publishScheduledActivities(ctx: Context) { // ! Set group activity status to ended for all published group activities that have ended const groupActivitiesToEnd = await ctx.prisma.groupActivity.findMany({ where: { - status: GroupActivityStatus.PUBLISHED, + status: PublicationStatus.PUBLISHED, scheduledEndAt: { lte: new Date(), }, @@ -1143,7 +1142,7 @@ export async function publishScheduledActivities(ctx: Context) { id: group.id, }, data: { - status: GroupActivityStatus.ENDED, + status: PublicationStatus.ENDED, }, }) ) diff --git a/packages/graphql/src/services/groups.ts b/packages/graphql/src/services/groups.ts index 285f73ebae..c65434038b 100644 --- a/packages/graphql/src/services/groups.ts +++ b/packages/graphql/src/services/groups.ts @@ -4,11 +4,11 @@ import { ElementInstanceType, ElementStackType, ElementType, - GroupActivityStatus, LeaderboardType, ParameterType, type Participant, type ParticipantGroup, + PublicationStatus, } from '@klicker-uzh/prisma' import { ElementInstanceResults, @@ -969,9 +969,9 @@ export async function manipulateGroupActivity( throw new GraphQLError('Group Activity not found') } if ( - oldElement.status === GroupActivityStatus.SCHEDULED || - oldElement.status === GroupActivityStatus.PUBLISHED || - oldElement.status === GroupActivityStatus.GRADED + oldElement.status === PublicationStatus.SCHEDULED || + oldElement.status === PublicationStatus.PUBLISHED || + oldElement.status === PublicationStatus.GRADED ) { throw new GraphQLError('Can only edit draft group activities') } @@ -1018,7 +1018,7 @@ export async function manipulateGroupActivity( name: name, displayName: displayName, description: description, - status: GroupActivityStatus.DRAFT, + status: PublicationStatus.DRAFT, scheduledStartAt: startDate, scheduledEndAt: endDate, parameters: {}, @@ -1185,9 +1185,9 @@ export async function getGroupActivityDetails( id: activityId, status: { in: [ - GroupActivityStatus.PUBLISHED, - GroupActivityStatus.ENDED, - GroupActivityStatus.GRADED, + PublicationStatus.PUBLISHED, + PublicationStatus.ENDED, + PublicationStatus.GRADED, ], }, isDeleted: false, @@ -1270,7 +1270,7 @@ export async function getGroupActivityDetails( } return { - ...(groupActivity.status === GroupActivityStatus.GRADED + ...(groupActivity.status === PublicationStatus.GRADED ? clueAssignment.groupActivityClueInstance : omitBy( clueAssignment.groupActivityClueInstance, @@ -1293,7 +1293,7 @@ export async function startGroupActivity( ctx: ContextWithUser ) { const groupActivity = await ctx.prisma.groupActivity.findUnique({ - where: { id: activityId, status: GroupActivityStatus.PUBLISHED }, + where: { id: activityId, status: PublicationStatus.PUBLISHED }, include: { course: true, clues: { @@ -1469,10 +1469,10 @@ export async function submitGroupActivityDecisions( !groupActivityInstance || groupActivityInstance.group.participants.length === 0 || !!groupActivityInstance.decisionsSubmittedAt || - groupActivityInstance.groupActivity.status === GroupActivityStatus.DRAFT || + groupActivityInstance.groupActivity.status === PublicationStatus.DRAFT || groupActivityInstance.groupActivity.status === - GroupActivityStatus.SCHEDULED || - groupActivityInstance.groupActivity.status === GroupActivityStatus.ENDED + PublicationStatus.SCHEDULED || + groupActivityInstance.groupActivity.status === PublicationStatus.ENDED ) { return null } @@ -1617,10 +1617,10 @@ export async function publishGroupActivity( data: { status: now < groupActivity.scheduledStartAt - ? GroupActivityStatus.SCHEDULED + ? PublicationStatus.SCHEDULED : now > groupActivity.scheduledEndAt - ? GroupActivityStatus.ENDED - : GroupActivityStatus.PUBLISHED, + ? PublicationStatus.ENDED + : PublicationStatus.PUBLISHED, }, }) @@ -1635,7 +1635,7 @@ export async function unpublishGroupActivity( where: { id, ownerId: ctx.user.sub, - status: GroupActivityStatus.SCHEDULED, + status: PublicationStatus.SCHEDULED, isDeleted: false, }, }) @@ -1645,7 +1645,7 @@ export async function unpublishGroupActivity( const updatedGroupActivity = await ctx.prisma.groupActivity.update({ where: { id }, data: { - status: GroupActivityStatus.DRAFT, + status: PublicationStatus.DRAFT, }, }) @@ -1660,7 +1660,7 @@ export async function openGroupActivity( where: { id, ownerId: ctx.user.sub, - status: GroupActivityStatus.SCHEDULED, + status: PublicationStatus.SCHEDULED, isDeleted: false, }, }) @@ -1670,7 +1670,7 @@ export async function openGroupActivity( const updatedGroupActivity = await ctx.prisma.groupActivity.update({ where: { id }, data: { - status: GroupActivityStatus.PUBLISHED, + status: PublicationStatus.PUBLISHED, scheduledStartAt: new Date(), }, }) @@ -1689,7 +1689,7 @@ export async function endGroupActivity( where: { id, ownerId: ctx.user.sub, - status: GroupActivityStatus.PUBLISHED, + status: PublicationStatus.PUBLISHED, isDeleted: false, }, }) @@ -1699,7 +1699,7 @@ export async function endGroupActivity( const updatedGroupActivity = await ctx.prisma.groupActivity.update({ where: { id }, data: { - status: GroupActivityStatus.ENDED, + status: PublicationStatus.ENDED, scheduledEndAt: new Date(), }, }) @@ -1729,8 +1729,8 @@ export async function deleteGroupActivity( // if the the group activity is not yet published / has not started or has no instances -> hard deletion // as soon as an instance exists (independent of results) -> soft deletion if ( - groupActivity.status === GroupActivityStatus.DRAFT || - groupActivity.status === GroupActivityStatus.SCHEDULED || + groupActivity.status === PublicationStatus.DRAFT || + groupActivity.status === PublicationStatus.SCHEDULED || groupActivity.activityInstances.length === 0 ) { const deletedItem = await ctx.prisma.groupActivity.delete({ @@ -1774,10 +1774,10 @@ export async function getCourseGroupActivities( where: { status: { in: [ - GroupActivityStatus.SCHEDULED, - GroupActivityStatus.PUBLISHED, - GroupActivityStatus.ENDED, - GroupActivityStatus.GRADED, + PublicationStatus.SCHEDULED, + PublicationStatus.PUBLISHED, + PublicationStatus.ENDED, + PublicationStatus.GRADED, ], }, isDeleted: false, @@ -1903,7 +1903,7 @@ export async function extendGroupActivity( id, ownerId: ctx.user.sub, status: { - in: [GroupActivityStatus.SCHEDULED, GroupActivityStatus.PUBLISHED], + in: [PublicationStatus.SCHEDULED, PublicationStatus.PUBLISHED], }, scheduledEndAt: { gt: new Date() }, }, @@ -2007,7 +2007,7 @@ export async function finalizeGroupActivityGrading( const updatedGroupActivity = await ctx.prisma.groupActivity.update({ where: { id }, data: { - status: GroupActivityStatus.GRADED, + status: PublicationStatus.GRADED, activityInstances: { updateMany: { where: { diff --git a/packages/graphql/src/services/participants.ts b/packages/graphql/src/services/participants.ts index 55e6ecfcce..780c1f1db3 100644 --- a/packages/graphql/src/services/participants.ts +++ b/packages/graphql/src/services/participants.ts @@ -534,8 +534,8 @@ export async function flagElement( }) if ( - !elementInstance?.elementStack.practiceQuiz?.course?.notificationEmail && - !elementInstance?.elementStack.microLearning?.course?.notificationEmail + !elementInstance?.elementStack!.practiceQuiz?.course?.notificationEmail && + !elementInstance?.elementStack!.microLearning?.course?.notificationEmail ) { // return early if no notification email has been specified -> only set database entry return elementFeedback diff --git a/packages/graphql/src/services/stacks.ts b/packages/graphql/src/services/stacks.ts index fb007a6171..f91dff1b87 100644 --- a/packages/graphql/src/services/stacks.ts +++ b/packages/graphql/src/services/stacks.ts @@ -62,10 +62,10 @@ type PrismaTransactionClient = Omit< '$connect' | '$disconnect' | '$on' | '$transaction' | '$use' | '$extends' > type ExistingInstanceType = ElementInstance & { - elementStack: { + elementStack?: { practiceQuizId?: string | null microLearningId?: string | null - } + } | null } const POINTS_PER_INSTANCE = 10 @@ -498,17 +498,17 @@ async function createFlashcardResponseDetail({ elementInstance: { connect: { id }, }, - practiceQuiz: existingInstance.elementStack.practiceQuizId + practiceQuiz: existingInstance.elementStack?.practiceQuizId ? { connect: { - id: existingInstance.elementStack.practiceQuizId, + id: existingInstance.elementStack?.practiceQuizId, }, } : undefined, - microLearning: existingInstance.elementStack.microLearningId + microLearning: existingInstance.elementStack?.microLearningId ? { connect: { - id: existingInstance.elementStack.microLearningId, + id: existingInstance.elementStack?.microLearningId, }, } : undefined, @@ -564,17 +564,17 @@ async function upsertFlashcardResponse({ elementInstance: { connect: { id }, }, - practiceQuiz: existingInstance.elementStack.practiceQuizId + practiceQuiz: existingInstance.elementStack?.practiceQuizId ? { connect: { - id: existingInstance.elementStack.practiceQuizId, + id: existingInstance.elementStack?.practiceQuizId, }, } : undefined, - microLearning: existingInstance.elementStack.microLearningId + microLearning: existingInstance.elementStack?.microLearningId ? { connect: { - id: existingInstance.elementStack.microLearningId, + id: existingInstance.elementStack?.microLearningId, }, } : undefined, @@ -717,7 +717,7 @@ async function respondToFlashcard( // compute updated instance statistics const instanceInPracticeQuiz = - !!existingInstance.elementStack.practiceQuizId + !!existingInstance.elementStack?.practiceQuizId const statisticsUpdate = computeUpdatedInstanceStatistics({ participation, existingResponse, @@ -844,17 +844,17 @@ async function createContentResponseDetail({ elementInstance: { connect: { id }, }, - practiceQuiz: existingInstance.elementStack.practiceQuizId + practiceQuiz: existingInstance.elementStack?.practiceQuizId ? { connect: { - id: existingInstance.elementStack.practiceQuizId, + id: existingInstance.elementStack?.practiceQuizId, }, } : undefined, - microLearning: existingInstance.elementStack.microLearningId + microLearning: existingInstance.elementStack?.microLearningId ? { connect: { - id: existingInstance.elementStack.microLearningId, + id: existingInstance.elementStack?.microLearningId, }, } : undefined, @@ -904,17 +904,17 @@ async function upsertContentResponse({ elementInstance: { connect: { id }, }, - practiceQuiz: existingInstance.elementStack.practiceQuizId + practiceQuiz: existingInstance.elementStack?.practiceQuizId ? { connect: { - id: existingInstance.elementStack.practiceQuizId, + id: existingInstance.elementStack?.practiceQuizId, }, } : undefined, - microLearning: existingInstance.elementStack.microLearningId + microLearning: existingInstance.elementStack?.microLearningId ? { connect: { - id: existingInstance.elementStack.microLearningId, + id: existingInstance.elementStack?.microLearningId, }, } : undefined, @@ -1042,7 +1042,7 @@ async function respondToContent( // compute updated instance statistics const instanceInPracticeQuiz = - !!existingInstance.elementStack.practiceQuizId + !!existingInstance.elementStack?.practiceQuizId const statisticsUpdate = computeUpdatedInstanceStatistics({ participation, existingResponse, @@ -2189,7 +2189,7 @@ export async function respondToQuestion( // compute updated instance statistics const instanceInPracticeQuiz = - !!existingInstance.elementStack.practiceQuizId + !!existingInstance.elementStack?.practiceQuizId const statisticsUpdate = computeUpdatedInstanceStatistics({ participation, existingResponse: existingResponse, // this is safe because we only use it inside the function if the participation is defined @@ -2303,9 +2303,9 @@ export async function respondToQuestion( pointsAwarded, xpAwarded, answerTime, - practiceQuizId: updatedInstance.elementStack.practiceQuizId ?? undefined, + practiceQuizId: updatedInstance.elementStack?.practiceQuizId ?? undefined, microLearningId: - updatedInstance.elementStack.microLearningId ?? undefined, + updatedInstance.elementStack?.microLearningId ?? undefined, }) // upsert the question response @@ -2324,9 +2324,9 @@ export async function respondToQuestion( newAverageResponseTime, existingResponse, newAggResponses, - practiceQuizId: updatedInstance.elementStack.practiceQuizId ?? undefined, + practiceQuizId: updatedInstance.elementStack?.practiceQuizId ?? undefined, microLearningId: - updatedInstance.elementStack.microLearningId ?? undefined, + updatedInstance.elementStack?.microLearningId ?? undefined, resultSpacedRepetition, })