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);
}
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;
}
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);
}
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);
}
}
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();
}
}
Aggregations