VBV-525: Refactor feedback submission
This commit is contained in:
parent
ce15054340
commit
70655935b0
|
|
@ -13,7 +13,6 @@ import type { TypedDocumentNode as DocumentNode } from '@graphql-typed-document-
|
||||||
* Therefore it is highly recommended to use the babel or swc plugin for production.
|
* Therefore it is highly recommended to use the babel or swc plugin for production.
|
||||||
*/
|
*/
|
||||||
const documents = {
|
const documents = {
|
||||||
"\n mutation SendFeedbackMutation($input: SendFeedbackInput!) {\n send_feedback(input: $input) {\n feedback_response {\n id\n }\n errors {\n field\n messages\n }\n }\n }\n": types.SendFeedbackMutationDocument,
|
|
||||||
"\n mutation AttendanceCheckMutation(\n $attendanceCourseId: ID!\n $attendanceUserList: [AttendanceUserInputType]!\n ) {\n update_course_session_attendance_course_users(\n id: $attendanceCourseId\n attendance_user_list: $attendanceUserList\n ) {\n course_session_attendance_course {\n id\n attendance_user_list {\n user_id\n first_name\n last_name\n email\n status\n }\n }\n }\n }\n": types.AttendanceCheckMutationDocument,
|
"\n mutation AttendanceCheckMutation(\n $attendanceCourseId: ID!\n $attendanceUserList: [AttendanceUserInputType]!\n ) {\n update_course_session_attendance_course_users(\n id: $attendanceCourseId\n attendance_user_list: $attendanceUserList\n ) {\n course_session_attendance_course {\n id\n attendance_user_list {\n user_id\n first_name\n last_name\n email\n status\n }\n }\n }\n }\n": types.AttendanceCheckMutationDocument,
|
||||||
"\n mutation UpsertAssignmentCompletion(\n $assignmentId: ID!\n $courseSessionId: ID!\n $learningContentId: ID\n $assignmentUserId: UUID\n $completionStatus: AssignmentCompletionStatus!\n $completionDataString: String!\n $evaluationGrade: Float\n $evaluationPoints: Float\n $initializeCompletion: Boolean\n ) {\n upsert_assignment_completion(\n assignment_id: $assignmentId\n course_session_id: $courseSessionId\n learning_content_page_id: $learningContentId\n assignment_user_id: $assignmentUserId\n completion_status: $completionStatus\n completion_data_string: $completionDataString\n evaluation_grade: $evaluationGrade\n evaluation_points: $evaluationPoints\n initialize_completion: $initializeCompletion\n ) {\n assignment_completion {\n id\n completion_status\n submitted_at\n evaluation_submitted_at\n evaluation_grade\n evaluation_points\n completion_data\n }\n }\n }\n": types.UpsertAssignmentCompletionDocument,
|
"\n mutation UpsertAssignmentCompletion(\n $assignmentId: ID!\n $courseSessionId: ID!\n $learningContentId: ID\n $assignmentUserId: UUID\n $completionStatus: AssignmentCompletionStatus!\n $completionDataString: String!\n $evaluationGrade: Float\n $evaluationPoints: Float\n $initializeCompletion: Boolean\n ) {\n upsert_assignment_completion(\n assignment_id: $assignmentId\n course_session_id: $courseSessionId\n learning_content_page_id: $learningContentId\n assignment_user_id: $assignmentUserId\n completion_status: $completionStatus\n completion_data_string: $completionDataString\n evaluation_grade: $evaluationGrade\n evaluation_points: $evaluationPoints\n initialize_completion: $initializeCompletion\n ) {\n assignment_completion {\n id\n completion_status\n submitted_at\n evaluation_submitted_at\n evaluation_grade\n evaluation_points\n completion_data\n }\n }\n }\n": types.UpsertAssignmentCompletionDocument,
|
||||||
"\n fragment CoursePageFields on CoursePageInterface {\n title\n id\n slug\n content_type\n frontend_url\n }\n": types.CoursePageFieldsFragmentDoc,
|
"\n fragment CoursePageFields on CoursePageInterface {\n title\n id\n slug\n content_type\n frontend_url\n }\n": types.CoursePageFieldsFragmentDoc,
|
||||||
|
|
@ -21,6 +20,7 @@ const documents = {
|
||||||
"\n query assignmentCompletionQuery(\n $assignmentId: ID!\n $courseSessionId: ID!\n $learningContentId: ID\n $assignmentUserId: UUID\n ) {\n assignment(id: $assignmentId) {\n assignment_type\n max_points\n content_type\n effort_required\n evaluation_description\n evaluation_document_url\n evaluation_tasks\n id\n intro_text\n performance_objectives\n slug\n tasks\n title\n translation_key\n competence_certificate {\n ...CoursePageFields\n }\n }\n assignment_completion(\n assignment_id: $assignmentId\n course_session_id: $courseSessionId\n assignment_user_id: $assignmentUserId\n learning_content_page_id: $learningContentId\n ) {\n id\n completion_status\n submitted_at\n evaluation_submitted_at\n evaluation_user {\n id\n }\n assignment_user {\n id\n }\n evaluation_grade\n evaluation_points\n completion_data\n }\n }\n": types.AssignmentCompletionQueryDocument,
|
"\n query assignmentCompletionQuery(\n $assignmentId: ID!\n $courseSessionId: ID!\n $learningContentId: ID\n $assignmentUserId: UUID\n ) {\n assignment(id: $assignmentId) {\n assignment_type\n max_points\n content_type\n effort_required\n evaluation_description\n evaluation_document_url\n evaluation_tasks\n id\n intro_text\n performance_objectives\n slug\n tasks\n title\n translation_key\n competence_certificate {\n ...CoursePageFields\n }\n }\n assignment_completion(\n assignment_id: $assignmentId\n course_session_id: $courseSessionId\n assignment_user_id: $assignmentUserId\n learning_content_page_id: $learningContentId\n ) {\n id\n completion_status\n submitted_at\n evaluation_submitted_at\n evaluation_user {\n id\n }\n assignment_user {\n id\n }\n evaluation_grade\n evaluation_points\n completion_data\n }\n }\n": types.AssignmentCompletionQueryDocument,
|
||||||
"\n query courseQuery($courseId: Int!) {\n course(id: $courseId) {\n id\n slug\n title\n category_name\n learning_path {\n id\n }\n }\n }\n": types.CourseQueryDocument,
|
"\n query courseQuery($courseId: Int!) {\n course(id: $courseId) {\n id\n slug\n title\n category_name\n learning_path {\n id\n }\n }\n }\n": types.CourseQueryDocument,
|
||||||
"\n query competenceCertificateQuery($courseSlug: String!, $courseSessionId: ID!) {\n competence_certificate_list(course_slug: $courseSlug) {\n ...CoursePageFields\n competence_certificates {\n ...CoursePageFields\n assignments {\n ...CoursePageFields\n assignment_type\n max_points\n completion(course_session_id: $courseSessionId) {\n id\n completion_status\n submitted_at\n evaluation_points\n }\n learning_content {\n title\n id\n slug\n content_type\n frontend_url\n circle {\n ...CoursePageFields\n }\n }\n }\n }\n }\n }\n": types.CompetenceCertificateQueryDocument,
|
"\n query competenceCertificateQuery($courseSlug: String!, $courseSessionId: ID!) {\n competence_certificate_list(course_slug: $courseSlug) {\n ...CoursePageFields\n competence_certificates {\n ...CoursePageFields\n assignments {\n ...CoursePageFields\n assignment_type\n max_points\n completion(course_session_id: $courseSessionId) {\n id\n completion_status\n submitted_at\n evaluation_points\n }\n learning_content {\n title\n id\n slug\n content_type\n frontend_url\n circle {\n ...CoursePageFields\n }\n }\n }\n }\n }\n }\n": types.CompetenceCertificateQueryDocument,
|
||||||
|
"\n mutation SendFeedbackMutation(\n $courseSessionId: ID!\n $learningContentId: ID!\n $data: GenericScalar\n ) {\n send_feedback(\n course_session_id: $courseSessionId\n learning_content_page_id: $learningContentId\n data: $data\n ) {\n feedback_response {\n id\n data\n }\n errors {\n field\n messages\n }\n }\n }\n": types.SendFeedbackMutationDocument,
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -37,10 +37,6 @@ const documents = {
|
||||||
*/
|
*/
|
||||||
export function graphql(source: string): unknown;
|
export function graphql(source: string): unknown;
|
||||||
|
|
||||||
/**
|
|
||||||
* The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.
|
|
||||||
*/
|
|
||||||
export function graphql(source: "\n mutation SendFeedbackMutation($input: SendFeedbackInput!) {\n send_feedback(input: $input) {\n feedback_response {\n id\n }\n errors {\n field\n messages\n }\n }\n }\n"): (typeof documents)["\n mutation SendFeedbackMutation($input: SendFeedbackInput!) {\n send_feedback(input: $input) {\n feedback_response {\n id\n }\n errors {\n field\n messages\n }\n }\n }\n"];
|
|
||||||
/**
|
/**
|
||||||
* The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.
|
* The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.
|
||||||
*/
|
*/
|
||||||
|
|
@ -69,6 +65,10 @@ export function graphql(source: "\n query courseQuery($courseId: Int!) {\n c
|
||||||
* The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.
|
* The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.
|
||||||
*/
|
*/
|
||||||
export function graphql(source: "\n query competenceCertificateQuery($courseSlug: String!, $courseSessionId: ID!) {\n competence_certificate_list(course_slug: $courseSlug) {\n ...CoursePageFields\n competence_certificates {\n ...CoursePageFields\n assignments {\n ...CoursePageFields\n assignment_type\n max_points\n completion(course_session_id: $courseSessionId) {\n id\n completion_status\n submitted_at\n evaluation_points\n }\n learning_content {\n title\n id\n slug\n content_type\n frontend_url\n circle {\n ...CoursePageFields\n }\n }\n }\n }\n }\n }\n"): (typeof documents)["\n query competenceCertificateQuery($courseSlug: String!, $courseSessionId: ID!) {\n competence_certificate_list(course_slug: $courseSlug) {\n ...CoursePageFields\n competence_certificates {\n ...CoursePageFields\n assignments {\n ...CoursePageFields\n assignment_type\n max_points\n completion(course_session_id: $courseSessionId) {\n id\n completion_status\n submitted_at\n evaluation_points\n }\n learning_content {\n title\n id\n slug\n content_type\n frontend_url\n circle {\n ...CoursePageFields\n }\n }\n }\n }\n }\n }\n"];
|
export function graphql(source: "\n query competenceCertificateQuery($courseSlug: String!, $courseSessionId: ID!) {\n competence_certificate_list(course_slug: $courseSlug) {\n ...CoursePageFields\n competence_certificates {\n ...CoursePageFields\n assignments {\n ...CoursePageFields\n assignment_type\n max_points\n completion(course_session_id: $courseSessionId) {\n id\n completion_status\n submitted_at\n evaluation_points\n }\n learning_content {\n title\n id\n slug\n content_type\n frontend_url\n circle {\n ...CoursePageFields\n }\n }\n }\n }\n }\n }\n"): (typeof documents)["\n query competenceCertificateQuery($courseSlug: String!, $courseSessionId: ID!) {\n competence_certificate_list(course_slug: $courseSlug) {\n ...CoursePageFields\n competence_certificates {\n ...CoursePageFields\n assignments {\n ...CoursePageFields\n assignment_type\n max_points\n completion(course_session_id: $courseSessionId) {\n id\n completion_status\n submitted_at\n evaluation_points\n }\n learning_content {\n title\n id\n slug\n content_type\n frontend_url\n circle {\n ...CoursePageFields\n }\n }\n }\n }\n }\n }\n"];
|
||||||
|
/**
|
||||||
|
* The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.
|
||||||
|
*/
|
||||||
|
export function graphql(source: "\n mutation SendFeedbackMutation(\n $courseSessionId: ID!\n $learningContentId: ID!\n $data: GenericScalar\n ) {\n send_feedback(\n course_session_id: $courseSessionId\n learning_content_page_id: $learningContentId\n data: $data\n ) {\n feedback_response {\n id\n data\n }\n errors {\n field\n messages\n }\n }\n }\n"): (typeof documents)["\n mutation SendFeedbackMutation(\n $courseSessionId: ID!\n $learningContentId: ID!\n $data: GenericScalar\n ) {\n send_feedback(\n course_session_id: $courseSessionId\n learning_content_page_id: $learningContentId\n data: $data\n ) {\n feedback_response {\n id\n data\n }\n errors {\n field\n messages\n }\n }\n }\n"];
|
||||||
|
|
||||||
export function graphql(source: string) {
|
export function graphql(source: string) {
|
||||||
return (documents as any)[source] ?? {};
|
return (documents as any)[source] ?? {};
|
||||||
|
|
|
||||||
|
|
@ -270,13 +270,10 @@ export type ErrorType = {
|
||||||
messages: Array<Scalars['String']['output']>;
|
messages: Array<Scalars['String']['output']>;
|
||||||
};
|
};
|
||||||
|
|
||||||
export type FeedbackResponse = Node & {
|
export type FeedbackResponseObjectType = {
|
||||||
__typename?: 'FeedbackResponse';
|
__typename?: 'FeedbackResponseObjectType';
|
||||||
circle: CircleObjectType;
|
|
||||||
created_at: Scalars['DateTime']['output'];
|
|
||||||
data?: Maybe<Scalars['GenericScalar']['output']>;
|
data?: Maybe<Scalars['GenericScalar']['output']>;
|
||||||
/** The ID of the object */
|
id: Scalars['UUID']['output'];
|
||||||
id: Scalars['ID']['output'];
|
|
||||||
};
|
};
|
||||||
|
|
||||||
export type LearningContentAssignmentObjectType = LearningContentInterface & {
|
export type LearningContentAssignmentObjectType = LearningContentInterface & {
|
||||||
|
|
@ -537,14 +534,16 @@ export type LearnpathLearningContentAssignmentAssignmentTypeChoices =
|
||||||
|
|
||||||
export type Mutation = {
|
export type Mutation = {
|
||||||
__typename?: 'Mutation';
|
__typename?: 'Mutation';
|
||||||
send_feedback?: Maybe<SendFeedbackPayload>;
|
send_feedback?: Maybe<SendFeedbackMutation>;
|
||||||
update_course_session_attendance_course_users?: Maybe<AttendanceCourseUserMutation>;
|
update_course_session_attendance_course_users?: Maybe<AttendanceCourseUserMutation>;
|
||||||
upsert_assignment_completion?: Maybe<AssignmentCompletionMutation>;
|
upsert_assignment_completion?: Maybe<AssignmentCompletionMutation>;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
export type MutationSendFeedbackArgs = {
|
export type MutationSendFeedbackArgs = {
|
||||||
input: SendFeedbackInput;
|
course_session_id: Scalars['ID']['input'];
|
||||||
|
data?: InputMaybe<Scalars['GenericScalar']['input']>;
|
||||||
|
learning_content_page_id: Scalars['ID']['input'];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -566,12 +565,6 @@ export type MutationUpsertAssignmentCompletionArgs = {
|
||||||
learning_content_page_id?: InputMaybe<Scalars['ID']['input']>;
|
learning_content_page_id?: InputMaybe<Scalars['ID']['input']>;
|
||||||
};
|
};
|
||||||
|
|
||||||
/** An object with an ID */
|
|
||||||
export type Node = {
|
|
||||||
/** The ID of the object */
|
|
||||||
id: Scalars['ID']['output'];
|
|
||||||
};
|
|
||||||
|
|
||||||
export type Query = {
|
export type Query = {
|
||||||
__typename?: 'Query';
|
__typename?: 'Query';
|
||||||
assignment?: Maybe<AssignmentObjectType>;
|
assignment?: Maybe<AssignmentObjectType>;
|
||||||
|
|
@ -647,19 +640,11 @@ export type QueryLearningPathArgs = {
|
||||||
slug?: InputMaybe<Scalars['String']['input']>;
|
slug?: InputMaybe<Scalars['String']['input']>;
|
||||||
};
|
};
|
||||||
|
|
||||||
export type SendFeedbackInput = {
|
export type SendFeedbackMutation = {
|
||||||
clientMutationId?: InputMaybe<Scalars['String']['input']>;
|
__typename?: 'SendFeedbackMutation';
|
||||||
course_session: Scalars['Int']['input'];
|
|
||||||
data?: InputMaybe<Scalars['GenericScalar']['input']>;
|
|
||||||
page: Scalars['Int']['input'];
|
|
||||||
};
|
|
||||||
|
|
||||||
export type SendFeedbackPayload = {
|
|
||||||
__typename?: 'SendFeedbackPayload';
|
|
||||||
clientMutationId?: Maybe<Scalars['String']['output']>;
|
|
||||||
/** 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<FeedbackResponseObjectType>;
|
||||||
};
|
};
|
||||||
|
|
||||||
export type TopicObjectType = CoursePageInterface & {
|
export type TopicObjectType = CoursePageInterface & {
|
||||||
|
|
@ -689,13 +674,6 @@ export type UserType = {
|
||||||
username: Scalars['String']['output'];
|
username: Scalars['String']['output'];
|
||||||
};
|
};
|
||||||
|
|
||||||
export type SendFeedbackMutationMutationVariables = Exact<{
|
|
||||||
input: SendFeedbackInput;
|
|
||||||
}>;
|
|
||||||
|
|
||||||
|
|
||||||
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 AttendanceCheckMutationMutationVariables = Exact<{
|
export type AttendanceCheckMutationMutationVariables = Exact<{
|
||||||
attendanceCourseId: Scalars['ID']['input'];
|
attendanceCourseId: Scalars['ID']['input'];
|
||||||
attendanceUserList: Array<InputMaybe<AttendanceUserInputType>> | InputMaybe<AttendanceUserInputType>;
|
attendanceUserList: Array<InputMaybe<AttendanceUserInputType>> | InputMaybe<AttendanceUserInputType>;
|
||||||
|
|
@ -811,11 +789,20 @@ export type CompetenceCertificateQueryQuery = { __typename?: 'Query', competence
|
||||||
& { ' $fragmentRefs'?: { 'CoursePageFieldsCompetenceCertificateListObjectTypeFragment': CoursePageFieldsCompetenceCertificateListObjectTypeFragment } }
|
& { ' $fragmentRefs'?: { 'CoursePageFieldsCompetenceCertificateListObjectTypeFragment': CoursePageFieldsCompetenceCertificateListObjectTypeFragment } }
|
||||||
) | null };
|
) | null };
|
||||||
|
|
||||||
|
export type SendFeedbackMutationMutationVariables = Exact<{
|
||||||
|
courseSessionId: Scalars['ID']['input'];
|
||||||
|
learningContentId: Scalars['ID']['input'];
|
||||||
|
data?: InputMaybe<Scalars['GenericScalar']['input']>;
|
||||||
|
}>;
|
||||||
|
|
||||||
|
|
||||||
|
export type SendFeedbackMutationMutation = { __typename?: 'Mutation', send_feedback?: { __typename?: 'SendFeedbackMutation', feedback_response?: { __typename?: 'FeedbackResponseObjectType', id: any, data?: any | null } | null, errors?: Array<{ __typename?: 'ErrorType', field: string, messages: Array<string> } | null> | null } | null };
|
||||||
|
|
||||||
export const CoursePageFieldsFragmentDoc = {"kind":"Document","definitions":[{"kind":"FragmentDefinition","name":{"kind":"Name","value":"CoursePageFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"CoursePageInterface"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"title"}},{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"slug"}},{"kind":"Field","name":{"kind":"Name","value":"content_type"}},{"kind":"Field","name":{"kind":"Name","value":"frontend_url"}}]}}]} as unknown as DocumentNode<CoursePageFieldsFragment, unknown>;
|
export const CoursePageFieldsFragmentDoc = {"kind":"Document","definitions":[{"kind":"FragmentDefinition","name":{"kind":"Name","value":"CoursePageFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"CoursePageInterface"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"title"}},{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"slug"}},{"kind":"Field","name":{"kind":"Name","value":"content_type"}},{"kind":"Field","name":{"kind":"Name","value":"frontend_url"}}]}}]} as unknown as DocumentNode<CoursePageFieldsFragment, unknown>;
|
||||||
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 AttendanceCheckMutationDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"AttendanceCheckMutation"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"attendanceCourseId"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"ID"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"attendanceUserList"}},"type":{"kind":"NonNullType","type":{"kind":"ListType","type":{"kind":"NamedType","name":{"kind":"Name","value":"AttendanceUserInputType"}}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"update_course_session_attendance_course_users"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"id"},"value":{"kind":"Variable","name":{"kind":"Name","value":"attendanceCourseId"}}},{"kind":"Argument","name":{"kind":"Name","value":"attendance_user_list"},"value":{"kind":"Variable","name":{"kind":"Name","value":"attendanceUserList"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"course_session_attendance_course"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"attendance_user_list"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"user_id"}},{"kind":"Field","name":{"kind":"Name","value":"first_name"}},{"kind":"Field","name":{"kind":"Name","value":"last_name"}},{"kind":"Field","name":{"kind":"Name","value":"email"}},{"kind":"Field","name":{"kind":"Name","value":"status"}}]}}]}}]}}]}}]} as unknown as DocumentNode<AttendanceCheckMutationMutation, AttendanceCheckMutationMutationVariables>;
|
export const AttendanceCheckMutationDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"AttendanceCheckMutation"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"attendanceCourseId"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"ID"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"attendanceUserList"}},"type":{"kind":"NonNullType","type":{"kind":"ListType","type":{"kind":"NamedType","name":{"kind":"Name","value":"AttendanceUserInputType"}}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"update_course_session_attendance_course_users"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"id"},"value":{"kind":"Variable","name":{"kind":"Name","value":"attendanceCourseId"}}},{"kind":"Argument","name":{"kind":"Name","value":"attendance_user_list"},"value":{"kind":"Variable","name":{"kind":"Name","value":"attendanceUserList"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"course_session_attendance_course"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"attendance_user_list"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"user_id"}},{"kind":"Field","name":{"kind":"Name","value":"first_name"}},{"kind":"Field","name":{"kind":"Name","value":"last_name"}},{"kind":"Field","name":{"kind":"Name","value":"email"}},{"kind":"Field","name":{"kind":"Name","value":"status"}}]}}]}}]}}]}}]} as unknown as DocumentNode<AttendanceCheckMutationMutation, AttendanceCheckMutationMutationVariables>;
|
||||||
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":"learningContentId"}},"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":"UUID"}}},{"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"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"initializeCompletion"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"Boolean"}}}],"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":"learning_content_page_id"},"value":{"kind":"Variable","name":{"kind":"Name","value":"learningContentId"}}},{"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"}}},{"kind":"Argument","name":{"kind":"Name","value":"initialize_completion"},"value":{"kind":"Variable","name":{"kind":"Name","value":"initializeCompletion"}}}],"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":"learningContentId"}},"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":"UUID"}}},{"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"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"initializeCompletion"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"Boolean"}}}],"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":"learning_content_page_id"},"value":{"kind":"Variable","name":{"kind":"Name","value":"learningContentId"}}},{"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"}}},{"kind":"Argument","name":{"kind":"Name","value":"initialize_completion"},"value":{"kind":"Variable","name":{"kind":"Name","value":"initializeCompletion"}}}],"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 AttendanceCheckQueryDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"attendanceCheckQuery"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"courseSessionId"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"ID"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"course_session_attendance_course"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"id"},"value":{"kind":"Variable","name":{"kind":"Name","value":"courseSessionId"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"attendance_user_list"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"user_id"}},{"kind":"Field","name":{"kind":"Name","value":"status"}}]}}]}}]}}]} as unknown as DocumentNode<AttendanceCheckQueryQuery, AttendanceCheckQueryQueryVariables>;
|
export const AttendanceCheckQueryDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"attendanceCheckQuery"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"courseSessionId"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"ID"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"course_session_attendance_course"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"id"},"value":{"kind":"Variable","name":{"kind":"Name","value":"courseSessionId"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"attendance_user_list"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"user_id"}},{"kind":"Field","name":{"kind":"Name","value":"status"}}]}}]}}]}}]} as unknown as DocumentNode<AttendanceCheckQueryQuery, AttendanceCheckQueryQueryVariables>;
|
||||||
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":"learningContentId"}},"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":"UUID"}}}],"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":"max_points"}},{"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":"competence_certificate"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"CoursePageFields"}}]}}]}},{"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"}}},{"kind":"Argument","name":{"kind":"Name","value":"learning_content_page_id"},"value":{"kind":"Variable","name":{"kind":"Name","value":"learningContentId"}}}],"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"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"CoursePageFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"CoursePageInterface"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"title"}},{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"slug"}},{"kind":"Field","name":{"kind":"Name","value":"content_type"}},{"kind":"Field","name":{"kind":"Name","value":"frontend_url"}}]}}]} 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":"learningContentId"}},"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":"UUID"}}}],"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":"max_points"}},{"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":"competence_certificate"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"CoursePageFields"}}]}}]}},{"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"}}},{"kind":"Argument","name":{"kind":"Name","value":"learning_content_page_id"},"value":{"kind":"Variable","name":{"kind":"Name","value":"learningContentId"}}}],"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"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"CoursePageFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"CoursePageInterface"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"title"}},{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"slug"}},{"kind":"Field","name":{"kind":"Name","value":"content_type"}},{"kind":"Field","name":{"kind":"Name","value":"frontend_url"}}]}}]} 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>;
|
||||||
export const CompetenceCertificateQueryDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"competenceCertificateQuery"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"courseSlug"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"courseSessionId"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"ID"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"competence_certificate_list"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"course_slug"},"value":{"kind":"Variable","name":{"kind":"Name","value":"courseSlug"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"CoursePageFields"}},{"kind":"Field","name":{"kind":"Name","value":"competence_certificates"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"CoursePageFields"}},{"kind":"Field","name":{"kind":"Name","value":"assignments"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"CoursePageFields"}},{"kind":"Field","name":{"kind":"Name","value":"assignment_type"}},{"kind":"Field","name":{"kind":"Name","value":"max_points"}},{"kind":"Field","name":{"kind":"Name","value":"completion"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"course_session_id"},"value":{"kind":"Variable","name":{"kind":"Name","value":"courseSessionId"}}}],"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_points"}}]}},{"kind":"Field","name":{"kind":"Name","value":"learning_content"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"title"}},{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"slug"}},{"kind":"Field","name":{"kind":"Name","value":"content_type"}},{"kind":"Field","name":{"kind":"Name","value":"frontend_url"}},{"kind":"Field","name":{"kind":"Name","value":"circle"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"CoursePageFields"}}]}}]}}]}}]}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"CoursePageFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"CoursePageInterface"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"title"}},{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"slug"}},{"kind":"Field","name":{"kind":"Name","value":"content_type"}},{"kind":"Field","name":{"kind":"Name","value":"frontend_url"}}]}}]} as unknown as DocumentNode<CompetenceCertificateQueryQuery, CompetenceCertificateQueryQueryVariables>;
|
export const CompetenceCertificateQueryDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"competenceCertificateQuery"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"courseSlug"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"courseSessionId"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"ID"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"competence_certificate_list"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"course_slug"},"value":{"kind":"Variable","name":{"kind":"Name","value":"courseSlug"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"CoursePageFields"}},{"kind":"Field","name":{"kind":"Name","value":"competence_certificates"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"CoursePageFields"}},{"kind":"Field","name":{"kind":"Name","value":"assignments"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"CoursePageFields"}},{"kind":"Field","name":{"kind":"Name","value":"assignment_type"}},{"kind":"Field","name":{"kind":"Name","value":"max_points"}},{"kind":"Field","name":{"kind":"Name","value":"completion"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"course_session_id"},"value":{"kind":"Variable","name":{"kind":"Name","value":"courseSessionId"}}}],"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_points"}}]}},{"kind":"Field","name":{"kind":"Name","value":"learning_content"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"title"}},{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"slug"}},{"kind":"Field","name":{"kind":"Name","value":"content_type"}},{"kind":"Field","name":{"kind":"Name","value":"frontend_url"}},{"kind":"Field","name":{"kind":"Name","value":"circle"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"CoursePageFields"}}]}}]}}]}}]}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"CoursePageFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"CoursePageInterface"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"title"}},{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"slug"}},{"kind":"Field","name":{"kind":"Name","value":"content_type"}},{"kind":"Field","name":{"kind":"Name","value":"frontend_url"}}]}}]} as unknown as DocumentNode<CompetenceCertificateQueryQuery, CompetenceCertificateQueryQueryVariables>;
|
||||||
|
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":"courseSessionId"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"ID"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"learningContentId"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"ID"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"data"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"GenericScalar"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"send_feedback"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"course_session_id"},"value":{"kind":"Variable","name":{"kind":"Name","value":"courseSessionId"}}},{"kind":"Argument","name":{"kind":"Name","value":"learning_content_page_id"},"value":{"kind":"Variable","name":{"kind":"Name","value":"learningContentId"}}},{"kind":"Argument","name":{"kind":"Name","value":"data"},"value":{"kind":"Variable","name":{"kind":"Name","value":"data"}}}],"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":"data"}}]}},{"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>;
|
||||||
|
|
@ -546,31 +546,21 @@ type CompetenceCertificateListObjectType implements CoursePageInterface {
|
||||||
}
|
}
|
||||||
|
|
||||||
type Mutation {
|
type Mutation {
|
||||||
send_feedback(input: SendFeedbackInput!): SendFeedbackPayload
|
send_feedback(course_session_id: ID!, data: GenericScalar, learning_content_page_id: ID!): SendFeedbackMutation
|
||||||
update_course_session_attendance_course_users(attendance_user_list: [AttendanceUserInputType]!, id: ID!): AttendanceCourseUserMutation
|
update_course_session_attendance_course_users(attendance_user_list: [AttendanceUserInputType]!, id: ID!): AttendanceCourseUserMutation
|
||||||
upsert_assignment_completion(assignment_id: ID!, assignment_user_id: UUID, completion_data_string: String, completion_status: AssignmentCompletionStatus, course_session_id: ID!, evaluation_grade: Float, evaluation_points: Float, initialize_completion: Boolean, learning_content_page_id: ID): AssignmentCompletionMutation
|
upsert_assignment_completion(assignment_id: ID!, assignment_user_id: UUID, completion_data_string: String, completion_status: AssignmentCompletionStatus, course_session_id: ID!, evaluation_grade: Float, evaluation_points: Float, initialize_completion: Boolean, learning_content_page_id: ID): AssignmentCompletionMutation
|
||||||
}
|
}
|
||||||
|
|
||||||
type SendFeedbackPayload {
|
type SendFeedbackMutation {
|
||||||
feedback_response: FeedbackResponse
|
feedback_response: FeedbackResponseObjectType
|
||||||
|
|
||||||
"""May contain more than one error for same field."""
|
"""May contain more than one error for same field."""
|
||||||
errors: [ErrorType]
|
errors: [ErrorType]
|
||||||
clientMutationId: String
|
|
||||||
}
|
}
|
||||||
|
|
||||||
type FeedbackResponse implements Node {
|
type FeedbackResponseObjectType {
|
||||||
"""The ID of the object"""
|
id: UUID!
|
||||||
id: ID!
|
|
||||||
data: GenericScalar
|
data: GenericScalar
|
||||||
created_at: DateTime!
|
|
||||||
circle: CircleObjectType!
|
|
||||||
}
|
|
||||||
|
|
||||||
"""An object with an ID"""
|
|
||||||
interface Node {
|
|
||||||
"""The ID of the object"""
|
|
||||||
id: ID!
|
|
||||||
}
|
}
|
||||||
|
|
||||||
type ErrorType {
|
type ErrorType {
|
||||||
|
|
@ -578,13 +568,6 @@ type ErrorType {
|
||||||
messages: [String!]!
|
messages: [String!]!
|
||||||
}
|
}
|
||||||
|
|
||||||
input SendFeedbackInput {
|
|
||||||
page: Int!
|
|
||||||
course_session: Int!
|
|
||||||
data: GenericScalar
|
|
||||||
clientMutationId: String
|
|
||||||
}
|
|
||||||
|
|
||||||
type AttendanceCourseUserMutation {
|
type AttendanceCourseUserMutation {
|
||||||
course_session_attendance_course: CourseSessionAttendanceCourseType
|
course_session_attendance_course: CourseSessionAttendanceCourseType
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,7 @@ export const CoursePageInterface = "CoursePageInterface";
|
||||||
export const CourseSessionAttendanceCourseType = "CourseSessionAttendanceCourseType";
|
export const CourseSessionAttendanceCourseType = "CourseSessionAttendanceCourseType";
|
||||||
export const DateTime = "DateTime";
|
export const DateTime = "DateTime";
|
||||||
export const ErrorType = "ErrorType";
|
export const ErrorType = "ErrorType";
|
||||||
export const FeedbackResponse = "FeedbackResponse";
|
export const FeedbackResponseObjectType = "FeedbackResponseObjectType";
|
||||||
export const Float = "Float";
|
export const Float = "Float";
|
||||||
export const GenericScalar = "GenericScalar";
|
export const GenericScalar = "GenericScalar";
|
||||||
export const ID = "ID";
|
export const ID = "ID";
|
||||||
|
|
@ -41,10 +41,8 @@ export const LearningSequenceObjectType = "LearningSequenceObjectType";
|
||||||
export const LearningUnitObjectType = "LearningUnitObjectType";
|
export const LearningUnitObjectType = "LearningUnitObjectType";
|
||||||
export const LearnpathLearningContentAssignmentAssignmentTypeChoices = "LearnpathLearningContentAssignmentAssignmentTypeChoices";
|
export const LearnpathLearningContentAssignmentAssignmentTypeChoices = "LearnpathLearningContentAssignmentAssignmentTypeChoices";
|
||||||
export const Mutation = "Mutation";
|
export const Mutation = "Mutation";
|
||||||
export const Node = "Node";
|
|
||||||
export const Query = "Query";
|
export const Query = "Query";
|
||||||
export const SendFeedbackInput = "SendFeedbackInput";
|
export const SendFeedbackMutation = "SendFeedbackMutation";
|
||||||
export const SendFeedbackPayload = "SendFeedbackPayload";
|
|
||||||
export const String = "String";
|
export const String = "String";
|
||||||
export const TopicObjectType = "TopicObjectType";
|
export const TopicObjectType = "TopicObjectType";
|
||||||
export const UUID = "UUID";
|
export const UUID = "UUID";
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,7 @@ import type { Component } from "vue";
|
||||||
import { computed, onUnmounted } from "vue";
|
import { computed, onUnmounted } from "vue";
|
||||||
import AssignmentBlock from "./blocks/AssignmentBlock.vue";
|
import AssignmentBlock from "./blocks/AssignmentBlock.vue";
|
||||||
import AttendanceCourseBlock from "./blocks/AttendanceCourseBlock.vue";
|
import AttendanceCourseBlock from "./blocks/AttendanceCourseBlock.vue";
|
||||||
import FeedbackBlock from "./blocks/FeedbackBlock.vue";
|
import FeedbackBlock from "./feedback/FeedbackBlock.vue";
|
||||||
import IframeBlock from "./blocks/IframeBlock.vue";
|
import IframeBlock from "./blocks/IframeBlock.vue";
|
||||||
import MediaLibraryBlock from "./blocks/MediaLibraryBlock.vue";
|
import MediaLibraryBlock from "./blocks/MediaLibraryBlock.vue";
|
||||||
import PlaceholderBlock from "./blocks/PlaceholderBlock.vue";
|
import PlaceholderBlock from "./blocks/PlaceholderBlock.vue";
|
||||||
|
|
|
||||||
|
|
@ -1,12 +0,0 @@
|
||||||
<template>
|
|
||||||
<FeedbackForm :page="content" />
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script setup lang="ts">
|
|
||||||
import FeedbackForm from "@/components/FeedbackForm.vue";
|
|
||||||
import type { LearningContentFeedback } from "@/types";
|
|
||||||
|
|
||||||
defineProps<{
|
|
||||||
content: LearningContentFeedback;
|
|
||||||
}>();
|
|
||||||
</script>
|
|
||||||
|
|
@ -1,8 +1,7 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import ItRadioGroup from "@/components/ui/ItRadioGroup.vue";
|
import ItRadioGroup from "@/components/ui/ItRadioGroup.vue";
|
||||||
import ItTextarea from "@/components/ui/ItTextarea.vue";
|
import ItTextarea from "@/components/ui/ItTextarea.vue";
|
||||||
import { graphql } from "@/gql/";
|
import { graphql } from "@/gql";
|
||||||
import type { SendFeedbackInput } from "@/gql/graphql";
|
|
||||||
import FeedbackCompletition from "@/pages/learningPath/learningContentPage/feedback/FeedbackCompletition.vue";
|
import FeedbackCompletition from "@/pages/learningPath/learningContentPage/feedback/FeedbackCompletition.vue";
|
||||||
import {
|
import {
|
||||||
PERCENTAGES,
|
PERCENTAGES,
|
||||||
|
|
@ -18,16 +17,16 @@ import { useRouteQuery } from "@vueuse/router";
|
||||||
import log from "loglevel";
|
import log from "loglevel";
|
||||||
import { computed, onMounted, reactive, ref } from "vue";
|
import { computed, onMounted, reactive, ref } from "vue";
|
||||||
import { useTranslation } from "i18next-vue";
|
import { useTranslation } from "i18next-vue";
|
||||||
|
import { useCurrentCourseSession } from "@/composables";
|
||||||
|
|
||||||
const props = defineProps<{ page: LearningContentFeedback }>();
|
const props = defineProps<{
|
||||||
|
content: LearningContentFeedback;
|
||||||
|
}>();
|
||||||
const courseSessionsStore = useCourseSessionsStore();
|
const courseSessionsStore = useCourseSessionsStore();
|
||||||
|
const courseSession = useCurrentCourseSession();
|
||||||
const circleStore = useCircleStore();
|
const circleStore = useCircleStore();
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
|
|
||||||
onMounted(async () => {
|
|
||||||
log.debug("Feedback mounted");
|
|
||||||
});
|
|
||||||
|
|
||||||
const stepNo = useRouteQuery("step", "0", { transform: Number, mode: "push" });
|
const stepNo = useRouteQuery("step", "0", { transform: Number, mode: "push" });
|
||||||
|
|
||||||
const title = computed(
|
const title = computed(
|
||||||
|
|
@ -51,11 +50,21 @@ const stepLabels = [
|
||||||
|
|
||||||
const numSteps = stepLabels.length;
|
const numSteps = stepLabels.length;
|
||||||
|
|
||||||
|
// noinspection GraphQLUnresolvedReference
|
||||||
const sendFeedbackMutation = graphql(`
|
const sendFeedbackMutation = graphql(`
|
||||||
mutation SendFeedbackMutation($input: SendFeedbackInput!) {
|
mutation SendFeedbackMutation(
|
||||||
send_feedback(input: $input) {
|
$courseSessionId: ID!
|
||||||
|
$learningContentId: ID!
|
||||||
|
$data: GenericScalar
|
||||||
|
) {
|
||||||
|
send_feedback(
|
||||||
|
course_session_id: $courseSessionId
|
||||||
|
learning_content_page_id: $learningContentId
|
||||||
|
data: $data
|
||||||
|
) {
|
||||||
feedback_response {
|
feedback_response {
|
||||||
id
|
id
|
||||||
|
data
|
||||||
}
|
}
|
||||||
errors {
|
errors {
|
||||||
field
|
field
|
||||||
|
|
@ -64,18 +73,71 @@ const sendFeedbackMutation = graphql(`
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
`);
|
`);
|
||||||
|
|
||||||
const { executeMutation } = useMutation(sendFeedbackMutation);
|
const { executeMutation } = useMutation(sendFeedbackMutation);
|
||||||
|
|
||||||
const satisfaction = ref(null);
|
const feedbackData = reactive({
|
||||||
const goalAttainment = ref(null);
|
satisfaction: null,
|
||||||
const proficiency = ref(null);
|
goal_attainment: null,
|
||||||
const preparationTaskClarity = ref(null);
|
proficiency: null,
|
||||||
const instructorCompetence = ref(null);
|
preparation_task_clarity: null,
|
||||||
const instructorRespect = ref(null);
|
instructor_competence: null,
|
||||||
const instructorOpenFeedback = ref("");
|
instructor_respect: null,
|
||||||
const wouldRecommend = ref(null);
|
instructor_open_feedback: "",
|
||||||
const courseNegativeFeedback = ref("");
|
would_recommend: null,
|
||||||
const coursePositiveFeedback = ref("");
|
course_negative_feedback: "",
|
||||||
|
course_positive_feedback: "",
|
||||||
|
});
|
||||||
|
|
||||||
|
const questionData = [
|
||||||
|
{
|
||||||
|
modelKey: "satisfaction",
|
||||||
|
items: RATINGS,
|
||||||
|
component: ItRadioGroup,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
modelKey: "goal_attainment",
|
||||||
|
items: RATINGS,
|
||||||
|
component: ItRadioGroup,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
modelKey: "proficiency",
|
||||||
|
items: PERCENTAGES,
|
||||||
|
component: ItRadioGroup,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
modelKey: "preparation_task_clarity",
|
||||||
|
items: YES_NO,
|
||||||
|
component: ItRadioGroup,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
modelKey: "instructor_competence",
|
||||||
|
items: RATINGS,
|
||||||
|
component: ItRadioGroup,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
modelKey: "instructor_respect",
|
||||||
|
items: RATINGS,
|
||||||
|
component: ItRadioGroup,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
modelKey: "instructor_open_feedback",
|
||||||
|
component: ItTextarea,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
modelKey: "would_recommend",
|
||||||
|
items: YES_NO,
|
||||||
|
component: ItRadioGroup,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
modelKey: "course_negative_feedback",
|
||||||
|
component: ItTextarea,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
modelKey: "course_positive_feedback",
|
||||||
|
component: ItTextarea,
|
||||||
|
},
|
||||||
|
];
|
||||||
|
|
||||||
const mutationResult = ref<any>(null);
|
const mutationResult = ref<any>(null);
|
||||||
|
|
||||||
|
|
@ -84,63 +146,60 @@ const previousStep = () => {
|
||||||
stepNo.value -= 1;
|
stepNo.value -= 1;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const nextStep = () => {
|
const nextStep = () => {
|
||||||
if (stepNo.value < numSteps) {
|
if (stepNo.value < numSteps && hasStepValidInput(stepNo.value)) {
|
||||||
stepNo.value += 1;
|
stepNo.value += 1;
|
||||||
}
|
}
|
||||||
log.info(`next step ${stepNo.value} of ${numSteps}`);
|
log.debug(`next step ${stepNo.value} of ${numSteps}`);
|
||||||
|
mutateFeedback();
|
||||||
};
|
};
|
||||||
|
|
||||||
const sendFeedback = () => {
|
function hasStepValidInput(stepNumber: number) {
|
||||||
log.info("sending feedback");
|
const question = questionData[stepNumber - 1];
|
||||||
const courseSession = courseSessionsStore.currentCourseSession;
|
if (question) {
|
||||||
if (!courseSession || !courseSession.id) {
|
return Boolean(feedbackData[question.modelKey]);
|
||||||
log.error("no course session set");
|
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
const input: SendFeedbackInput = reactive({
|
return true;
|
||||||
data: {
|
}
|
||||||
preparation_task_clarity: preparationTaskClarity,
|
|
||||||
course_negative_feedback: courseNegativeFeedback,
|
function mutateFeedback() {
|
||||||
course_positive_feedback: coursePositiveFeedback,
|
log.debug("mutate feedback", feedbackData);
|
||||||
goal_attainment: goalAttainment,
|
executeMutation({
|
||||||
instructor_competence: instructorCompetence,
|
courseSessionId: courseSession.value.id.toString(),
|
||||||
instructor_respect: instructorRespect,
|
learningContentId: props.content.id.toString(),
|
||||||
instructor_open_feedback: instructorOpenFeedback,
|
data: feedbackData,
|
||||||
satisfaction,
|
})
|
||||||
proficiency,
|
.then((result) => {
|
||||||
would_recommend: wouldRecommend,
|
log.debug("feedback mutation result", result);
|
||||||
},
|
if (result.data?.send_feedback?.feedback_response?.data) {
|
||||||
page: props.page.id,
|
Object.assign(feedbackData, result.data.send_feedback.feedback_response.data);
|
||||||
course_session: courseSession.id,
|
}
|
||||||
});
|
|
||||||
const variables = reactive({
|
|
||||||
input,
|
|
||||||
});
|
|
||||||
log.debug(variables);
|
|
||||||
executeMutation(variables)
|
|
||||||
.then(({ data }) => {
|
|
||||||
log.debug(data);
|
|
||||||
mutationResult.value = data;
|
|
||||||
})
|
})
|
||||||
.catch((e) => log.error(e));
|
.catch((e) => log.error(e));
|
||||||
};
|
}
|
||||||
|
|
||||||
|
onMounted(async () => {
|
||||||
|
log.debug("Feedback mounted");
|
||||||
|
mutateFeedback();
|
||||||
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<LearningContentMultiLayout
|
<LearningContentMultiLayout
|
||||||
:title="title"
|
:title="title"
|
||||||
sub-title="Feedback"
|
sub-title="Feedback"
|
||||||
:learning-content="page"
|
:learning-content="content"
|
||||||
:show-start-button="stepNo === 0"
|
:show-start-button="stepNo === 0"
|
||||||
:show-next-button="stepNo > 0 && stepNo + 1 < numSteps"
|
:show-next-button="stepNo > 0 && stepNo + 1 < numSteps"
|
||||||
|
:disable-next-button="!hasStepValidInput(stepNo)"
|
||||||
:show-previous-button="stepNo > 0"
|
:show-previous-button="stepNo > 0"
|
||||||
:show-exit-button="stepNo + 1 === numSteps"
|
:show-exit-button="stepNo + 1 === numSteps"
|
||||||
:current-step="stepNo"
|
:current-step="stepNo"
|
||||||
:steps-count="numSteps"
|
:steps-count="numSteps"
|
||||||
:start-badge-text="$t('general.introduction')"
|
:start-badge-text="$t('general.introduction')"
|
||||||
:end-badge-text="$t('general.submission')"
|
:end-badge-text="$t('general.submission')"
|
||||||
:base-url="props.page.frontend_url"
|
:base-url="props.content.frontend_url"
|
||||||
close-button-variant="close"
|
close-button-variant="close"
|
||||||
@previous="previousStep()"
|
@previous="previousStep()"
|
||||||
@next="nextStep()"
|
@next="nextStep()"
|
||||||
|
|
@ -156,51 +215,14 @@ const sendFeedback = () => {
|
||||||
<p v-if="stepNo > 0 && stepNo + 1 < numSteps" class="pb-2">
|
<p v-if="stepNo > 0 && stepNo + 1 < numSteps" class="pb-2">
|
||||||
{{ stepLabels[stepNo] }}
|
{{ stepLabels[stepNo] }}
|
||||||
</p>
|
</p>
|
||||||
<ItRadioGroup
|
<div v-for="(question, index) in questionData" :key="index">
|
||||||
v-if="stepNo === 1"
|
<component
|
||||||
v-model="satisfaction"
|
:is="question.component"
|
||||||
class="mb-8"
|
v-if="index + 1 === stepNo"
|
||||||
:items="RATINGS"
|
v-model="feedbackData[question.modelKey]"
|
||||||
/>
|
:items="question['items']"
|
||||||
<ItRadioGroup
|
/>
|
||||||
v-if="stepNo === 2"
|
</div>
|
||||||
v-model="goalAttainment"
|
|
||||||
class="mb-8"
|
|
||||||
:items="RATINGS"
|
|
||||||
/>
|
|
||||||
<ItRadioGroup
|
|
||||||
v-if="stepNo === 3"
|
|
||||||
v-model="proficiency"
|
|
||||||
class="mb-8"
|
|
||||||
:items="PERCENTAGES"
|
|
||||||
/>
|
|
||||||
<ItRadioGroup
|
|
||||||
v-if="stepNo === 4"
|
|
||||||
v-model="preparationTaskClarity"
|
|
||||||
class="mb-8"
|
|
||||||
:items="YES_NO"
|
|
||||||
/>
|
|
||||||
<ItRadioGroup
|
|
||||||
v-if="stepNo === 5"
|
|
||||||
v-model="instructorCompetence"
|
|
||||||
class="mb-8"
|
|
||||||
:items="RATINGS"
|
|
||||||
/>
|
|
||||||
<ItRadioGroup
|
|
||||||
v-if="stepNo === 6"
|
|
||||||
v-model="instructorRespect"
|
|
||||||
class="mb-8"
|
|
||||||
:items="RATINGS"
|
|
||||||
/>
|
|
||||||
<ItTextarea v-if="stepNo === 7" v-model="instructorOpenFeedback" class="mb-8" />
|
|
||||||
<ItRadioGroup
|
|
||||||
v-if="stepNo === 8"
|
|
||||||
v-model="wouldRecommend"
|
|
||||||
class="mb-8"
|
|
||||||
:items="YES_NO"
|
|
||||||
/>
|
|
||||||
<ItTextarea v-if="stepNo === 9" v-model="courseNegativeFeedback" class="mb-8" />
|
|
||||||
<ItTextarea v-if="stepNo === 10" v-model="coursePositiveFeedback" class="mb-8" />
|
|
||||||
<FeedbackCompletition
|
<FeedbackCompletition
|
||||||
v-if="stepNo === 11"
|
v-if="stepNo === 11"
|
||||||
:avatar-url="courseSessionsStore.circleExperts[0].avatar_url"
|
:avatar-url="courseSessionsStore.circleExperts[0].avatar_url"
|
||||||
|
|
@ -215,19 +237,4 @@ const sendFeedback = () => {
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</LearningContentMultiLayout>
|
</LearningContentMultiLayout>
|
||||||
<!--
|
|
||||||
<pre>
|
|
||||||
satisfaction {{ satisfaction }}
|
|
||||||
goalAttainment {{ goalAttainment }}
|
|
||||||
proficiency {{ proficiency }}
|
|
||||||
receivedMaterials {{ receivedMaterials }}
|
|
||||||
materialsRating {{ materialsRating }}
|
|
||||||
instructorCompetence {{ instructorCompetence }}
|
|
||||||
instructorRespect {{ instructorRespect }}
|
|
||||||
instructorOpenFeedback {{ instructorOpenFeedback }}
|
|
||||||
wouldRecommend {{ wouldRecommend }}
|
|
||||||
coursePositiveFeedback {{ coursePositiveFeedback }}
|
|
||||||
courseNegativeFeedback {{ courseNegativeFeedback }}
|
|
||||||
mutationResult: {{ mutationResult }}
|
|
||||||
</pre> -->
|
|
||||||
</template>
|
</template>
|
||||||
|
|
@ -8,6 +8,7 @@ const props = defineProps<{
|
||||||
showStartButton: boolean;
|
showStartButton: boolean;
|
||||||
showPreviousButton: boolean;
|
showPreviousButton: boolean;
|
||||||
showNextButton: boolean;
|
showNextButton: boolean;
|
||||||
|
disableNextButton: boolean;
|
||||||
showExitButton: boolean;
|
showExitButton: boolean;
|
||||||
closingButtonVariant: ClosingButtonVariant;
|
closingButtonVariant: ClosingButtonVariant;
|
||||||
}>();
|
}>();
|
||||||
|
|
@ -41,6 +42,7 @@ const closingButtonText = computed(() => {
|
||||||
</button>
|
</button>
|
||||||
<button
|
<button
|
||||||
v-if="props.showNextButton"
|
v-if="props.showNextButton"
|
||||||
|
:disabled="props.disableNextButton"
|
||||||
class="btn-blue z-10 flex items-center"
|
class="btn-blue z-10 flex items-center"
|
||||||
data-cy="next-step"
|
data-cy="next-step"
|
||||||
@click="$emit('next')"
|
@click="$emit('next')"
|
||||||
|
|
|
||||||
|
|
@ -16,6 +16,7 @@ interface Props {
|
||||||
showStartButton: boolean;
|
showStartButton: boolean;
|
||||||
showPreviousButton: boolean;
|
showPreviousButton: boolean;
|
||||||
showNextButton: boolean;
|
showNextButton: boolean;
|
||||||
|
disableNextButton: boolean;
|
||||||
showExitButton: boolean;
|
showExitButton: boolean;
|
||||||
currentStep: number;
|
currentStep: number;
|
||||||
stepsCount: number;
|
stepsCount: number;
|
||||||
|
|
@ -37,6 +38,7 @@ const props = withDefaults(defineProps<Props>(), {
|
||||||
closeButtonVariant: "mark_as_done",
|
closeButtonVariant: "mark_as_done",
|
||||||
baseUrl: undefined,
|
baseUrl: undefined,
|
||||||
stepQueryParam: undefined,
|
stepQueryParam: undefined,
|
||||||
|
disableNextButton: false,
|
||||||
beforeExitCallback: async () => Promise.resolve(),
|
beforeExitCallback: async () => Promise.resolve(),
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
@ -103,6 +105,7 @@ const emit = defineEmits(["previous", "next", "exit"]);
|
||||||
:show-previous-button="props.showPreviousButton"
|
:show-previous-button="props.showPreviousButton"
|
||||||
:show-exit-button="props.showExitButton"
|
:show-exit-button="props.showExitButton"
|
||||||
:closing-button-variant="props.closeButtonVariant"
|
:closing-button-variant="props.closeButtonVariant"
|
||||||
|
:disable-next-button="props.disableNextButton"
|
||||||
@previous="emit('previous')"
|
@previous="emit('previous')"
|
||||||
@next="emit('next')"
|
@next="emit('next')"
|
||||||
@start="emit('next')"
|
@start="emit('next')"
|
||||||
|
|
|
||||||
|
|
@ -69,6 +69,7 @@ const closingButtonVariant = computed(() => {
|
||||||
<slot></slot>
|
<slot></slot>
|
||||||
<LearningContentFooter
|
<LearningContentFooter
|
||||||
:show-next-button="false"
|
:show-next-button="false"
|
||||||
|
:disable-next-button="false"
|
||||||
:show-previous-button="false"
|
:show-previous-button="false"
|
||||||
:show-exit-button="true"
|
:show-exit-button="true"
|
||||||
:show-start-button="false"
|
:show-start-button="false"
|
||||||
|
|
|
||||||
|
|
@ -18,6 +18,18 @@ def has_course_access(user, course_id):
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
|
||||||
|
def has_course_session_access(user, course_session_id: int):
|
||||||
|
if user.is_superuser:
|
||||||
|
return True
|
||||||
|
|
||||||
|
if CourseSessionUser.objects.filter(
|
||||||
|
course_session_id=course_session_id, user=user
|
||||||
|
).exists():
|
||||||
|
return True
|
||||||
|
|
||||||
|
return False
|
||||||
|
|
||||||
|
|
||||||
def is_course_session_expert(user, course_session_id: int):
|
def is_course_session_expert(user, course_session_id: int):
|
||||||
if user.is_superuser:
|
if user.is_superuser:
|
||||||
return True
|
return True
|
||||||
|
|
|
||||||
|
|
@ -1,55 +1,107 @@
|
||||||
|
import graphene
|
||||||
import structlog
|
import structlog
|
||||||
from graphene import ClientIDMutation, Field, Int, List
|
|
||||||
from graphene.types.generic import GenericScalar
|
from graphene.types.generic import GenericScalar
|
||||||
from graphene_django.types import ErrorType
|
from graphene_django.types import ErrorType
|
||||||
|
|
||||||
from vbv_lernwelt.course.models import CourseSession
|
from vbv_lernwelt.course.models import CourseSession
|
||||||
from vbv_lernwelt.feedback.graphql.types import FeedbackResponse as FeedbackResponseType
|
from vbv_lernwelt.course.permissions import has_course_session_access
|
||||||
|
from vbv_lernwelt.feedback.graphql.types import (
|
||||||
|
FeedbackResponseObjectType as FeedbackResponseType,
|
||||||
|
)
|
||||||
from vbv_lernwelt.feedback.models import FeedbackResponse
|
from vbv_lernwelt.feedback.models import FeedbackResponse
|
||||||
from vbv_lernwelt.feedback.serializers import CourseFeedbackSerializer
|
from vbv_lernwelt.feedback.serializers import CourseFeedbackSerializer
|
||||||
from wagtail.models import Page
|
from vbv_lernwelt.learnpath.models import LearningContentFeedback
|
||||||
|
|
||||||
logger = structlog.get_logger(__name__)
|
logger = structlog.get_logger(__name__)
|
||||||
|
|
||||||
|
|
||||||
# https://medium.com/open-graphql/jsonfield-models-in-graphene-django-308ae43d14ee
|
# https://medium.com/open-graphql/jsonfield-models-in-graphene-django-308ae43d14ee
|
||||||
class SendFeedback(ClientIDMutation):
|
class SendFeedbackMutation(graphene.Mutation):
|
||||||
feedback_response = Field(FeedbackResponseType)
|
feedback_response = graphene.Field(FeedbackResponseType)
|
||||||
errors = List(
|
errors = graphene.List(
|
||||||
ErrorType, description="May contain more than one error for same field."
|
ErrorType, description="May contain more than one error for same field."
|
||||||
)
|
)
|
||||||
|
|
||||||
class Input:
|
class Arguments:
|
||||||
page = Int(required=True)
|
course_session_id = graphene.ID(required=True)
|
||||||
course_session = Int(required=True)
|
learning_content_page_id = graphene.ID(required=True)
|
||||||
data = GenericScalar()
|
data = GenericScalar()
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def mutate_and_get_payload(cls, _, info, **input):
|
def mutate(
|
||||||
page_id = input["page"]
|
cls,
|
||||||
course_session_id = input["course_session"]
|
root,
|
||||||
logger.info("creating feedback")
|
info,
|
||||||
|
course_session_id,
|
||||||
learning_content = Page.objects.get(id=page_id)
|
learning_content_page_id,
|
||||||
circle = learning_content.get_parent().specific
|
data,
|
||||||
|
):
|
||||||
|
feedback_user_id = info.context.user.id
|
||||||
|
learning_content = LearningContentFeedback.objects.get(
|
||||||
|
id=learning_content_page_id
|
||||||
|
)
|
||||||
|
circle = learning_content.get_circle()
|
||||||
course_session = CourseSession.objects.get(id=course_session_id)
|
course_session = CourseSession.objects.get(id=course_session_id)
|
||||||
data = input.get("data", {})
|
|
||||||
|
if not has_course_session_access(
|
||||||
|
info.context.user,
|
||||||
|
course_session.id,
|
||||||
|
):
|
||||||
|
return SendFeedbackMutation(
|
||||||
|
errors=[
|
||||||
|
ErrorType(
|
||||||
|
field="send_feedback", messages=["Insufficient permissions"]
|
||||||
|
)
|
||||||
|
]
|
||||||
|
)
|
||||||
|
|
||||||
|
logger.info(
|
||||||
|
"creating feedback",
|
||||||
|
label="feedback",
|
||||||
|
feedback_user_id=feedback_user_id,
|
||||||
|
circle_title=circle.title,
|
||||||
|
course_session_id=course_session_id,
|
||||||
|
)
|
||||||
|
|
||||||
serializer = CourseFeedbackSerializer(data=data)
|
serializer = CourseFeedbackSerializer(data=data)
|
||||||
|
|
||||||
if not serializer.is_valid():
|
if not serializer.is_valid():
|
||||||
logger.error(serializer.errors)
|
logger.error(
|
||||||
return SendFeedback(errors=serializer.errors)
|
"creating feedback serializer invalid",
|
||||||
|
error_list=serializer.errors,
|
||||||
|
label="feedback",
|
||||||
|
)
|
||||||
|
errors = [
|
||||||
|
ErrorType(field=field, messages=msgs)
|
||||||
|
for field, msgs in serializer.errors.items()
|
||||||
|
]
|
||||||
|
return SendFeedbackMutation(errors=errors)
|
||||||
|
|
||||||
feedback_response = FeedbackResponse.objects.create(
|
feedback_response, _ = FeedbackResponse.objects.get_or_create(
|
||||||
circle=circle,
|
feedback_user_id=feedback_user_id,
|
||||||
|
circle_id=circle.id,
|
||||||
course_session=course_session,
|
course_session=course_session,
|
||||||
data=serializer.validated_data,
|
|
||||||
)
|
)
|
||||||
logger.info(feedback_response)
|
original_data = feedback_response.data
|
||||||
|
updated_data = serializer.validated_data
|
||||||
|
|
||||||
return SendFeedback(feedback_response=feedback_response)
|
merged_data = {
|
||||||
|
key: updated_data[key] if updated_data.get(key) else original_data.get(key)
|
||||||
|
for key in updated_data.keys()
|
||||||
|
}
|
||||||
|
feedback_response.data = merged_data
|
||||||
|
feedback_response.save()
|
||||||
|
|
||||||
|
logger.info(
|
||||||
|
"feedback successfully created",
|
||||||
|
label="feedback",
|
||||||
|
feedback_user_id=feedback_user_id,
|
||||||
|
circle_title=circle.title,
|
||||||
|
course_session_id=course_session_id,
|
||||||
|
)
|
||||||
|
|
||||||
|
return SendFeedbackMutation(feedback_response=feedback_response)
|
||||||
|
|
||||||
|
|
||||||
class FeedbackMutation(object):
|
class FeedbackMutation(object):
|
||||||
send_feedback = SendFeedback.Field()
|
send_feedback = SendFeedbackMutation.Field()
|
||||||
|
|
|
||||||
|
|
@ -1,13 +1,15 @@
|
||||||
from graphene.relay import Node
|
|
||||||
from graphene.types.generic import GenericScalar
|
from graphene.types.generic import GenericScalar
|
||||||
from graphene_django import DjangoObjectType
|
from graphene_django import DjangoObjectType
|
||||||
|
|
||||||
from vbv_lernwelt.feedback.models import FeedbackResponse as FeedbackResponseModel
|
from vbv_lernwelt.feedback.models import FeedbackResponse as FeedbackResponseModel
|
||||||
|
|
||||||
|
|
||||||
class FeedbackResponse(DjangoObjectType):
|
class FeedbackResponseObjectType(DjangoObjectType):
|
||||||
data = GenericScalar()
|
data = GenericScalar()
|
||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
model = FeedbackResponseModel
|
model = FeedbackResponseModel
|
||||||
interfaces = (Node,)
|
fields = [
|
||||||
|
"id",
|
||||||
|
"data",
|
||||||
|
]
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,22 @@
|
||||||
|
# Generated by Django 3.2.20 on 2023-09-21 13:30
|
||||||
|
|
||||||
|
from django.conf import settings
|
||||||
|
from django.db import migrations, models
|
||||||
|
import django.db.models.deletion
|
||||||
|
|
||||||
|
|
||||||
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
|
dependencies = [
|
||||||
|
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
|
||||||
|
('feedback', '0003_alter_feedbackresponse_course_session'),
|
||||||
|
]
|
||||||
|
|
||||||
|
operations = [
|
||||||
|
migrations.AddField(
|
||||||
|
model_name='feedbackresponse',
|
||||||
|
name='feedback_user',
|
||||||
|
field=models.ForeignKey(default='872efd96-3bd7-4a1e-a239-2d72cad9f604', on_delete=django.db.models.deletion.CASCADE, to='core.user'),
|
||||||
|
preserve_default=False,
|
||||||
|
),
|
||||||
|
]
|
||||||
|
|
@ -25,6 +25,7 @@ class FeedbackIntegerField(models.IntegerField):
|
||||||
|
|
||||||
class FeedbackResponse(models.Model):
|
class FeedbackResponse(models.Model):
|
||||||
id = models.UUIDField(primary_key=True, default=uuid.uuid4, editable=False)
|
id = models.UUIDField(primary_key=True, default=uuid.uuid4, editable=False)
|
||||||
|
feedback_user = models.ForeignKey(User, on_delete=models.CASCADE)
|
||||||
|
|
||||||
class DiscoveredChoices(models.TextChoices):
|
class DiscoveredChoices(models.TextChoices):
|
||||||
INTERNET = "I", _("Internet")
|
INTERNET = "I", _("Internet")
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,5 @@
|
||||||
|
from unittest import skip
|
||||||
|
|
||||||
from rest_framework.test import APITestCase
|
from rest_framework.test import APITestCase
|
||||||
|
|
||||||
from vbv_lernwelt.core.create_default_users import create_default_users
|
from vbv_lernwelt.core.create_default_users import create_default_users
|
||||||
|
|
@ -148,6 +150,7 @@ class FeedbackSummaryApiTestCase(FeedbackApiBaseTestCase):
|
||||||
]
|
]
|
||||||
self.assertEqual(response.data, expected)
|
self.assertEqual(response.data, expected)
|
||||||
|
|
||||||
|
@skip("For now every trainer can see all feedback from the same course session")
|
||||||
def test_can_only_see_feedback_from_own_circle(self):
|
def test_can_only_see_feedback_from_own_circle(self):
|
||||||
number_basis_feedback = 5
|
number_basis_feedback = 5
|
||||||
number_analyse_feedback = 10
|
number_analyse_feedback = 10
|
||||||
|
|
@ -195,8 +198,7 @@ class FeedbackSummaryApiTestCase(FeedbackApiBaseTestCase):
|
||||||
f"/api/core/feedback/{csu.course_session.id}/summary/"
|
f"/api/core/feedback/{csu.course_session.id}/summary/"
|
||||||
)
|
)
|
||||||
|
|
||||||
self.assertEqual(response.status_code, 200)
|
self.assertEqual(response.status_code, 403)
|
||||||
self.assertEqual(response.data, [])
|
|
||||||
|
|
||||||
|
|
||||||
class FeedbackDetailApiTestCase(FeedbackApiBaseTestCase):
|
class FeedbackDetailApiTestCase(FeedbackApiBaseTestCase):
|
||||||
|
|
@ -259,6 +261,7 @@ class FeedbackDetailApiTestCase(FeedbackApiBaseTestCase):
|
||||||
self.assertEqual(response.status_code, 200)
|
self.assertEqual(response.status_code, 200)
|
||||||
self.assertDictEqual(response.data, expected)
|
self.assertDictEqual(response.data, expected)
|
||||||
|
|
||||||
|
@skip("For now every trainer can see all feedback from the same course session")
|
||||||
def test_cannot_receive_feedback_from_other_circle(self):
|
def test_cannot_receive_feedback_from_other_circle(self):
|
||||||
csu = CourseSessionUser.objects.get(
|
csu = CourseSessionUser.objects.get(
|
||||||
course_session=self.course_session,
|
course_session=self.course_session,
|
||||||
|
|
@ -289,5 +292,4 @@ class FeedbackDetailApiTestCase(FeedbackApiBaseTestCase):
|
||||||
f"/api/core/feedback/{csu.course_session.id}/{circle.id}/"
|
f"/api/core/feedback/{csu.course_session.id}/{circle.id}/"
|
||||||
)
|
)
|
||||||
|
|
||||||
self.assertEqual(response.status_code, 200)
|
self.assertEqual(response.status_code, 403)
|
||||||
self.assertEqual(response.data, {"amount": 0, "questions": {}})
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue