Search in sources :

Example 6 with AssessmentToolSecurityCallback

use of org.olat.modules.assessment.ui.AssessmentToolSecurityCallback in project OpenOLAT by OpenOLAT.

the class QTI21RuntimeController method doAssessmentTool.

private Activateable2 doAssessmentTool(UserRequest ureq) {
    OLATResourceable ores = OresHelper.createOLATResourceableType("TestStatistics");
    ThreadLocalUserActivityLogger.addLoggingResourceInfo(LoggingResourceable.wrapBusinessPath(ores));
    WindowControl swControl = addToHistory(ureq, ores, null);
    if (reSecurity.isEntryAdmin() || reSecurity.isCourseCoach() || reSecurity.isGroupCoach()) {
        AssessmentToolSecurityCallback secCallback = new AssessmentToolSecurityCallback(reSecurity.isEntryAdmin(), reSecurity.isEntryAdmin(), reSecurity.isCourseCoach(), reSecurity.isGroupCoach(), null);
        AssessableResource el = getAssessableElement(getRepositoryEntry());
        AssessmentToolController ctrl = new AssessmentToolController(ureq, swControl, toolbarPanel, getRepositoryEntry(), el, secCallback);
        listenTo(ctrl);
        assessmentToolCtrl = pushController(ureq, translate("command.openassessment"), ctrl);
        currentToolCtr = assessmentToolCtrl;
        setActiveTool(assessmentLink);
        return assessmentToolCtrl;
    }
    return null;
}
Also used : OLATResourceable(org.olat.core.id.OLATResourceable) AssessmentToolSecurityCallback(org.olat.modules.assessment.ui.AssessmentToolSecurityCallback) AssessableResource(org.olat.modules.assessment.ui.AssessableResource) WindowControl(org.olat.core.gui.control.WindowControl) AssessmentToolController(org.olat.modules.assessment.ui.AssessmentToolController)

Example 7 with AssessmentToolSecurityCallback

use of org.olat.modules.assessment.ui.AssessmentToolSecurityCallback in project openolat by klemens.

the class CourseRuntimeController method doAssessmentTool.

private Activateable2 doAssessmentTool(UserRequest ureq) {
    if (delayedClose == Delayed.assessmentTool || requestForClose(ureq)) {
        OLATResourceable ores = OresHelper.createOLATResourceableType("assessmentToolv2");
        ThreadLocalUserActivityLogger.addLoggingResourceInfo(LoggingResourceable.wrapBusinessPath(ores));
        WindowControl swControl = addToHistory(ureq, ores, null);
        boolean admin = reSecurity.isEntryAdmin() || hasCourseRight(CourseRights.RIGHT_ASSESSMENT);
        boolean nonMembers = reSecurity.isEntryAdmin();
        boolean repositoryEntryMembers = reSecurity.isCourseCoach();
        boolean businessGoupMembers = reSecurity.isGroupCoach();
        List<BusinessGroup> coachedGroups = null;
        if (businessGoupMembers) {
            coachedGroups = getUserCourseEnvironment().getCoachedGroups();
        }
        AssessmentToolSecurityCallback secCallBack = new AssessmentToolSecurityCallback(admin, nonMembers, repositoryEntryMembers, businessGoupMembers, coachedGroups);
        removeCustomCSS();
        AssessmentToolController ctrl = new AssessmentToolController(ureq, swControl, toolbarPanel, getRepositoryEntry(), getUserCourseEnvironment(), secCallBack);
        ctrl.activate(ureq, null, null);
        listenTo(ctrl);
        assessmentToolCtr = pushController(ureq, translate("command.openassessment"), ctrl);
        assessmentToolCtr.assessmentModeMessage();
        currentToolCtr = assessmentToolCtr;
        setActiveTool(assessmentLink);
        ctrl.initToolbar();
        return assessmentToolCtr;
    } else {
        delayedClose = Delayed.assessmentTool;
    }
    return null;
}
Also used : OLATResourceable(org.olat.core.id.OLATResourceable) BusinessGroup(org.olat.group.BusinessGroup) AssessmentToolSecurityCallback(org.olat.modules.assessment.ui.AssessmentToolSecurityCallback) WindowControl(org.olat.core.gui.control.WindowControl) AssessmentToolController(org.olat.course.assessment.ui.tool.AssessmentToolController)

Example 8 with AssessmentToolSecurityCallback

use of org.olat.modules.assessment.ui.AssessmentToolSecurityCallback in project openolat by klemens.

the class QTI21RuntimeController method doAssessmentTool.

private Activateable2 doAssessmentTool(UserRequest ureq) {
    OLATResourceable ores = OresHelper.createOLATResourceableType("TestStatistics");
    ThreadLocalUserActivityLogger.addLoggingResourceInfo(LoggingResourceable.wrapBusinessPath(ores));
    WindowControl swControl = addToHistory(ureq, ores, null);
    if (reSecurity.isEntryAdmin() || reSecurity.isCourseCoach() || reSecurity.isGroupCoach()) {
        AssessmentToolSecurityCallback secCallback = new AssessmentToolSecurityCallback(reSecurity.isEntryAdmin(), reSecurity.isEntryAdmin(), reSecurity.isCourseCoach(), reSecurity.isGroupCoach(), null);
        AssessableResource el = getAssessableElement(getRepositoryEntry());
        AssessmentToolController ctrl = new AssessmentToolController(ureq, swControl, toolbarPanel, getRepositoryEntry(), el, secCallback);
        listenTo(ctrl);
        assessmentToolCtrl = pushController(ureq, translate("command.openassessment"), ctrl);
        currentToolCtr = assessmentToolCtrl;
        setActiveTool(assessmentLink);
        return assessmentToolCtrl;
    }
    return null;
}
Also used : OLATResourceable(org.olat.core.id.OLATResourceable) AssessmentToolSecurityCallback(org.olat.modules.assessment.ui.AssessmentToolSecurityCallback) AssessableResource(org.olat.modules.assessment.ui.AssessableResource) WindowControl(org.olat.core.gui.control.WindowControl) AssessmentToolController(org.olat.modules.assessment.ui.AssessmentToolController)

Aggregations

AssessmentToolSecurityCallback (org.olat.modules.assessment.ui.AssessmentToolSecurityCallback)8 WindowControl (org.olat.core.gui.control.WindowControl)6 OLATResourceable (org.olat.core.id.OLATResourceable)6 BusinessGroup (org.olat.group.BusinessGroup)4 AssessableResource (org.olat.modules.assessment.ui.AssessableResource)4 AssessmentToolController (org.olat.modules.assessment.ui.AssessmentToolController)4 Test (org.junit.Test)2 IdentityShort (org.olat.basesecurity.IdentityShort)2 Identity (org.olat.core.id.Identity)2 ICourse (org.olat.course.ICourse)2 AssessedBusinessGroup (org.olat.course.assessment.model.AssessedBusinessGroup)2 AssessmentStatistics (org.olat.course.assessment.model.AssessmentStatistics)2 SearchAssessedIdentityParams (org.olat.course.assessment.model.SearchAssessedIdentityParams)2 AssessmentToolController (org.olat.course.assessment.ui.tool.AssessmentToolController)2 AssessmentEntry (org.olat.modules.assessment.AssessmentEntry)2 AssessmentMembersStatistics (org.olat.modules.assessment.model.AssessmentMembersStatistics)2 RepositoryEntry (org.olat.repository.RepositoryEntry)2