Show correct numbers for subset of users on AssignmentSubmissionProgress
This commit is contained in:
parent
4f6b14efae
commit
661f5aa435
|
|
@ -32,7 +32,8 @@ const state = reactive({
|
||||||
});
|
});
|
||||||
|
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
const { assignmentSubmittedUsers, gradedUsers, total } =
|
// eslint-disable-next-line prefer-const
|
||||||
|
let { assignmentSubmittedUsers, gradedUsers, total } =
|
||||||
await loadAssignmentCompletionStatusData(
|
await loadAssignmentCompletionStatusData(
|
||||||
props.learningContent.content_assignment.id,
|
props.learningContent.content_assignment.id,
|
||||||
props.courseSession.id,
|
props.courseSession.id,
|
||||||
|
|
@ -40,6 +41,10 @@ onMounted(async () => {
|
||||||
props.userSelectionIds
|
props.userSelectionIds
|
||||||
);
|
);
|
||||||
|
|
||||||
|
if (props.userSelectionIds && props.userSelectionIds.length > 0) {
|
||||||
|
total = props.userSelectionIds.length;
|
||||||
|
}
|
||||||
|
|
||||||
state.submissionProgressStatusCount = {
|
state.submissionProgressStatusCount = {
|
||||||
SUCCESS: assignmentSubmittedUsers.length,
|
SUCCESS: assignmentSubmittedUsers.length,
|
||||||
UNKNOWN: total - assignmentSubmittedUsers.length,
|
UNKNOWN: total - assignmentSubmittedUsers.length,
|
||||||
|
|
@ -57,6 +62,9 @@ const doneCount = (status: StatusCount) => {
|
||||||
};
|
};
|
||||||
|
|
||||||
const totalCount = (status: StatusCount) => {
|
const totalCount = (status: StatusCount) => {
|
||||||
|
if (props.userSelectionIds && props.userSelectionIds.length > 0) {
|
||||||
|
return props.userSelectionIds.length;
|
||||||
|
}
|
||||||
return doneCount(status) + status.UNKNOWN || 0;
|
return doneCount(status) + status.UNKNOWN || 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,6 @@ import * as log from "loglevel";
|
||||||
import { computed } from "vue";
|
import { computed } from "vue";
|
||||||
import type { LearningContentAssignment, LearningContentEdoniqTest } from "@/types";
|
import type { LearningContentAssignment, LearningContentEdoniqTest } from "@/types";
|
||||||
import { useExpertCockpitPageData } from "@/pages/cockpit/cockpitPage/composables";
|
import { useExpertCockpitPageData } from "@/pages/cockpit/cockpitPage/composables";
|
||||||
import { getPreviousRoute } from "@/router/history";
|
|
||||||
|
|
||||||
const props = defineProps<{
|
const props = defineProps<{
|
||||||
courseSlug: string;
|
courseSlug: string;
|
||||||
|
|
|
||||||
|
|
@ -24,9 +24,11 @@ const courseId = ref<string | undefined>(undefined);
|
||||||
const agentAssignmentData = ref<BaseStatisticsType | null>(null);
|
const agentAssignmentData = ref<BaseStatisticsType | null>(null);
|
||||||
|
|
||||||
const courseSessionName = (courseSessionId: string) => {
|
const courseSessionName = (courseSessionId: string) => {
|
||||||
return agentAssignmentData.value?.course_session_properties?.sessions.find(
|
return (
|
||||||
|
agentAssignmentData.value?.course_session_properties?.sessions.find(
|
||||||
(session) => session.id === courseSessionId
|
(session) => session.id === courseSessionId
|
||||||
)?.name;
|
)?.name ?? ""
|
||||||
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
const circleMeta = (circleId: string) => {
|
const circleMeta = (circleId: string) => {
|
||||||
|
|
@ -71,7 +73,7 @@ onMounted(async () => {
|
||||||
v-if="agentAssignmentData"
|
v-if="agentAssignmentData"
|
||||||
:course-statistics="agentAssignmentData"
|
:course-statistics="agentAssignmentData"
|
||||||
:course-session-name="courseSessionName"
|
:course-session-name="courseSessionName"
|
||||||
:circle-meta="circleMeta"
|
:circle-meta="circleMeta as any"
|
||||||
:detail-base-url="`/statistic/${props.agentRole}/${props.courseSlug}/assignment/`"
|
:detail-base-url="`/statistic/${props.agentRole}/${props.courseSlug}/assignment/`"
|
||||||
></AssignmentList>
|
></AssignmentList>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -59,7 +59,6 @@ const itemDetailUrl = (item: AssignmentStatisticsRecordType) => {
|
||||||
}
|
}
|
||||||
return item.details_url;
|
return item.details_url;
|
||||||
};
|
};
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
import { useCourseSessionDetailQuery } from "@/composables";
|
import { useCourseSessionDetailQuery } from "@/composables";
|
||||||
import { itGet, itPost } from "@/fetchHelpers";
|
import { itPost } from "@/fetchHelpers";
|
||||||
import type {
|
import type {
|
||||||
Assignment,
|
Assignment,
|
||||||
AssignmentCompletion,
|
AssignmentCompletion,
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,6 @@ import {
|
||||||
|
|
||||||
import { itGetCached, itPost } from "@/fetchHelpers";
|
import { itGetCached, itPost } from "@/fetchHelpers";
|
||||||
import type {
|
import type {
|
||||||
AssignmentsStatisticsType,
|
|
||||||
BaseStatisticsType,
|
BaseStatisticsType,
|
||||||
CourseProgressType,
|
CourseProgressType,
|
||||||
CourseStatisticsType,
|
CourseStatisticsType,
|
||||||
|
|
@ -111,6 +110,7 @@ export const fetchStatisticData = async (
|
||||||
console.error("Error fetching statistics for course ID:", courseId, res.error);
|
console.error("Error fetching statistics for course ID:", courseId, res.error);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// @ts-ignore
|
||||||
return res.data?.course_statistics || null;
|
return res.data?.course_statistics || null;
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error(`Error fetching statistics for course ID: ${courseId}`, error);
|
console.error(`Error fetching statistics for course ID: ${courseId}`, error);
|
||||||
|
|
|
||||||
|
|
@ -395,7 +395,7 @@ def get_widgets_for_course(
|
||||||
|
|
||||||
if "BERUFSBILDNER" in relation_roles:
|
if "BERUFSBILDNER" in relation_roles:
|
||||||
if is_uk:
|
if is_uk:
|
||||||
widgets.append(WidgetType.UK_STATISTICS_WIDGET.value)
|
widgets.append(WidgetType.UK_BERUFSBILDNER_STATISTICS_WIDGET.value)
|
||||||
|
|
||||||
return widgets
|
return widgets
|
||||||
|
|
||||||
|
|
@ -532,7 +532,9 @@ def get_mentor_open_tasks_count(request, course_id: str):
|
||||||
return Response(
|
return Response(
|
||||||
status=200,
|
status=200,
|
||||||
data={
|
data={
|
||||||
"open_task_count": _get_mentor_open_tasks_count(course_id, request.user) # noqa
|
"open_task_count": _get_mentor_open_tasks_count(
|
||||||
|
course_id, request.user
|
||||||
|
) # noqa
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
except PermissionDenied as e:
|
except PermissionDenied as e:
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue