Search in sources :

Example 36 with UserNodeAuditManager

use of org.olat.course.auditing.UserNodeAuditManager in project openolat by klemens.

the class CheckListRunController method exposeUserDataToVC.

private void exposeUserDataToVC(UserRequest ureq, FormLayoutContainer layoutCont) {
    AssessmentEntry scoreEval = courseNode.getUserAssessmentEntry(userCourseEnv);
    if (scoreEval == null) {
        layoutCont.contextPut("score", null);
        layoutCont.contextPut("hasPassedValue", Boolean.FALSE);
        layoutCont.contextPut("passed", null);
        layoutCont.contextPut("comment", null);
        layoutCont.contextPut("docs", null);
    } else {
        boolean resultsVisible = scoreEval.getUserVisibility() == null || scoreEval.getUserVisibility().booleanValue();
        layoutCont.contextPut("resultsVisible", resultsVisible);
        layoutCont.contextPut("score", AssessmentHelper.getRoundedScore(scoreEval.getScore()));
        layoutCont.contextPut("hasPassedValue", (scoreEval.getPassed() == null ? Boolean.FALSE : Boolean.TRUE));
        layoutCont.contextPut("passed", scoreEval.getPassed());
        if (resultsVisible) {
            if (courseNode.hasCommentConfigured()) {
                StringBuilder comment = Formatter.stripTabsAndReturns(scoreEval.getComment());
                layoutCont.contextPut("comment", StringHelper.xssScan(comment));
                layoutCont.contextPut("in-comment", isPanelOpen(ureq, "comment", true));
            }
            if (courseNode.hasIndividualAsssessmentDocuments()) {
                List<File> docs = courseNode.getIndividualAssessmentDocuments(userCourseEnv);
                String mapperUri = registerCacheableMapper(ureq, null, new DocumentsMapper(docs));
                layoutCont.contextPut("docsMapperUri", mapperUri);
                layoutCont.contextPut("docs", docs);
                layoutCont.contextPut("in-assessmentDocuments", isPanelOpen(ureq, "assessmentDocuments", true));
            }
        } else {
            layoutCont.contextPut("comment", null);
            layoutCont.contextPut("docs", null);
        }
    }
    UserNodeAuditManager am = userCourseEnv.getCourseEnvironment().getAuditManager();
    layoutCont.contextPut("log", am.getUserNodeLog(courseNode, userCourseEnv.getIdentityEnvironment().getIdentity()));
}
Also used : UserNodeAuditManager(org.olat.course.auditing.UserNodeAuditManager) DocumentsMapper(org.olat.course.nodes.ms.DocumentsMapper) AssessmentEntry(org.olat.modules.assessment.AssessmentEntry) File(java.io.File)

Example 37 with UserNodeAuditManager

use of org.olat.course.auditing.UserNodeAuditManager in project openolat by klemens.

the class IQRunController method exposeUserTestDataToVC.

