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;
}
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);
}
}
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);
}
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();
}
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);
}
}
Aggregations