diff --git a/client/src/components/dashboard/BaseBox.vue b/client/src/components/dashboard/BaseBox.vue
index f98d6fb9..e8c3aec3 100644
--- a/client/src/components/dashboard/BaseBox.vue
+++ b/client/src/components/dashboard/BaseBox.vue
@@ -12,7 +12,7 @@ defineProps<{
-
+
{{ $t("a.Details anschauen") }}
diff --git a/client/src/components/dashboard/CompetenceSummaryBox.vue b/client/src/components/dashboard/CompetenceSummaryBox.vue
index 18169f9a..6c2a7cca 100644
--- a/client/src/components/dashboard/CompetenceSummaryBox.vue
+++ b/client/src/components/dashboard/CompetenceSummaryBox.vue
@@ -9,14 +9,19 @@ defineProps<{
-
+
{{ $t("a.Selbsteinschätzungen") }}
- {{ successCount }}
+
+ {{ successCount }}
+
@@ -24,7 +29,12 @@ defineProps<{
- {{ failCount }}
+
+ {{ failCount }}
+
diff --git a/client/src/components/dashboard/CourseStatistics.vue b/client/src/components/dashboard/CourseStatistics.vue
index 009d277c..c4942c93 100644
--- a/client/src/components/dashboard/CourseStatistics.vue
+++ b/client/src/components/dashboard/CourseStatistics.vue
@@ -10,19 +10,19 @@ defineProps<{
-
+
{{ participantCount }}
{{ $t("a.Teilnehmer") }}
-
+
{{ expertCount }}
{{ $t("a.Trainer") }}
-
+
{{ sessionCount }}
{{ $t("a.Durchführungen") }}
diff --git a/client/src/components/dashboard/FeedbackSummaryBox.vue b/client/src/components/dashboard/FeedbackSummaryBox.vue
index 30d8e264..0c80d5cf 100644
--- a/client/src/components/dashboard/FeedbackSummaryBox.vue
+++ b/client/src/components/dashboard/FeedbackSummaryBox.vue
@@ -15,7 +15,7 @@ const satisfactionColor = computed(() => {
-
+
{{ $t("a.Feedback Teilnehmer") }}
@@ -26,7 +26,10 @@ const satisfactionColor = computed(() => {
>
-
+
{{ props.statisfactionAvg.toFixed(1) }}
@@ -41,7 +44,9 @@ const satisfactionColor = computed(() => {
- {{ props.feedbackCount }}
+
+ {{ props.feedbackCount }}
+
diff --git a/cypress/e2e/dashboard/dashboardSupervisor.cy.js b/cypress/e2e/dashboard/dashboardSupervisor.cy.js
new file mode 100644
index 00000000..7ed71457
--- /dev/null
+++ b/cypress/e2e/dashboard/dashboardSupervisor.cy.js
@@ -0,0 +1,62 @@
+import {login} from "../helpers";
+
+const getDashboardStatistics = (what) => {
+ return cy.get(`[data-cy="dashboard.stats.${what}"]`);
+};
+
+const clickOnDetailsLink = (within) => {
+ cy.get(`[data-cy="dashboard.stats.${within}"]`).within(() => {
+ cy.get('[data-cy="basebox.detailsLink"]').click();
+ })
+};
+
+describe("dashboardSupervisor.cy.js", () => {
+ beforeEach(() => {
+ cy.manageCommand("cypress_reset --create-assignment-evaluation --create-feedback-responses --create-course-completion-performance-criteria --create-attendance-days");
+ login("test-supervisor1@example.com", "test");
+ cy.visit("/");
+ });
+
+ describe("overall summary box", () => {
+ it("contains correct numbers (members, experts etc.)", () => {
+ getDashboardStatistics("participant.count").should("have.text", "4");
+ getDashboardStatistics("expert.count").should("have.text", "1");
+ getDashboardStatistics("session.count").should("have.text", "2");
+ });
+ });
+
+ describe("feedback summary box", () => {
+ it("contains correct numbers", () => {
+ getDashboardStatistics("feedback.average").should("have.text", "3.3");
+ getDashboardStatistics("feedback.count").should("have.text", "3");
+
+ });
+ it("contains correct details link", () => {
+ clickOnDetailsLink("feedback");
+ cy.url().should("contain", "/statistic/feedback");
+
+ // might be improved: roughly check
+ // that the correct data is displayed
+ cy.contains("3.3 von 4");
+ cy.contains("Test Trainer1");
+ cy.contains("Durchführung «Test Bern 2022 a»")
+ cy.contains("Circle «Fahrzeug»")
+ });
+ });
+
+ describe("competence summary box", () => {
+ it("contains correct numbers", () => {
+ getDashboardStatistics("competence.success").should("have.text", "1");
+ getDashboardStatistics("competence.fail").should("have.text", "0");
+ });
+ it("contains correct details link", () => {
+ clickOnDetailsLink("competence");
+ cy.url().should("contain", "/statistic/competence");
+
+ // might be improved: roughly check
+ // that the correct data is displayed
+ cy.contains("Selbsteinschätzung: Learning Unit");
+ cy.contains("Durchführung «Test Bern 2022 a»");
+ });
+ });
+});
diff --git a/server/vbv_lernwelt/core/management/commands/cypress_reset.py b/server/vbv_lernwelt/core/management/commands/cypress_reset.py
index 12fc46b6..2fb18626 100644
--- a/server/vbv_lernwelt/core/management/commands/cypress_reset.py
+++ b/server/vbv_lernwelt/core/management/commands/cypress_reset.py
@@ -1,4 +1,7 @@
+from datetime import timedelta
+
import djclick as click
+from django.utils import timezone
from vbv_lernwelt.assignment.models import Assignment, AssignmentCompletion
from vbv_lernwelt.core.constants import (
@@ -15,9 +18,21 @@ from vbv_lernwelt.course.creators.test_course import (
create_test_assignment_evaluation_data,
create_test_assignment_submitted_data,
)
-from vbv_lernwelt.course.models import CourseCompletion, CourseSession
+from vbv_lernwelt.course.creators.test_utils import (
+ create_attendance_course,
+ create_performance_criteria_page,
+)
+from vbv_lernwelt.course.models import (
+ Course,
+ CourseCompletion,
+ CourseCompletionStatus,
+ CourseSession,
+)
+from vbv_lernwelt.course.services import mark_course_completion
+from vbv_lernwelt.course_session.models import CourseSessionAttendanceCourse
+from vbv_lernwelt.course_session.services.attendance import AttendanceUserStatus
from vbv_lernwelt.feedback.models import FeedbackResponse
-from vbv_lernwelt.learnpath.models import LearningContentFeedback
+from vbv_lernwelt.learnpath.models import Circle, LearningContentFeedback
from vbv_lernwelt.notify.models import Notification
@@ -49,18 +64,31 @@ from vbv_lernwelt.notify.models import Notification
default=False,
help="will create feedback response data",
)
+@click.option(
+ "--create-course-completion-performance-criteria/--no-create-course-completion-performance-criteria",
+ default=False,
+ help="will create course completion performance criteria data",
+)
+@click.option(
+ "--create-attendance-days/--no-create-attendance-days",
+ default=False,
+ help="will create attendance days data",
+)
def command(
create_assignment_completion,
create_assignment_evaluation,
assignment_evaluation_scores,
create_edoniq_test_results,
create_feedback_responses,
+ create_course_completion_performance_criteria,
+ create_attendance_days,
):
print("cypress reset data")
CourseCompletion.objects.all().delete()
Notification.objects.all().delete()
AssignmentCompletion.objects.all().delete()
FeedbackResponse.objects.all().delete()
+ CourseSessionAttendanceCourse.objects.all().delete()
User.objects.all().update(language="de")
User.objects.all().update(additional_json_data={})
@@ -171,3 +199,50 @@ def command(
"course_positive_feedback": "Die Präsentation war super",
},
)
+
+ if create_course_completion_performance_criteria:
+ member = User.objects.get(id=TEST_STUDENT1_USER_ID)
+ course = Course.objects.get(slug="test-lehrgang")
+ course_session = CourseSession.objects.get(id=TEST_COURSE_SESSION_BERN_ID)
+
+ # circle, _ = create_circle(
+ # title="How to circle like a pro!", course_page=course.coursepage
+ # )
+
+ circle = Circle.objects.get(slug="überbetriebliche-kurse-lp-circle-kickoff")
+
+ mark_course_completion(
+ page=create_performance_criteria_page(
+ course=course,
+ course_page=course.coursepage,
+ circle=circle,
+ ),
+ user=member,
+ course_session=course_session,
+ completion_status=CourseCompletionStatus.SUCCESS.value,
+ )
+
+ if create_attendance_days:
+ course_session = CourseSession.objects.get(id=TEST_COURSE_SESSION_BERN_ID)
+ course = course_session.course
+
+ # circle, _ = create_circle(
+ # title="Circle to attend", course_page=course_session.course.coursepage
+ # )
+ circle = Circle.objects.get(slug="überbetriebliche-kurse-lp-circle-kickoff")
+
+ create_attendance_course(
+ course_session=course_session,
+ circle=circle,
+ due_date_end=timezone.now() - timedelta(hours=2),
+ attendance_user_list=[
+ {
+ "user_id": TEST_STUDENT1_USER_ID,
+ "status": AttendanceUserStatus.PRESENT.value,
+ },
+ {
+ "user_id": TEST_STUDENT2_USER_ID,
+ "status": AttendanceUserStatus.ABSENT.value,
+ },
+ ],
+ )