Search in sources :

Example 46 with TaskList

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();
}
Also used : TaskList(org.olat.course.nodes.gta.TaskList) Identity(org.olat.core.id.Identity) Test(org.junit.Test)

Example 47 with TaskList

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();
}
Also used : TaskList(org.olat.course.nodes.gta.TaskList) Identity(org.olat.core.id.Identity) Test(org.junit.Test)

Example 48 with TaskList

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();
}
Also used : TaskList(org.olat.course.nodes.gta.TaskList) Identity(org.olat.core.id.Identity) Test(org.junit.Test)

Example 49 with TaskList

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);
    }
}
Also used : MSCourseNodeRunController(org.olat.course.nodes.ms.MSCourseNodeRunController) AssessmentEvaluation(org.olat.course.run.scoring.AssessmentEvaluation) TaskList(org.olat.course.nodes.gta.TaskList) RepositoryEntry(org.olat.repository.RepositoryEntry)

Example 50 with TaskList

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();
    }
}
Also used : Task(org.olat.course.nodes.gta.Task) TaskProcess(org.olat.course.nodes.gta.TaskProcess) CloseableModalController(org.olat.core.gui.control.generic.closablewrapper.CloseableModalController) TaskList(org.olat.course.nodes.gta.TaskList) ArrayList(java.util.ArrayList) RepositoryEntry(org.olat.repository.RepositoryEntry)

Aggregations

TaskList (org.olat.course.nodes.gta.TaskList)102 Identity (org.olat.core.id.Identity)68 Test (org.junit.Test)64 RepositoryEntry (org.olat.repository.RepositoryEntry)60 GTACourseNode (org.olat.course.nodes.GTACourseNode)48 File (java.io.File)36 Task (org.olat.course.nodes.gta.Task)36 AssignmentResponse (org.olat.course.nodes.gta.AssignmentResponse)32 BusinessGroup (org.olat.group.BusinessGroup)20 ArrayList (java.util.ArrayList)16 Date (java.util.Date)12 List (java.util.List)12 TaskRevisionDate (org.olat.course.nodes.gta.TaskRevisionDate)12 TaskProcess (org.olat.course.nodes.gta.TaskProcess)10 ReminderRuleImpl (org.olat.modules.reminder.model.ReminderRuleImpl)10 IdentityMark (org.olat.course.nodes.gta.IdentityMark)8 ModuleConfiguration (org.olat.modules.ModuleConfiguration)8 Calendar (java.util.Calendar)6 CloseableModalController (org.olat.core.gui.control.generic.closablewrapper.CloseableModalController)6 GTAManager (org.olat.course.nodes.gta.GTAManager)6