use of org.olat.modules.ModuleConfiguration in project OpenOLAT by OpenOLAT.
the class AbstractDueDateTaskRuleSPI method getPeopleToRemind.
protected List<Identity> getPeopleToRemind(RepositoryEntry entry, GTACourseNode gtaNode) {
ModuleConfiguration config = gtaNode.getModuleConfiguration();
TaskList taskList = gtaManager.getTaskList(entry, gtaNode);
if (GTAType.group.name().equals(config.getStringValue(GTACourseNode.GTASK_TYPE))) {
return getGroupsToRemind(taskList, gtaNode);
} else {
return getIndividualsToRemind(taskList, entry, gtaNode);
}
}
use of org.olat.modules.ModuleConfiguration in project OpenOLAT by OpenOLAT.
the class QTI12ResultDetailsController method doRetrieveTest.
/**
* Retrieve the test: load the course, close the assessment instamce, persist the QTI
* result set, pass the score to the course node.
* @param ureq
*/
private void doRetrieveTest() {
ICourse course = CourseFactory.loadCourse(courseResourceableId);
AssessableCourseNode testNode = (AssessableCourseNode) course.getRunStructure().getNode(nodeIdent);
ModuleConfiguration modConfig = testNode.getModuleConfiguration();
String resourcePathInfo = courseResourceableId + File.separator + nodeIdent;
AssessmentInstance ai = AssessmentFactory.createAssessmentInstance(assessedIdentity, "", modConfig, false, courseResourceableId, nodeIdent, resourcePathInfo, null);
// close the test
ai.stop();
// persist the results
iqm.persistResults(ai);
// reporting
Document docResReporting = iqm.getResultsReporting(ai, assessedIdentity, I18nModule.getDefaultLocale());
FilePersister.createResultsReporting(docResReporting, assessedIdentity, ai.getFormattedType(), ai.getAssessID());
// olat results
AssessmentContext ac = ai.getAssessmentContext();
Float score = Float.valueOf(ac.getScore());
Boolean passed = Boolean.valueOf(ac.isPassed());
ScoreEvaluation sceval = new ScoreEvaluation(score, passed, Boolean.FALSE, new Long(ai.getAssessID()));
UserCourseEnvironment userCourseEnv = AssessmentHelper.createAndInitUserCourseEnvironment(assessedIdentity, course);
testNode.updateUserScoreEvaluation(sceval, userCourseEnv, assessedIdentity, true, Role.coach);
// cleanup
ai.cleanUp();
List<QTIResultSet> resultSets = qrm.getResultSets(courseResourceableId, nodeIdent, repositoryEntry.getKey(), assessedIdentity);
tableModel.setObjects(resultSets);
tableCtr.modelChanged();
}
use of org.olat.modules.ModuleConfiguration in project OpenOLAT by OpenOLAT.
the class STCourseNodeIndexer method doIndex.
@Override
public void doIndex(SearchResourceContext repositoryResourceContext, ICourse course, CourseNode courseNode, OlatFullIndexer indexWriter) throws IOException, InterruptedException {
if (log.isDebug())
log.debug("Index StructureNode...");
SearchResourceContext courseNodeResourceContext = createSearchResourceContext(repositoryResourceContext, courseNode, TYPE);
Document document = CourseNodeDocument.createDocument(courseNodeResourceContext, courseNode);
indexWriter.addDocument(document);
ModuleConfiguration config = courseNode.getModuleConfiguration();
String displayType = config.getStringValue(STCourseNodeEditController.CONFIG_KEY_DISPLAY_TYPE);
String relPath = STCourseNodeEditController.getFileName(config);
if (relPath != null && displayType != null && displayType.equals(STCourseNodeEditController.CONFIG_VALUE_DISPLAY_FILE)) {
VFSItem displayPage = course.getCourseFolderContainer().resolve(relPath);
if (displayPage instanceof VFSLeaf) {
doIndexVFSLeafByMySelf(courseNodeResourceContext, (VFSLeaf) displayPage, indexWriter, relPath);
}
}
}
use of org.olat.modules.ModuleConfiguration in project OpenOLAT by OpenOLAT.
the class AssignTaskRuleSPI method getDueDate.
@Override
protected Date getDueDate(GTACourseNode gtaNode) {
Date dueDate = null;
ModuleConfiguration config = gtaNode.getModuleConfiguration();
boolean assignment = config.getBooleanSafe(GTACourseNode.GTASK_ASSIGNMENT);
if (assignment) {
dueDate = config.getDateValue(GTACourseNode.GTASK_ASSIGNMENT_DEADLINE);
}
return dueDate;
}
use of org.olat.modules.ModuleConfiguration in project OpenOLAT by OpenOLAT.
the class PortfolioCourseNode method getCutValueConfiguration.
@Override
public Float getCutValueConfiguration() {
if (!hasPassedConfigured()) {
throw new OLATRuntimeException(PortfolioCourseNode.class, "getCutValue not defined when hasPassed set to false", null);
}
ModuleConfiguration config = getModuleConfiguration();
Float cut = (Float) config.get(MSCourseNode.CONFIG_KEY_PASSED_CUT_VALUE);
return cut;
}
Aggregations