Search in sources :

Example 11 with AssessmentNodeData

use of org.olat.course.assessment.model.AssessmentNodeData in project OpenOLAT by OpenOLAT.

the class IdentityAssessmentOverviewController method formInnerEvent.

@Override
protected void formInnerEvent(UserRequest ureq, FormItem source, FormEvent event) {
    if (tableEl == source) {
        if (event instanceof SelectionEvent) {
            SelectionEvent se = (SelectionEvent) event;
            String cmd = se.getCommand();
            AssessmentNodeData nodeData = tableModel.getObject(se.getIndex());
            if (CMD_SELECT_NODE.equals(cmd)) {
                CourseNode node = runStructure.getNode(nodeData.getIdent());
                selectedCourseNode = (AssessableCourseNode) node;
                fireEvent(ureq, EVENT_NODE_SELECTED);
            }
        }
    }
    super.formInnerEvent(ureq, source, event);
}
Also used : SelectionEvent(org.olat.core.gui.components.form.flexible.impl.elements.table.SelectionEvent) AssessableCourseNode(org.olat.course.nodes.AssessableCourseNode) CourseNode(org.olat.course.nodes.CourseNode) AssessmentNodeData(org.olat.course.assessment.model.AssessmentNodeData)

Example 12 with AssessmentNodeData

use of org.olat.course.assessment.model.AssessmentNodeData in project OpenOLAT by OpenOLAT.

the class CourseQTIArchiveController method addQTINodesAndParentsToList.

/**
 * Recursive method that adds tasks nodes and all its parents to a list
 * @param recursionLevel
 * @param courseNode
 * @return A list of Object[indent, courseNode, selectable]
 */
private List<AssessmentNodeData> addQTINodesAndParentsToList(int recursionLevel, CourseNode courseNode) {
    // 1) Get list of children data using recursion of this method
    List<AssessmentNodeData> childrenData = new ArrayList<>();
    for (int i = 0; i < courseNode.getChildCount(); i++) {
        CourseNode child = (CourseNode) courseNode.getChildAt(i);
        List<AssessmentNodeData> childData = addQTINodesAndParentsToList((recursionLevel + 1), child);
        if (childData != null) {
            childrenData.addAll(childData);
        }
    }
    if (childrenData.size() > 0 || courseNode instanceof IQSURVCourseNode) {
        // Store node data in hash map. This hash map serves as data model for
        // the tasks overview table. Leave user data empty since not used in
        // this table. (use only node data)
        AssessmentNodeData nodeData = new AssessmentNodeData(recursionLevel, courseNode);
        if (courseNode instanceof IQSURVCourseNode) {
            nodeData.setSelectable(true);
        } else {
            nodeData.setSelectable(false);
        }
        List<AssessmentNodeData> nodeAndChildren = new ArrayList<>();
        nodeAndChildren.add(nodeData);
        nodeAndChildren.addAll(childrenData);
        return nodeAndChildren;
    }
    return null;
}
Also used : IQSURVCourseNode(org.olat.course.nodes.IQSURVCourseNode) ArrayList(java.util.ArrayList) IQSURVCourseNode(org.olat.course.nodes.IQSURVCourseNode) CourseNode(org.olat.course.nodes.CourseNode) AssessmentNodeData(org.olat.course.assessment.model.AssessmentNodeData)

Example 13 with AssessmentNodeData

use of org.olat.course.assessment.model.AssessmentNodeData in project OpenOLAT by OpenOLAT.

the class SelectTestOrSurveyController method formInnerEvent.

@Override
protected void formInnerEvent(UserRequest ureq, FormItem source, FormEvent event) {
    if (tableEl == source) {
        if (event instanceof SelectionEvent) {
            SelectionEvent se = (SelectionEvent) event;
            AssessmentNodeData data = tableModel.getObject(se.getIndex());
            archiver.setData(data);
            if (validateFormLogic(ureq)) {
                fireEvent(ureq, new SelectTestOrSurveyEvent(archiver, data));
            }
        }
    }
    super.formInnerEvent(ureq, source, event);
}
Also used : SelectionEvent(org.olat.core.gui.components.form.flexible.impl.elements.table.SelectionEvent) AssessmentNodeData(org.olat.course.assessment.model.AssessmentNodeData)

Example 14 with AssessmentNodeData

use of org.olat.course.assessment.model.AssessmentNodeData in project OpenOLAT by OpenOLAT.

