WIP: Fix typecheck
This commit is contained in:
parent
0206fd4217
commit
8a89bed0ac
|
|
@ -1,6 +1,7 @@
|
|||
<script setup lang="ts">
|
||||
import { computed, onMounted, ref, Ref } from "vue";
|
||||
import { ProgressDashboardAssignmentType } from "@/gql/graphql";
|
||||
import type { Ref } from "vue";
|
||||
import { computed, onMounted, ref } from "vue";
|
||||
import type { ProgressDashboardAssignmentType } from "@/gql/graphql";
|
||||
import { fetchProgressData } from "@/services/dashboard";
|
||||
import AssignmentProgressSummaryBox from "@/components/dashboard/AssignmentProgressSummaryBox.vue";
|
||||
|
||||
|
|
@ -11,11 +12,12 @@ const props = defineProps<{
|
|||
}>();
|
||||
|
||||
const DEFAULT_ASSIGNMENT = {
|
||||
_id: "",
|
||||
points_achieved_count: 0,
|
||||
points_max_count: 0,
|
||||
total_count: 0,
|
||||
};
|
||||
const assignment: Ref<ProgressDashboardAssignmentType> = ref(DEFAULT_ASSIGNMENT);
|
||||
const assignment: Ref<ProgressDashboardAssignmentType | null> = ref(DEFAULT_ASSIGNMENT);
|
||||
|
||||
const competenceCertificateUrl = computed(() => {
|
||||
return `/course/${props.courseSlug}/competence/certificates?courseSessionId=${props.sessionToContinueId}`;
|
||||
|
|
@ -23,7 +25,7 @@ const competenceCertificateUrl = computed(() => {
|
|||
|
||||
onMounted(async () => {
|
||||
const data = await fetchProgressData(props.courseId);
|
||||
assignment.value = data?.assignment;
|
||||
assignment.value = data?.assignment ?? null;
|
||||
});
|
||||
</script>
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
<script setup lang="ts">
|
||||
import { computed, onMounted, ref, Ref } from "vue";
|
||||
import type { Ref } from "vue";
|
||||
import { computed, onMounted, ref } from "vue";
|
||||
import type { ProgressDashboardCompetenceType } from "@/gql/graphql";
|
||||
import CompetenceSummaryBox from "@/components/dashboard/CompetenceSummaryBox.vue";
|
||||
import { fetchProgressData } from "@/services/dashboard";
|
||||
|
|
@ -10,8 +11,8 @@ const props = defineProps<{
|
|||
sessionToContinueId: string;
|
||||
}>();
|
||||
|
||||
const DEFAULT_COMPETENCE = { total_count: 0, success_count: 0, fail_count: 0 };
|
||||
const competence: Ref<ProgressDashboardCompetenceType> = ref(DEFAULT_COMPETENCE);
|
||||
const DEFAULT_COMPETENCE = { _id: "", total_count: 0, success_count: 0, fail_count: 0 };
|
||||
const competence: Ref<ProgressDashboardCompetenceType | null> = ref(DEFAULT_COMPETENCE);
|
||||
|
||||
const competenceCriteriaUrl = computed(() => {
|
||||
return `/course/${props.courseSlug}/competence/self-evaluation-and-feedback?courseSessionId=${props.sessionToContinueId}`;
|
||||
|
|
@ -19,7 +20,7 @@ const competenceCriteriaUrl = computed(() => {
|
|||
|
||||
onMounted(async () => {
|
||||
const data = await fetchProgressData(props.courseId);
|
||||
competence.value = data.competence;
|
||||
competence.value = data?.competence ?? null;
|
||||
});
|
||||
</script>
|
||||
|
||||
|
|
|
|||
|
|
@ -17,36 +17,41 @@ const mentorWidgets = [
|
|||
const progressWidgets = ["CompetenceWidget", "CompetenceCertificateWidget"];
|
||||
|
||||
const props = defineProps<{
|
||||
courseConfig: DashboardCourseConfigType;
|
||||
courseConfig: DashboardCourseConfigType | undefined;
|
||||
}>();
|
||||
|
||||
const courseSlug = computed(() => props.courseConfig?.course_slug);
|
||||
const courseName = computed(() => props.courseConfig?.course_title);
|
||||
const courseSlug = computed(() => props.courseConfig?.course_slug ?? "");
|
||||
const courseName = computed(() => props.courseConfig?.course_title ?? "");
|
||||
const numberOfMentorWidgets = computed(() => {
|
||||
return props.courseConfig.widgets.filter((widget) => mentorWidgets.includes(widget))
|
||||
.length;
|
||||
return (
|
||||
props.courseConfig?.widgets?.filter((widget) => mentorWidgets.includes(widget))
|
||||
.length ?? 0
|
||||
);
|
||||
});
|
||||
const numberOfProgressWidgets = computed(() => {
|
||||
return props.courseConfig.widgets.filter((widget) => progressWidgets.includes(widget))
|
||||
.length;
|
||||
return (
|
||||
props.courseConfig?.widgets?.filter((widget) => progressWidgets.includes(widget))
|
||||
.length ?? 0
|
||||
);
|
||||
});
|
||||
|
||||
function hasWidget(widget: WidgetType) {
|
||||
return props.courseConfig.widgets.includes(widget);
|
||||
return props.courseConfig?.widgets?.includes(widget) ?? false;
|
||||
}
|
||||
|
||||
function buttonLink(): string {
|
||||
if (props.courseConfig?.role_key === "Member") {
|
||||
return getLearningPathUrl(props.courseConfig?.course_slug);
|
||||
} else if (props.courseConfig?.role_key === "Expert") {
|
||||
return "btn-secondary";
|
||||
return "linktocockpit";
|
||||
} else if (props.courseConfig?.role_key === "Supervisor") {
|
||||
return "btn-secondary";
|
||||
return "linktocockpit";
|
||||
}
|
||||
return getLearningPathUrl(props.courseConfig?.course_slug);
|
||||
}
|
||||
|
||||
function hasActionButton(): boolean {
|
||||
return props.courseConfig.role_key !== "MentorUK";
|
||||
return props.courseConfig?.role_key !== "MentorUK";
|
||||
}
|
||||
</script>
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,8 @@
|
|||
<script setup lang="ts">
|
||||
import { onMounted, ref, Ref } from "vue";
|
||||
import type { Ref } from "vue";
|
||||
import { onMounted, ref } from "vue";
|
||||
import { fetchMentorCompetenceSummary } from "@/services/dashboard";
|
||||
import { AssignmentsStatisticsType } from "@/gql/graphql";
|
||||
import type { AssignmentsStatisticsType } from "@/gql/graphql";
|
||||
import BaseBox from "@/components/dashboard/BaseBox.vue";
|
||||
|
||||
const props = defineProps<{
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
<script setup lang="ts">
|
||||
import { onMounted, ref, Ref } from "vue";
|
||||
import type { Ref } from "vue";
|
||||
import { onMounted, ref } from "vue";
|
||||
import { fetchMenteeCount } from "@/services/dashboard";
|
||||
import BaseBox from "@/components/dashboard/BaseBox.vue";
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
<script setup lang="ts">
|
||||
import { onMounted, ref, Ref } from "vue";
|
||||
import type { Ref } from "vue";
|
||||
import { onMounted, ref } from "vue";
|
||||
import { fetchOpenTasksCount } from "@/services/dashboard";
|
||||
import BaseBox from "@/components/dashboard/BaseBox.vue";
|
||||
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ const numFeedbacks = computed(() => {
|
|||
});
|
||||
|
||||
onMounted(async () => {
|
||||
const data = await itGet(
|
||||
const data: { amount: number } = await itGet(
|
||||
`/api/core/feedback/${props.courseSession.id}/${props.circleId}/`
|
||||
);
|
||||
completeFeedbacks.value = data.amount;
|
||||
|
|
|
|||
|
|
@ -20,12 +20,12 @@ 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 needs_expert_evaluation\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 solution_sample {\n id\n url\n }\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 first_name\n last_name\n }\n assignment_user {\n avatar_url\n first_name\n last_name\n id\n }\n evaluation_points\n evaluation_max_points\n evaluation_passed\n edoniq_extended_time_flag\n completion_data\n task_completion_data\n }\n }\n": types.AssignmentCompletionQueryDocument,
|
||||
"\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 configuration {\n id\n enable_circle_documents\n enable_learning_mentor\n enable_competence_certificates\n }\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 configuration {\n id\n enable_circle_documents\n enable_learning_mentor\n enable_competence_certificates\n }\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 assignment_type\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 assignment_type\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 slug\n name\n dashboard_type\n course_configuration {\n id\n enable_circle_documents\n enable_learning_mentor\n enable_competence_certificates\n }\n }\n }\n": types.DashboardConfigDocument,
|
||||
"\n query courseQuery($slug: String!) {\n course(slug: $slug) {\n id\n title\n slug\n category_name\n configuration {\n id\n enable_circle_documents\n enable_learning_mentor\n enable_competence_certificates\n is_uk\n }\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 assignment_type\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 assignment_type\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 slug\n name\n dashboard_type\n course_configuration {\n id\n enable_circle_documents\n enable_learning_mentor\n enable_competence_certificates\n is_uk\n }\n }\n }\n": types.DashboardConfigDocument,
|
||||
"\n query dashboardProgress($courseId: ID!) {\n course_progress(course_id: $courseId) {\n _id\n course_id\n session_to_continue_id\n competence {\n _id\n total_count\n success_count\n fail_count\n }\n assignment {\n _id\n total_count\n points_max_count\n points_achieved_count\n }\n }\n }\n": types.DashboardProgressDocument,
|
||||
"\n query dashboardCourseData($courseId: ID!) {\n course_progress(course_id: $courseId) {\n _id\n course_id\n session_to_continue_id\n }\n }\n": types.DashboardCourseDataDocument,
|
||||
"\n query courseStatistics($courseId: ID!) {\n course_statistics(course_id: $courseId) {\n _id\n course_id\n course_title\n course_slug\n course_session_properties {\n _id\n sessions {\n id\n name\n }\n generations\n circles {\n id\n name\n }\n }\n course_session_selection_ids\n course_session_selection_metrics {\n _id\n session_count\n participant_count\n expert_count\n }\n attendance_day_presences {\n _id\n records {\n _id\n course_session_id\n generation\n circle_id\n due_date\n participants_present\n participants_total\n details_url\n }\n summary {\n _id\n days_completed\n participants_present\n }\n }\n feedback_responses {\n _id\n records {\n _id\n course_session_id\n generation\n circle_id\n experts\n satisfaction_average\n satisfaction_max\n details_url\n }\n summary {\n _id\n satisfaction_average\n satisfaction_max\n total_responses\n }\n }\n assignments {\n _id\n summary {\n _id\n completed_count\n average_passed\n }\n records {\n _id\n course_session_id\n course_session_assignment_id\n circle_id\n generation\n assignment_title\n assignment_type_translation_key\n details_url\n deadline\n metrics {\n _id\n passed_count\n failed_count\n unranked_count\n ranking_completed\n average_passed\n }\n }\n }\n competences {\n _id\n summary {\n _id\n success_total\n fail_total\n }\n records {\n _id\n course_session_id\n generation\n circle_id\n title\n success_count\n fail_count\n details_url\n }\n }\n }\n }\n": types.CourseStatisticsDocument,
|
||||
"\n query mentorCourseStatistics($courseId: ID!) {\n mentor_course_statistics(course_id: $courseId) {\n _id\n assignments {\n _id\n summary {\n _id\n total_passed\n total_failed\n }\n }\n }\n }\n": types.MentorCourseStatisticsDocument,
|
||||
"\n query courseStatistics($courseId: ID!) {\n course_statistics(course_id: $courseId) {\n _id\n course_id\n course_title\n course_slug\n course_session_properties {\n _id\n sessions {\n id\n name\n }\n generations\n circles {\n id\n name\n }\n }\n course_session_selection_ids\n course_session_selection_metrics {\n _id\n session_count\n participant_count\n expert_count\n }\n attendance_day_presences {\n _id\n records {\n _id\n course_session_id\n generation\n circle_id\n due_date\n participants_present\n participants_total\n details_url\n }\n summary {\n _id\n days_completed\n participants_present\n }\n }\n feedback_responses {\n _id\n records {\n _id\n course_session_id\n generation\n circle_id\n experts\n satisfaction_average\n satisfaction_max\n details_url\n }\n summary {\n _id\n satisfaction_average\n satisfaction_max\n total_responses\n }\n }\n assignments {\n _id\n summary {\n _id\n completed_count\n average_passed\n total_passed\n total_failed\n }\n records {\n _id\n course_session_id\n course_session_assignment_id\n circle_id\n generation\n assignment_title\n assignment_type_translation_key\n details_url\n deadline\n metrics {\n _id\n passed_count\n failed_count\n unranked_count\n ranking_completed\n average_passed\n }\n }\n }\n competences {\n _id\n summary {\n _id\n success_total\n fail_total\n }\n records {\n _id\n course_session_id\n generation\n circle_id\n title\n success_count\n fail_count\n details_url\n }\n }\n }\n }\n": types.CourseStatisticsDocument,
|
||||
"\n query mentorCourseStatistics($courseId: ID!) {\n mentor_course_statistics(course_id: $courseId) {\n _id\n course_id\n course_title\n course_slug\n course_session_properties {\n _id\n sessions {\n id\n name\n }\n generations\n circles {\n id\n name\n }\n }\n course_session_selection_ids\n user_selection_ids\n assignments {\n _id\n summary {\n _id\n completed_count\n average_passed\n total_passed\n total_failed\n }\n records {\n _id\n course_session_id\n course_session_assignment_id\n circle_id\n generation\n assignment_title\n assignment_type_translation_key\n details_url\n deadline\n metrics {\n _id\n passed_count\n failed_count\n unranked_count\n ranking_completed\n average_passed\n }\n }\n }\n }\n }\n": types.MentorCourseStatisticsDocument,
|
||||
"\n mutation SendFeedbackMutation(\n $courseSessionId: ID!\n $learningContentId: ID!\n $learningContentType: String!\n $data: GenericScalar!\n $submitted: Boolean\n ) {\n send_feedback(\n course_session_id: $courseSessionId\n learning_content_page_id: $learningContentId\n learning_content_type: $learningContentType\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,
|
||||
};
|
||||
|
||||
|
|
@ -74,11 +74,11 @@ 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 configuration {\n id\n enable_circle_documents\n enable_learning_mentor\n enable_competence_certificates\n }\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 assignment_type\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 assignment_type\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 configuration {\n id\n enable_circle_documents\n enable_learning_mentor\n enable_competence_certificates\n }\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 assignment_type\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 assignment_type\n }\n competence_certificate {\n ...CoursePageFields\n }\n }\n ... on LearningContentRichTextObjectType {\n text\n }\n }\n }\n }\n }\n }\n }\n }\n }\n"];
|
||||
export function graphql(source: "\n query courseQuery($slug: String!) {\n course(slug: $slug) {\n id\n title\n slug\n category_name\n configuration {\n id\n enable_circle_documents\n enable_learning_mentor\n enable_competence_certificates\n is_uk\n }\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 assignment_type\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 assignment_type\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 configuration {\n id\n enable_circle_documents\n enable_learning_mentor\n enable_competence_certificates\n is_uk\n }\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 assignment_type\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 assignment_type\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 slug\n name\n dashboard_type\n course_configuration {\n id\n enable_circle_documents\n enable_learning_mentor\n enable_competence_certificates\n }\n }\n }\n"): (typeof documents)["\n query dashboardConfig {\n dashboard_config {\n id\n slug\n name\n dashboard_type\n course_configuration {\n id\n enable_circle_documents\n enable_learning_mentor\n enable_competence_certificates\n }\n }\n }\n"];
|
||||
export function graphql(source: "\n query dashboardConfig {\n dashboard_config {\n id\n slug\n name\n dashboard_type\n course_configuration {\n id\n enable_circle_documents\n enable_learning_mentor\n enable_competence_certificates\n is_uk\n }\n }\n }\n"): (typeof documents)["\n query dashboardConfig {\n dashboard_config {\n id\n slug\n name\n dashboard_type\n course_configuration {\n id\n enable_circle_documents\n enable_learning_mentor\n enable_competence_certificates\n is_uk\n }\n }\n }\n"];
|
||||
/**
|
||||
* The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.
|
||||
*/
|
||||
|
|
@ -90,11 +90,11 @@ export function graphql(source: "\n query dashboardCourseData($courseId: ID!) {
|
|||
/**
|
||||
* 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 courseStatistics($courseId: ID!) {\n course_statistics(course_id: $courseId) {\n _id\n course_id\n course_title\n course_slug\n course_session_properties {\n _id\n sessions {\n id\n name\n }\n generations\n circles {\n id\n name\n }\n }\n course_session_selection_ids\n course_session_selection_metrics {\n _id\n session_count\n participant_count\n expert_count\n }\n attendance_day_presences {\n _id\n records {\n _id\n course_session_id\n generation\n circle_id\n due_date\n participants_present\n participants_total\n details_url\n }\n summary {\n _id\n days_completed\n participants_present\n }\n }\n feedback_responses {\n _id\n records {\n _id\n course_session_id\n generation\n circle_id\n experts\n satisfaction_average\n satisfaction_max\n details_url\n }\n summary {\n _id\n satisfaction_average\n satisfaction_max\n total_responses\n }\n }\n assignments {\n _id\n summary {\n _id\n completed_count\n average_passed\n }\n records {\n _id\n course_session_id\n course_session_assignment_id\n circle_id\n generation\n assignment_title\n assignment_type_translation_key\n details_url\n deadline\n metrics {\n _id\n passed_count\n failed_count\n unranked_count\n ranking_completed\n average_passed\n }\n }\n }\n competences {\n _id\n summary {\n _id\n success_total\n fail_total\n }\n records {\n _id\n course_session_id\n generation\n circle_id\n title\n success_count\n fail_count\n details_url\n }\n }\n }\n }\n"): (typeof documents)["\n query courseStatistics($courseId: ID!) {\n course_statistics(course_id: $courseId) {\n _id\n course_id\n course_title\n course_slug\n course_session_properties {\n _id\n sessions {\n id\n name\n }\n generations\n circles {\n id\n name\n }\n }\n course_session_selection_ids\n course_session_selection_metrics {\n _id\n session_count\n participant_count\n expert_count\n }\n attendance_day_presences {\n _id\n records {\n _id\n course_session_id\n generation\n circle_id\n due_date\n participants_present\n participants_total\n details_url\n }\n summary {\n _id\n days_completed\n participants_present\n }\n }\n feedback_responses {\n _id\n records {\n _id\n course_session_id\n generation\n circle_id\n experts\n satisfaction_average\n satisfaction_max\n details_url\n }\n summary {\n _id\n satisfaction_average\n satisfaction_max\n total_responses\n }\n }\n assignments {\n _id\n summary {\n _id\n completed_count\n average_passed\n }\n records {\n _id\n course_session_id\n course_session_assignment_id\n circle_id\n generation\n assignment_title\n assignment_type_translation_key\n details_url\n deadline\n metrics {\n _id\n passed_count\n failed_count\n unranked_count\n ranking_completed\n average_passed\n }\n }\n }\n competences {\n _id\n summary {\n _id\n success_total\n fail_total\n }\n records {\n _id\n course_session_id\n generation\n circle_id\n title\n success_count\n fail_count\n details_url\n }\n }\n }\n }\n"];
|
||||
export function graphql(source: "\n query courseStatistics($courseId: ID!) {\n course_statistics(course_id: $courseId) {\n _id\n course_id\n course_title\n course_slug\n course_session_properties {\n _id\n sessions {\n id\n name\n }\n generations\n circles {\n id\n name\n }\n }\n course_session_selection_ids\n course_session_selection_metrics {\n _id\n session_count\n participant_count\n expert_count\n }\n attendance_day_presences {\n _id\n records {\n _id\n course_session_id\n generation\n circle_id\n due_date\n participants_present\n participants_total\n details_url\n }\n summary {\n _id\n days_completed\n participants_present\n }\n }\n feedback_responses {\n _id\n records {\n _id\n course_session_id\n generation\n circle_id\n experts\n satisfaction_average\n satisfaction_max\n details_url\n }\n summary {\n _id\n satisfaction_average\n satisfaction_max\n total_responses\n }\n }\n assignments {\n _id\n summary {\n _id\n completed_count\n average_passed\n total_passed\n total_failed\n }\n records {\n _id\n course_session_id\n course_session_assignment_id\n circle_id\n generation\n assignment_title\n assignment_type_translation_key\n details_url\n deadline\n metrics {\n _id\n passed_count\n failed_count\n unranked_count\n ranking_completed\n average_passed\n }\n }\n }\n competences {\n _id\n summary {\n _id\n success_total\n fail_total\n }\n records {\n _id\n course_session_id\n generation\n circle_id\n title\n success_count\n fail_count\n details_url\n }\n }\n }\n }\n"): (typeof documents)["\n query courseStatistics($courseId: ID!) {\n course_statistics(course_id: $courseId) {\n _id\n course_id\n course_title\n course_slug\n course_session_properties {\n _id\n sessions {\n id\n name\n }\n generations\n circles {\n id\n name\n }\n }\n course_session_selection_ids\n course_session_selection_metrics {\n _id\n session_count\n participant_count\n expert_count\n }\n attendance_day_presences {\n _id\n records {\n _id\n course_session_id\n generation\n circle_id\n due_date\n participants_present\n participants_total\n details_url\n }\n summary {\n _id\n days_completed\n participants_present\n }\n }\n feedback_responses {\n _id\n records {\n _id\n course_session_id\n generation\n circle_id\n experts\n satisfaction_average\n satisfaction_max\n details_url\n }\n summary {\n _id\n satisfaction_average\n satisfaction_max\n total_responses\n }\n }\n assignments {\n _id\n summary {\n _id\n completed_count\n average_passed\n total_passed\n total_failed\n }\n records {\n _id\n course_session_id\n course_session_assignment_id\n circle_id\n generation\n assignment_title\n assignment_type_translation_key\n details_url\n deadline\n metrics {\n _id\n passed_count\n failed_count\n unranked_count\n ranking_completed\n average_passed\n }\n }\n }\n competences {\n _id\n summary {\n _id\n success_total\n fail_total\n }\n records {\n _id\n course_session_id\n generation\n circle_id\n title\n success_count\n fail_count\n details_url\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 mentorCourseStatistics($courseId: ID!) {\n mentor_course_statistics(course_id: $courseId) {\n _id\n assignments {\n _id\n summary {\n _id\n total_passed\n total_failed\n }\n }\n }\n }\n"): (typeof documents)["\n query mentorCourseStatistics($courseId: ID!) {\n mentor_course_statistics(course_id: $courseId) {\n _id\n assignments {\n _id\n summary {\n _id\n total_passed\n total_failed\n }\n }\n }\n }\n"];
|
||||
export function graphql(source: "\n query mentorCourseStatistics($courseId: ID!) {\n mentor_course_statistics(course_id: $courseId) {\n _id\n course_id\n course_title\n course_slug\n course_session_properties {\n _id\n sessions {\n id\n name\n }\n generations\n circles {\n id\n name\n }\n }\n course_session_selection_ids\n user_selection_ids\n assignments {\n _id\n summary {\n _id\n completed_count\n average_passed\n total_passed\n total_failed\n }\n records {\n _id\n course_session_id\n course_session_assignment_id\n circle_id\n generation\n assignment_title\n assignment_type_translation_key\n details_url\n deadline\n metrics {\n _id\n passed_count\n failed_count\n unranked_count\n ranking_completed\n average_passed\n }\n }\n }\n }\n }\n"): (typeof documents)["\n query mentorCourseStatistics($courseId: ID!) {\n mentor_course_statistics(course_id: $courseId) {\n _id\n course_id\n course_title\n course_slug\n course_session_properties {\n _id\n sessions {\n id\n name\n }\n generations\n circles {\n id\n name\n }\n }\n course_session_selection_ids\n user_selection_ids\n assignments {\n _id\n summary {\n _id\n completed_count\n average_passed\n total_passed\n total_failed\n }\n records {\n _id\n course_session_id\n course_session_assignment_id\n circle_id\n generation\n assignment_title\n assignment_type_translation_key\n details_url\n deadline\n metrics {\n _id\n passed_count\n failed_count\n unranked_count\n ranking_completed\n average_passed\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.
|
||||
*/
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
|
|
@ -1,6 +1,6 @@
|
|||
type Query {
|
||||
course_statistics(course_id: ID!): CourseStatisticsType
|
||||
mentor_course_statistics(course_id: ID!): CourseStatisticsType
|
||||
mentor_course_statistics(course_id: ID!): BaseStatisticsType
|
||||
course_progress(course_id: ID!): CourseProgressType
|
||||
dashboard_config: [DashboardConfigType!]!
|
||||
learning_path(id: ID, slug: String, course_id: ID, course_slug: String): LearningPathObjectType
|
||||
|
|
@ -30,13 +30,13 @@ type CourseStatisticsType {
|
|||
course_id: ID!
|
||||
course_title: String!
|
||||
course_slug: String!
|
||||
course_session_properties: StatisticsCourseSessionPropertiesType!
|
||||
course_session_selection_ids: [ID]!
|
||||
course_session_properties: StatisticsCourseSessionPropertiesType!
|
||||
user_selection_ids: [ID]
|
||||
assignments: AssignmentsStatisticsType!
|
||||
course_session_selection_metrics: StatisticsCourseSessionsSelectionMetricType!
|
||||
attendance_day_presences: AttendanceDayPresencesStatisticsType!
|
||||
feedback_responses: FeedbackStatisticsResponsesType!
|
||||
assignments: AssignmentsStatisticsType!
|
||||
competences: CompetencesStatisticsType!
|
||||
}
|
||||
|
||||
|
|
@ -57,6 +57,49 @@ type StatisticsCircleDataType {
|
|||
name: String!
|
||||
}
|
||||
|
||||
type AssignmentsStatisticsType {
|
||||
_id: ID!
|
||||
records: [AssignmentStatisticsRecordType!]!
|
||||
summary: AssignmentStatisticsSummaryType!
|
||||
}
|
||||
|
||||
type AssignmentStatisticsRecordType {
|
||||
_id: ID!
|
||||
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: AssignmentCompletionMetricsType!
|
||||
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 AssignmentCompletionMetricsType {
|
||||
_id: ID!
|
||||
passed_count: Int!
|
||||
failed_count: Int!
|
||||
unranked_count: Int!
|
||||
ranking_completed: Boolean!
|
||||
average_passed: Float!
|
||||
}
|
||||
|
||||
type AssignmentStatisticsSummaryType {
|
||||
_id: ID!
|
||||
completed_count: Int!
|
||||
average_passed: Float!
|
||||
total_passed: Int!
|
||||
total_failed: Int!
|
||||
}
|
||||
|
||||
type StatisticsCourseSessionsSelectionMetricType {
|
||||
_id: ID!
|
||||
session_count: Int!
|
||||
|
|
@ -81,13 +124,6 @@ type PresenceRecordStatisticsType {
|
|||
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 AttendanceSummaryStatisticsType {
|
||||
_id: ID!
|
||||
days_completed: Int!
|
||||
|
|
@ -118,42 +154,6 @@ type FeedbackStatisticsSummaryType {
|
|||
total_responses: Int!
|
||||
}
|
||||
|
||||
type AssignmentsStatisticsType {
|
||||
_id: ID!
|
||||
records: [AssignmentStatisticsRecordType!]!
|
||||
summary: AssignmentStatisticsSummaryType!
|
||||
}
|
||||
|
||||
type AssignmentStatisticsRecordType {
|
||||
_id: ID!
|
||||
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: AssignmentCompletionMetricsType!
|
||||
details_url: String!
|
||||
}
|
||||
|
||||
type AssignmentCompletionMetricsType {
|
||||
_id: ID!
|
||||
passed_count: Int!
|
||||
failed_count: Int!
|
||||
unranked_count: Int!
|
||||
ranking_completed: Boolean!
|
||||
average_passed: Float!
|
||||
}
|
||||
|
||||
type AssignmentStatisticsSummaryType {
|
||||
_id: ID!
|
||||
completed_count: Int!
|
||||
average_passed: Float!
|
||||
total_passed: Int!
|
||||
total_failed: Int!
|
||||
}
|
||||
|
||||
type CompetencesStatisticsType {
|
||||
_id: ID!
|
||||
summary: CompetencePerformanceStatisticsSummaryType!
|
||||
|
|
@ -177,6 +177,17 @@ type CompetenceRecordStatisticsType {
|
|||
details_url: String!
|
||||
}
|
||||
|
||||
type BaseStatisticsType {
|
||||
_id: ID!
|
||||
course_id: ID!
|
||||
course_title: String!
|
||||
course_slug: String!
|
||||
course_session_selection_ids: [ID]!
|
||||
course_session_properties: StatisticsCourseSessionPropertiesType!
|
||||
user_selection_ids: [ID]
|
||||
assignments: AssignmentsStatisticsType!
|
||||
}
|
||||
|
||||
type CourseProgressType {
|
||||
_id: ID!
|
||||
course_id: ID!
|
||||
|
|
@ -220,6 +231,7 @@ type CourseConfigurationObjectType {
|
|||
enable_circle_documents: Boolean!
|
||||
enable_learning_mentor: Boolean!
|
||||
enable_competence_certificates: Boolean!
|
||||
is_uk: Boolean!
|
||||
}
|
||||
|
||||
type LearningPathObjectType implements CoursePageInterface {
|
||||
|
|
|
|||
|
|
@ -15,6 +15,7 @@ export const AttendanceSummaryStatisticsType = "AttendanceSummaryStatisticsType"
|
|||
export const AttendanceUserInputType = "AttendanceUserInputType";
|
||||
export const AttendanceUserObjectType = "AttendanceUserObjectType";
|
||||
export const AttendanceUserStatus = "AttendanceUserStatus";
|
||||
export const BaseStatisticsType = "BaseStatisticsType";
|
||||
export const Boolean = "Boolean";
|
||||
export const CircleLightObjectType = "CircleLightObjectType";
|
||||
export const CircleObjectType = "CircleObjectType";
|
||||
|
|
|
|||
|
|
@ -220,6 +220,7 @@ export const COURSE_QUERY = graphql(`
|
|||
enable_circle_documents
|
||||
enable_learning_mentor
|
||||
enable_competence_certificates
|
||||
is_uk
|
||||
}
|
||||
action_competences {
|
||||
competence_id
|
||||
|
|
@ -304,6 +305,7 @@ export const DASHBOARD_CONFIG = graphql(`
|
|||
enable_circle_documents
|
||||
enable_learning_mentor
|
||||
enable_competence_certificates
|
||||
is_uk
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -410,6 +412,8 @@ export const DASHBOARD_COURSE_STATISTICS = graphql(`
|
|||
_id
|
||||
completed_count
|
||||
average_passed
|
||||
total_passed
|
||||
total_failed
|
||||
}
|
||||
records {
|
||||
_id
|
||||
|
|
@ -457,13 +461,51 @@ export const DASHBOARD_MENTOR_COMPETENCE_SUMMARY = graphql(`
|
|||
query mentorCourseStatistics($courseId: ID!) {
|
||||
mentor_course_statistics(course_id: $courseId) {
|
||||
_id
|
||||
course_id
|
||||
course_title
|
||||
course_slug
|
||||
course_session_properties {
|
||||
_id
|
||||
sessions {
|
||||
id
|
||||
name
|
||||
}
|
||||
generations
|
||||
circles {
|
||||
id
|
||||
name
|
||||
}
|
||||
}
|
||||
course_session_selection_ids
|
||||
user_selection_ids
|
||||
assignments {
|
||||
_id
|
||||
summary {
|
||||
_id
|
||||
completed_count
|
||||
average_passed
|
||||
total_passed
|
||||
total_failed
|
||||
}
|
||||
records {
|
||||
_id
|
||||
course_session_id
|
||||
course_session_assignment_id
|
||||
circle_id
|
||||
generation
|
||||
assignment_title
|
||||
assignment_type_translation_key
|
||||
details_url
|
||||
deadline
|
||||
metrics {
|
||||
_id
|
||||
passed_count
|
||||
failed_count
|
||||
unranked_count
|
||||
ranking_completed
|
||||
average_passed
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -40,7 +40,7 @@ const updateItems = async (_items: []) => {
|
|||
};
|
||||
|
||||
onMounted(async () => {
|
||||
const response = await itGet("/api/notify/email_notification_settings/");
|
||||
const response: any = await itGet("/api/notify/email_notification_settings/");
|
||||
items.value = items.value.map((item) => {
|
||||
item.checked = response.includes(item.value);
|
||||
return item;
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@ const circleDocumentsResultData = ref<CircleDocument[]>([]);
|
|||
let courseSessionDocumentsUrl = "";
|
||||
|
||||
async function fetchDocuments() {
|
||||
const result = await fetchCourseSessionDocuments(courseSession.value?.id);
|
||||
const result: any = await fetchCourseSessionDocuments(courseSession.value?.id);
|
||||
if (result.length > 0) {
|
||||
circleDocumentsResultData.value = result;
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -7,17 +7,14 @@ import SimpleDates from "@/components/dashboard/SimpleDates.vue";
|
|||
import ItDropdownSelect from "@/components/ui/ItDropdownSelect.vue";
|
||||
import { useDashboardStore } from "@/stores/dashboard";
|
||||
import type { DashboardType } from "@/gql/graphql";
|
||||
import type { DashboardCourseConfigType } from "@/services/dashboard";
|
||||
import { fetchDashboardConfigv2 } from "@/services/dashboard";
|
||||
import SimpleCoursePage from "@/pages/dashboard/SimpleCoursePage.vue";
|
||||
import LoadingSpinner from "@/components/ui/LoadingSpinner.vue";
|
||||
import CourseDetailDates from "@/components/dashboard/CourseDetailDates.vue";
|
||||
import NoCourseSession from "@/components/dashboard/NoCourseSession.vue";
|
||||
import MentorPage from "@/pages/dashboard/MentorPage.vue";
|
||||
import CoursePanel from "@/components/dashboard/CoursePanel.vue";
|
||||
import {
|
||||
DashboardConfigType,
|
||||
DashboardCourseConfigType,
|
||||
fetchDashboardConfigv2,
|
||||
} from "@/services/dashboard";
|
||||
|
||||
const dashboardStore = useDashboardStore();
|
||||
|
||||
|
|
@ -41,8 +38,8 @@ onMounted(async () => {
|
|||
await dashboardStore.loadDashboardDetails();
|
||||
});
|
||||
|
||||
function newDashboardConfigForId(id: string) {
|
||||
return dashboardConfigv2.value.find((config) => config.course_id == +id);
|
||||
function newDashboardConfigForId(id: string): DashboardCourseConfigType | undefined {
|
||||
return dashboardConfigv2.value.find((config) => config.course_id == id);
|
||||
}
|
||||
</script>
|
||||
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@ const courseSession = useCurrentCourseSession();
|
|||
const circleDocumentsResultData = ref<CircleDocument[]>([]);
|
||||
|
||||
async function fetchDocuments() {
|
||||
const result = await fetchCourseSessionDocuments(courseSession.value?.id);
|
||||
const result: any = await fetchCourseSessionDocuments(courseSession.value?.id);
|
||||
if (result.length > 0) {
|
||||
circleDocumentsResultData.value = result;
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ const documents = ref<BlockDocument[]>([]);
|
|||
|
||||
onMounted(async () => {
|
||||
log.debug("DocumentListBlock mounted");
|
||||
const response = await itGetCached(`/api/course/page/${props.content.slug}/`);
|
||||
const response: any = await itGetCached(`/api/course/page/${props.content.slug}/`);
|
||||
documents.value = response.documents;
|
||||
});
|
||||
</script>
|
||||
|
|
|
|||
|
|
@ -64,7 +64,7 @@ async function startTest() {
|
|||
extendedTimeTest.value = true;
|
||||
}
|
||||
|
||||
const response = await itPost("/api/core/edoniq-test/redirect/", {
|
||||
const response: any = await itPost("/api/core/edoniq-test/redirect/", {
|
||||
learning_content_id: props.content.id,
|
||||
extended_time_test: extendedTimeTest.value,
|
||||
});
|
||||
|
|
|
|||
|
|
@ -202,7 +202,7 @@ const executePayment = () => {
|
|||
redirect_url: fullHost,
|
||||
address: address.value,
|
||||
product: props.courseType,
|
||||
}).then((res) => {
|
||||
}).then((res: any) => {
|
||||
console.log("Going to next page", res.next_step_url);
|
||||
window.location.href = res.next_step_url;
|
||||
});
|
||||
|
|
|
|||
|
|
@ -12,6 +12,7 @@ import {
|
|||
} from "@/router/guards";
|
||||
import { addToHistory } from "@/router/history";
|
||||
import { onboardingRedirect } from "@/router/onboarding";
|
||||
import type { RouteLocationNormalized } from "vue-router";
|
||||
import { createRouter, createWebHistory } from "vue-router";
|
||||
|
||||
const router = createRouter({
|
||||
|
|
@ -404,10 +405,10 @@ router.beforeEach(
|
|||
async function ignoreGuardsForHomeRoute(
|
||||
to: RouteLocationNormalized,
|
||||
from: RouteLocationNormalized,
|
||||
guard: NavigationGuardNext
|
||||
guard: any
|
||||
) {
|
||||
if (to.name !== "home") {
|
||||
return await guard(to, from);
|
||||
return await guard(to);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ export function useEntities() {
|
|||
const countries: Ref<Country[]> = ref([]);
|
||||
const organisations: Ref<Organisation[]> = ref([]);
|
||||
|
||||
itGetCached("/api/core/entities/").then((res) => {
|
||||
itGetCached("/api/core/entities/").then((res: any) => {
|
||||
countries.value = res.countries;
|
||||
organisations.value = res.organisations;
|
||||
});
|
||||
|
|
|
|||
|
|
@ -84,7 +84,7 @@ export async function uploadCircleDocument(
|
|||
throw new Error("No file selected");
|
||||
}
|
||||
|
||||
const startData = await startFileUpload(data, courseSessionId);
|
||||
const startData: any = await startFileUpload(data, courseSessionId);
|
||||
|
||||
await uploadFile(startData, data.file);
|
||||
const response = itPost(`/api/core/file/finish/`, {
|
||||
|
|
|
|||
|
|
@ -69,7 +69,7 @@ export const useLearningMentees = (
|
|||
error.value = null;
|
||||
|
||||
itGet(`/api/mentor/${courseSessionId}/summary`)
|
||||
.then((response) => {
|
||||
.then((response: any) => {
|
||||
summary.value = response;
|
||||
})
|
||||
.catch((err) => (error.value = err))
|
||||
|
|
|
|||
|
|
@ -46,7 +46,7 @@ export const useCompletionStore = defineStore({
|
|||
}
|
||||
|
||||
if (courseSessionId) {
|
||||
const completionData = await itPost("/api/course/completion/mark/", {
|
||||
const completionData: any = await itPost("/api/course/completion/mark/", {
|
||||
page_id: page.id,
|
||||
completion_status: page.completion_status,
|
||||
course_session_id: courseSessionId,
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ export const useMediaLibraryStore = defineStore({
|
|||
return this.mediaLibraryPage;
|
||||
}
|
||||
log.debug("load mediaLibraryPageData");
|
||||
const mediaLibraryPageData = await itGet(`/api/course/page/${slug}/`);
|
||||
const mediaLibraryPageData: any = await itGet(`/api/course/page/${slug}/`);
|
||||
|
||||
if (!mediaLibraryPageData) {
|
||||
throw `No mediaLibraryPageData found with: ${slug}`;
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@ export const useNotificationsStore = defineStore("notifications", () => {
|
|||
}
|
||||
|
||||
async function updateUnreadCount() {
|
||||
const data = await itGet("/notifications/api/unread_count/");
|
||||
const data: any = await itGet("/notifications/api/unread_count/");
|
||||
hasUnread.value = data.unread_count !== 0;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -155,7 +155,7 @@ export const useUserStore = defineStore({
|
|||
});
|
||||
},
|
||||
async fetchUser() {
|
||||
const data = await itGetCached("/api/core/me/");
|
||||
const data: any = await itGetCached("/api/core/me/");
|
||||
this.$state = data;
|
||||
this.loggedIn = true;
|
||||
await setLocale(data.language);
|
||||
|
|
|
|||
|
|
@ -95,6 +95,7 @@ class CourseConfigurationObjectType(DjangoObjectType):
|
|||
"enable_circle_documents",
|
||||
"enable_learning_mentor",
|
||||
"enable_competence_certificates",
|
||||
"is_uk",
|
||||
)
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -12,6 +12,7 @@ from vbv_lernwelt.course.models import Course, CourseSession, CourseSessionUser
|
|||
from vbv_lernwelt.course_session_group.models import CourseSessionGroup
|
||||
from vbv_lernwelt.dashboard.graphql.types.competence import competences
|
||||
from vbv_lernwelt.dashboard.graphql.types.dashboard import (
|
||||
BaseStatisticsType,
|
||||
CourseProgressType,
|
||||
CourseStatisticsType,
|
||||
DashboardConfigType,
|
||||
|
|
@ -33,7 +34,7 @@ class DashboardQuery(graphene.ObjectType):
|
|||
)
|
||||
|
||||
mentor_course_statistics = graphene.Field(
|
||||
CourseStatisticsType, course_id=graphene.ID(required=True)
|
||||
BaseStatisticsType, course_id=graphene.ID(required=True)
|
||||
)
|
||||
|
||||
course_progress = graphene.Field(
|
||||
|
|
|
|||
|
|
@ -87,16 +87,32 @@ class CourseProgressType(graphene.ObjectType):
|
|||
assignment = graphene.Field(ProgressDashboardAssignmentType, required=False)
|
||||
|
||||
|
||||
class CourseStatisticsType(graphene.ObjectType):
|
||||
class BaseStatisticsType(graphene.ObjectType):
|
||||
_id = graphene.ID(required=True)
|
||||
course_id = graphene.ID(required=True)
|
||||
course_title = graphene.String(required=True)
|
||||
course_slug = graphene.String(required=True)
|
||||
course_session_selection_ids = graphene.List(graphene.ID, required=True)
|
||||
course_session_properties = graphene.Field(
|
||||
StatisticsCourseSessionPropertiesType, required=True
|
||||
)
|
||||
course_session_selection_ids = graphene.List(graphene.ID, required=True)
|
||||
user_selection_ids = graphene.List(graphene.ID, required=False)
|
||||
assignments = graphene.Field(AssignmentsStatisticsType, required=True)
|
||||
|
||||
def resolve_assignments(root, _info) -> AssignmentsStatisticsType:
|
||||
user_selection_ids = (
|
||||
[str(user) for user in root.user_selection_ids]
|
||||
if root.user_selection_ids
|
||||
else None
|
||||
) # noqa
|
||||
return assignments(
|
||||
course_id=root.course_id,
|
||||
course_session_selection_ids=root.course_session_selection_ids,
|
||||
user_selection_ids=user_selection_ids,
|
||||
)
|
||||
|
||||
|
||||
class CourseStatisticsType(BaseStatisticsType):
|
||||
course_session_selection_metrics = graphene.Field(
|
||||
StatisticsCourseSessionsSelectionMetricType, required=True
|
||||
)
|
||||
|
|
@ -104,7 +120,6 @@ class CourseStatisticsType(graphene.ObjectType):
|
|||
AttendanceDayPresencesStatisticsType, required=True
|
||||
)
|
||||
feedback_responses = graphene.Field(FeedbackStatisticsResponsesType, required=True)
|
||||
assignments = graphene.Field(AssignmentsStatisticsType, required=True)
|
||||
competences = graphene.Field(CompetencesStatisticsType, required=True)
|
||||
|
||||
def resolve_attendance_day_presences(
|
||||
|
|
@ -145,18 +160,6 @@ class CourseStatisticsType(graphene.ObjectType):
|
|||
),
|
||||
)
|
||||
|
||||
def resolve_assignments(root, _info) -> AssignmentsStatisticsType:
|
||||
user_selection_ids = (
|
||||
[str(user) for user in root.user_selection_ids]
|
||||
if root.user_selection_ids
|
||||
else None
|
||||
) # noqa
|
||||
return assignments(
|
||||
course_id=root.course_id,
|
||||
course_session_selection_ids=root.course_session_selection_ids,
|
||||
user_selection_ids=user_selection_ids,
|
||||
)
|
||||
|
||||
def resolve_course_session_selection_metrics(
|
||||
root, info
|
||||
) -> StatisticsCourseSessionsSelectionMetricType:
|
||||
|
|
|
|||
Loading…
Reference in New Issue