Search in sources :

Example 76 with TaskList

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

the class GTAManagerImpl method deleteTaskList.

@Override
public int deleteTaskList(RepositoryEntryRef entry, GTACourseNode cNode) {
    TaskList taskList = getTaskList(entry, cNode);
    int numOfDeletedObjects = 0;
    if (taskList != null) {
        StringBuilder sb = new StringBuilder(128);
        sb.append("delete from gtataskrevisiondate as taskrev where taskrev.task.key in (").append("  select task.key from gtatask as task where task.taskList.key=:taskListKey)");
        numOfDeletedObjects += dbInstance.getCurrentEntityManager().createQuery(sb.toString()).setParameter("taskListKey", taskList.getKey()).executeUpdate();
        String deleteTasks = "delete from gtatask as task where task.taskList.key=:taskListKey";
        numOfDeletedObjects += dbInstance.getCurrentEntityManager().createQuery(deleteTasks).setParameter("taskListKey", taskList.getKey()).executeUpdate();
        numOfDeletedObjects += gtaMarkDao.deleteMark(taskList);
        dbInstance.getCurrentEntityManager().remove(taskList);
        numOfDeletedObjects++;
    }
    return numOfDeletedObjects;
}
Also used : TaskList(org.olat.course.nodes.gta.TaskList)

Example 77 with TaskList

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

the class ConvertToGTACourseNode method convert.

public void convert(TACourseNode sourceNode, GTACourseNode gtaNode, ICourse course) {
    ModuleConfiguration modConfig = sourceNode.getModuleConfiguration();
    CourseEnvironment courseEnv = course.getCourseEnvironment();
    gtaNode.setShortTitle("New_ " + sourceNode.getShortTitle());
    gtaNode.setLongTitle("New_ " + sourceNode.getLongTitle());
    gtaNode.setDisplayOption(sourceNode.getDisplayOption());
    gtaNode.setLearningObjectives(sourceNode.getLearningObjectives());
    TaskList taskList = gtaManager.createIfNotExists(courseEnv.getCourseGroupManager().getCourseEntry(), gtaNode);
    DBFactory.getInstance().commit();
    convertConfiguration(sourceNode, gtaNode);
    if (modConfig.getBooleanSafe(TACourseNode.CONF_TASK_ENABLED)) {
        convertTasks(taskList, sourceNode, gtaNode, course);
        DBFactory.getInstance().commit();
    }
    if (modConfig.getBooleanSafe(TACourseNode.CONF_DROPBOX_ENABLED)) {
        convertDropbox(taskList, sourceNode, gtaNode, courseEnv);
        DBFactory.getInstance().commit();
    }
    if (modConfig.getBooleanSafe(TACourseNode.CONF_RETURNBOX_ENABLED)) {
        convertReturnbox(taskList, sourceNode, gtaNode, courseEnv);
        DBFactory.getInstance().commit();
    }
    if (modConfig.getBooleanSafe(TACourseNode.CONF_SCORING_ENABLED)) {
        // copy the scores
        convertAssessmentDatas(taskList, sourceNode, gtaNode, course);
        DBFactory.getInstance().commit();
    }
    // solutions
    if (modConfig.getBooleanSafe(TACourseNode.CONF_SOLUTION_ENABLED)) {
        copySolutions(sourceNode, gtaNode, courseEnv);
    }
}
Also used : ModuleConfiguration(org.olat.modules.ModuleConfiguration) CourseEnvironment(org.olat.course.run.environment.CourseEnvironment) UserCourseEnvironment(org.olat.course.run.userview.UserCourseEnvironment) TaskList(org.olat.course.nodes.gta.TaskList)

Example 78 with TaskList

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

the class AbstractAssignmentEditController method doFinishReplacementOfTask.

private void doFinishReplacementOfTask(String replacedFilename, TaskDefinition taskDef) {
    TaskList list = gtaManager.getTaskList(courseEnv.getCourseGroupManager().getCourseEntry(), gtaNode);
    if (list != null) {
        gtaManager.updateTaskName(list, replacedFilename, taskDef.getFilename());
    }
    gtaManager.updateTaskDefinition(replacedFilename, taskDef, courseEnv, gtaNode);
}
Also used : TaskList(org.olat.course.nodes.gta.TaskList)

Example 79 with TaskList

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

the class GTACoachedGroupListController method doEditDueDate.

private void doEditDueDate(UserRequest ureq, CoachedGroupRow row) {
    if (editDueDatesCtrl != null)
        return;
    Task task;
    BusinessGroup assessedGroup = row.getBusinessGroup();
    RepositoryEntry entry = coachCourseEnv.getCourseEnvironment().getCourseGroupManager().getCourseEntry();
    if (row.getTask() == null) {
        TaskProcess firstStep = gtaManager.firstStep(gtaNode);
        TaskList taskList = gtaManager.getTaskList(entry, gtaNode);
        task = gtaManager.createAndPersistTask(null, taskList, firstStep, assessedGroup, null, gtaNode);
    } else {
        task = gtaManager.getTask(row.getTask());
    }
    editDueDatesCtrl = new EditDueDatesController(ureq, getWindowControl(), task, null, assessedGroup, gtaNode, entry, courseEnv);
    listenTo(editDueDatesCtrl);
    String title = translate("duedates.user", new String[] { StringHelper.escapeHtml(assessedGroup.getName()) });
    cmc = new CloseableModalController(getWindowControl(), "close", editDueDatesCtrl.getInitialComponent(), true, title, true);
    listenTo(cmc);
    cmc.activate();
}
Also used : Task(org.olat.course.nodes.gta.Task) BusinessGroup(org.olat.group.BusinessGroup) TaskProcess(org.olat.course.nodes.gta.TaskProcess) CloseableModalController(org.olat.core.gui.control.generic.closablewrapper.CloseableModalController) TaskList(org.olat.course.nodes.gta.TaskList) RepositoryEntry(org.olat.repository.RepositoryEntry)

Example 80 with TaskList

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

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)

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