the class EfficiencyStatementManager method updateUserEfficiencyStatement.

/**
 * Updates the users efficiency statement for this course
 * @param userCourseEnv
 * @param repoEntryKey
 * @param courseOres
 */
private void updateUserEfficiencyStatement(final UserCourseEnvironment userCourseEnv, final RepositoryEntry repoEntry) {
    // o_clusterOK: by ld
    CourseConfig cc = userCourseEnv.getCourseEnvironment().getCourseConfig();
    // write only when enabled for this course
    if (cc.isEfficencyStatementEnabled()) {
        Identity identity = userCourseEnv.getIdentityEnvironment().getIdentity();
        AssessmentNodesLastModified lastModifications = new AssessmentNodesLastModified();
        List<AssessmentNodeData> assessmentNodeList = AssessmentHelper.getAssessmentNodeDataList(userCourseEnv, lastModifications, true, true, true);
        updateUserEfficiencyStatement(identity, userCourseEnv.getCourseEnvironment(), assessmentNodeList, lastModifications, repoEntry);
    }
}
Also used : AssessmentNodesLastModified(org.olat.course.assessment.model.AssessmentNodesLastModified) Identity(org.olat.core.id.Identity) AssessmentNodeData(org.olat.course.assessment.model.AssessmentNodeData) CourseConfig(org.olat.course.config.CourseConfig)

Example 15 with AssessmentNodeData

use of org.olat.course.assessment.model.AssessmentNodeData in project OpenOLAT by OpenOLAT.

the class GenericArchiveController method event.

@Override
public void event(UserRequest ureq, Controller source, Event event) {
    if (source == nodeListCtr) {
        if (event.getCommand().equals(Table.COMMANDLINK_ROWACTION_CLICKED)) {
            TableEvent te = (TableEvent) event;
            String actionid = te.getActionId();
            if (actionid.equals(CMD_SELECT_NODE)) {
                AssessmentNodeData nodeData = nodeTableModel.getObject(te.getRowId());
                doSelectNode(ureq, nodeData);
            }
        }
    } else if (source == chooseGroupCtrl) {
        cmc.deactivate();
        CourseNode courseNode = chooseGroupCtrl.getCourseNode();
        BusinessGroup group = chooseGroupCtrl.getSelectedGroup();
        cleanUpPopups();
        if (Event.DONE_EVENT == event) {
            archiveNode(ureq, courseNode, group);
        }
    } else if (source == cmc) {
        cleanUpPopups();
    }
}
Also used : TableEvent(org.olat.core.gui.components.table.TableEvent) BusinessGroup(org.olat.group.BusinessGroup) CourseNode(org.olat.course.nodes.CourseNode) TACourseNode(org.olat.course.nodes.TACourseNode) AssessmentNodeData(org.olat.course.assessment.model.AssessmentNodeData)

Aggregations

AssessmentNodeData (org.olat.course.assessment.model.AssessmentNodeData)22 CourseNode (org.olat.course.nodes.CourseNode)14 ArrayList (java.util.ArrayList)8 AssessableCourseNode (org.olat.course.nodes.AssessableCourseNode)6 TACourseNode (org.olat.course.nodes.TACourseNode)6 SelectionEvent (org.olat.core.gui.components.form.flexible.impl.elements.table.SelectionEvent)4 ICourse (org.olat.course.ICourse)4 AssessmentNodesLastModified (org.olat.course.assessment.model.AssessmentNodesLastModified)4 ScoreAccounting (org.olat.course.run.scoring.ScoreAccounting)4 BigDecimal (java.math.BigDecimal)2 Date (java.util.Date)2 Map (java.util.Map)2 CustomRenderColumnDescriptor (org.olat.core.gui.components.table.CustomRenderColumnDescriptor)2 DefaultColumnDescriptor (org.olat.core.gui.components.table.DefaultColumnDescriptor)2 TableController (org.olat.core.gui.components.table.TableController)2 TableEvent (org.olat.core.gui.components.table.TableEvent)2 TableGuiConfiguration (org.olat.core.gui.components.table.TableGuiConfiguration)2 Identity (org.olat.core.id.Identity)2 AssessmentChangedEvent (org.olat.course.assessment.AssessmentChangedEvent)2 IndentedNodeRenderer (org.olat.course.assessment.IndentedNodeRenderer)2