Search in sources :

Example 6 with ModuleConfiguration

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);
    }
}
Also used : ModuleConfiguration(org.olat.modules.ModuleConfiguration) TaskList(org.olat.course.nodes.gta.TaskList)

Example 7 with ModuleConfiguration

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();
}
Also used : ScoreEvaluation(org.olat.course.run.scoring.ScoreEvaluation) ModuleConfiguration(org.olat.modules.ModuleConfiguration) UserCourseEnvironment(org.olat.course.run.userview.UserCourseEnvironment) ICourse(org.olat.course.ICourse) Document(org.dom4j.Document) QTIDocument(org.olat.ims.qti.editor.beecom.objects.QTIDocument) AssessableCourseNode(org.olat.course.nodes.AssessableCourseNode) AssessmentContext(org.olat.ims.qti.container.AssessmentContext) AssessmentInstance(org.olat.ims.qti.process.AssessmentInstance)

Example 8 with ModuleConfiguration

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);
        }
    }
}
Also used : VFSLeaf(org.olat.core.util.vfs.VFSLeaf) ModuleConfiguration(org.olat.modules.ModuleConfiguration) SearchResourceContext(org.olat.search.service.SearchResourceContext) VFSItem(org.olat.core.util.vfs.VFSItem) Document(org.apache.lucene.document.Document) CourseNodeDocument(org.olat.search.service.document.CourseNodeDocument)

Example 9 with ModuleConfiguration

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;
}
Also used : ModuleConfiguration(org.olat.modules.ModuleConfiguration) Date(java.util.Date)

Example 10 with ModuleConfiguration

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;
}
Also used : ModuleConfiguration(org.olat.modules.ModuleConfiguration) OLATRuntimeException(org.olat.core.logging.OLATRuntimeException)

Aggregations

ModuleConfiguration (org.olat.modules.ModuleConfiguration)296 ArrayList (java.util.ArrayList)34 OLATRuntimeException (org.olat.core.logging.OLATRuntimeException)28 ICourse (org.olat.course.ICourse)26 CourseNode (org.olat.course.nodes.CourseNode)26 Date (java.util.Date)22 RepositoryEntry (org.olat.repository.RepositoryEntry)22 File (java.io.File)20 CheckboxList (org.olat.course.nodes.cl.model.CheckboxList)18 List (java.util.List)16 Identity (org.olat.core.id.Identity)16 CheckboxManager (org.olat.course.nodes.cl.CheckboxManager)16 UserCourseEnvironment (org.olat.course.run.userview.UserCourseEnvironment)16 Translator (org.olat.core.gui.translator.Translator)14 AssessmentManager (org.olat.course.assessment.AssessmentManager)14 CourseEnvironment (org.olat.course.run.environment.CourseEnvironment)14 ScoreEvaluation (org.olat.course.run.scoring.ScoreEvaluation)14 VFSItem (org.olat.core.util.vfs.VFSItem)12 BusinessGroup (org.olat.group.BusinessGroup)12 Checkbox (org.olat.course.nodes.cl.model.Checkbox)11