use of org.olat.course.nodes.gta.TaskList in project openolat by klemens.
the class GTAIdentityMarkDAOTest method shouldCheckIfHasMarks.
@Test
public void shouldCheckIfHasMarks() {
TaskList taskList = createTaskList();
Identity marker = JunitTestHelper.createAndPersistIdentityAsAuthor("coach");
Identity participant1 = JunitTestHelper.createAndPersistIdentityAsUser("participant1");
Identity participant2 = JunitTestHelper.createAndPersistIdentityAsUser("participant2");
sut.createAndPersisitMark(taskList, marker, participant1);
sut.createAndPersisitMark(taskList, marker, participant2);
dbInstance.commitAndCloseSession();
boolean hasMarks = sut.hasMarks(taskList, marker);
assertThat(hasMarks).isTrue();
}
use of org.olat.course.nodes.gta.TaskList in project openolat by klemens.
the class GTAIdentityMarkDAOTest method shouldCheckIfHasNoMarks.
@Test
public void shouldCheckIfHasNoMarks() {
TaskList taskList = createTaskList();
TaskList otherTaskList = createTaskList();
Identity marker = JunitTestHelper.createAndPersistIdentityAsAuthor("coach");
Identity otherMarker = JunitTestHelper.createAndPersistIdentityAsAuthor("otherCoach");
Identity participant = JunitTestHelper.createAndPersistIdentityAsUser("participant3");
sut.createAndPersisitMark(otherTaskList, marker, participant);
sut.createAndPersisitMark(taskList, otherMarker, participant);
dbInstance.commitAndCloseSession();
boolean hasMarks = sut.hasMarks(taskList, marker);
assertThat(hasMarks).isFalse();
}
use of org.olat.course.nodes.gta.TaskList in project openolat by klemens.
the class GTAIdentityMarkDAOTest method shouldCheckIfMarked.
@Test
public void shouldCheckIfMarked() {
TaskList taskList = createTaskList();
Identity marker = JunitTestHelper.createAndPersistIdentityAsAuthor("coach");
Identity participant = JunitTestHelper.createAndPersistIdentityAsUser("participant");
sut.createAndPersisitMark(taskList, marker, participant);
dbInstance.commitAndCloseSession();
boolean isMarked = sut.isMarked(taskList, marker, participant);
assertThat(isMarked).isTrue();
}
use of org.olat.course.nodes.gta.TaskList in project openolat by klemens.
the class GTACoachedParticipantGradingController method doGraded.
private void doGraded(UserRequest ureq, UserCourseEnvironment assessedUserCourseEnv) {
removeAsListenerAndDispose(msCtrl);
msCtrl = new MSCourseNodeRunController(ureq, getWindowControl(), assessedUserCourseEnv, gtaNode, false, false, true);
listenTo(msCtrl);
mainVC.put("msrun", msCtrl.getInitialComponent());
AssessmentEvaluation scoreEval = gtaNode.getUserScoreEvaluation(assessedUserCourseEnv);
if (scoreEval.getAssessmentStatus() == AssessmentEntryStatus.done) {
if (assignedTask == null) {
RepositoryEntry courseEntry = coachCourseEnv.getCourseEnvironment().getCourseGroupManager().getCourseEntry();
TaskList taskList = gtaManager.createIfNotExists(courseEntry, gtaNode);
assignedTask = gtaManager.createTask(null, taskList, TaskProcess.graded, null, assessedIdentity, gtaNode);
} else {
assignedTask = gtaManager.updateTask(assignedTask, TaskProcess.graded, gtaNode, Role.coach);
}
fireEvent(ureq, Event.CHANGED_EVENT);
}
}
use of org.olat.course.nodes.gta.TaskList in project openolat by klemens.
the class GTACoachedParticipantListController method doEditMultipleDueDates.
private void doEditMultipleDueDates(UserRequest ureq, List<CoachedIdentityRow> rows) {
if (editMultipleDueDatesCtrl != null)
return;
if (rows.isEmpty()) {
showWarning("error.atleast.task");
} else {
List<Task> tasks = new ArrayList<>(rows.size());
RepositoryEntry entry = coachCourseEnv.getCourseEnvironment().getCourseGroupManager().getCourseEntry();
for (CoachedIdentityRow row : rows) {
if (row.getTask() == null) {
TaskProcess firstStep = gtaManager.firstStep(gtaNode);
TaskList taskList = gtaManager.getTaskList(entry, gtaNode);
tasks.add(gtaManager.createAndPersistTask(null, taskList, firstStep, null, securityManager.loadIdentityByKey(row.getIdentity().getIdentityKey()), gtaNode));
} else {
tasks.add(gtaManager.getTask(row.getTask()));
}
}
editMultipleDueDatesCtrl = new EditMultipleDueDatesController(ureq, getWindowControl(), tasks, gtaNode, entry, courseEnv);
listenTo(editMultipleDueDatesCtrl);
String title = translate("duedates.multiple.user");
cmc = new CloseableModalController(getWindowControl(), "close", editMultipleDueDatesCtrl.getInitialComponent(), true, title, true);
listenTo(cmc);
cmc.activate();
}
}
Aggregations