private void exposeUserTestDataToVC(UserRequest ureq) {
    // config : show score info
    Object enableScoreInfoObject = modConfig.get(IQEditController.CONFIG_KEY_ENABLESCOREINFO);
    if (enableScoreInfoObject != null) {
        myContent.contextPut("enableScoreInfo", enableScoreInfoObject);
    } else {
        myContent.contextPut("enableScoreInfo", Boolean.TRUE);
    }
    // configuration data
    myContent.contextPut("attemptsConfig", modConfig.get(IQEditController.CONFIG_KEY_ATTEMPTS));
    // user data
    Identity identity = userCourseEnv.getIdentityEnvironment().getIdentity();
    if (courseNode instanceof PersistentAssessableCourseNode) {
        PersistentAssessableCourseNode acn = (PersistentAssessableCourseNode) courseNode;
        AssessmentEntry assessmentEntry = acn.getUserAssessmentEntry(userCourseEnv);
        if (assessmentEntry == null) {
            myContent.contextPut("blockAfterSuccess", Boolean.FALSE);
            myContent.contextPut("score", null);
            myContent.contextPut("hasPassedValue", Boolean.FALSE);
            myContent.contextPut("passed", Boolean.FALSE);
            myContent.contextPut("comment", null);
            myContent.contextPut("docs", null);
            myContent.contextPut("attempts", 0);
        } else {
            // block if test passed (and config set to check it)
            Boolean blockAfterSuccess = modConfig.getBooleanEntry(IQEditController.CONFIG_KEY_BLOCK_AFTER_SUCCESS);
            Boolean blocked = Boolean.FALSE;
            if (blockAfterSuccess != null && blockAfterSuccess.booleanValue()) {
                Boolean passed = assessmentEntry.getPassed();
                if (passed != null && passed.booleanValue()) {
                    blocked = Boolean.TRUE;
                }
            }
            myContent.contextPut("blockAfterSuccess", blocked);
            boolean resultsVisible = assessmentEntry.getUserVisibility() == null || assessmentEntry.getUserVisibility().booleanValue();
            myContent.contextPut("resultsVisible", resultsVisible);
            myContent.contextPut("score", AssessmentHelper.getRoundedScore(assessmentEntry.getScore()));
            myContent.contextPut("hasPassedValue", (assessmentEntry.getPassed() == null ? Boolean.FALSE : Boolean.TRUE));
            myContent.contextPut("passed", assessmentEntry.getPassed());
            if (resultsVisible) {
                if (acn.hasCommentConfigured()) {
                    StringBuilder comment = Formatter.stripTabsAndReturns(assessmentEntry.getComment());
                    myContent.contextPut("comment", StringHelper.xssScan(comment));
                    myContent.contextPut("in-comment", isPanelOpen(ureq, "comment", true));
                }
                if (acn.hasIndividualAsssessmentDocuments()) {
                    List<File> docs = acn.getIndividualAssessmentDocuments(userCourseEnv);
                    String mapperUri = registerCacheableMapper(ureq, null, new DocumentsMapper(docs));
                    myContent.contextPut("docsMapperUri", mapperUri);
                    myContent.contextPut("docs", docs);
                    myContent.contextPut("in-assessmentDocuments", isPanelOpen(ureq, "assessmentDocuments", true));
                }
            }
            myContent.contextPut("attempts", assessmentEntry.getAttempts() == null ? 0 : assessmentEntry.getAttempts());
        }
    }
    UserNodeAuditManager am = userCourseEnv.getCourseEnvironment().getAuditManager();
    myContent.contextPut("log", am.getUserNodeLog(courseNode, identity));
    exposeResults(ureq);
}
Also used : UserNodeAuditManager(org.olat.course.auditing.UserNodeAuditManager) PersistentAssessableCourseNode(org.olat.course.nodes.PersistentAssessableCourseNode) Identity(org.olat.core.id.Identity) DocumentsMapper(org.olat.course.nodes.ms.DocumentsMapper) AssessmentEntry(org.olat.modules.assessment.AssessmentEntry) File(java.io.File)

Example 38 with UserNodeAuditManager

use of org.olat.course.auditing.UserNodeAuditManager in project openolat by klemens.

the class MSCourseNodeRunController method exposeUserDataToVC.

private void exposeUserDataToVC(UserRequest ureq) {
    AssessmentEntry assessmentEntry = courseNode.getUserAssessmentEntry(userCourseEnv);
    if (assessmentEntry == null) {
        myContent.contextPut("hasPassedValue", Boolean.FALSE);
        myContent.contextPut("passed", Boolean.FALSE);
        hasPassed = hasScore = hasComment = false;
    } else {
        String rawComment = assessmentEntry.getComment();
        hasPassed = assessmentEntry.getPassed() != null;
        hasScore = assessmentEntry.getScore() != null;
        hasComment = courseNode.hasCommentConfigured() && StringHelper.containsNonWhitespace(rawComment);
        boolean resultsVisible = overrideUserResultsVisiblity || assessmentEntry.getUserVisibility() == null || assessmentEntry.getUserVisibility().booleanValue();
        myContent.contextPut("resultsVisible", resultsVisible);
        myContent.contextPut("score", AssessmentHelper.getRoundedScore(assessmentEntry.getScore()));
        myContent.contextPut("hasPassedValue", (assessmentEntry.getPassed() == null ? Boolean.FALSE : Boolean.TRUE));
        myContent.contextPut("passed", assessmentEntry.getPassed());
        if (resultsVisible) {
            if (hasComment) {
                StringBuilder comment = Formatter.stripTabsAndReturns(rawComment);
                myContent.contextPut("comment", StringHelper.xssScan(comment));
                myContent.contextPut("in-comment", isPanelOpen(ureq, "comment", true));
            }
            if (courseNode.hasIndividualAsssessmentDocuments()) {
                List<File> docs = courseNode.getIndividualAssessmentDocuments(userCourseEnv);
                mapperUri = registerCacheableMapper(ureq, null, new DocumentsMapper(docs));
                myContent.contextPut("docsMapperUri", mapperUri);
                myContent.contextPut("docs", docs);
                myContent.contextPut("in-assessmentDocuments", isPanelOpen(ureq, "assessmentDocuments", true));
                if (download == null) {
                    download = new DisplayOrDownloadComponent("", null);
                    myContent.put("download", download);
                }
            }
        }
    }
    if (showLog) {
        UserNodeAuditManager am = userCourseEnv.getCourseEnvironment().getAuditManager();
        myContent.contextPut("log", am.getUserNodeLog(courseNode, userCourseEnv.getIdentityEnvironment().getIdentity()));
    }
}
Also used : UserNodeAuditManager(org.olat.course.auditing.UserNodeAuditManager) DisplayOrDownloadComponent(org.olat.core.gui.components.download.DisplayOrDownloadComponent) AssessmentEntry(org.olat.modules.assessment.AssessmentEntry) File(java.io.File)

