use of org.olat.course.nodes.ProjectBrokerCourseNode in project OpenOLAT by OpenOLAT.
the class ArchiverMainController method launchArchiveControllers.
private void launchArchiveControllers(UserRequest ureq, String menuCommand) {
if (menuCommand.equals(CMD_INDEX)) {
main.setContent(intro);
} else {
removeAsListenerAndDispose(contentCtr);
if (menuCommand.equals(CMD_QTISURVRESULTS)) {
contentCtr = new GenericArchiveController(ureq, getWindowControl(), ores, new IQSURVCourseNode());
main.setContent(contentCtr.getInitialComponent());
} else if (menuCommand.equals(CMD_QTITESTRESULTS)) {
contentCtr = new TestArchiveController(ureq, getWindowControl(), ores, new IQTESTCourseNode(), new IQSELFCourseNode());
main.setContent(contentCtr.getInitialComponent());
} else if (menuCommand.equals(CMD_SCOREACCOUNTING)) {
contentCtr = new ScoreAccountingArchiveController(ureq, getWindowControl(), ores);
main.setContent(contentCtr.getInitialComponent());
} else if (menuCommand.equals(CMD_ARCHIVELOGFILES)) {
contentCtr = new CourseLogsArchiveController(ureq, getWindowControl(), ores);
main.setContent(contentCtr.getInitialComponent());
} else if (menuCommand.equals(CMD_HANDEDINTASKS)) {
// TACourseNode
contentCtr = new GenericArchiveController(ureq, getWindowControl(), ores, new TACourseNode());
main.setContent(contentCtr.getInitialComponent());
} else if (menuCommand.equals(CMD_GROUPTASKS)) {
contentCtr = new GenericArchiveController(ureq, getWindowControl(), ores, new GTACourseNode(), new GTACourseNode(GTACourseNode.TYPE_INDIVIDUAL));
main.setContent(contentCtr.getInitialComponent());
} else if (menuCommand.equals(CMD_PROJECTBROKER)) {
contentCtr = new GenericArchiveController(ureq, getWindowControl(), ores, new ProjectBrokerCourseNode());
main.setContent(contentCtr.getInitialComponent());
} else if (menuCommand.equals(CMD_FORUMS)) {
contentCtr = new GenericArchiveController(ureq, getWindowControl(), ores, new FOCourseNode());
main.setContent(contentCtr.getInitialComponent());
} else if (menuCommand.equals(CMD_DIALOGS)) {
contentCtr = new GenericArchiveController(ureq, getWindowControl(), ores, new DialogCourseNode());
main.setContent(contentCtr.getInitialComponent());
} else if (menuCommand.equals(CMD_WIKIS)) {
contentCtr = new GenericArchiveController(ureq, getWindowControl(), ores, new WikiCourseNode());
main.setContent(contentCtr.getInitialComponent());
} else if (menuCommand.equals(CMD_SCORM)) {
contentCtr = new GenericArchiveController(ureq, getWindowControl(), ores, new ScormCourseNode());
main.setContent(contentCtr.getInitialComponent());
} else if (menuCommand.equals(CMD_CHECKLIST)) {
contentCtr = new GenericArchiveController(ureq, getWindowControl(), ores, new CheckListCourseNode());
main.setContent(contentCtr.getInitialComponent());
} else if (menuCommand.equals(CMD_PARTICIPANTFOLDER)) {
contentCtr = new GenericArchiveController(ureq, getWindowControl(), ores, new PFCourseNode());
main.setContent(contentCtr.getInitialComponent());
}
listenTo(contentCtr);
}
}
use of org.olat.course.nodes.ProjectBrokerCourseNode in project openolat by klemens.
the class ArchiverMainController method launchArchiveControllers.
private void launchArchiveControllers(UserRequest ureq, String menuCommand) {
if (menuCommand.equals(CMD_INDEX)) {
main.setContent(intro);
} else {
removeAsListenerAndDispose(contentCtr);
if (menuCommand.equals(CMD_QTISURVRESULTS)) {
contentCtr = new GenericArchiveController(ureq, getWindowControl(), ores, new IQSURVCourseNode());
main.setContent(contentCtr.getInitialComponent());
} else if (menuCommand.equals(CMD_QTITESTRESULTS)) {
contentCtr = new TestArchiveController(ureq, getWindowControl(), ores, new IQTESTCourseNode(), new IQSELFCourseNode());
main.setContent(contentCtr.getInitialComponent());
} else if (menuCommand.equals(CMD_SCOREACCOUNTING)) {
contentCtr = new ScoreAccountingArchiveController(ureq, getWindowControl(), ores);
main.setContent(contentCtr.getInitialComponent());
} else if (menuCommand.equals(CMD_ARCHIVELOGFILES)) {
contentCtr = new CourseLogsArchiveController(ureq, getWindowControl(), ores);
main.setContent(contentCtr.getInitialComponent());
} else if (menuCommand.equals(CMD_HANDEDINTASKS)) {
// TACourseNode
contentCtr = new GenericArchiveController(ureq, getWindowControl(), ores, new TACourseNode());
main.setContent(contentCtr.getInitialComponent());
} else if (menuCommand.equals(CMD_GROUPTASKS)) {
contentCtr = new GenericArchiveController(ureq, getWindowControl(), ores, new GTACourseNode(), new GTACourseNode(GTACourseNode.TYPE_INDIVIDUAL));
main.setContent(contentCtr.getInitialComponent());
} else if (menuCommand.equals(CMD_PROJECTBROKER)) {
contentCtr = new GenericArchiveController(ureq, getWindowControl(), ores, new ProjectBrokerCourseNode());
main.setContent(contentCtr.getInitialComponent());
} else if (menuCommand.equals(CMD_FORUMS)) {
contentCtr = new GenericArchiveController(ureq, getWindowControl(), ores, new FOCourseNode());
main.setContent(contentCtr.getInitialComponent());
} else if (menuCommand.equals(CMD_DIALOGS)) {
contentCtr = new GenericArchiveController(ureq, getWindowControl(), ores, new DialogCourseNode());
main.setContent(contentCtr.getInitialComponent());
} else if (menuCommand.equals(CMD_WIKIS)) {
contentCtr = new GenericArchiveController(ureq, getWindowControl(), ores, new WikiCourseNode());
main.setContent(contentCtr.getInitialComponent());
} else if (menuCommand.equals(CMD_SCORM)) {
contentCtr = new GenericArchiveController(ureq, getWindowControl(), ores, new ScormCourseNode());
main.setContent(contentCtr.getInitialComponent());
} else if (menuCommand.equals(CMD_CHECKLIST)) {
contentCtr = new GenericArchiveController(ureq, getWindowControl(), ores, new CheckListCourseNode());
main.setContent(contentCtr.getInitialComponent());
} else if (menuCommand.equals(CMD_PARTICIPANTFOLDER)) {
contentCtr = new GenericArchiveController(ureq, getWindowControl(), ores, new PFCourseNode());
main.setContent(contentCtr.getInitialComponent());
}
listenTo(contentCtr);
}
}
use of org.olat.course.nodes.ProjectBrokerCourseNode in project OpenOLAT by OpenOLAT.
the class AssessmentHelper method getAssessmentNodeDataList.
public static int getAssessmentNodeDataList(int recursionLevel, CourseNode courseNode, ScoreAccounting scoreAccounting, UserCourseEnvironment userCourseEnv, boolean followUserVisibility, boolean discardEmptyNodes, boolean discardComments, List<AssessmentNodeData> data, AssessmentNodesLastModified lastModifications) {
// 1) Get list of children data using recursion of this method
AssessmentNodeData assessmentNodeData = new AssessmentNodeData(recursionLevel, courseNode);
data.add(assessmentNodeData);
int numOfChildren = 0;
for (int i = 0; i < courseNode.getChildCount(); i++) {
CourseNode child = (CourseNode) courseNode.getChildAt(i);
numOfChildren += getAssessmentNodeDataList(recursionLevel + 1, child, scoreAccounting, userCourseEnv, followUserVisibility, discardEmptyNodes, discardComments, data, lastModifications);
}
// 2) Get data of this node only if
// - it has any wrapped children or
// - it is of an assessable course node type
boolean hasDisplayableValuesConfigured = false;
boolean hasDisplayableUserValues = false;
if (numOfChildren > 0 || courseNode instanceof AssessableCourseNode) {
if (courseNode instanceof ProjectBrokerCourseNode) {
// ProjectBroker : no assessment-tool in V1.0 , remove project broker completely form assessment-tool gui
assessmentNodeData.setSelectable(false);
} else if (courseNode instanceof AssessableCourseNode) {
AssessableCourseNode assessableCourseNode = (AssessableCourseNode) courseNode;
AssessmentEvaluation scoreEvaluation = scoreAccounting.evalCourseNode(assessableCourseNode);
if (scoreEvaluation != null) {
assessmentNodeData.setAssessmentStatus(scoreEvaluation.getAssessmentStatus());
assessmentNodeData.setNumOfAssessmentDocs(scoreEvaluation.getNumOfAssessmentDocs());
}
assessmentNodeData.setUserVisibility(scoreEvaluation.getUserVisible());
assessmentNodeData.setLastModified(scoreEvaluation.getLastModified());
assessmentNodeData.setLastUserModified(scoreEvaluation.getLastUserModified());
assessmentNodeData.setLastCoachModified(scoreEvaluation.getLastCoachModified());
if (lastModifications != null) {
lastModifications.addLastModified(scoreEvaluation.getLastModified());
lastModifications.addLastUserModified(scoreEvaluation.getLastUserModified());
lastModifications.addLastCoachModified(scoreEvaluation.getLastCoachModified());
}
if (!followUserVisibility || scoreEvaluation.getUserVisible() == null || scoreEvaluation.getUserVisible().booleanValue()) {
// details
if (assessableCourseNode.hasDetails()) {
hasDisplayableValuesConfigured = true;
String detailValue = assessableCourseNode.getDetailsListView(userCourseEnv);
if (detailValue == null) {
// ignore unset details in discardEmptyNodes mode
assessmentNodeData.setDetails(AssessmentHelper.DETAILS_NA_VALUE);
} else {
assessmentNodeData.setDetails(detailValue);
hasDisplayableUserValues = true;
}
}
// attempts
if (assessableCourseNode.hasAttemptsConfigured()) {
hasDisplayableValuesConfigured = true;
Integer attemptsValue = scoreEvaluation.getAttempts();
if (attemptsValue != null) {
assessmentNodeData.setAttempts(attemptsValue);
if (attemptsValue.intValue() > 0) {
// ignore attempts = 0 in discardEmptyNodes mode
hasDisplayableUserValues = true;
}
}
}
// score
if (assessableCourseNode.hasScoreConfigured()) {
hasDisplayableValuesConfigured = true;
Float score = scoreEvaluation.getScore();
if (score != null) {
assessmentNodeData.setRoundedScore(AssessmentHelper.getRoundedScore(score));
assessmentNodeData.setScore(score);
hasDisplayableUserValues = true;
}
if (!(assessableCourseNode instanceof STCourseNode)) {
assessmentNodeData.setMaxScore(assessableCourseNode.getMaxScoreConfiguration());
assessmentNodeData.setMinScore(assessableCourseNode.getMinScoreConfiguration());
}
}
// passed
if (assessableCourseNode.hasPassedConfigured()) {
hasDisplayableValuesConfigured = true;
Boolean passed = scoreEvaluation.getPassed();
if (passed != null) {
assessmentNodeData.setPassed(passed);
hasDisplayableUserValues = true;
}
}
}
// selection command available
AssessableCourseNode acn = (AssessableCourseNode) courseNode;
if (acn.isEditableConfigured()) {
// Assessable course nodes are selectable
assessmentNodeData.setSelectable(true);
} else {
// assessable nodes that do not have score or passed are not selectable
// (e.g. a st node with no defined rule
assessmentNodeData.setSelectable(false);
}
if (!hasDisplayableUserValues && assessableCourseNode.hasCommentConfigured() && !discardComments) {
// comments are invisible in the table but if configured the node must be in the list
// for the efficiency statement this can be ignored, this is the case when discardComments is true
hasDisplayableValuesConfigured = true;
if (assessableCourseNode.getUserUserComment(userCourseEnv) != null) {
hasDisplayableUserValues = true;
}
}
} else {
// Not assessable nodes are not selectable. (e.g. a node that
// has an assessable child node but is itself not assessable)
assessmentNodeData.setSelectable(false);
}
}
// 3) Add data of this node to mast list if node assessable or children list has any data.
// Do only add nodes when they have any assessable element, otherwhise discard (e.g. empty course,
// structure nodes without scoring rules)! When the discardEmptyNodes flag is set then only
// add this node when there is user data found for this node.
boolean addNode = (numOfChildren > 0 || (discardEmptyNodes && hasDisplayableValuesConfigured && hasDisplayableUserValues) || (!discardEmptyNodes && hasDisplayableValuesConfigured));
if (!addNode) {
data.remove(assessmentNodeData);
return 0;
}
// add itself
return numOfChildren + 1;
}
use of org.olat.course.nodes.ProjectBrokerCourseNode in project openolat by klemens.
the class AssessmentHelper method getAssessmentNodeDataList.
public static int getAssessmentNodeDataList(int recursionLevel, CourseNode courseNode, ScoreAccounting scoreAccounting, UserCourseEnvironment userCourseEnv, boolean followUserVisibility, boolean discardEmptyNodes, boolean discardComments, List<AssessmentNodeData> data, AssessmentNodesLastModified lastModifications) {
// 1) Get list of children data using recursion of this method
AssessmentNodeData assessmentNodeData = new AssessmentNodeData(recursionLevel, courseNode);
data.add(assessmentNodeData);
int numOfChildren = 0;
for (int i = 0; i < courseNode.getChildCount(); i++) {
CourseNode child = (CourseNode) courseNode.getChildAt(i);
numOfChildren += getAssessmentNodeDataList(recursionLevel + 1, child, scoreAccounting, userCourseEnv, followUserVisibility, discardEmptyNodes, discardComments, data, lastModifications);
}
// 2) Get data of this node only if
// - it has any wrapped children or
// - it is of an assessable course node type
boolean hasDisplayableValuesConfigured = false;
boolean hasDisplayableUserValues = false;
if (numOfChildren > 0 || courseNode instanceof AssessableCourseNode) {
if (courseNode instanceof ProjectBrokerCourseNode) {
// ProjectBroker : no assessment-tool in V1.0 , remove project broker completely form assessment-tool gui
assessmentNodeData.setSelectable(false);
} else if (courseNode instanceof AssessableCourseNode) {
AssessableCourseNode assessableCourseNode = (AssessableCourseNode) courseNode;
AssessmentEvaluation scoreEvaluation = scoreAccounting.evalCourseNode(assessableCourseNode);
if (scoreEvaluation != null) {
assessmentNodeData.setAssessmentStatus(scoreEvaluation.getAssessmentStatus());
assessmentNodeData.setNumOfAssessmentDocs(scoreEvaluation.getNumOfAssessmentDocs());
}
assessmentNodeData.setUserVisibility(scoreEvaluation.getUserVisible());
assessmentNodeData.setLastModified(scoreEvaluation.getLastModified());
assessmentNodeData.setLastUserModified(scoreEvaluation.getLastUserModified());
assessmentNodeData.setLastCoachModified(scoreEvaluation.getLastCoachModified());
if (lastModifications != null) {
lastModifications.addLastModified(scoreEvaluation.getLastModified());
lastModifications.addLastUserModified(scoreEvaluation.getLastUserModified());
lastModifications.addLastCoachModified(scoreEvaluation.getLastCoachModified());
}
if (!followUserVisibility || scoreEvaluation.getUserVisible() == null || scoreEvaluation.getUserVisible().booleanValue()) {
// details
if (assessableCourseNode.hasDetails()) {
hasDisplayableValuesConfigured = true;
String detailValue = assessableCourseNode.getDetailsListView(userCourseEnv);
if (detailValue == null) {
// ignore unset details in discardEmptyNodes mode
assessmentNodeData.setDetails(AssessmentHelper.DETAILS_NA_VALUE);
} else {
assessmentNodeData.setDetails(detailValue);
hasDisplayableUserValues = true;
}
}
// attempts
if (assessableCourseNode.hasAttemptsConfigured()) {
hasDisplayableValuesConfigured = true;
Integer attemptsValue = scoreEvaluation.getAttempts();
if (attemptsValue != null) {
assessmentNodeData.setAttempts(attemptsValue);
if (attemptsValue.intValue() > 0) {
// ignore attempts = 0 in discardEmptyNodes mode
hasDisplayableUserValues = true;
}
}
}
// score
if (assessableCourseNode.hasScoreConfigured()) {
hasDisplayableValuesConfigured = true;
Float score = scoreEvaluation.getScore();
if (score != null) {
assessmentNodeData.setRoundedScore(AssessmentHelper.getRoundedScore(score));
assessmentNodeData.setScore(score);
hasDisplayableUserValues = true;
}
if (!(assessableCourseNode instanceof STCourseNode)) {
assessmentNodeData.setMaxScore(assessableCourseNode.getMaxScoreConfiguration());
assessmentNodeData.setMinScore(assessableCourseNode.getMinScoreConfiguration());
}
}
// passed
if (assessableCourseNode.hasPassedConfigured()) {
hasDisplayableValuesConfigured = true;
Boolean passed = scoreEvaluation.getPassed();
if (passed != null) {
assessmentNodeData.setPassed(passed);
hasDisplayableUserValues = true;
}
}
}
// selection command available
AssessableCourseNode acn = (AssessableCourseNode) courseNode;
if (acn.isEditableConfigured()) {
// Assessable course nodes are selectable
assessmentNodeData.setSelectable(true);
} else {
// assessable nodes that do not have score or passed are not selectable
// (e.g. a st node with no defined rule
assessmentNodeData.setSelectable(false);
}
if (!hasDisplayableUserValues && assessableCourseNode.hasCommentConfigured() && !discardComments) {
// comments are invisible in the table but if configured the node must be in the list
// for the efficiency statement this can be ignored, this is the case when discardComments is true
hasDisplayableValuesConfigured = true;
if (assessableCourseNode.getUserUserComment(userCourseEnv) != null) {
hasDisplayableUserValues = true;
}
}
} else {
// Not assessable nodes are not selectable. (e.g. a node that
// has an assessable child node but is itself not assessable)
assessmentNodeData.setSelectable(false);
}
}
// 3) Add data of this node to mast list if node assessable or children list has any data.
// Do only add nodes when they have any assessable element, otherwhise discard (e.g. empty course,
// structure nodes without scoring rules)! When the discardEmptyNodes flag is set then only
// add this node when there is user data found for this node.
boolean addNode = (numOfChildren > 0 || (discardEmptyNodes && hasDisplayableValuesConfigured && hasDisplayableUserValues) || (!discardEmptyNodes && hasDisplayableValuesConfigured));
if (!addNode) {
data.remove(assessmentNodeData);
return 0;
}
// add itself
return numOfChildren + 1;
}
Aggregations