feat: praxis assigment evaluation user
This commit is contained in:
parent
10c8178aaa
commit
2bf741ab67
|
|
@ -73,7 +73,7 @@ const onSubmit = async () => {
|
|||
></ItCheckbox>
|
||||
|
||||
<div>
|
||||
<select v-model="selectedLearningMentor">
|
||||
<select v-model="selectedLearningMentor" data-cy="select-learning-mentor">
|
||||
<option
|
||||
v-for="learningMentor in learningMentors"
|
||||
:key="learningMentor.id"
|
||||
|
|
|
|||
|
|
@ -1,29 +1,29 @@
|
|||
import { TEST_STUDENT1_USER_ID } from "../../consts";
|
||||
import { login } from "../helpers";
|
||||
|
||||
function completePraxisAssignment(selectExpert = false) {
|
||||
function completePraxisAssignment() {
|
||||
cy.visit("/course/test-lehrgang/learn/reisen/mein-kundenstamm");
|
||||
cy.learningContentMultiLayoutNextStep();
|
||||
cy.testLearningContentTitle(
|
||||
"Teilaufgabe 1: Filtere nach Kundeneigenschaften"
|
||||
);
|
||||
cy.get('[data-cy="it-textarea-user-text-input-1"]')
|
||||
cy.get("[data-cy=\"it-textarea-user-text-input-1\"]")
|
||||
.clear()
|
||||
.type("Hallo Teilaufgabe 1.1");
|
||||
cy.wait(550);
|
||||
cy.get('[data-cy="it-textarea-user-text-input-2"]')
|
||||
cy.get("[data-cy=\"it-textarea-user-text-input-2\"]")
|
||||
.clear()
|
||||
.type("Hallo Teilaufgabe 1.2");
|
||||
cy.wait(550);
|
||||
cy.get('[data-cy="it-textarea-user-text-input-3"]')
|
||||
cy.get("[data-cy=\"it-textarea-user-text-input-3\"]")
|
||||
.clear()
|
||||
.type("Hallo Teilaufgabe 1.3");
|
||||
cy.wait(550);
|
||||
cy.get('[data-cy="it-textarea-user-text-input-4"]')
|
||||
cy.get("[data-cy=\"it-textarea-user-text-input-4\"]")
|
||||
.clear()
|
||||
.type("Hallo Teilaufgabe 1.4");
|
||||
cy.wait(550);
|
||||
cy.get('[data-cy="it-textarea-user-text-input-5"]')
|
||||
cy.get("[data-cy=\"it-textarea-user-text-input-5\"]")
|
||||
.clear()
|
||||
.type("Hallo Teilaufgabe 1.5");
|
||||
// wait because of input debounce
|
||||
|
|
@ -32,19 +32,19 @@ function completePraxisAssignment(selectExpert = false) {
|
|||
|
||||
// step 2
|
||||
cy.testLearningContentTitle("Teilaufgabe 2: Filtere nach Versicherungen");
|
||||
cy.get('[data-cy="it-textarea-user-text-input-1"]')
|
||||
cy.get("[data-cy=\"it-textarea-user-text-input-1\"]")
|
||||
.clear()
|
||||
.type("Hallo Teilaufgabe 2.1");
|
||||
cy.wait(550);
|
||||
cy.get('[data-cy="it-textarea-user-text-input-2"]')
|
||||
cy.get("[data-cy=\"it-textarea-user-text-input-2\"]")
|
||||
.clear()
|
||||
.type("Hallo Teilaufgabe 2.2");
|
||||
cy.wait(550);
|
||||
cy.get('[data-cy="it-textarea-user-text-input-3"]')
|
||||
cy.get("[data-cy=\"it-textarea-user-text-input-3\"]")
|
||||
.clear()
|
||||
.type("Hallo Teilaufgabe 2.3");
|
||||
cy.wait(550);
|
||||
cy.get('[data-cy="it-textarea-user-text-input-4"]')
|
||||
cy.get("[data-cy=\"it-textarea-user-text-input-4\"]")
|
||||
.clear()
|
||||
.type("Hallo Teilaufgabe 2.4");
|
||||
// wait because of input debounce
|
||||
|
|
@ -66,11 +66,11 @@ function completePraxisAssignment(selectExpert = false) {
|
|||
cy.testLearningContentTitle(
|
||||
"Teilaufgabe 3: Filtere nach besonderen Ereignissen"
|
||||
);
|
||||
cy.get('[data-cy="it-textarea-user-text-input-1"]')
|
||||
cy.get("[data-cy=\"it-textarea-user-text-input-1\"]")
|
||||
.clear()
|
||||
.type("Hallo Teilaufgabe 3.1");
|
||||
cy.wait(550);
|
||||
cy.get('[data-cy="it-textarea-user-text-input-2"]')
|
||||
cy.get("[data-cy=\"it-textarea-user-text-input-2\"]")
|
||||
.clear()
|
||||
.type("Hallo Teilaufgabe 3.2");
|
||||
// wait because of input debounce
|
||||
|
|
@ -79,7 +79,7 @@ function completePraxisAssignment(selectExpert = false) {
|
|||
|
||||
// step 4
|
||||
cy.testLearningContentTitle("Teilaufgabe 4: Kundentelefonate");
|
||||
cy.get('[data-cy="it-textarea-user-text-input-0"]')
|
||||
cy.get("[data-cy=\"it-textarea-user-text-input-0\"]")
|
||||
.clear()
|
||||
.type("Hallo Teilaufgabe 4.1");
|
||||
// wait because of input debounce
|
||||
|
|
@ -88,23 +88,24 @@ function completePraxisAssignment(selectExpert = false) {
|
|||
|
||||
// step 5
|
||||
cy.testLearningContentTitle("Teilaufgabe 5: Kundentelefonate2");
|
||||
cy.get('[data-cy="it-textarea-user-text-input-0"]')
|
||||
cy.get("[data-cy=\"it-textarea-user-text-input-0\"]")
|
||||
.clear()
|
||||
.type("Hallo Teilaufgabe 5.1");
|
||||
// wait because of input debounce
|
||||
cy.wait(550);
|
||||
cy.learningContentMultiLayoutNextStep();
|
||||
|
||||
cy.get('[data-cy="confirm-submit-results"]').should("not.exist");
|
||||
cy.get('[data-cy="confirm-submit-person"]').should(
|
||||
cy.get("[data-cy=\"confirm-submit-results\"]").should("not.exist");
|
||||
cy.get("[data-cy=\"confirm-submit-person\"]").should(
|
||||
"contain",
|
||||
"Folgende Person soll mir Feedback zu meinen Ergebnissen geben."
|
||||
);
|
||||
if (selectExpert) {
|
||||
cy.get('[data-cy="confirm-submit-person"]').click();
|
||||
}
|
||||
cy.get('[data-cy="submit-assignment"]').click();
|
||||
cy.get('[data-cy="success-text"]').should("exist");
|
||||
|
||||
cy.get("[data-cy=\"confirm-submit-person\"]").click();
|
||||
cy.get("[data-cy='select-learning-mentor']").should("be.visible").select(0);
|
||||
|
||||
cy.get("[data-cy=\"submit-assignment\"]").click();
|
||||
cy.get("[data-cy=\"success-text\"]").should("exist");
|
||||
|
||||
// app goes back to circle view -> check if assignment is marked as completed
|
||||
cy.url().should((url) => {
|
||||
|
|
@ -112,13 +113,13 @@ function completePraxisAssignment(selectExpert = false) {
|
|||
});
|
||||
cy.reload();
|
||||
cy.get(
|
||||
'[data-cy="test-lehrgang-lp-circle-reisen-lc-mein-kundenstamm-checkbox"]'
|
||||
"[data-cy=\"test-lehrgang-lp-circle-reisen-lc-mein-kundenstamm-checkbox\"]"
|
||||
).should("have.class", "cy-checked");
|
||||
}
|
||||
|
||||
describe("assignmentStudent.cy.js", () => {
|
||||
beforeEach(() => {
|
||||
cy.manageCommand("cypress_reset");
|
||||
cy.manageCommand("cypress_reset --create-learning-mentor");
|
||||
login("test-student1@example.com", "test");
|
||||
cy.visit(
|
||||
"/course/test-lehrgang/learn/fahrzeug/überprüfen-einer-motorfahrzeug-versicherungspolice"
|
||||
|
|
@ -162,10 +163,10 @@ describe("assignmentStudent.cy.js", () => {
|
|||
"Teilaufgabe 1: Beispiel einer Versicherungspolice finden"
|
||||
);
|
||||
// Click confirmation
|
||||
cy.get('[data-cy="it-checkbox-confirmation-1"]').click();
|
||||
cy.get("[data-cy=\"it-checkbox-confirmation-1\"]").click();
|
||||
|
||||
cy.reload();
|
||||
cy.get('[data-cy="it-checkbox-confirmation-1"]').should(
|
||||
cy.get("[data-cy=\"it-checkbox-confirmation-1\"]").should(
|
||||
"have.class",
|
||||
"cy-checked"
|
||||
);
|
||||
|
|
@ -179,14 +180,14 @@ describe("assignmentStudent.cy.js", () => {
|
|||
"Teilaufgabe 2: Kundensituation und Ausgangslage"
|
||||
);
|
||||
// Enter text
|
||||
cy.get('[data-cy="it-textarea-user-text-input-1"]')
|
||||
cy.get("[data-cy=\"it-textarea-user-text-input-1\"]")
|
||||
.clear()
|
||||
.type("Hallovelo");
|
||||
// wait because of input debounce
|
||||
cy.wait(550);
|
||||
cy.reload();
|
||||
|
||||
cy.get('[data-cy="it-textarea-user-text-input-1"]').should(
|
||||
cy.get("[data-cy=\"it-textarea-user-text-input-1\"]").should(
|
||||
"have.value",
|
||||
"Hallovelo"
|
||||
);
|
||||
|
|
@ -200,7 +201,7 @@ describe("assignmentStudent.cy.js", () => {
|
|||
});
|
||||
|
||||
it("can visit sub step by clicking navigation bar", () => {
|
||||
cy.get('[data-cy="nav-progress-step-4"]').click();
|
||||
cy.get("[data-cy=\"nav-progress-step-4\"]").click();
|
||||
cy.testLearningContentTitle("Teilaufgabe 4: Deine Empfehlungen");
|
||||
});
|
||||
|
||||
|
|
@ -208,10 +209,10 @@ describe("assignmentStudent.cy.js", () => {
|
|||
cy.visit(
|
||||
"/course/test-lehrgang/learn/fahrzeug/überprüfen-einer-motorfahrzeug-versicherungspolice?step=7"
|
||||
);
|
||||
cy.get('[data-cy="confirm-submit-results"] label').click();
|
||||
cy.get('[data-cy="confirm-submit-person"]').click();
|
||||
cy.get('[data-cy="submit-assignment"]').click();
|
||||
cy.get('[data-cy="success-text"]').should("exist");
|
||||
cy.get("[data-cy=\"confirm-submit-results\"] label").click();
|
||||
cy.get("[data-cy=\"confirm-submit-person\"]").click();
|
||||
cy.get("[data-cy=\"submit-assignment\"]").click();
|
||||
cy.get("[data-cy=\"success-text\"]").should("exist");
|
||||
|
||||
// Check if trainer received notification
|
||||
cy.clearLocalStorage();
|
||||
|
|
@ -220,8 +221,8 @@ describe("assignmentStudent.cy.js", () => {
|
|||
login("test-trainer1@example.com", "test");
|
||||
cy.visit("/notifications");
|
||||
cy.get(`[data-cy=notification-idx-0]`).within(() => {
|
||||
cy.get('[data-cy="unread"]').should("exist");
|
||||
cy.get('[data-cy="notification-target-idx-0-verb"]').contains(
|
||||
cy.get("[data-cy=\"unread\"]").should("exist");
|
||||
cy.get("[data-cy=\"notification-target-idx-0-verb\"]").contains(
|
||||
"Test Student1 hat die geleitete Fallarbeit «Überprüfen einer Motorfahrzeugs-Versicherungspolice» abgegeben."
|
||||
);
|
||||
});
|
||||
|
|
@ -233,14 +234,14 @@ describe("assignmentStudent.cy.js", () => {
|
|||
"Teilaufgabe 1: Beispiel einer Versicherungspolice finden"
|
||||
);
|
||||
// Click confirmation
|
||||
cy.get('[data-cy="it-checkbox-confirmation-1"]').click();
|
||||
cy.get("[data-cy=\"it-checkbox-confirmation-1\"]").click();
|
||||
cy.learningContentMultiLayoutNextStep();
|
||||
|
||||
// step 2
|
||||
cy.testLearningContentTitle(
|
||||
"Teilaufgabe 2: Kundensituation und Ausgangslage"
|
||||
);
|
||||
cy.get('[data-cy="it-textarea-user-text-input-1"]')
|
||||
cy.get("[data-cy=\"it-textarea-user-text-input-1\"]")
|
||||
.clear()
|
||||
.type("Hallo Teilaufgabe 2");
|
||||
// wait because of input debounce
|
||||
|
|
@ -261,7 +262,7 @@ describe("assignmentStudent.cy.js", () => {
|
|||
|
||||
// step 3
|
||||
cy.testLearningContentTitle("Teilaufgabe 3: Aktuelle Versicherung");
|
||||
cy.get('[data-cy="it-textarea-user-text-input-1"]')
|
||||
cy.get("[data-cy=\"it-textarea-user-text-input-1\"]")
|
||||
.clear()
|
||||
.type("Hallo Teilaufgabe 3");
|
||||
// wait because of input debounce
|
||||
|
|
@ -270,15 +271,15 @@ describe("assignmentStudent.cy.js", () => {
|
|||
|
||||
// step 4
|
||||
cy.testLearningContentTitle("Teilaufgabe 4: Deine Empfehlungen");
|
||||
cy.get('[data-cy="it-textarea-user-text-input-1"]')
|
||||
cy.get("[data-cy=\"it-textarea-user-text-input-1\"]")
|
||||
.clear()
|
||||
.type("Hallo Teilaufgabe 4.1");
|
||||
cy.wait(550);
|
||||
cy.get('[data-cy="it-textarea-user-text-input-2"]')
|
||||
cy.get("[data-cy=\"it-textarea-user-text-input-2\"]")
|
||||
.clear()
|
||||
.type("Hallo Teilaufgabe 4.2");
|
||||
cy.wait(550);
|
||||
cy.get('[data-cy="it-textarea-user-text-input-3"]')
|
||||
cy.get("[data-cy=\"it-textarea-user-text-input-3\"]")
|
||||
.clear()
|
||||
.type("Hallo Teilaufgabe 4.3");
|
||||
// wait because of input debounce
|
||||
|
|
@ -287,15 +288,15 @@ describe("assignmentStudent.cy.js", () => {
|
|||
|
||||
// step 5
|
||||
cy.testLearningContentTitle("Teilaufgabe 5: Reflexion");
|
||||
cy.get('[data-cy="it-textarea-user-text-input-1"]')
|
||||
cy.get("[data-cy=\"it-textarea-user-text-input-1\"]")
|
||||
.clear()
|
||||
.type("Hallo Teilaufgabe 5.1");
|
||||
cy.wait(550);
|
||||
cy.get('[data-cy="it-textarea-user-text-input-2"]')
|
||||
cy.get("[data-cy=\"it-textarea-user-text-input-2\"]")
|
||||
.clear()
|
||||
.type("Hallo Teilaufgabe 5.2");
|
||||
cy.wait(550);
|
||||
cy.get('[data-cy="it-textarea-user-text-input-3"]')
|
||||
cy.get("[data-cy=\"it-textarea-user-text-input-3\"]")
|
||||
.clear()
|
||||
.type("Hallo Teilaufgabe 5.3");
|
||||
// wait because of input debounce
|
||||
|
|
@ -304,40 +305,40 @@ describe("assignmentStudent.cy.js", () => {
|
|||
|
||||
// step 6
|
||||
cy.testLearningContentTitle("Teilaufgabe 6: Learnings");
|
||||
cy.get('[data-cy="it-textarea-user-text-input-1"]')
|
||||
cy.get("[data-cy=\"it-textarea-user-text-input-1\"]")
|
||||
.clear()
|
||||
.type("Hallo Teilaufgabe 6.1");
|
||||
cy.wait(550);
|
||||
cy.get('[data-cy="it-textarea-user-text-input-2"]')
|
||||
cy.get("[data-cy=\"it-textarea-user-text-input-2\"]")
|
||||
.clear()
|
||||
.type("Hallo Teilaufgabe 6.2");
|
||||
// wait because of input debounce
|
||||
cy.wait(550);
|
||||
cy.learningContentMultiLayoutNextStep();
|
||||
|
||||
cy.get('[data-cy="confirm-submit-person"]').should(
|
||||
cy.get("[data-cy=\"confirm-submit-person\"]").should(
|
||||
"contain",
|
||||
"Ja, die folgende Person soll meine Ergebnisse bewerten."
|
||||
);
|
||||
cy.get('[data-cy="confirm-submit-results"] label').click();
|
||||
cy.get('[data-cy="confirm-submit-person"]').click();
|
||||
cy.get('[data-cy="submit-assignment"]').click();
|
||||
cy.get('[data-cy="success-text"]').should("exist");
|
||||
cy.get("[data-cy=\"confirm-submit-results\"] label").click();
|
||||
cy.get("[data-cy=\"confirm-submit-person\"]").click();
|
||||
cy.get("[data-cy=\"submit-assignment\"]").click();
|
||||
cy.get("[data-cy=\"success-text\"]").should("exist");
|
||||
|
||||
cy.get('[data-cy="confirm-container"]')
|
||||
.find('[data-cy="show-sample-solution"]')
|
||||
cy.get("[data-cy=\"confirm-container\"]")
|
||||
.find("[data-cy=\"show-sample-solution\"]")
|
||||
.then(($elements) => {
|
||||
if ($elements.length > 0) {
|
||||
// Ist die Musterlösung da?
|
||||
cy.get('[data-cy="show-sample-solution"]').should("exist");
|
||||
cy.get('[data-cy="show-sample-solution-button"]').should("exist");
|
||||
cy.get("[data-cy=\"show-sample-solution\"]").should("exist");
|
||||
cy.get("[data-cy=\"show-sample-solution-button\"]").should("exist");
|
||||
}
|
||||
});
|
||||
|
||||
cy.visit("/course/test-lehrgang/learn/fahrzeug/");
|
||||
|
||||
cy.get(
|
||||
'[data-cy="test-lehrgang-lp-circle-fahrzeug-lc-überprüfen-einer-motorfahrzeug-versicherungspolice-checkbox"]'
|
||||
"[data-cy=\"test-lehrgang-lp-circle-fahrzeug-lc-überprüfen-einer-motorfahrzeug-versicherungspolice-checkbox\"]"
|
||||
).should("have.class", "cy-checked");
|
||||
|
||||
//reopening page should get directly to last step
|
||||
|
|
@ -370,10 +371,7 @@ describe("assignmentStudent.cy.js", () => {
|
|||
});
|
||||
|
||||
describe("Praxis Assignment", () => {
|
||||
it("can make complete assignment without expert", () =>
|
||||
it("can make complete assignment with mentor", () =>
|
||||
completePraxisAssignment());
|
||||
|
||||
it("can make complete assignment with expert", () =>
|
||||
completePraxisAssignment(true));
|
||||
});
|
||||
});
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@ from vbv_lernwelt.assignment.models import Assignment, AssignmentCompletion
|
|||
from vbv_lernwelt.competence.models import PerformanceCriteria
|
||||
from vbv_lernwelt.core.constants import (
|
||||
TEST_COURSE_SESSION_BERN_ID,
|
||||
TEST_MENTOR1_USER_ID,
|
||||
TEST_STUDENT1_USER_ID,
|
||||
TEST_STUDENT2_USER_ID,
|
||||
TEST_STUDENT3_USER_ID,
|
||||
|
|
@ -25,11 +26,13 @@ from vbv_lernwelt.course.models import (
|
|||
CourseCompletion,
|
||||
CourseCompletionStatus,
|
||||
CourseSession,
|
||||
CourseSessionUser,
|
||||
)
|
||||
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.learning_mentor.models import LearningMentor
|
||||
from vbv_lernwelt.learnpath.models import (
|
||||
LearningContentAttendanceCourse,
|
||||
LearningContentFeedbackUK,
|
||||
|
|
@ -81,6 +84,11 @@ from vbv_lernwelt.notify.models import Notification
|
|||
default=True,
|
||||
help="will enable circle documents for test course",
|
||||
)
|
||||
@click.option(
|
||||
"--create-learning-mentor/--no--create-learning-mentor",
|
||||
default=False,
|
||||
help="Will create a learning mentor for test user",
|
||||
)
|
||||
def command(
|
||||
create_assignment_completion,
|
||||
create_assignment_evaluation,
|
||||
|
|
@ -90,6 +98,7 @@ def command(
|
|||
create_course_completion_performance_criteria,
|
||||
create_attendance_days,
|
||||
enable_circle_documents,
|
||||
create_learning_mentor,
|
||||
):
|
||||
print("cypress reset data")
|
||||
CourseCompletion.objects.all().delete()
|
||||
|
|
@ -98,6 +107,7 @@ def command(
|
|||
FeedbackResponse.objects.all().delete()
|
||||
CourseSessionAttendanceCourse.objects.all().update(attendance_user_list=[])
|
||||
|
||||
LearningMentor.objects.all().delete()
|
||||
User.objects.all().update(language="de")
|
||||
User.objects.all().update(additional_json_data={})
|
||||
|
||||
|
|
@ -320,6 +330,18 @@ def command(
|
|||
)
|
||||
attendance_course.save()
|
||||
|
||||
if create_learning_mentor:
|
||||
print("Create learning mentor")
|
||||
mentor = LearningMentor.objects.create(
|
||||
course=Course.objects.get(id=COURSE_TEST_ID),
|
||||
mentor=User.objects.get(id=TEST_MENTOR1_USER_ID),
|
||||
)
|
||||
course_session = CourseSession.objects.get(id=TEST_COURSE_SESSION_BERN_ID)
|
||||
csu = CourseSessionUser.objects.get(
|
||||
user__id=TEST_STUDENT1_USER_ID, course_session=course_session
|
||||
)
|
||||
mentor.participants.add(csu)
|
||||
|
||||
course = Course.objects.get(id=COURSE_TEST_ID)
|
||||
course.enable_circle_documents = enable_circle_documents
|
||||
course.save()
|
||||
|
|
|
|||
Loading…
Reference in New Issue