Example 39 with UserNodeAuditManager

use of org.olat.course.auditing.UserNodeAuditManager in project openolat by klemens.

the class ProjectBrokerCourseNode method getUserLog.

/**
 * @see org.olat.course.nodes.AssessableCourseNode#getUserLog(org.olat.course.run.userview.UserCourseEnvironment)
 */
@Override
public String getUserLog(UserCourseEnvironment userCourseEnvironment) {
    UserNodeAuditManager am = userCourseEnvironment.getCourseEnvironment().getAuditManager();
    String logValue = am.getUserNodeLog(this, userCourseEnvironment.getIdentityEnvironment().getIdentity());
    return logValue;
}
Also used : UserNodeAuditManager(org.olat.course.auditing.UserNodeAuditManager)

Example 40 with UserNodeAuditManager

use of org.olat.course.auditing.UserNodeAuditManager in project openolat by klemens.

the class ScormCourseNode method getUserLog.

/**
 * @see org.olat.course.nodes.AssessableCourseNode#getUserLog(org.olat.course.run.userview.UserCourseEnvironment)
 */
@Override
public String getUserLog(UserCourseEnvironment userCourseEnvironment) {
    UserNodeAuditManager am = userCourseEnvironment.getCourseEnvironment().getAuditManager();
    Identity mySelf = userCourseEnvironment.getIdentityEnvironment().getIdentity();
    String logValue = am.getUserNodeLog(this, mySelf);
    return logValue;
}
Also used : UserNodeAuditManager(org.olat.course.auditing.UserNodeAuditManager) Identity(org.olat.core.id.Identity)

Aggregations

UserNodeAuditManager (org.olat.course.auditing.UserNodeAuditManager)46 ICourse (org.olat.course.ICourse)18 AssessmentEntry (org.olat.modules.assessment.AssessmentEntry)16 Identity (org.olat.core.id.Identity)14 AssessmentChangedEvent (org.olat.course.assessment.AssessmentChangedEvent)12 File (java.io.File)10 CoursePropertyManager (org.olat.course.properties.CoursePropertyManager)10 Date (java.util.Date)8 AssessableCourseNode (org.olat.course.nodes.AssessableCourseNode)8 RepositoryEntry (org.olat.repository.RepositoryEntry)8 SyncerExecutor (org.olat.core.util.coordinate.SyncerExecutor)4 SystemFileFilter (org.olat.core.util.io.SystemFileFilter)4 MailContext (org.olat.core.util.mail.MailContext)4 Structure (org.olat.course.Structure)4 AssessmentManager (org.olat.course.assessment.AssessmentManager)4 CertificateTemplate (org.olat.course.certificate.CertificateTemplate)4 CertificateInfos (org.olat.course.certificate.model.CertificateInfos)4 CourseConfig (org.olat.course.config.CourseConfig)4 CourseGroupManager (org.olat.course.groupsandrights.CourseGroupManager)4 CourseNode (org.olat.course.nodes.CourseNode)4