From 6f973d7e933f1756af80893decf0c25c07ae0d67 Mon Sep 17 00:00:00 2001 From: Reto Aebersold Date: Wed, 25 Oct 2023 11:39:36 +0200 Subject: [PATCH] chore: format and generate gql schema / types --- client/src/gql/gql.ts | 5 + client/src/gql/graphql.ts | 165 ++++++++++++++++++ client/src/gql/schema.graphql | 150 +++++++++++++++- client/src/gql/typenames.ts | 20 +++ client/src/graphql/queries.ts | 10 ++ client/src/pages/DashPage.vue | 21 --- server/vbv_lernwelt/course/views.py | 12 +- .../vbv_lernwelt/dashboard/graphql/queries.py | 51 ++++-- .../tests/graphql/test_assignment.py | 4 +- .../tests/graphql/test_attendance.py | 4 +- .../tests/graphql/test_competence.py | 4 +- .../dashboard/tests/graphql/test_dashboard.py | 6 +- .../dashboard/tests/graphql/test_feedback.py | 4 +- .../tests/graphql/test_selection_metrics.py | 8 +- 14 files changed, 395 insertions(+), 69 deletions(-) delete mode 100644 client/src/pages/DashPage.vue diff --git a/client/src/gql/gql.ts b/client/src/gql/gql.ts index 554937b8..b6ef5e52 100644 --- a/client/src/gql/gql.ts +++ b/client/src/gql/gql.ts @@ -21,6 +21,7 @@ const 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 evaluation_max_points\n evaluation_passed\n }\n learning_content {\n ...CoursePageFields\n circle {\n id\n title\n slug\n }\n }\n }\n }\n }\n }\n": types.CompetenceCertificateQueryDocument, "\n query courseSessionDetail($courseSessionId: ID!) {\n course_session(id: $courseSessionId) {\n id\n title\n course {\n id\n title\n slug\n }\n users {\n id\n user_id\n first_name\n last_name\n email\n avatar_url\n role\n circles {\n id\n title\n slug\n }\n }\n attendance_courses {\n id\n location\n trainer\n due_date {\n id\n start\n end\n }\n learning_content_id\n learning_content {\n id\n title\n circle {\n id\n title\n slug\n }\n }\n }\n assignments {\n id\n submission_deadline {\n id\n start\n }\n evaluation_deadline {\n id\n start\n }\n learning_content {\n id\n title\n content_assignment {\n id\n title\n assignment_type\n }\n }\n }\n edoniq_tests {\n id\n deadline {\n id\n start\n end\n }\n learning_content {\n id\n title\n content_assignment {\n id\n title\n assignment_type\n }\n }\n }\n }\n }\n": types.CourseSessionDetailDocument, "\n query courseQuery($slug: String!) {\n course(slug: $slug) {\n id\n title\n slug\n category_name\n action_competences {\n competence_id\n ...CoursePageFields\n performance_criteria {\n competence_id\n learning_unit {\n id\n slug\n evaluate_url\n }\n ...CoursePageFields\n }\n }\n learning_path {\n ...CoursePageFields\n topics {\n is_visible\n ...CoursePageFields\n circles {\n description\n goals\n ...CoursePageFields\n learning_sequences {\n icon\n ...CoursePageFields\n learning_units {\n evaluate_url\n ...CoursePageFields\n performance_criteria {\n ...CoursePageFields\n }\n learning_contents {\n can_user_self_toggle_course_completion\n content_url\n minutes\n description\n ...CoursePageFields\n ... on LearningContentAssignmentObjectType {\n assignment_type\n content_assignment {\n id\n }\n competence_certificate {\n ...CoursePageFields\n }\n }\n ... on LearningContentEdoniqTestObjectType {\n checkbox_text\n has_extended_time_test\n content_assignment {\n id\n }\n competence_certificate {\n ...CoursePageFields\n }\n }\n ... on LearningContentRichTextObjectType {\n text\n }\n }\n }\n }\n }\n }\n }\n }\n }\n": types.CourseQueryDocument, + "\n query dashboardConfig {\n dashboard_config {\n id\n name\n dashboard_type\n }\n }\n": types.DashboardConfigDocument, "\n mutation SendFeedbackMutation(\n $courseSessionId: ID!\n $learningContentId: ID!\n $data: GenericScalar!\n $submitted: Boolean\n ) {\n send_feedback(\n course_session_id: $courseSessionId\n learning_content_page_id: $learningContentId\n data: $data\n submitted: $submitted\n ) {\n feedback_response {\n id\n data\n submitted\n }\n errors {\n field\n messages\n }\n }\n }\n": types.SendFeedbackMutationDocument, }; @@ -70,6 +71,10 @@ export function graphql(source: "\n query courseSessionDetail($courseSessionId: * 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 courseQuery($slug: String!) {\n course(slug: $slug) {\n id\n title\n slug\n category_name\n action_competences {\n competence_id\n ...CoursePageFields\n performance_criteria {\n competence_id\n learning_unit {\n id\n slug\n evaluate_url\n }\n ...CoursePageFields\n }\n }\n learning_path {\n ...CoursePageFields\n topics {\n is_visible\n ...CoursePageFields\n circles {\n description\n goals\n ...CoursePageFields\n learning_sequences {\n icon\n ...CoursePageFields\n learning_units {\n evaluate_url\n ...CoursePageFields\n performance_criteria {\n ...CoursePageFields\n }\n learning_contents {\n can_user_self_toggle_course_completion\n content_url\n minutes\n description\n ...CoursePageFields\n ... on LearningContentAssignmentObjectType {\n assignment_type\n content_assignment {\n id\n }\n competence_certificate {\n ...CoursePageFields\n }\n }\n ... on LearningContentEdoniqTestObjectType {\n checkbox_text\n has_extended_time_test\n content_assignment {\n id\n }\n competence_certificate {\n ...CoursePageFields\n }\n }\n ... on LearningContentRichTextObjectType {\n text\n }\n }\n }\n }\n }\n }\n }\n }\n }\n"): (typeof documents)["\n query courseQuery($slug: String!) {\n course(slug: $slug) {\n id\n title\n slug\n category_name\n action_competences {\n competence_id\n ...CoursePageFields\n performance_criteria {\n competence_id\n learning_unit {\n id\n slug\n evaluate_url\n }\n ...CoursePageFields\n }\n }\n learning_path {\n ...CoursePageFields\n topics {\n is_visible\n ...CoursePageFields\n circles {\n description\n goals\n ...CoursePageFields\n learning_sequences {\n icon\n ...CoursePageFields\n learning_units {\n evaluate_url\n ...CoursePageFields\n performance_criteria {\n ...CoursePageFields\n }\n learning_contents {\n can_user_self_toggle_course_completion\n content_url\n minutes\n description\n ...CoursePageFields\n ... on LearningContentAssignmentObjectType {\n assignment_type\n content_assignment {\n id\n }\n competence_certificate {\n ...CoursePageFields\n }\n }\n ... on LearningContentEdoniqTestObjectType {\n checkbox_text\n has_extended_time_test\n content_assignment {\n id\n }\n competence_certificate {\n ...CoursePageFields\n }\n }\n ... on LearningContentRichTextObjectType {\n text\n }\n }\n }\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 query dashboardConfig {\n dashboard_config {\n id\n name\n dashboard_type\n }\n }\n"): (typeof documents)["\n query dashboardConfig {\n dashboard_config {\n id\n name\n dashboard_type\n }\n }\n"]; /** * The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients. */ diff --git a/client/src/gql/graphql.ts b/client/src/gql/graphql.ts index d2ac2e1c..af755314 100644 --- a/client/src/gql/graphql.ts +++ b/client/src/gql/graphql.ts @@ -85,6 +85,15 @@ export type AssignmentAssignmentCompletionCompletionStatusChoices = /** SUBMITTED */ | 'SUBMITTED'; +export type AssignmentCompletionMetrics = { + __typename?: 'AssignmentCompletionMetrics'; + average_passed: Scalars['Float']['output']; + failed_count: Scalars['Int']['output']; + passed_count: Scalars['Int']['output']; + ranking_completed: Scalars['Boolean']['output']; + unranked_count: Scalars['Int']['output']; +}; + export type AssignmentCompletionMutation = { __typename?: 'AssignmentCompletionMutation'; assignment_completion?: Maybe; @@ -156,11 +165,48 @@ export type AssignmentObjectTypeCompletionArgs = { learning_content_page_id?: InputMaybe; }; +export type AssignmentRecord = { + __typename?: 'AssignmentRecord'; + assignment_title: Scalars['String']['output']; + assignment_type_translation_key: Scalars['String']['output']; + circle_id: Scalars['ID']['output']; + course_session_assignment_id: Scalars['ID']['output']; + course_session_id: Scalars['ID']['output']; + deadline: Scalars['DateTime']['output']; + details_url: Scalars['String']['output']; + generation: Scalars['String']['output']; + metrics: AssignmentCompletionMetrics; +}; + +export type AssignmentSummary = { + __typename?: 'AssignmentSummary'; + average_passed: Scalars['Float']['output']; + completed_count: Scalars['Int']['output']; +}; + +export type Assignments = { + __typename?: 'Assignments'; + records: Array>; + summary: AssignmentSummary; +}; + export type AttendanceCourseUserMutation = { __typename?: 'AttendanceCourseUserMutation'; course_session_attendance_course?: Maybe; }; +export type AttendanceDayPresences = { + __typename?: 'AttendanceDayPresences'; + records: Array>; + summary: AttendanceSummary; +}; + +export type AttendanceSummary = { + __typename?: 'AttendanceSummary'; + days_completed: Scalars['Int']['output']; + participants_present: Scalars['Int']['output']; +}; + export type AttendanceUserInputType = { status: AttendanceUserStatus; user_id: Scalars['UUID']['input']; @@ -180,6 +226,13 @@ export type AttendanceUserStatus = | 'ABSENT' | 'PRESENT'; +export type CircleData = { + __typename?: 'CircleData'; + circle_id: Scalars['ID']['output']; + circle_title: Scalars['String']['output']; + experts: Array>; +}; + export type CircleLightObjectType = { __typename?: 'CircleLightObjectType'; id: Scalars['ID']['output']; @@ -228,6 +281,27 @@ export type CompetenceCertificateObjectType = CoursePageInterface & { translation_key: Scalars['String']['output']; }; +export type CompetencePerformance = { + __typename?: 'CompetencePerformance'; + circle_id: Scalars['ID']['output']; + course_session_id: Scalars['ID']['output']; + fail_count: Scalars['Int']['output']; + generation: Scalars['String']['output']; + success_count: Scalars['Int']['output']; +}; + +export type Competences = { + __typename?: 'Competences'; + performances: Array>; + summary: CompletionSummary; +}; + +export type CompletionSummary = { + __typename?: 'CompletionSummary'; + fail_total: Scalars['Int']['output']; + success_total: Scalars['Int']['output']; +}; + /** An enumeration. */ export type CoreUserLanguageChoices = /** Deutsch */ @@ -289,6 +363,12 @@ export type CourseSessionAttendanceCourseObjectType = { trainer: Scalars['String']['output']; }; +export type CourseSessionData = { + __typename?: 'CourseSessionData'; + session_id: Scalars['ID']['output']; + session_title: Scalars['String']['output']; +}; + export type CourseSessionEdoniqTestObjectType = { __typename?: 'CourseSessionEdoniqTestObjectType'; course_session_id: Scalars['ID']['output']; @@ -313,6 +393,13 @@ export type CourseSessionObjectType = { users: Array; }; +export type CourseSessionProperties = { + __typename?: 'CourseSessionProperties'; + circles: Array>; + generations: Array>; + sessions: Array>; +}; + export type CourseSessionUserExpertCircleType = { __typename?: 'CourseSessionUserExpertCircleType'; id: Scalars['ID']['output']; @@ -332,6 +419,38 @@ export type CourseSessionUserObjectsType = { user_id: Scalars['UUID']['output']; }; +export type CourseSessionsSelectionMetrics = { + __typename?: 'CourseSessionsSelectionMetrics'; + expert_count: Scalars['Int']['output']; + participant_count: Scalars['Int']['output']; + session_count: Scalars['Int']['output']; +}; + +export type CourseStatisticsType = { + __typename?: 'CourseStatisticsType'; + assignments: Assignments; + attendance_day_presences: AttendanceDayPresences; + competences: Competences; + course_session_properties: CourseSessionProperties; + course_session_selection_ids: Array>; + course_session_selection_metrics: CourseSessionsSelectionMetrics; + course_title: Scalars['String']['output']; + feedback_responses: FeedbackResponses; + id: Scalars['ID']['output']; +}; + +export type DashboardConfigType = { + __typename?: 'DashboardConfigType'; + dashboard_type: DashboardType; + id: Scalars['ID']['output']; + name: Scalars['String']['output']; +}; + +export type DashboardType = + | 'PROGRESS_DASHBOARD' + | 'SIMPLE_LIST_DASHBOARD' + | 'STATISTICS_DASHBOARD'; + export type DueDateObjectType = { __typename?: 'DueDateObjectType'; /** Translation Key aus dem Frontend */ @@ -360,6 +479,15 @@ export type ErrorType = { messages: Array; }; +export type FeedbackRecord = { + __typename?: 'FeedbackRecord'; + circle_id: Scalars['ID']['output']; + course_session_id: Scalars['ID']['output']; + generation: Scalars['String']['output']; + satisfaction_average: Scalars['Float']['output']; + satisfaction_max: Scalars['Int']['output']; +}; + export type FeedbackResponseObjectType = { __typename?: 'FeedbackResponseObjectType'; data?: Maybe; @@ -367,6 +495,19 @@ export type FeedbackResponseObjectType = { submitted: Scalars['Boolean']['output']; }; +export type FeedbackResponses = { + __typename?: 'FeedbackResponses'; + records: Array>; + summary: FeedbackSummary; +}; + +export type FeedbackSummary = { + __typename?: 'FeedbackSummary'; + satisfaction_average: Scalars['Float']['output']; + satisfaction_max: Scalars['Int']['output']; + total_responses: Scalars['Int']['output']; +}; + export type LearningContentAssignmentObjectType = CoursePageInterface & LearningContentInterface & { __typename?: 'LearningContentAssignmentObjectType'; assignment_type: LearnpathLearningContentAssignmentAssignmentTypeChoices; @@ -665,6 +806,17 @@ export type PerformanceCriteriaObjectType = CoursePageInterface & { translation_key: Scalars['String']['output']; }; +export type PresenceRecord = { + __typename?: 'PresenceRecord'; + circle_id: Scalars['ID']['output']; + cockpit_url: Scalars['String']['output']; + course_session_id: Scalars['ID']['output']; + due_date: Scalars['String']['output']; + generation: Scalars['String']['output']; + participants_present: Scalars['Int']['output']; + participants_total: Scalars['Int']['output']; +}; + export type Query = { __typename?: 'Query'; assignment?: Maybe; @@ -674,6 +826,8 @@ export type Query = { course?: Maybe; course_session?: Maybe; course_session_attendance_course?: Maybe; + course_statistics?: Maybe; + dashboard_config: Array; learning_content_assignment?: Maybe; learning_content_attendance_course?: Maybe; learning_content_document_list?: Maybe; @@ -733,6 +887,11 @@ export type QueryCourseSessionAttendanceCourseArgs = { }; +export type QueryCourseStatisticsArgs = { + course_id: Scalars['ID']['input']; +}; + + export type QueryLearningPathArgs = { course_id?: InputMaybe; course_slug?: InputMaybe; @@ -978,6 +1137,11 @@ export type CourseQueryQuery = { __typename?: 'Query', course?: { __typename?: ' & { ' $fragmentRefs'?: { 'CoursePageFieldsLearningPathObjectTypeFragment': CoursePageFieldsLearningPathObjectTypeFragment } } ) } | null }; +export type DashboardConfigQueryVariables = Exact<{ [key: string]: never; }>; + + +export type DashboardConfigQuery = { __typename?: 'Query', dashboard_config: Array<{ __typename?: 'DashboardConfigType', id: string, name: string, dashboard_type: DashboardType }> }; + export type SendFeedbackMutationMutationVariables = Exact<{ courseSessionId: Scalars['ID']['input']; learningContentId: Scalars['ID']['input']; @@ -996,4 +1160,5 @@ export const AssignmentCompletionQueryDocument = {"kind":"Document","definitions 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":"evaluation_max_points"}},{"kind":"Field","name":{"kind":"Name","value":"evaluation_passed"}}]}},{"kind":"Field","name":{"kind":"Name","value":"learning_content"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"CoursePageFields"}},{"kind":"Field","name":{"kind":"Name","value":"circle"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"title"}},{"kind":"Field","name":{"kind":"Name","value":"slug"}}]}}]}}]}}]}}]}}]}},{"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; export const CourseSessionDetailDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"courseSessionDetail"},"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"},"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":"title"}},{"kind":"Field","name":{"kind":"Name","value":"course"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"title"}},{"kind":"Field","name":{"kind":"Name","value":"slug"}}]}},{"kind":"Field","name":{"kind":"Name","value":"users"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"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":"avatar_url"}},{"kind":"Field","name":{"kind":"Name","value":"role"}},{"kind":"Field","name":{"kind":"Name","value":"circles"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"title"}},{"kind":"Field","name":{"kind":"Name","value":"slug"}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"attendance_courses"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"location"}},{"kind":"Field","name":{"kind":"Name","value":"trainer"}},{"kind":"Field","name":{"kind":"Name","value":"due_date"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"start"}},{"kind":"Field","name":{"kind":"Name","value":"end"}}]}},{"kind":"Field","name":{"kind":"Name","value":"learning_content_id"}},{"kind":"Field","name":{"kind":"Name","value":"learning_content"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"title"}},{"kind":"Field","name":{"kind":"Name","value":"circle"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"title"}},{"kind":"Field","name":{"kind":"Name","value":"slug"}}]}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"assignments"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"submission_deadline"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"start"}}]}},{"kind":"Field","name":{"kind":"Name","value":"evaluation_deadline"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"start"}}]}},{"kind":"Field","name":{"kind":"Name","value":"learning_content"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"title"}},{"kind":"Field","name":{"kind":"Name","value":"content_assignment"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"title"}},{"kind":"Field","name":{"kind":"Name","value":"assignment_type"}}]}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"edoniq_tests"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"deadline"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"start"}},{"kind":"Field","name":{"kind":"Name","value":"end"}}]}},{"kind":"Field","name":{"kind":"Name","value":"learning_content"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"title"}},{"kind":"Field","name":{"kind":"Name","value":"content_assignment"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"title"}},{"kind":"Field","name":{"kind":"Name","value":"assignment_type"}}]}}]}}]}}]}}]}}]} as unknown as DocumentNode; 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":"slug"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"course"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"slug"},"value":{"kind":"Variable","name":{"kind":"Name","value":"slug"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"title"}},{"kind":"Field","name":{"kind":"Name","value":"slug"}},{"kind":"Field","name":{"kind":"Name","value":"category_name"}},{"kind":"Field","name":{"kind":"Name","value":"action_competences"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"competence_id"}},{"kind":"FragmentSpread","name":{"kind":"Name","value":"CoursePageFields"}},{"kind":"Field","name":{"kind":"Name","value":"performance_criteria"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"competence_id"}},{"kind":"Field","name":{"kind":"Name","value":"learning_unit"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"slug"}},{"kind":"Field","name":{"kind":"Name","value":"evaluate_url"}}]}},{"kind":"FragmentSpread","name":{"kind":"Name","value":"CoursePageFields"}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"learning_path"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"CoursePageFields"}},{"kind":"Field","name":{"kind":"Name","value":"topics"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"is_visible"}},{"kind":"FragmentSpread","name":{"kind":"Name","value":"CoursePageFields"}},{"kind":"Field","name":{"kind":"Name","value":"circles"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"description"}},{"kind":"Field","name":{"kind":"Name","value":"goals"}},{"kind":"FragmentSpread","name":{"kind":"Name","value":"CoursePageFields"}},{"kind":"Field","name":{"kind":"Name","value":"learning_sequences"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"icon"}},{"kind":"FragmentSpread","name":{"kind":"Name","value":"CoursePageFields"}},{"kind":"Field","name":{"kind":"Name","value":"learning_units"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"evaluate_url"}},{"kind":"FragmentSpread","name":{"kind":"Name","value":"CoursePageFields"}},{"kind":"Field","name":{"kind":"Name","value":"performance_criteria"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"CoursePageFields"}}]}},{"kind":"Field","name":{"kind":"Name","value":"learning_contents"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"can_user_self_toggle_course_completion"}},{"kind":"Field","name":{"kind":"Name","value":"content_url"}},{"kind":"Field","name":{"kind":"Name","value":"minutes"}},{"kind":"Field","name":{"kind":"Name","value":"description"}},{"kind":"FragmentSpread","name":{"kind":"Name","value":"CoursePageFields"}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"LearningContentAssignmentObjectType"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"assignment_type"}},{"kind":"Field","name":{"kind":"Name","value":"content_assignment"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}}]}},{"kind":"Field","name":{"kind":"Name","value":"competence_certificate"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"CoursePageFields"}}]}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"LearningContentEdoniqTestObjectType"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"checkbox_text"}},{"kind":"Field","name":{"kind":"Name","value":"has_extended_time_test"}},{"kind":"Field","name":{"kind":"Name","value":"content_assignment"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}}]}},{"kind":"Field","name":{"kind":"Name","value":"competence_certificate"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"CoursePageFields"}}]}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"LearningContentRichTextObjectType"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"text"}}]}}]}}]}}]}}]}}]}}]}}]}}]}},{"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; +export const DashboardConfigDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"dashboardConfig"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"dashboard_config"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"dashboard_type"}}]}}]}}]} as unknown as DocumentNode; 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":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"GenericScalar"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"submitted"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"Boolean"}}}],"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"}}},{"kind":"Argument","name":{"kind":"Name","value":"submitted"},"value":{"kind":"Variable","name":{"kind":"Name","value":"submitted"}}}],"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":"submitted"}}]}},{"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; \ No newline at end of file diff --git a/client/src/gql/schema.graphql b/client/src/gql/schema.graphql index d443746f..e50c8055 100644 --- a/client/src/gql/schema.graphql +++ b/client/src/gql/schema.graphql @@ -1,4 +1,6 @@ type Query { + course_statistics(course_id: ID!): CourseStatisticsType + dashboard_config: [DashboardConfigType!]! learning_path(id: ID, slug: String, course_id: ID, course_slug: String): LearningPathObjectType course_session_attendance_course(id: ID!, assignment_user_id: ID): CourseSessionAttendanceCourseObjectType course(id: ID, slug: String): CourseObjectType @@ -19,6 +21,147 @@ type Query { assignment_completion(assignment_id: ID!, course_session_id: ID!, learning_content_page_id: ID, assignment_user_id: UUID): AssignmentCompletionObjectType } +type CourseStatisticsType { + id: ID! + course_title: String! + course_session_properties: CourseSessionProperties! + course_session_selection_ids: [ID]! + course_session_selection_metrics: CourseSessionsSelectionMetrics! + attendance_day_presences: AttendanceDayPresences! + feedback_responses: FeedbackResponses! + assignments: Assignments! + competences: Competences! +} + +type CourseSessionProperties { + sessions: [CourseSessionData]! + generations: [String]! + circles: [CircleData]! +} + +type CourseSessionData { + session_id: ID! + session_title: String! +} + +type CircleData { + circle_id: ID! + circle_title: String! + experts: [String]! +} + +type CourseSessionsSelectionMetrics { + session_count: Int! + participant_count: Int! + expert_count: Int! +} + +type AttendanceDayPresences { + records: [PresenceRecord]! + summary: AttendanceSummary! +} + +type PresenceRecord { + course_session_id: ID! + generation: String! + circle_id: ID! + due_date: String! + participants_present: Int! + participants_total: Int! + cockpit_url: String! +} + +type AttendanceSummary { + days_completed: Int! + participants_present: Int! +} + +type FeedbackResponses { + records: [FeedbackRecord]! + summary: FeedbackSummary! +} + +type FeedbackRecord { + course_session_id: ID! + generation: String! + circle_id: ID! + satisfaction_average: Float! + satisfaction_max: Int! +} + +type FeedbackSummary { + satisfaction_average: Float! + satisfaction_max: Int! + total_responses: Int! +} + +type Assignments { + records: [AssignmentRecord]! + summary: AssignmentSummary! +} + +type AssignmentRecord { + course_session_id: ID! + course_session_assignment_id: ID! + circle_id: ID! + generation: String! + assignment_type_translation_key: String! + assignment_title: String! + deadline: DateTime! + metrics: AssignmentCompletionMetrics! + details_url: String! +} + +""" +The `DateTime` scalar type represents a DateTime +value as specified by +[iso8601](https://en.wikipedia.org/wiki/ISO_8601). +""" +scalar DateTime + +type AssignmentCompletionMetrics { + passed_count: Int! + failed_count: Int! + unranked_count: Int! + ranking_completed: Boolean! + average_passed: Float! +} + +type AssignmentSummary { + completed_count: Int! + average_passed: Float! +} + +type Competences { + performances: [CompetencePerformance]! + summary: CompletionSummary! +} + +type CompetencePerformance { + course_session_id: ID! + generation: String! + circle_id: ID! + success_count: Int! + fail_count: Int! +} + +type CompletionSummary { + success_total: Int! + fail_total: Int! +} + +type DashboardConfigType { + id: ID! + name: String! + dashboard_type: DashboardType! +} + +enum DashboardType { + STATISTICS_DASHBOARD + PROGRESS_DASHBOARD + SIMPLE_LIST_DASHBOARD +} + type LearningPathObjectType implements CoursePageInterface { id: ID! title: String! @@ -214,13 +357,6 @@ type DueDateObjectType { course_session: CourseSessionObjectType! } -""" -The `DateTime` scalar type represents a DateTime -value as specified by -[iso8601](https://en.wikipedia.org/wiki/ISO_8601). -""" -scalar DateTime - type CourseSessionObjectType { id: ID! created_at: DateTime! diff --git a/client/src/gql/typenames.ts b/client/src/gql/typenames.ts index 2302eac2..c870470a 100644 --- a/client/src/gql/typenames.ts +++ b/client/src/gql/typenames.ts @@ -1,34 +1,53 @@ export const ActionCompetenceObjectType = "ActionCompetenceObjectType"; export const AssignmentAssignmentAssignmentTypeChoices = "AssignmentAssignmentAssignmentTypeChoices"; export const AssignmentAssignmentCompletionCompletionStatusChoices = "AssignmentAssignmentCompletionCompletionStatusChoices"; +export const AssignmentCompletionMetrics = "AssignmentCompletionMetrics"; export const AssignmentCompletionMutation = "AssignmentCompletionMutation"; export const AssignmentCompletionObjectType = "AssignmentCompletionObjectType"; export const AssignmentCompletionStatus = "AssignmentCompletionStatus"; export const AssignmentObjectType = "AssignmentObjectType"; +export const AssignmentRecord = "AssignmentRecord"; +export const AssignmentSummary = "AssignmentSummary"; +export const Assignments = "Assignments"; export const AttendanceCourseUserMutation = "AttendanceCourseUserMutation"; +export const AttendanceDayPresences = "AttendanceDayPresences"; +export const AttendanceSummary = "AttendanceSummary"; export const AttendanceUserInputType = "AttendanceUserInputType"; export const AttendanceUserObjectType = "AttendanceUserObjectType"; export const AttendanceUserStatus = "AttendanceUserStatus"; export const Boolean = "Boolean"; +export const CircleData = "CircleData"; export const CircleLightObjectType = "CircleLightObjectType"; export const CircleObjectType = "CircleObjectType"; export const CompetenceCertificateListObjectType = "CompetenceCertificateListObjectType"; export const CompetenceCertificateObjectType = "CompetenceCertificateObjectType"; +export const CompetencePerformance = "CompetencePerformance"; +export const Competences = "Competences"; +export const CompletionSummary = "CompletionSummary"; export const CoreUserLanguageChoices = "CoreUserLanguageChoices"; export const CourseCourseSessionUserRoleChoices = "CourseCourseSessionUserRoleChoices"; export const CourseObjectType = "CourseObjectType"; export const CoursePageInterface = "CoursePageInterface"; export const CourseSessionAssignmentObjectType = "CourseSessionAssignmentObjectType"; export const CourseSessionAttendanceCourseObjectType = "CourseSessionAttendanceCourseObjectType"; +export const CourseSessionData = "CourseSessionData"; export const CourseSessionEdoniqTestObjectType = "CourseSessionEdoniqTestObjectType"; export const CourseSessionObjectType = "CourseSessionObjectType"; +export const CourseSessionProperties = "CourseSessionProperties"; export const CourseSessionUserExpertCircleType = "CourseSessionUserExpertCircleType"; export const CourseSessionUserObjectsType = "CourseSessionUserObjectsType"; +export const CourseSessionsSelectionMetrics = "CourseSessionsSelectionMetrics"; +export const CourseStatisticsType = "CourseStatisticsType"; +export const DashboardConfigType = "DashboardConfigType"; +export const DashboardType = "DashboardType"; export const Date = "Date"; export const DateTime = "DateTime"; export const DueDateObjectType = "DueDateObjectType"; export const ErrorType = "ErrorType"; +export const FeedbackRecord = "FeedbackRecord"; export const FeedbackResponseObjectType = "FeedbackResponseObjectType"; +export const FeedbackResponses = "FeedbackResponses"; +export const FeedbackSummary = "FeedbackSummary"; export const Float = "Float"; export const GenericScalar = "GenericScalar"; export const ID = "ID"; @@ -52,6 +71,7 @@ export const LearningUnitObjectType = "LearningUnitObjectType"; export const LearnpathLearningContentAssignmentAssignmentTypeChoices = "LearnpathLearningContentAssignmentAssignmentTypeChoices"; export const Mutation = "Mutation"; export const PerformanceCriteriaObjectType = "PerformanceCriteriaObjectType"; +export const PresenceRecord = "PresenceRecord"; export const Query = "Query"; export const SendFeedbackMutation = "SendFeedbackMutation"; export const String = "String"; diff --git a/client/src/graphql/queries.ts b/client/src/graphql/queries.ts index d995e4f3..7751e093 100644 --- a/client/src/graphql/queries.ts +++ b/client/src/graphql/queries.ts @@ -268,3 +268,13 @@ export const COURSE_QUERY = graphql(` } } `); + +export const DASHBOARD_CONFIG = graphql(` + query dashboardConfig { + dashboard_config { + id + name + dashboard_type + } + } +`); diff --git a/client/src/pages/DashPage.vue b/client/src/pages/DashPage.vue deleted file mode 100644 index eac1f744..00000000 --- a/client/src/pages/DashPage.vue +++ /dev/null @@ -1,21 +0,0 @@ - - - - - diff --git a/server/vbv_lernwelt/course/views.py b/server/vbv_lernwelt/course/views.py index 627ab7a8..fa8e4686 100644 --- a/server/vbv_lernwelt/course/views.py +++ b/server/vbv_lernwelt/course/views.py @@ -6,11 +6,7 @@ from rest_framework.response import Response from wagtail.models import Page from vbv_lernwelt.core.utils import get_django_content_type -from vbv_lernwelt.course.models import ( - CircleDocument, - CourseCompletion, - CourseSession, -) +from vbv_lernwelt.course.models import CircleDocument, CourseCompletion, CourseSession from vbv_lernwelt.course.serializers import ( CourseCompletionSerializer, CourseSessionSerializer, @@ -21,11 +17,11 @@ from vbv_lernwelt.course.services import mark_course_completion from vbv_lernwelt.files.models import UploadFile from vbv_lernwelt.files.services import FileDirectUploadService from vbv_lernwelt.iam.permissions import ( - has_course_access_by_page_request, - has_course_access, - is_course_session_expert, course_sessions_for_user_qs, + has_course_access, + has_course_access_by_page_request, is_circle_expert, + is_course_session_expert, ) logger = structlog.get_logger(__name__) diff --git a/server/vbv_lernwelt/dashboard/graphql/queries.py b/server/vbv_lernwelt/dashboard/graphql/queries.py index b3584906..797c0b4c 100644 --- a/server/vbv_lernwelt/dashboard/graphql/queries.py +++ b/server/vbv_lernwelt/dashboard/graphql/queries.py @@ -1,17 +1,28 @@ import graphene -from vbv_lernwelt.course.models import CourseSession, Course +from vbv_lernwelt.course.models import Course, CourseSession from vbv_lernwelt.course_session_group.models import CourseSessionGroup -from vbv_lernwelt.dashboard.graphql.types.dashboard import CourseStatisticsType, DashboardConfigType, DashboardType -from vbv_lernwelt.iam.permissions import can_view_course_session_group_statistics, can_view_course_session, \ - can_view_course_session_progress +from vbv_lernwelt.dashboard.graphql.types.dashboard import ( + CourseStatisticsType, + DashboardConfigType, + DashboardType, +) +from vbv_lernwelt.iam.permissions import ( + can_view_course_session, + can_view_course_session_group_statistics, + can_view_course_session_progress, +) class DashboardQuery(graphene.ObjectType): - course_statistics = graphene.Field(CourseStatisticsType, course_id=graphene.ID(required=True)) - dashboard_config = graphene.List(DashboardConfigType, required=True) + course_statistics = graphene.Field( + CourseStatisticsType, course_id=graphene.ID(required=True) + ) + dashboard_config = graphene.List( + graphene.NonNull(DashboardConfigType), required=True + ) - def resolve_course_statistics(root, info, course_id: str): # noqa + def resolve_course_statistics(root, info, course_id: str): # noqa user = info.context.user course = Course.objects.get(id=course_id) @@ -19,18 +30,20 @@ class DashboardQuery(graphene.ObjectType): for group in CourseSessionGroup.objects.filter(course=course): if can_view_course_session_group_statistics(user=user, group=group): - course_session_ids.update(group.course_session.all().values_list("id", flat=True)) + course_session_ids.update( + group.course_session.all().values_list("id", flat=True) + ) if not course_session_ids: return None + return CourseStatisticsType( + id=course.id, + course_title=course.title, # noqa + course_session_selection_ids=list(course_session_ids), + ) # noqa - return CourseStatisticsType(id=course.id, course_title=course.title, # noqa - course_session_selection_ids=list(course_session_ids)) # noqa - - - - def resolve_dashboard_config(root, info): # noqa + def resolve_dashboard_config(root, info): # noqa user = info.context.user course_index = set() @@ -44,7 +57,7 @@ class DashboardQuery(graphene.ObjectType): { "id": str(course.id), "name": course.title, - "dashboard_type": DashboardType.STATISTICS_DASHBOARD + "dashboard_type": DashboardType.STATISTICS_DASHBOARD, } ) @@ -55,15 +68,17 @@ class DashboardQuery(graphene.ObjectType): { "id": str(course.id), "name": course.title, - "dashboard_type": DashboardType.SIMPLE_LIST_DASHBOARD + "dashboard_type": DashboardType.SIMPLE_LIST_DASHBOARD, } ) - if can_view_course_session_progress(user=user, course_session=course_session): + if can_view_course_session_progress( + user=user, course_session=course_session + ): dashboards.append( { "id": str(course.id), "name": course.title, - "dashboard_type": DashboardType.PROGRESS_DASHBOARD + "dashboard_type": DashboardType.PROGRESS_DASHBOARD, } ) diff --git a/server/vbv_lernwelt/dashboard/tests/graphql/test_assignment.py b/server/vbv_lernwelt/dashboard/tests/graphql/test_assignment.py index 1dede516..734129d4 100644 --- a/server/vbv_lernwelt/dashboard/tests/graphql/test_assignment.py +++ b/server/vbv_lernwelt/dashboard/tests/graphql/test_assignment.py @@ -10,6 +10,7 @@ from vbv_lernwelt.course_session.models import ( CourseSessionEdoniqTest, ) from vbv_lernwelt.dashboard.tests.graphql.utils import ( + add_course_session_group_supervisor, add_course_session_user, create_assignment, create_assignment_completion, @@ -19,9 +20,8 @@ from vbv_lernwelt.dashboard.tests.graphql.utils import ( create_course_session, create_course_session_assignment, create_course_session_edoniq_test, - create_user, create_course_session_group, - add_course_session_group_supervisor, + create_user, ) from vbv_lernwelt.learnpath.models import Circle diff --git a/server/vbv_lernwelt/dashboard/tests/graphql/test_attendance.py b/server/vbv_lernwelt/dashboard/tests/graphql/test_attendance.py index 17fce53a..29734f4e 100644 --- a/server/vbv_lernwelt/dashboard/tests/graphql/test_attendance.py +++ b/server/vbv_lernwelt/dashboard/tests/graphql/test_attendance.py @@ -6,14 +6,14 @@ from graphene_django.utils import GraphQLTestCase from vbv_lernwelt.course.models import CourseSessionUser from vbv_lernwelt.course_session.services.attendance import AttendanceUserStatus from vbv_lernwelt.dashboard.tests.graphql.utils import ( + add_course_session_group_supervisor, add_course_session_user, create_attendance_course, create_circle, create_course, create_course_session, - create_user, create_course_session_group, - add_course_session_group_supervisor, + create_user, ) diff --git a/server/vbv_lernwelt/dashboard/tests/graphql/test_competence.py b/server/vbv_lernwelt/dashboard/tests/graphql/test_competence.py index f2ce8f03..88658e6a 100644 --- a/server/vbv_lernwelt/dashboard/tests/graphql/test_competence.py +++ b/server/vbv_lernwelt/dashboard/tests/graphql/test_competence.py @@ -3,14 +3,14 @@ from graphene_django.utils import GraphQLTestCase from vbv_lernwelt.course.models import CourseSessionUser from vbv_lernwelt.course.services import mark_course_completion from vbv_lernwelt.dashboard.tests.graphql.utils import ( + add_course_session_group_supervisor, add_course_session_user, create_circle, create_course, create_course_session, + create_course_session_group, create_performance_criteria_page, create_user, - create_course_session_group, - add_course_session_group_supervisor, ) diff --git a/server/vbv_lernwelt/dashboard/tests/graphql/test_dashboard.py b/server/vbv_lernwelt/dashboard/tests/graphql/test_dashboard.py index ceb28fd7..e7b4de92 100644 --- a/server/vbv_lernwelt/dashboard/tests/graphql/test_dashboard.py +++ b/server/vbv_lernwelt/dashboard/tests/graphql/test_dashboard.py @@ -2,12 +2,12 @@ from graphene_django.utils import GraphQLTestCase from vbv_lernwelt.course.models import CourseSessionUser from vbv_lernwelt.dashboard.tests.graphql.utils import ( + add_course_session_group_supervisor, + add_course_session_user, create_course, create_course_session, - create_user, - add_course_session_user, create_course_session_group, - add_course_session_group_supervisor, + create_user, ) diff --git a/server/vbv_lernwelt/dashboard/tests/graphql/test_feedback.py b/server/vbv_lernwelt/dashboard/tests/graphql/test_feedback.py index 0cb100e6..a7e5c2fa 100644 --- a/server/vbv_lernwelt/dashboard/tests/graphql/test_feedback.py +++ b/server/vbv_lernwelt/dashboard/tests/graphql/test_feedback.py @@ -2,13 +2,13 @@ from graphene_django.utils import GraphQLTestCase from vbv_lernwelt.course.models import CourseSessionUser from vbv_lernwelt.dashboard.tests.graphql.utils import ( + add_course_session_group_supervisor, add_course_session_user, create_circle, create_course, create_course_session, - create_user, create_course_session_group, - add_course_session_group_supervisor, + create_user, ) from vbv_lernwelt.feedback.models import FeedbackResponse diff --git a/server/vbv_lernwelt/dashboard/tests/graphql/test_selection_metrics.py b/server/vbv_lernwelt/dashboard/tests/graphql/test_selection_metrics.py index bd2665da..c290aec5 100644 --- a/server/vbv_lernwelt/dashboard/tests/graphql/test_selection_metrics.py +++ b/server/vbv_lernwelt/dashboard/tests/graphql/test_selection_metrics.py @@ -2,13 +2,13 @@ from graphene_django.utils import GraphQLTestCase from vbv_lernwelt.course.models import CourseSessionUser from vbv_lernwelt.dashboard.tests.graphql.utils import ( + add_course_session_group_course_session, + add_course_session_group_supervisor, + add_course_session_user, create_course, create_course_session, - create_user, - add_course_session_user, create_course_session_group, - add_course_session_group_supervisor, - add_course_session_group_course_session, + create_user, )