Create mutation with test case

This commit is contained in:
Daniel Egger 2023-06-23 18:34:08 +02:00
parent a75bb14e4c
commit eb0b03f413
9 changed files with 393 additions and 174 deletions

View File

@ -5,132 +5,147 @@ export type InputMaybe<T> = Maybe<T>;
export type Exact<T extends { [key: string]: unknown }> = { [K in keyof T]: T[K] }; export type Exact<T extends { [key: string]: unknown }> = { [K in keyof T]: T[K] };
export type MakeOptional<T, K extends keyof T> = Omit<T, K> & { [SubKey in K]?: Maybe<T[SubKey]> }; export type MakeOptional<T, K extends keyof T> = Omit<T, K> & { [SubKey in K]?: Maybe<T[SubKey]> };
export type MakeMaybe<T, K extends keyof T> = Omit<T, K> & { [SubKey in K]: Maybe<T[SubKey]> }; export type MakeMaybe<T, K extends keyof T> = Omit<T, K> & { [SubKey in K]: Maybe<T[SubKey]> };
export type MakeEmpty<T extends { [key: string]: unknown }, K extends keyof T> = { [_ in K]?: never };
export type Incremental<T> = T | { [P in keyof T]?: P extends ' $fragmentName' | '__typename' ? T[P] : never };
/** All built-in and custom scalars, mapped to their actual values */ /** All built-in and custom scalars, mapped to their actual values */
export type Scalars = { export type Scalars = {
ID: { input: string; output: string; } ID: string;
String: { input: string; output: string; } String: string;
Boolean: { input: boolean; output: boolean; } Boolean: boolean;
Int: { input: number; output: number; } Int: number;
Float: { input: number; output: number; } Float: number;
/** /**
* The `DateTime` scalar type represents a DateTime * The `DateTime` scalar type represents a DateTime
* value as specified by * value as specified by
* [iso8601](https://en.wikipedia.org/wiki/ISO_8601). * [iso8601](https://en.wikipedia.org/wiki/ISO_8601).
*/ */
DateTime: { input: any; output: any; } DateTime: any;
/** /**
* The `GenericScalar` scalar type represents a generic * The `GenericScalar` scalar type represents a generic
* GraphQL scalar value that could be: * GraphQL scalar value that could be:
* String, Boolean, Int, Float, List or Object. * String, Boolean, Int, Float, List or Object.
*/ */
GenericScalar: { input: any; output: any; } GenericScalar: any;
JSONStreamField: { input: any; output: any; } JSONStreamField: any;
/** /**
* Allows use of a JSON String for input / output from the GraphQL schema. * Allows use of a JSON String for input / output from the GraphQL schema.
* *
* Use of this type is *not recommended* as you lose the benefits of having a defined, static * Use of this type is *not recommended* as you lose the benefits of having a defined, static
* schema (one of the key benefits of GraphQL). * schema (one of the key benefits of GraphQL).
*/ */
JSONString: { input: any; output: any; } JSONString: any;
}; };
/** An enumeration. */ /** An enumeration. */
export type AssignmentAssignmentAssignmentTypeChoices = export enum AssignmentAssignmentAssignmentTypeChoices {
/** CASEWORK */ /** CASEWORK */
| 'CASEWORK' Casework = 'CASEWORK',
/** PREP_ASSIGNMENT */ /** PREP_ASSIGNMENT */
| 'PREP_ASSIGNMENT' PrepAssignment = 'PREP_ASSIGNMENT',
/** REFLECTION */ /** REFLECTION */
| 'REFLECTION'; Reflection = 'REFLECTION'
}
/** An enumeration. */ /** An enumeration. */
export type AssignmentAssignmentCompletionCompletionStatusChoices = export enum AssignmentAssignmentCompletionCompletionStatusChoices {
/** EVALUATION_IN_PROGRESS */ /** EVALUATION_IN_PROGRESS */
| 'EVALUATION_IN_PROGRESS' EvaluationInProgress = 'EVALUATION_IN_PROGRESS',
/** EVALUATION_SUBMITTED */ /** EVALUATION_SUBMITTED */
| 'EVALUATION_SUBMITTED' EvaluationSubmitted = 'EVALUATION_SUBMITTED',
/** IN_PROGRESS */ /** IN_PROGRESS */
| 'IN_PROGRESS' InProgress = 'IN_PROGRESS',
/** SUBMITTED */ /** SUBMITTED */
| 'SUBMITTED'; Submitted = 'SUBMITTED'
}
export type AssignmentCompletionMutation = { export type AssignmentCompletionMutation = {
__typename?: 'AssignmentCompletionMutation'; __typename?: 'AssignmentCompletionMutation';
assignment_completion?: Maybe<AssignmentCompletionObjectType>; assignment_completion?: Maybe<AssignmentCompletionType>;
}; };
export type AssignmentCompletionObjectType = { export type AssignmentCompletionType = {
__typename?: 'AssignmentCompletionObjectType'; __typename?: 'AssignmentCompletionType';
additional_json_data: Scalars['JSONString']['output']; additional_json_data: Scalars['JSONString'];
assignment: AssignmentObjectType; assignment: AssignmentType;
assignment_user: UserType; assignment_user: UserType;
completion_data?: Maybe<Scalars['GenericScalar']['output']>; completion_data?: Maybe<Scalars['GenericScalar']>;
completion_status: AssignmentAssignmentCompletionCompletionStatusChoices; completion_status: AssignmentAssignmentCompletionCompletionStatusChoices;
created_at: Scalars['DateTime']['output']; created_at: Scalars['DateTime'];
evaluation_grade?: Maybe<Scalars['Float']['output']>; evaluation_grade?: Maybe<Scalars['Float']>;
evaluation_points?: Maybe<Scalars['Float']['output']>; evaluation_points?: Maybe<Scalars['Float']>;
evaluation_submitted_at?: Maybe<Scalars['DateTime']['output']>; evaluation_submitted_at?: Maybe<Scalars['DateTime']>;
evaluation_user?: Maybe<UserType>; evaluation_user?: Maybe<UserType>;
id: Scalars['ID']['output']; id: Scalars['ID'];
submitted_at?: Maybe<Scalars['DateTime']['output']>; submitted_at?: Maybe<Scalars['DateTime']>;
updated_at: Scalars['DateTime']['output']; updated_at: Scalars['DateTime'];
}; };
/** An enumeration. */ export type AssignmentType = CoursePageInterface & {
export type AssignmentCompletionStatus = __typename?: 'AssignmentType';
| 'EVALUATION_IN_PROGRESS'
| 'EVALUATION_SUBMITTED'
| 'IN_PROGRESS'
| 'SUBMITTED';
export type AssignmentObjectType = CoursePageInterface & {
__typename?: 'AssignmentObjectType';
assignment_type: AssignmentAssignmentAssignmentTypeChoices; assignment_type: AssignmentAssignmentAssignmentTypeChoices;
content_type?: Maybe<Scalars['String']['output']>; content_type?: Maybe<Scalars['String']>;
/** Zeitaufwand als Text */ /** Zeitaufwand als Text */
effort_required: Scalars['String']['output']; effort_required: Scalars['String'];
/** Beschreibung der Bewertung */ /** Beschreibung der Bewertung */
evaluation_description: Scalars['String']['output']; evaluation_description: Scalars['String'];
/** URL zum Beurteilungsinstrument */ /** URL zum Beurteilungsinstrument */
evaluation_document_url: Scalars['String']['output']; evaluation_document_url: Scalars['String'];
evaluation_tasks?: Maybe<Scalars['JSONStreamField']['output']>; evaluation_tasks?: Maybe<Scalars['JSONStreamField']>;
frontend_url?: Maybe<Scalars['String']['output']>; frontend_url?: Maybe<Scalars['String']>;
id?: Maybe<Scalars['ID']['output']>; id?: Maybe<Scalars['ID']>;
/** Erläuterung der Ausgangslage */ /** Erläuterung der Ausgangslage */
intro_text: Scalars['String']['output']; intro_text: Scalars['String'];
live?: Maybe<Scalars['Boolean']['output']>; live?: Maybe<Scalars['Boolean']>;
performance_objectives?: Maybe<Scalars['JSONStreamField']['output']>; performance_objectives?: Maybe<Scalars['JSONStreamField']>;
slug?: Maybe<Scalars['String']['output']>; slug?: Maybe<Scalars['String']>;
tasks?: Maybe<Scalars['JSONStreamField']['output']>; tasks?: Maybe<Scalars['JSONStreamField']>;
title?: Maybe<Scalars['String']['output']>; title?: Maybe<Scalars['String']>;
translation_key?: Maybe<Scalars['String']['output']>; translation_key?: Maybe<Scalars['String']>;
};
export type AttendanceCourseUserMutation = {
__typename?: 'AttendanceCourseUserMutation';
course_session_attendance_course?: Maybe<CourseSessionAttendanceCourseType>;
};
export type AttendanceUserInputType = {
user_id?: InputMaybe<Scalars['ID']>;
};
export type AttendanceUserType = {
__typename?: 'AttendanceUserType';
email?: Maybe<Scalars['String']>;
first_name?: Maybe<Scalars['String']>;
last_name?: Maybe<Scalars['String']>;
user_id?: Maybe<Scalars['ID']>;
}; };
/** An enumeration. */ /** An enumeration. */
export type CoreUserLanguageChoices = export enum CoreUserLanguageChoices {
/** Deutsch */ /** Deutsch */
| 'DE' De = 'DE',
/** Français */ /** Français */
| 'FR' Fr = 'FR',
/** Italiano */ /** Italiano */
| 'IT'; It = 'IT'
}
export type CoursePageInterface = { export type CoursePageInterface = {
content_type?: Maybe<Scalars['String']['output']>; content_type?: Maybe<Scalars['String']>;
frontend_url?: Maybe<Scalars['String']['output']>; frontend_url?: Maybe<Scalars['String']>;
id?: Maybe<Scalars['ID']['output']>; id?: Maybe<Scalars['ID']>;
live?: Maybe<Scalars['Boolean']['output']>; live?: Maybe<Scalars['Boolean']>;
slug?: Maybe<Scalars['String']['output']>; slug?: Maybe<Scalars['String']>;
title?: Maybe<Scalars['String']['output']>; title?: Maybe<Scalars['String']>;
translation_key?: Maybe<Scalars['String']['output']>; translation_key?: Maybe<Scalars['String']>;
}; };
export type CourseSessionAttendanceCourseType = { export type CourseSessionAttendanceCourseType = {
__typename?: 'CourseSessionAttendanceCourseType'; __typename?: 'CourseSessionAttendanceCourseType';
attendance_user_list?: Maybe<Array<Maybe<AttendanceUserType>>>;
course_session_id?: Maybe<Scalars['ID']>;
due_date_id?: Maybe<Scalars['ID']>;
end?: Maybe<Scalars['DateTime']>; end?: Maybe<Scalars['DateTime']>;
id: Scalars['ID']; id: Scalars['ID'];
learning_content_id?: Maybe<Scalars['ID']>;
location: Scalars['String']; location: Scalars['String'];
start?: Maybe<Scalars['DateTime']>; start?: Maybe<Scalars['DateTime']>;
trainer: Scalars['String']; trainer: Scalars['String'];
@ -138,112 +153,119 @@ export type CourseSessionAttendanceCourseType = {
export type CourseType = { export type CourseType = {
__typename?: 'CourseType'; __typename?: 'CourseType';
category_name: Scalars['String']['output']; category_name: Scalars['String'];
id: Scalars['ID']['output']; id: Scalars['ID'];
learning_path?: Maybe<LearningPathType>; learning_path?: Maybe<LearningPathType>;
slug: Scalars['String']['output']; slug: Scalars['String'];
title: Scalars['String']['output']; title: Scalars['String'];
}; };
export type ErrorType = { export type ErrorType = {
__typename?: 'ErrorType'; __typename?: 'ErrorType';
field: Scalars['String']['output']; field: Scalars['String'];
messages: Array<Scalars['String']['output']>; messages: Array<Scalars['String']>;
}; };
export type FeedbackResponse = Node & { export type FeedbackResponse = Node & {
__typename?: 'FeedbackResponse'; __typename?: 'FeedbackResponse';
created_at: Scalars['DateTime']['output']; created_at: Scalars['DateTime'];
data?: Maybe<Scalars['GenericScalar']['output']>; data?: Maybe<Scalars['GenericScalar']>;
/** The ID of the object */ /** The ID of the object */
id: Scalars['ID']['output']; id: Scalars['ID'];
}; };
export type LearningPathType = CoursePageInterface & { export type LearningPathType = CoursePageInterface & {
__typename?: 'LearningPathType'; __typename?: 'LearningPathType';
content_type?: Maybe<Scalars['String']['output']>; content_type?: Maybe<Scalars['String']>;
depth: Scalars['Int']['output']; depth: Scalars['Int'];
draft_title: Scalars['String']['output']; draft_title: Scalars['String'];
expire_at?: Maybe<Scalars['DateTime']['output']>; expire_at?: Maybe<Scalars['DateTime']>;
expired: Scalars['Boolean']['output']; expired: Scalars['Boolean'];
first_published_at?: Maybe<Scalars['DateTime']['output']>; first_published_at?: Maybe<Scalars['DateTime']>;
frontend_url?: Maybe<Scalars['String']['output']>; frontend_url?: Maybe<Scalars['String']>;
go_live_at?: Maybe<Scalars['DateTime']['output']>; go_live_at?: Maybe<Scalars['DateTime']>;
has_unpublished_changes: Scalars['Boolean']['output']; has_unpublished_changes: Scalars['Boolean'];
id?: Maybe<Scalars['ID']['output']>; id?: Maybe<Scalars['ID']>;
last_published_at?: Maybe<Scalars['DateTime']['output']>; last_published_at?: Maybe<Scalars['DateTime']>;
latest_revision_created_at?: Maybe<Scalars['DateTime']['output']>; latest_revision_created_at?: Maybe<Scalars['DateTime']>;
live?: Maybe<Scalars['Boolean']['output']>; live?: Maybe<Scalars['Boolean']>;
locked: Scalars['Boolean']['output']; locked: Scalars['Boolean'];
locked_at?: Maybe<Scalars['DateTime']['output']>; locked_at?: Maybe<Scalars['DateTime']>;
locked_by?: Maybe<UserType>; locked_by?: Maybe<UserType>;
numchild: Scalars['Int']['output']; numchild: Scalars['Int'];
owner?: Maybe<UserType>; owner?: Maybe<UserType>;
path: Scalars['String']['output']; path: Scalars['String'];
/** Die informative Beschreibung, dargestellt in Suchmaschinen-Ergebnissen unter der Überschrift. */ /** Die informative Beschreibung, dargestellt in Suchmaschinen-Ergebnissen unter der Überschrift. */
search_description: Scalars['String']['output']; search_description: Scalars['String'];
/** Der Titel der Seite, dargestellt in Suchmaschinen-Ergebnissen als die verlinkte Überschrift. */ /** Der Titel der Seite, dargestellt in Suchmaschinen-Ergebnissen als die verlinkte Überschrift. */
seo_title: Scalars['String']['output']; seo_title: Scalars['String'];
/** Ob ein Link zu dieser Seite in automatisch generierten Menüs auftaucht. */ /** Ob ein Link zu dieser Seite in automatisch generierten Menüs auftaucht. */
show_in_menus: Scalars['Boolean']['output']; show_in_menus: Scalars['Boolean'];
slug?: Maybe<Scalars['String']['output']>; slug?: Maybe<Scalars['String']>;
title?: Maybe<Scalars['String']['output']>; title?: Maybe<Scalars['String']>;
translation_key?: Maybe<Scalars['String']['output']>; translation_key?: Maybe<Scalars['String']>;
url_path: Scalars['String']['output']; url_path: Scalars['String'];
}; };
export type Mutation = { export type Mutation = {
__typename?: 'Mutation'; __typename?: 'Mutation';
send_feedback?: Maybe<SendFeedbackPayload>; send_feedback?: Maybe<SendFeedbackPayload>;
update_course_session_attendance_course_users?: Maybe<AttendanceCourseUserMutation>;
upsert_assignment_completion?: Maybe<AssignmentCompletionMutation>; upsert_assignment_completion?: Maybe<AssignmentCompletionMutation>;
}; };
export type MutationSendFeedbackArgs = { export type MutationSend_FeedbackArgs = {
input: SendFeedbackInput; input: SendFeedbackInput;
}; };
export type MutationUpsertAssignmentCompletionArgs = { export type MutationUpdate_Course_Session_Attendance_Course_UsersArgs = {
assignment_id: Scalars['ID']['input']; attendance_user_list: Array<InputMaybe<AttendanceUserInputType>>;
assignment_user_id?: InputMaybe<Scalars['ID']['input']>; id: Scalars['ID'];
completion_data_string?: InputMaybe<Scalars['String']['input']>; };
completion_status?: InputMaybe<AssignmentCompletionStatus>;
course_session_id: Scalars['ID']['input'];
evaluation_grade?: InputMaybe<Scalars['Float']['input']>; export type MutationUpsert_Assignment_CompletionArgs = {
evaluation_points?: InputMaybe<Scalars['Float']['input']>; assignment_id: Scalars['ID'];
assignment_user_id?: InputMaybe<Scalars['ID']>;
completion_data_string?: InputMaybe<Scalars['String']>;
completion_status?: InputMaybe<Scalars['String']>;
course_session_id: Scalars['ID'];
evaluation_grade?: InputMaybe<Scalars['Float']>;
evaluation_points?: InputMaybe<Scalars['Float']>;
}; };
/** An object with an ID */ /** An object with an ID */
export type Node = { export type Node = {
/** The ID of the object */ /** The ID of the object */
id: Scalars['ID']['output']; id: Scalars['ID'];
}; };
export type Query = { export type Query = {
__typename?: 'Query'; __typename?: 'Query';
assignment?: Maybe<AssignmentObjectType>; assignment?: Maybe<AssignmentType>;
assignment_completion?: Maybe<AssignmentCompletionObjectType>; assignment_completion?: Maybe<AssignmentCompletionType>;
course?: Maybe<CourseType>; course?: Maybe<CourseType>;
course_session_attendance_course?: Maybe<CourseSessionAttendanceCourseType>; course_session_attendance_course?: Maybe<CourseSessionAttendanceCourseType>;
}; };
export type QueryAssignmentArgs = { export type QueryAssignmentArgs = {
id?: InputMaybe<Scalars['ID']['input']>; id?: InputMaybe<Scalars['ID']>;
slug?: InputMaybe<Scalars['String']['input']>; slug?: InputMaybe<Scalars['String']>;
}; };
export type QueryAssignmentCompletionArgs = { export type QueryAssignment_CompletionArgs = {
assignment_id: Scalars['ID']['input']; assignment_id: Scalars['ID'];
assignment_user_id?: InputMaybe<Scalars['ID']['input']>; assignment_user_id?: InputMaybe<Scalars['ID']>;
course_session_id: Scalars['ID']['input']; course_session_id: Scalars['ID'];
}; };
export type QueryCourseArgs = { export type QueryCourseArgs = {
id?: InputMaybe<Scalars['Int']['input']>; id?: InputMaybe<Scalars['Int']>;
}; };
@ -253,15 +275,15 @@ export type QueryCourse_Session_Attendance_CourseArgs = {
}; };
export type SendFeedbackInput = { export type SendFeedbackInput = {
clientMutationId?: InputMaybe<Scalars['String']['input']>; clientMutationId?: InputMaybe<Scalars['String']>;
course_session: Scalars['Int']['input']; course_session: Scalars['Int'];
data?: InputMaybe<Scalars['GenericScalar']['input']>; data?: InputMaybe<Scalars['GenericScalar']>;
page: Scalars['String']['input']; page: Scalars['String'];
}; };
export type SendFeedbackPayload = { export type SendFeedbackPayload = {
__typename?: 'SendFeedbackPayload'; __typename?: 'SendFeedbackPayload';
clientMutationId?: Maybe<Scalars['String']['output']>; clientMutationId?: Maybe<Scalars['String']>;
/** May contain more than one error for same field. */ /** May contain more than one error for same field. */
errors?: Maybe<Array<Maybe<ErrorType>>>; errors?: Maybe<Array<Maybe<ErrorType>>>;
feedback_response?: Maybe<FeedbackResponse>; feedback_response?: Maybe<FeedbackResponse>;
@ -269,14 +291,14 @@ export type SendFeedbackPayload = {
export type UserType = { export type UserType = {
__typename?: 'UserType'; __typename?: 'UserType';
avatar_url: Scalars['String']['output']; avatar_url: Scalars['String'];
email: Scalars['String']['output']; email: Scalars['String'];
first_name: Scalars['String']['output']; first_name: Scalars['String'];
id: Scalars['ID']['output']; id: Scalars['ID'];
language: CoreUserLanguageChoices; language: CoreUserLanguageChoices;
last_name: Scalars['String']['output']; last_name: Scalars['String'];
/** Erforderlich. 150 Zeichen oder weniger. Nur Buchstaben, Ziffern und @/./+/-/_. */ /** Erforderlich. 150 Zeichen oder weniger. Nur Buchstaben, Ziffern und @/./+/-/_. */
username: Scalars['String']['output']; username: Scalars['String'];
}; };
export type SendFeedbackMutationMutationVariables = Exact<{ export type SendFeedbackMutationMutationVariables = Exact<{
@ -287,29 +309,29 @@ export type SendFeedbackMutationMutationVariables = Exact<{
export type SendFeedbackMutationMutation = { __typename?: 'Mutation', send_feedback?: { __typename?: 'SendFeedbackPayload', feedback_response?: { __typename?: 'FeedbackResponse', id: string } | null, errors?: Array<{ __typename?: 'ErrorType', field: string, messages: Array<string> } | null> | null } | null }; export type SendFeedbackMutationMutation = { __typename?: 'Mutation', send_feedback?: { __typename?: 'SendFeedbackPayload', feedback_response?: { __typename?: 'FeedbackResponse', id: string } | null, errors?: Array<{ __typename?: 'ErrorType', field: string, messages: Array<string> } | null> | null } | null };
export type UpsertAssignmentCompletionMutationVariables = Exact<{ export type UpsertAssignmentCompletionMutationVariables = Exact<{
assignmentId: Scalars['ID']['input']; assignmentId: Scalars['ID'];
courseSessionId: Scalars['ID']['input']; courseSessionId: Scalars['ID'];
assignmentUserId?: InputMaybe<Scalars['ID']['input']>; assignmentUserId?: InputMaybe<Scalars['ID']>;
completionStatus: AssignmentCompletionStatus; completionStatus: Scalars['String'];
completionDataString: Scalars['String']['input']; completionDataString: Scalars['String'];
evaluationGrade?: InputMaybe<Scalars['Float']['input']>; evaluationGrade?: InputMaybe<Scalars['Float']>;
evaluationPoints?: InputMaybe<Scalars['Float']['input']>; evaluationPoints?: InputMaybe<Scalars['Float']>;
}>; }>;
export type UpsertAssignmentCompletionMutation = { __typename?: 'Mutation', upsert_assignment_completion?: { __typename?: 'AssignmentCompletionMutation', assignment_completion?: { __typename?: 'AssignmentCompletionObjectType', id: string, completion_status: AssignmentAssignmentCompletionCompletionStatusChoices, submitted_at?: any | null, evaluation_submitted_at?: any | null, evaluation_grade?: number | null, evaluation_points?: number | null, completion_data?: any | null } | null } | null }; export type UpsertAssignmentCompletionMutation = { __typename?: 'Mutation', upsert_assignment_completion?: { __typename?: 'AssignmentCompletionMutation', assignment_completion?: { __typename?: 'AssignmentCompletionType', id: string, completion_status: AssignmentAssignmentCompletionCompletionStatusChoices, submitted_at?: any | null, evaluation_submitted_at?: any | null, evaluation_grade?: number | null, evaluation_points?: number | null, completion_data?: any | null } | null } | null };
export type AssignmentCompletionQueryQueryVariables = Exact<{ export type AssignmentCompletionQueryQueryVariables = Exact<{
assignmentId: Scalars['ID']['input']; assignmentId: Scalars['ID'];
courseSessionId: Scalars['ID']['input']; courseSessionId: Scalars['ID'];
assignmentUserId?: InputMaybe<Scalars['ID']['input']>; assignmentUserId?: InputMaybe<Scalars['ID']>;
}>; }>;
export type AssignmentCompletionQueryQuery = { __typename?: 'Query', assignment?: { __typename?: 'AssignmentObjectType', assignment_type: AssignmentAssignmentAssignmentTypeChoices, content_type?: string | null, effort_required: string, evaluation_description: string, evaluation_document_url: string, evaluation_tasks?: any | null, id?: string | null, intro_text: string, performance_objectives?: any | null, slug?: string | null, tasks?: any | null, title?: string | null, translation_key?: string | null } | null, assignment_completion?: { __typename?: 'AssignmentCompletionObjectType', id: string, completion_status: AssignmentAssignmentCompletionCompletionStatusChoices, submitted_at?: any | null, evaluation_submitted_at?: any | null, evaluation_grade?: number | null, evaluation_points?: number | null, completion_data?: any | null, evaluation_user?: { __typename?: 'UserType', id: string } | null, assignment_user: { __typename?: 'UserType', id: string } } | null }; export type AssignmentCompletionQueryQuery = { __typename?: 'Query', assignment?: { __typename?: 'AssignmentType', assignment_type: AssignmentAssignmentAssignmentTypeChoices, content_type?: string | null, effort_required: string, evaluation_description: string, evaluation_document_url: string, evaluation_tasks?: any | null, id?: string | null, intro_text: string, performance_objectives?: any | null, slug?: string | null, tasks?: any | null, title?: string | null, translation_key?: string | null } | null, assignment_completion?: { __typename?: 'AssignmentCompletionType', id: string, completion_status: AssignmentAssignmentCompletionCompletionStatusChoices, submitted_at?: any | null, evaluation_submitted_at?: any | null, evaluation_grade?: number | null, evaluation_points?: number | null, completion_data?: any | null, evaluation_user?: { __typename?: 'UserType', id: string } | null, assignment_user: { __typename?: 'UserType', id: string } } | null };
export type CourseQueryQueryVariables = Exact<{ export type CourseQueryQueryVariables = Exact<{
courseId: Scalars['Int']['input']; courseId: Scalars['Int'];
}>; }>;
@ -317,6 +339,6 @@ export type CourseQueryQuery = { __typename?: 'Query', course?: { __typename?: '
export const SendFeedbackMutationDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"SendFeedbackMutation"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"input"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"SendFeedbackInput"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"send_feedback"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"input"},"value":{"kind":"Variable","name":{"kind":"Name","value":"input"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"feedback_response"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}}]}},{"kind":"Field","name":{"kind":"Name","value":"errors"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"field"}},{"kind":"Field","name":{"kind":"Name","value":"messages"}}]}}]}}]}}]} as unknown as DocumentNode<SendFeedbackMutationMutation, SendFeedbackMutationMutationVariables>; export const SendFeedbackMutationDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"SendFeedbackMutation"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"input"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"SendFeedbackInput"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"send_feedback"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"input"},"value":{"kind":"Variable","name":{"kind":"Name","value":"input"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"feedback_response"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}}]}},{"kind":"Field","name":{"kind":"Name","value":"errors"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"field"}},{"kind":"Field","name":{"kind":"Name","value":"messages"}}]}}]}}]}}]} as unknown as DocumentNode<SendFeedbackMutationMutation, SendFeedbackMutationMutationVariables>;
export const UpsertAssignmentCompletionDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"UpsertAssignmentCompletion"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"assignmentId"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"ID"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"courseSessionId"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"ID"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"assignmentUserId"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"ID"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"completionStatus"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"AssignmentCompletionStatus"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"completionDataString"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"evaluationGrade"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"Float"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"evaluationPoints"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"Float"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"upsert_assignment_completion"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"assignment_id"},"value":{"kind":"Variable","name":{"kind":"Name","value":"assignmentId"}}},{"kind":"Argument","name":{"kind":"Name","value":"course_session_id"},"value":{"kind":"Variable","name":{"kind":"Name","value":"courseSessionId"}}},{"kind":"Argument","name":{"kind":"Name","value":"assignment_user_id"},"value":{"kind":"Variable","name":{"kind":"Name","value":"assignmentUserId"}}},{"kind":"Argument","name":{"kind":"Name","value":"completion_status"},"value":{"kind":"Variable","name":{"kind":"Name","value":"completionStatus"}}},{"kind":"Argument","name":{"kind":"Name","value":"completion_data_string"},"value":{"kind":"Variable","name":{"kind":"Name","value":"completionDataString"}}},{"kind":"Argument","name":{"kind":"Name","value":"evaluation_grade"},"value":{"kind":"Variable","name":{"kind":"Name","value":"evaluationGrade"}}},{"kind":"Argument","name":{"kind":"Name","value":"evaluation_points"},"value":{"kind":"Variable","name":{"kind":"Name","value":"evaluationPoints"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"assignment_completion"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"completion_status"}},{"kind":"Field","name":{"kind":"Name","value":"submitted_at"}},{"kind":"Field","name":{"kind":"Name","value":"evaluation_submitted_at"}},{"kind":"Field","name":{"kind":"Name","value":"evaluation_grade"}},{"kind":"Field","name":{"kind":"Name","value":"evaluation_points"}},{"kind":"Field","name":{"kind":"Name","value":"completion_data"}}]}}]}}]}}]} as unknown as DocumentNode<UpsertAssignmentCompletionMutation, UpsertAssignmentCompletionMutationVariables>; export const UpsertAssignmentCompletionDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"UpsertAssignmentCompletion"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"assignmentId"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"ID"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"courseSessionId"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"ID"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"assignmentUserId"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"ID"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"completionStatus"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"completionDataString"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"evaluationGrade"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"Float"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"evaluationPoints"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"Float"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"upsert_assignment_completion"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"assignment_id"},"value":{"kind":"Variable","name":{"kind":"Name","value":"assignmentId"}}},{"kind":"Argument","name":{"kind":"Name","value":"course_session_id"},"value":{"kind":"Variable","name":{"kind":"Name","value":"courseSessionId"}}},{"kind":"Argument","name":{"kind":"Name","value":"assignment_user_id"},"value":{"kind":"Variable","name":{"kind":"Name","value":"assignmentUserId"}}},{"kind":"Argument","name":{"kind":"Name","value":"completion_status"},"value":{"kind":"Variable","name":{"kind":"Name","value":"completionStatus"}}},{"kind":"Argument","name":{"kind":"Name","value":"completion_data_string"},"value":{"kind":"Variable","name":{"kind":"Name","value":"completionDataString"}}},{"kind":"Argument","name":{"kind":"Name","value":"evaluation_grade"},"value":{"kind":"Variable","name":{"kind":"Name","value":"evaluationGrade"}}},{"kind":"Argument","name":{"kind":"Name","value":"evaluation_points"},"value":{"kind":"Variable","name":{"kind":"Name","value":"evaluationPoints"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"assignment_completion"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"completion_status"}},{"kind":"Field","name":{"kind":"Name","value":"submitted_at"}},{"kind":"Field","name":{"kind":"Name","value":"evaluation_submitted_at"}},{"kind":"Field","name":{"kind":"Name","value":"evaluation_grade"}},{"kind":"Field","name":{"kind":"Name","value":"evaluation_points"}},{"kind":"Field","name":{"kind":"Name","value":"completion_data"}}]}}]}}]}}]} as unknown as DocumentNode<UpsertAssignmentCompletionMutation, UpsertAssignmentCompletionMutationVariables>;
export const AssignmentCompletionQueryDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"assignmentCompletionQuery"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"assignmentId"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"ID"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"courseSessionId"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"ID"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"assignmentUserId"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"ID"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"assignment"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"id"},"value":{"kind":"Variable","name":{"kind":"Name","value":"assignmentId"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"assignment_type"}},{"kind":"Field","name":{"kind":"Name","value":"content_type"}},{"kind":"Field","name":{"kind":"Name","value":"effort_required"}},{"kind":"Field","name":{"kind":"Name","value":"evaluation_description"}},{"kind":"Field","name":{"kind":"Name","value":"evaluation_document_url"}},{"kind":"Field","name":{"kind":"Name","value":"evaluation_tasks"}},{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"intro_text"}},{"kind":"Field","name":{"kind":"Name","value":"performance_objectives"}},{"kind":"Field","name":{"kind":"Name","value":"slug"}},{"kind":"Field","name":{"kind":"Name","value":"tasks"}},{"kind":"Field","name":{"kind":"Name","value":"title"}},{"kind":"Field","name":{"kind":"Name","value":"translation_key"}}]}},{"kind":"Field","name":{"kind":"Name","value":"assignment_completion"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"assignment_id"},"value":{"kind":"Variable","name":{"kind":"Name","value":"assignmentId"}}},{"kind":"Argument","name":{"kind":"Name","value":"course_session_id"},"value":{"kind":"Variable","name":{"kind":"Name","value":"courseSessionId"}}},{"kind":"Argument","name":{"kind":"Name","value":"assignment_user_id"},"value":{"kind":"Variable","name":{"kind":"Name","value":"assignmentUserId"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"completion_status"}},{"kind":"Field","name":{"kind":"Name","value":"submitted_at"}},{"kind":"Field","name":{"kind":"Name","value":"evaluation_submitted_at"}},{"kind":"Field","name":{"kind":"Name","value":"evaluation_user"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}}]}},{"kind":"Field","name":{"kind":"Name","value":"assignment_user"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}}]}},{"kind":"Field","name":{"kind":"Name","value":"evaluation_grade"}},{"kind":"Field","name":{"kind":"Name","value":"evaluation_points"}},{"kind":"Field","name":{"kind":"Name","value":"completion_data"}}]}}]}}]} as unknown as DocumentNode<AssignmentCompletionQueryQuery, AssignmentCompletionQueryQueryVariables>; export const AssignmentCompletionQueryDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"assignmentCompletionQuery"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"assignmentId"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"ID"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"courseSessionId"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"ID"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"assignmentUserId"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"ID"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"assignment"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"id"},"value":{"kind":"Variable","name":{"kind":"Name","value":"assignmentId"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"assignment_type"}},{"kind":"Field","name":{"kind":"Name","value":"content_type"}},{"kind":"Field","name":{"kind":"Name","value":"effort_required"}},{"kind":"Field","name":{"kind":"Name","value":"evaluation_description"}},{"kind":"Field","name":{"kind":"Name","value":"evaluation_document_url"}},{"kind":"Field","name":{"kind":"Name","value":"evaluation_tasks"}},{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"intro_text"}},{"kind":"Field","name":{"kind":"Name","value":"performance_objectives"}},{"kind":"Field","name":{"kind":"Name","value":"slug"}},{"kind":"Field","name":{"kind":"Name","value":"tasks"}},{"kind":"Field","name":{"kind":"Name","value":"title"}},{"kind":"Field","name":{"kind":"Name","value":"translation_key"}}]}},{"kind":"Field","name":{"kind":"Name","value":"assignment_completion"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"assignment_id"},"value":{"kind":"Variable","name":{"kind":"Name","value":"assignmentId"}}},{"kind":"Argument","name":{"kind":"Name","value":"course_session_id"},"value":{"kind":"Variable","name":{"kind":"Name","value":"courseSessionId"}}},{"kind":"Argument","name":{"kind":"Name","value":"assignment_user_id"},"value":{"kind":"Variable","name":{"kind":"Name","value":"assignmentUserId"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"completion_status"}},{"kind":"Field","name":{"kind":"Name","value":"submitted_at"}},{"kind":"Field","name":{"kind":"Name","value":"evaluation_submitted_at"}},{"kind":"Field","name":{"kind":"Name","value":"evaluation_user"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}}]}},{"kind":"Field","name":{"kind":"Name","value":"assignment_user"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}}]}},{"kind":"Field","name":{"kind":"Name","value":"evaluation_grade"}},{"kind":"Field","name":{"kind":"Name","value":"evaluation_points"}},{"kind":"Field","name":{"kind":"Name","value":"completion_data"}}]}}]}}]} as unknown as DocumentNode<AssignmentCompletionQueryQuery, AssignmentCompletionQueryQueryVariables>;
export const CourseQueryDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"courseQuery"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"courseId"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"Int"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"course"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"id"},"value":{"kind":"Variable","name":{"kind":"Name","value":"courseId"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"slug"}},{"kind":"Field","name":{"kind":"Name","value":"title"}},{"kind":"Field","name":{"kind":"Name","value":"category_name"}},{"kind":"Field","name":{"kind":"Name","value":"learning_path"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}}]}}]}}]}}]} as unknown as DocumentNode<CourseQueryQuery, CourseQueryQueryVariables>; export const CourseQueryDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"courseQuery"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"courseId"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"Int"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"course"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"id"},"value":{"kind":"Variable","name":{"kind":"Name","value":"courseId"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"slug"}},{"kind":"Field","name":{"kind":"Name","value":"title"}},{"kind":"Field","name":{"kind":"Name","value":"category_name"}},{"kind":"Field","name":{"kind":"Name","value":"learning_path"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}}]}}]}}]}}]} as unknown as DocumentNode<CourseQueryQuery, CourseQueryQueryVariables>;

View File

@ -1,16 +1,20 @@
type Query { type Query {
course_session_attendance_course(id: ID!, assignment_user_id: ID): CourseSessionAttendanceCourseType course_session_attendance_course(id: ID!, assignment_user_id: ID): CourseSessionAttendanceCourseType
course(id: Int): CourseType course(id: Int): CourseType
assignment(id: ID, slug: String): AssignmentObjectType assignment(id: ID, slug: String): AssignmentType
assignment_completion(assignment_id: ID!, course_session_id: ID!, assignment_user_id: ID): AssignmentCompletionObjectType assignment_completion(assignment_id: ID!, course_session_id: ID!, assignment_user_id: ID): AssignmentCompletionType
} }
type CourseSessionAttendanceCourseType { type CourseSessionAttendanceCourseType {
id: ID! id: ID!
location: String! location: String!
trainer: String! trainer: String!
course_session_id: ID
learning_content_id: ID
due_date_id: ID
end: DateTime end: DateTime
start: DateTime start: DateTime
attendance_user_list: [AttendanceUserType]
} }
""" """
@ -20,6 +24,13 @@ value as specified by
""" """
scalar DateTime scalar DateTime
type AttendanceUserType {
user_id: ID
first_name: String
last_name: String
email: String
}
type CourseType { type CourseType {
id: ID! id: ID!
title: String! title: String!
@ -105,7 +116,7 @@ enum CoreUserLanguageChoices {
IT IT
} }
type AssignmentObjectType implements CoursePageInterface { type AssignmentType implements CoursePageInterface {
assignment_type: AssignmentAssignmentAssignmentTypeChoices! assignment_type: AssignmentAssignmentAssignmentTypeChoices!
"""Erläuterung der Ausgangslage""" """Erläuterung der Ausgangslage"""
@ -145,7 +156,7 @@ enum AssignmentAssignmentAssignmentTypeChoices {
scalar JSONStreamField scalar JSONStreamField
type AssignmentCompletionObjectType { type AssignmentCompletionType {
id: ID! id: ID!
created_at: DateTime! created_at: DateTime!
updated_at: DateTime! updated_at: DateTime!
@ -155,7 +166,7 @@ type AssignmentCompletionObjectType {
evaluation_grade: Float evaluation_grade: Float
evaluation_points: Float evaluation_points: Float
assignment_user: UserType! assignment_user: UserType!
assignment: AssignmentObjectType! assignment: AssignmentType!
completion_status: AssignmentAssignmentCompletionCompletionStatusChoices! completion_status: AssignmentAssignmentCompletionCompletionStatusChoices!
completion_data: GenericScalar completion_data: GenericScalar
additional_json_data: JSONString! additional_json_data: JSONString!
@ -193,7 +204,8 @@ scalar JSONString
type Mutation { type Mutation {
send_feedback(input: SendFeedbackInput!): SendFeedbackPayload send_feedback(input: SendFeedbackInput!): SendFeedbackPayload
upsert_assignment_completion(assignment_id: ID!, assignment_user_id: ID, completion_data_string: String, completion_status: AssignmentCompletionStatus, course_session_id: ID!, evaluation_grade: Float, evaluation_points: Float): AssignmentCompletionMutation update_course_session_attendance_course_users(attendance_user_list: [AttendanceUserInputType]!, id: ID!): AttendanceCourseUserMutation
upsert_assignment_completion(assignment_id: ID!, assignment_user_id: ID, completion_data_string: String, completion_status: String, course_session_id: ID!, evaluation_grade: Float, evaluation_points: Float): AssignmentCompletionMutation
} }
type SendFeedbackPayload { type SendFeedbackPayload {
@ -229,14 +241,14 @@ input SendFeedbackInput {
clientMutationId: String clientMutationId: String
} }
type AssignmentCompletionMutation { type AttendanceCourseUserMutation {
assignment_completion: AssignmentCompletionObjectType course_session_attendance_course: CourseSessionAttendanceCourseType
} }
"""An enumeration.""" input AttendanceUserInputType {
enum AssignmentCompletionStatus { user_id: ID
IN_PROGRESS }
SUBMITTED
EVALUATION_IN_PROGRESS type AssignmentCompletionMutation {
EVALUATION_SUBMITTED assignment_completion: AssignmentCompletionType
} }

View File

@ -3,6 +3,7 @@ import graphene
from vbv_lernwelt.assignment.graphql.mutations import AssignmentMutation from vbv_lernwelt.assignment.graphql.mutations import AssignmentMutation
from vbv_lernwelt.assignment.graphql.queries import AssignmentQuery from vbv_lernwelt.assignment.graphql.queries import AssignmentQuery
from vbv_lernwelt.course.schema import CourseQuery from vbv_lernwelt.course.schema import CourseQuery
from vbv_lernwelt.course_session.graphql.mutations import CourseSessionMutation
from vbv_lernwelt.course_session.graphql.queries import CourseSessionQuery from vbv_lernwelt.course_session.graphql.queries import CourseSessionQuery
from vbv_lernwelt.feedback.graphql.mutations import FeedbackMutation from vbv_lernwelt.feedback.graphql.mutations import FeedbackMutation
@ -11,7 +12,9 @@ class Query(AssignmentQuery, CourseQuery, CourseSessionQuery, graphene.ObjectTyp
pass pass
class Mutation(AssignmentMutation, FeedbackMutation, graphene.ObjectType): class Mutation(
AssignmentMutation, CourseSessionMutation, FeedbackMutation, graphene.ObjectType
):
pass pass

View File

@ -1,5 +1,4 @@
import json import json
import random
from datetime import datetime, timedelta from datetime import datetime, timedelta
import wagtail_factories import wagtail_factories
@ -41,6 +40,7 @@ from vbv_lernwelt.course_session.models import (
CourseSessionAssignment, CourseSessionAssignment,
CourseSessionAttendanceCourse, CourseSessionAttendanceCourse,
) )
from vbv_lernwelt.duedate.models import DueDate
from vbv_lernwelt.learnpath.models import ( from vbv_lernwelt.learnpath.models import (
Circle, Circle,
LearningContentAssignment, LearningContentAssignment,
@ -98,6 +98,31 @@ def create_test_course(include_uk=True, include_vv=True, with_sessions=False):
id=TEST_COURSE_SESSION_BERN_ID, id=TEST_COURSE_SESSION_BERN_ID,
start_date=now, start_date=now,
) )
CourseSessionAttendanceCourse.objects.create(
course_session=cs_bern,
learning_content=LearningContentAttendanceCourse.objects.get(
slug="test-lehrgang-lp-circle-fahrzeug-lc-präsenzkurs-fahrzeug"
),
due_date=DueDate.objects.create(
course_session=cs_bern,
start=timezone.make_aware(
(datetime.now() + timedelta(days=15)).replace(
hour=10, minute=30, second=0, microsecond=0
)
),
end=timezone.make_aware(
(datetime.now() + timedelta(days=15)).replace(
hour=17, minute=30, second=0, microsecond=0
)
),
page=LearningContentAttendanceCourse.objects.get(
slug="test-lehrgang-lp-circle-fahrzeug-lc-präsenzkurs-fahrzeug"
),
),
location="Handelsschule KV Bern, Zimmer 123, Eigerstrasse 16, 3012 Bern",
trainer="Roland Grossenbacher, roland.grossenbacher@helvetia.ch",
)
cs_zurich = CourseSession.objects.create( cs_zurich = CourseSession.objects.create(
course_id=COURSE_TEST_ID, course_id=COURSE_TEST_ID,
title="Test Zürich 2022 a", title="Test Zürich 2022 a",

View File

@ -1,7 +1,64 @@
import graphene
import structlog import structlog
from rest_framework.exceptions import PermissionDenied
from vbv_lernwelt.core.models import User
from vbv_lernwelt.course.permissions import has_course_access
from vbv_lernwelt.course_session.graphql.types import CourseSessionAttendanceCourseType
from vbv_lernwelt.course_session.models import CourseSessionAttendanceCourse
logger = structlog.get_logger(__name__) logger = structlog.get_logger(__name__)
class AttendanceUserInputType(graphene.InputObjectType):
user_id = graphene.ID(required=True)
class AttendanceCourseUserMutation(graphene.Mutation):
course_session_attendance_course = graphene.Field(CourseSessionAttendanceCourseType)
class Input:
id = graphene.ID(required=True)
attendance_user_list = graphene.List(AttendanceUserInputType, required=True)
@classmethod
def mutate(
cls,
root,
info,
id,
attendance_user_list,
):
attendance_course = CourseSessionAttendanceCourse.objects.get(id=id)
if not has_course_access(
info.context.user,
attendance_course.course_session.course_id,
):
raise PermissionDenied()
# FIXME: create completion for every user in attendance_user_list
result_user_list = []
for attendance_user in attendance_user_list:
u = User.objects.filter(id=attendance_user.user_id).first()
if u is not None:
result_user_list.append(
{
"user_id": u.id,
"email": u.email,
"first_name": u.first_name,
"last_name": u.last_name,
}
)
attendance_course.attendance_user_list = result_user_list
attendance_course.save()
return AttendanceCourseUserMutation(
course_session_attendance_course=attendance_course
)
class CourseSessionMutation: class CourseSessionMutation:
pass update_course_session_attendance_course_users = AttendanceCourseUserMutation.Field()

View File

@ -4,12 +4,22 @@ from graphene_django import DjangoObjectType
from vbv_lernwelt.course_session.models import CourseSessionAttendanceCourse from vbv_lernwelt.course_session.models import CourseSessionAttendanceCourse
class AttendanceUserType(graphene.ObjectType):
user_id = graphene.ID()
first_name = graphene.String()
last_name = graphene.String()
email = graphene.String()
class CourseSessionAttendanceCourseType(DjangoObjectType): class CourseSessionAttendanceCourseType(DjangoObjectType):
course_session_id = graphene.ID(source="course_session_id") course_session_id = graphene.ID(source="course_session_id")
learning_content_id = graphene.ID(source="learning_content_id") learning_content_id = graphene.ID(source="learning_content_id")
due_date_id = graphene.ID(source="due_date_id") due_date_id = graphene.ID(source="due_date_id")
end = graphene.DateTime() end = graphene.DateTime()
start = graphene.DateTime() start = graphene.DateTime()
attendance_user_list = graphene.List(
AttendanceUserType, source="attendance_user_list"
)
class Meta: class Meta:
model = CourseSessionAttendanceCourse model = CourseSessionAttendanceCourse
@ -22,7 +32,6 @@ class CourseSessionAttendanceCourseType(DjangoObjectType):
"trainer", "trainer",
"start", "start",
"end", "end",
# "attendance_user_list",
) )
def resolve_start(self, info): def resolve_start(self, info):

View File

@ -0,0 +1,18 @@
# Generated by Django 3.2.13 on 2023-06-23 15:17
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("course_session", "0001_initial"),
]
operations = [
migrations.AddField(
model_name="coursesessionattendancecourse",
name="attendance_user_list",
field=models.JSONField(default=list),
),
]

View File

@ -29,6 +29,11 @@ class CourseSessionAttendanceCourse(models.Model):
location = models.CharField(max_length=255, blank=True, default="") location = models.CharField(max_length=255, blank=True, default="")
trainer = models.CharField(max_length=255, blank=True, default="") trainer = models.CharField(max_length=255, blank=True, default="")
# because the attendance list is more of a snapshot of the current state
# we will store the attendance list as a JSONField
# the important field of the list type is "user_id"
attendance_user_list = models.JSONField(default=list)
def save(self, *args, **kwargs): def save(self, *args, **kwargs):
if not self.pk: if not self.pk:
title = "" title = ""

View File

@ -2,25 +2,93 @@ import json
from graphene_django.utils.testing import GraphQLTestCase from graphene_django.utils.testing import GraphQLTestCase
from vbv_lernwelt.core.create_default_users import create_default_users
from vbv_lernwelt.core.models import User
from vbv_lernwelt.course.creators.test_course import create_test_course
from vbv_lernwelt.course.models import CourseSession
class MyFancyTestCase(GraphQLTestCase):
def test_some_query(self): class AttendanceCourseUserMutationTestCase(GraphQLTestCase):
GRAPHQL_URL = "/server/graphql/"
def setUp(self):
create_default_users()
create_test_course(include_vv=False, with_sessions=True)
self.course_session = CourseSession.objects.get(title="Test Bern 2022 a")
self.attendance_course = (
self.course_session.coursesessionattendancecourse_set.first()
)
self.trainer = User.objects.get(username="test-trainer1@example.com")
self.client.force_login(self.trainer)
def test_simple_query(self):
response = self.query( response = self.query(
""" """
query { {
myModel { course_session_attendance_course(id:1) {
id id
name trainer
} }
} }
""", """
op_name="myModel",
) )
content = json.loads(response.content) content = json.loads(response.content)
# This validates the status code and if you get errors self.assertResponseNoErrors(response)
self.assertEqual(
content["data"]["course_session_attendance_course"]["trainer"],
"Roland Grossenbacher, roland.grossenbacher@helvetia.ch",
)
def test_mutation_add_user_when_present(self):
student = User.objects.get(username="test-student1@example.com")
query = f"""
mutation {{
update_course_session_attendance_course_users(
id:1,
attendance_user_list:[
{{user_id: {student.id}}},
{{user_id: "123123123"}}
]
) {{
course_session_attendance_course {{
id
attendance_user_list {{
user_id
first_name
last_name
email
}}
}}
}}
}}
"""
print(query)
response = self.query(query)
self.assertResponseNoErrors(response) self.assertResponseNoErrors(response)
# Add some more asserts if you like data = json.loads(response.content)
...
self.maxDiff = None
self.assertDictEqual(
{
"data": {
"update_course_session_attendance_course_users": {
"course_session_attendance_course": {
"id": str(self.attendance_course.id),
"attendance_user_list": [
{
"user_id": str(student.id),
"first_name": student.first_name,
"last_name": student.last_name,
"email": student.email,
}
],
}
}
}
},
data,
)