use of org.olat.course.nodes.ms.MSCourseNodeRunController in project OpenOLAT by OpenOLAT.
the class GTAParticipantController method stepGrading.
@Override
protected Task stepGrading(UserRequest ureq, Task assignedTask) {
assignedTask = super.stepGrading(ureq, assignedTask);
String infoTextUser = config.getStringValue(MSCourseNode.CONFIG_KEY_INFOTEXT_USER);
if (StringHelper.containsNonWhitespace(infoTextUser)) {
mainVC.contextPut("gradingInfoTextUser", StringHelper.xssScan(infoTextUser));
}
boolean showGrading = false;
MSCourseNodeRunController msCtrl = new MSCourseNodeRunController(ureq, getWindowControl(), userCourseEnv, gtaNode, false, false);
if (msCtrl.hasScore() || msCtrl.hasPassed() || msCtrl.hasComment()) {
showGrading = true;
} else if (config.getBooleanSafe(GTACourseNode.GTASK_ASSIGNMENT) || config.getBooleanSafe(GTACourseNode.GTASK_SUBMIT) || config.getBooleanSafe(GTACourseNode.GTASK_REVIEW_AND_CORRECTION) || config.getBooleanSafe(GTACourseNode.GTASK_REVISION_PERIOD) || config.getBooleanSafe(GTACourseNode.GTASK_GRADING)) {
if (assignedTask == null || assignedTask.getTaskStatus() == TaskProcess.assignment || assignedTask.getTaskStatus() == TaskProcess.submit || assignedTask.getTaskStatus() == TaskProcess.review || assignedTask.getTaskStatus() == TaskProcess.correction || assignedTask.getTaskStatus() == TaskProcess.revision || assignedTask.getTaskStatus() == TaskProcess.solution) {
mainVC.contextPut("gradingCssClass", "");
} else if (assignedTask.getTaskStatus() == TaskProcess.graded || assignedTask.getTaskStatus() == TaskProcess.grading) {
showGrading = true;
}
} else if (assignedTask == null || assignedTask.getTaskStatus() == TaskProcess.graded || assignedTask.getTaskStatus() == TaskProcess.grading) {
showGrading = true;
}
if (showGrading) {
gradingCtrl = msCtrl;
listenTo(gradingCtrl);
if (assignedTask != null && assignedTask.getTaskStatus() == TaskProcess.graded) {
mainVC.contextPut("gradingCssClass", "o_done");
} else {
mainVC.contextPut("gradingCssClass", "o_active");
}
mainVC.put("grading", gradingCtrl.getInitialComponent());
stepPreferences.setGrading(Boolean.TRUE);
}
return assignedTask;
}
use of org.olat.course.nodes.ms.MSCourseNodeRunController in project openolat by klemens.
the class MSCourseNode method createNodeRunConstructionResult.
/**
* @see org.olat.course.nodes.CourseNode#createNodeRunConstructionResult(org.olat.core.gui.UserRequest,
* org.olat.core.gui.control.WindowControl,
* org.olat.course.run.userview.UserCourseEnvironment,
* org.olat.course.run.userview.NodeEvaluation)
*/
@Override
public NodeRunConstructionResult createNodeRunConstructionResult(UserRequest ureq, WindowControl wControl, UserCourseEnvironment userCourseEnv, NodeEvaluation ne, String nodecmd) {
Controller controller;
// Do not allow guests to have manual scoring
Roles roles = ureq.getUserSession().getRoles();
if (roles.isGuestOnly()) {
Translator trans = Util.createPackageTranslator(MSCourseNode.class, ureq.getLocale());
String title = trans.translate("guestnoaccess.title");
String message = trans.translate("guestnoaccess.message");
controller = MessageUIFactory.createInfoMessage(ureq, wControl, title, message);
} else {
controller = new MSCourseNodeRunController(ureq, wControl, userCourseEnv, this, true, true);
}
Controller wrappedCtrl = TitledWrapperHelper.getWrapper(ureq, wControl, controller, this, "o_ms_icon");
return new NodeRunConstructionResult(wrappedCtrl);
}
use of org.olat.course.nodes.ms.MSCourseNodeRunController in project openolat by klemens.
the class GTAParticipantController method stepGrading.
@Override
protected Task stepGrading(UserRequest ureq, Task assignedTask) {
assignedTask = super.stepGrading(ureq, assignedTask);
String infoTextUser = config.getStringValue(MSCourseNode.CONFIG_KEY_INFOTEXT_USER);
if (StringHelper.containsNonWhitespace(infoTextUser)) {
mainVC.contextPut("gradingInfoTextUser", StringHelper.xssScan(infoTextUser));
}
boolean showGrading = false;
MSCourseNodeRunController msCtrl = new MSCourseNodeRunController(ureq, getWindowControl(), userCourseEnv, gtaNode, false, false);
if (msCtrl.hasScore() || msCtrl.hasPassed() || msCtrl.hasComment()) {
showGrading = true;
} else if (config.getBooleanSafe(GTACourseNode.GTASK_ASSIGNMENT) || config.getBooleanSafe(GTACourseNode.GTASK_SUBMIT) || config.getBooleanSafe(GTACourseNode.GTASK_REVIEW_AND_CORRECTION) || config.getBooleanSafe(GTACourseNode.GTASK_REVISION_PERIOD) || config.getBooleanSafe(GTACourseNode.GTASK_GRADING)) {
if (assignedTask == null || assignedTask.getTaskStatus() == TaskProcess.assignment || assignedTask.getTaskStatus() == TaskProcess.submit || assignedTask.getTaskStatus() == TaskProcess.review || assignedTask.getTaskStatus() == TaskProcess.correction || assignedTask.getTaskStatus() == TaskProcess.revision || assignedTask.getTaskStatus() == TaskProcess.solution) {
mainVC.contextPut("gradingCssClass", "");
} else if (assignedTask.getTaskStatus() == TaskProcess.graded || assignedTask.getTaskStatus() == TaskProcess.grading) {
showGrading = true;
}
} else if (assignedTask == null || assignedTask.getTaskStatus() == TaskProcess.graded || assignedTask.getTaskStatus() == TaskProcess.grading) {
showGrading = true;
}
if (showGrading) {
gradingCtrl = msCtrl;
listenTo(gradingCtrl);
if (assignedTask != null && assignedTask.getTaskStatus() == TaskProcess.graded) {
mainVC.contextPut("gradingCssClass", "o_done");
} else {
mainVC.contextPut("gradingCssClass", "o_active");
}
mainVC.put("grading", gradingCtrl.getInitialComponent());
stepPreferences.setGrading(Boolean.TRUE);
}
return assignedTask;
}
use of org.olat.course.nodes.ms.MSCourseNodeRunController 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.ms.MSCourseNodeRunController in project openolat by klemens.
the class GTACoachedParticipantGradingController method setAssessmentDatas.
private void setAssessmentDatas(UserRequest ureq) {
removeAsListenerAndDispose(msCtrl);
ICourse course = CourseFactory.loadCourse(courseOres);
UserCourseEnvironment uce = AssessmentHelper.createAndInitUserCourseEnvironment(assessedIdentity, course);
msCtrl = new MSCourseNodeRunController(ureq, getWindowControl(), uce, gtaNode, false, false, true);
listenTo(msCtrl);
mainVC.put("msrun", msCtrl.getInitialComponent());
}
Aggregations