Search in sources :

Example 1 with TaskList

use of org.olat.course.nodes.gta.TaskList in project OpenOLAT by OpenOLAT.

the class GTAIdentityListCourseNodeController method loadModel.

@Override
protected void loadModel(UserRequest ureq) {
    super.loadModel(ureq);
    ModuleConfiguration config = courseNode.getModuleConfiguration();
    if (GTAType.individual.name().equals(config.getStringValue(GTACourseNode.GTASK_TYPE)) && config.getBooleanSafe(GTACourseNode.GTASK_ASSIGNMENT)) {
        TaskList taskList = gtaManager.getTaskList(getCourseRepositoryEntry(), (GTACourseNode) courseNode);
        if (taskList != null) {
            loadTasksInModel(taskList);
        }
    }
}
Also used : ModuleConfiguration(org.olat.modules.ModuleConfiguration) TaskList(org.olat.course.nodes.gta.TaskList)

Example 2 with TaskList

use of org.olat.course.nodes.gta.TaskList in project OpenOLAT by OpenOLAT.

the class GTAIdentityMarkDAOTest method shouldDeleteMarkOfAMarker.

@Test
public void shouldDeleteMarkOfAMarker() {
    TaskList taskList = createTaskList();
    TaskList otherTaskList = createTaskList();
    Identity marker = JunitTestHelper.createAndPersistIdentityAsAuthor("coach");
    Identity otherMarker = JunitTestHelper.createAndPersistIdentityAsAuthor("otherCoach");
    Identity participant1 = JunitTestHelper.createAndPersistIdentityAsUser("participant1");
    Identity participant2 = JunitTestHelper.createAndPersistIdentityAsUser("participant2");
    Identity participant3 = JunitTestHelper.createAndPersistIdentityAsUser("participant3");
    IdentityMark mark1 = sut.createAndPersisitMark(taskList, marker, participant1);
    sut.createAndPersisitMark(taskList, marker, participant2);
    sut.createAndPersisitMark(otherTaskList, marker, participant3);
    sut.createAndPersisitMark(taskList, otherMarker, participant3);
    IdentityMark mark3 = sut.createAndPersisitMark(taskList, marker, participant3);
    dbInstance.commitAndCloseSession();
    sut.deleteMark(taskList, marker, participant2);
    dbInstance.commitAndCloseSession();
    List<IdentityMark> marks = sut.loadMarks(taskList, marker);
    assertThat(marks).hasSize(2);
    assertThat(marks).containsExactly(mark1, mark3);
}
Also used : TaskList(org.olat.course.nodes.gta.TaskList) Identity(org.olat.core.id.Identity) IdentityMark(org.olat.course.nodes.gta.IdentityMark) Test(org.junit.Test)

Example 3 with TaskList

use of org.olat.course.nodes.gta.TaskList in project OpenOLAT by OpenOLAT.

the class GTAIdentityMarkDAOTest method shouldCheckIfNotMarked.

@Test
public void shouldCheckIfNotMarked() {
    TaskList taskList = createTaskList();
    Identity marker = JunitTestHelper.createAndPersistIdentityAsAuthor("coach");
    Identity participant = JunitTestHelper.createAndPersistIdentityAsUser("participant");
    sut.createAndPersisitMark(taskList, marker, participant);
    Identity participantNotMarked = JunitTestHelper.createAndPersistIdentityAsUser("participantNotMarked");
    dbInstance.commitAndCloseSession();
    boolean isMarked = sut.isMarked(taskList, marker, participantNotMarked);
    assertThat(isMarked).isFalse();
}
Also used : TaskList(org.olat.course.nodes.gta.TaskList) Identity(org.olat.core.id.Identity) Test(org.junit.Test)

Example 4 with TaskList

use of org.olat.course.nodes.gta.TaskList in project OpenOLAT by OpenOLAT.

the class GTAIdentityMarkDAOTest method shouldLoadAllMarksOfAMarker.

@Test
public void shouldLoadAllMarksOfAMarker() {
    TaskList taskList = createTaskList();
    TaskList otherTaskList = createTaskList();
    Identity marker = JunitTestHelper.createAndPersistIdentityAsAuthor("coach");
    Identity otherMarker = JunitTestHelper.createAndPersistIdentityAsAuthor("otherCoach");
    Identity participant1 = JunitTestHelper.createAndPersistIdentityAsUser("participant1");
    Identity participant2 = JunitTestHelper.createAndPersistIdentityAsUser("participant2");
    Identity participant3 = JunitTestHelper.createAndPersistIdentityAsUser("participant3");
    IdentityMark mark1 = sut.createAndPersisitMark(taskList, marker, participant1);
    IdentityMark mark2 = sut.createAndPersisitMark(taskList, marker, participant2);
    sut.createAndPersisitMark(otherTaskList, marker, participant3);
    sut.createAndPersisitMark(taskList, otherMarker, participant3);
    IdentityMark mark3 = sut.createAndPersisitMark(taskList, marker, participant3);
    dbInstance.commitAndCloseSession();
    List<IdentityMark> marks = sut.loadMarks(taskList, marker);
    assertThat(marks).hasSize(3);
    assertThat(marks).containsExactly(mark1, mark2, mark3);
}
Also used : TaskList(org.olat.course.nodes.gta.TaskList) Identity(org.olat.core.id.Identity) IdentityMark(org.olat.course.nodes.gta.IdentityMark) Test(org.junit.Test)

Example 5 with TaskList

use of org.olat.course.nodes.gta.TaskList in project OpenOLAT by OpenOLAT.

the class GTAIdentityMarkDAOTest method shouldDeleteMarkOfATaskList.

@Test
public void shouldDeleteMarkOfATaskList() {
    TaskList taskList = createTaskList();
    TaskList otherTaskList = createTaskList();
    Identity marker = JunitTestHelper.createAndPersistIdentityAsAuthor("coach");
    Identity otherMarker = JunitTestHelper.createAndPersistIdentityAsAuthor("otherCoach");
    Identity participant1 = JunitTestHelper.createAndPersistIdentityAsUser("participant1");
    Identity participant2 = JunitTestHelper.createAndPersistIdentityAsUser("participant2");
    Identity participant3 = JunitTestHelper.createAndPersistIdentityAsUser("participant3");
    sut.createAndPersisitMark(taskList, marker, participant1);
    sut.createAndPersisitMark(taskList, marker, participant2);
    sut.createAndPersisitMark(otherTaskList, marker, participant3);
    sut.createAndPersisitMark(taskList, otherMarker, participant3);
    sut.createAndPersisitMark(taskList, marker, participant3);
    dbInstance.commitAndCloseSession();
    int numberDeleted = sut.deleteMark(taskList);
    dbInstance.commitAndCloseSession();
    assertThat(numberDeleted).isSameAs(4);
    List<IdentityMark> marksOfDeletedTaskList = sut.loadMarks(taskList, marker);
    assertThat(marksOfDeletedTaskList).hasSize(0);
    List<IdentityMark> marksOfExistinTaskList = sut.loadMarks(otherTaskList, marker);
    assertThat(marksOfExistinTaskList).hasSize(1);
}
Also used : TaskList(org.olat.course.nodes.gta.TaskList) Identity(org.olat.core.id.Identity) IdentityMark(org.olat.course.nodes.gta.IdentityMark) Test(org.junit.Test)

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