org.olat.course.nodes
Class STCourseNode

java.lang.Object
  extended by org.olat.core.util.nodes.GenericNode
      extended by org.olat.course.nodes.GenericCourseNode
          extended by org.olat.course.nodes.AbstractAccessableCourseNode
              extended by org.olat.course.nodes.STCourseNode
All Implemented Interfaces:
java.io.Serializable, ShortName, INode, AssessableCourseNode, CourseNode

public class STCourseNode
extends AbstractAccessableCourseNode
implements AssessableCourseNode

Description:
The structure node (ST) is used to build structures in the course hierarchy. In addition it is also used to calculate score and passed values, to syndicate these values e.g. from children nodes. Example: a lesson with two tests is passed when both tests are passed. This would be designed as an ST node with two IMSTEST nodes as children and a scoring rule on the ST node that syndicates the testresults. In the assessment tool the ST node results can be seen but not changed since these are calculated values and not saved values from properties.

Initial Date: Feb 9, 2004

Author:
Mike Stock, BPS (BPS Bildungsportal Sachsen GmbH)
See Also:
Serialized Form

Field Summary
 
Fields inherited from interface org.olat.course.nodes.CourseNode
DISPLAY_OPTS_CONTENT, DISPLAY_OPTS_TITLE_CONTENT, DISPLAY_OPTS_TITLE_DESCRIPTION_CONTENT
 
Constructor Summary
STCourseNode()
          Constructor for a course building block of the type structure
 
Method Summary
 TabbableController createEditController(UserRequest ureq, WindowControl wControl, ICourse course, UserCourseEnvironment euce)
          Create a node edit controller for this node to configure node specific features
 NodeRunConstructionResult createNodeRunConstructionResult(UserRequest ureq, WindowControl wControl, UserCourseEnvironment userCourseEnv, NodeEvaluation ne, java.lang.String nodecmd)
          Create a course run controller for this node
 Controller createPeekViewRunController(UserRequest ureq, WindowControl wControl, UserCourseEnvironment userCourseEnv, NodeEvaluation ne)
          Default implementation of the peekview controller that returns NULL: no node specific peekview information should be shown
Override this method with a specific implementation if you have something interesting to show in the peekview
 Controller createPreviewController(UserRequest ureq, WindowControl wControl, UserCourseEnvironment userCourseEnv, NodeEvaluation ne)
          default implementation of the previewController
 java.util.List getConditionExpressions()
           
 java.lang.Float getCutValueConfiguration()
           
 Controller getDetailsEditController(UserRequest ureq, WindowControl wControl, UserCourseEnvironment userCourseEnvironment)
          Returns a controller to edit the node specific details
 java.lang.String getDetailsListView(UserCourseEnvironment userCourseEnvironment)
           
 java.lang.String getDetailsListViewHeaderKey()
           
 java.lang.String getDisplayOption()
           
 java.lang.Float getMaxScoreConfiguration()
           
 java.lang.Float getMinScoreConfiguration()
           
 RepositoryEntry getReferencedRepositoryEntry()
          used by the publish process to ensure the reference counters for a repository entry are correct.
 ScoreCalculator getScoreCalculator()
           
 java.lang.Integer getUserAttempts(UserCourseEnvironment userCourseEnvironment)
           
 java.lang.String getUserCoachComment(UserCourseEnvironment userCourseEnvironment)
           
 java.lang.String getUserLog(UserCourseEnvironment userCourseEnvironment)
           
 ScoreEvaluation getUserScoreEvaluation(UserCourseEnvironment userCourseEnv)
          the structure node does not have a score itself, but calculates the score/passed info by evaluating the configured expression in the the (condition)interpreter.
 java.lang.String getUserUserComment(UserCourseEnvironment userCourseEnvironment)
           
 boolean hasAttemptsConfigured()
           
 boolean hasCommentConfigured()
           
 boolean hasDetails()
           
 boolean hasPassedConfigured()
           
 boolean hasScoreConfigured()
           
 boolean hasStatusConfigured()
           
 void incrementUserAttempts(UserCourseEnvironment userCourseEnvironment)
          Increments the users attempts for this node and this user + 1.
 StatusDescription isConfigValid()
           
 StatusDescription[] isConfigValid(CourseEditorEnv cev)
          must be implemented in the concrete subclasses as a translator is needed for the errormessages which comes with evaluating condition expressions
 boolean isEditableConfigured()
           
 boolean needsReferenceToARepositoryEntry()
           
 void setScoreCalculator(ScoreCalculator scoreCalculatorP)
           
 void updateModuleConfigDefaults(boolean isNewNode)
          Update the module configuration to have all mandatory configuration flags set to usefull default values
 void updateUserAttempts(java.lang.Integer userAttempts, UserCourseEnvironment userCourseEnvironment, Identity coachingIdentity)
          Updates the users attempts for this node and this user.
 void updateUserCoachComment(java.lang.String coachComment, UserCourseEnvironment userCourseEnvironment)
          Updates the coach comment for this node and this user.
 void updateUserScoreEvaluation(ScoreEvaluation scoreEvaluation, UserCourseEnvironment userCourseEnvironment, Identity coachingIdentity, boolean incrementAttempts)
           
 void updateUserUserComment(java.lang.String userComment, UserCourseEnvironment userCourseEnvironment, Identity coachingIdentity)
          Updates the user comment for this node and this user.
 
Methods inherited from class org.olat.course.nodes.AbstractAccessableCourseNode
createInstanceForCopy, getPreConditionAccess, setPreConditionAccess
 
Methods inherited from class org.olat.course.nodes.GenericCourseNode
archiveNodeData, cleanupOnDelete, createInstanceForCopy, eval, explainThisDuringPublish, exportNode, getDisplayOption, getLearningObjectives, getLongTitle, getModuleConfiguration, getNoAccessExplanation, getPreConditionVisibility, getShortName, getShortTitle, getType, importNode, informOnDelete, setDisplayOption, setLearningObjectives, setLongTitle, setModuleConfiguration, setNoAccessExplanation, setPreConditionVisibility, setShortTitle, setType, toString
 
Methods inherited from class org.olat.core.util.nodes.GenericNode
addChild, findRoot, getChildAt, getChildCount, getIdent, getParent, getPosition, insert, remove, removeAllChildren, removeFromParent, setIdent, setParent
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.olat.course.nodes.CourseNode
archiveNodeData, cleanupOnDelete, createInstanceForCopy, createInstanceForCopy, eval, explainThisDuringPublish, exportNode, getLearningObjectives, getLongTitle, getModuleConfiguration, getNoAccessExplanation, getPreConditionAccess, getPreConditionVisibility, getShortTitle, getType, importNode, informOnDelete, setDisplayOption, setIdent, setLearningObjectives, setLongTitle, setNoAccessExplanation, setPreConditionVisibility, setShortTitle
 
Methods inherited from interface org.olat.core.util.nodes.INode
addChild, getChildAt, getChildCount, getIdent, getParent, getPosition, insert, remove, removeAllChildren, removeFromParent, setParent
 
Methods inherited from interface org.olat.core.gui.ShortName
getShortName
 

Constructor Detail

STCourseNode

public STCourseNode()
Constructor for a course building block of the type structure

Method Detail

createEditController

public TabbableController createEditController(UserRequest ureq,
                                               WindowControl wControl,
                                               ICourse course,
                                               UserCourseEnvironment euce)
Description copied from interface: CourseNode
Create a node edit controller for this node to configure node specific features

Specified by:
createEditController in interface CourseNode
Specified by:
createEditController in class AbstractAccessableCourseNode
Parameters:
ureq - The user request
wControl - The current window controller
course - The course
euce - the editor user course environment provides syntax/semantic check methods for conditions
Returns:
A tabbable node edit controller
See Also:
org.olat.course.nodes.CourseNode#createEditController(org.olat.core.gui.UserRequest, org.olat.core.gui.control.WindowControl, org.olat.course.ICourse)

createNodeRunConstructionResult

public NodeRunConstructionResult createNodeRunConstructionResult(UserRequest ureq,
                                                                 WindowControl wControl,
                                                                 UserCourseEnvironment userCourseEnv,
                                                                 NodeEvaluation ne,
                                                                 java.lang.String nodecmd)
Description copied from interface: CourseNode
Create a course run controller for this node

Specified by:
createNodeRunConstructionResult in interface CourseNode
Specified by:
createNodeRunConstructionResult in class AbstractAccessableCourseNode
Parameters:
ureq - The user request
wControl - The current window controller
userCourseEnv - The course environment
ne - The node evaluation
Returns:
The node run controller ATTENTION: udpateModuleConfigDefaults(false) should be called inside from the courseNode.createNodeRunConstructionResult(ureq, bwControl, userCourseEnv, nodeEval, nodecmd) to set the course node specific configuration default values!
See Also:
org.olat.course.nodes.CourseNode#createNodeRunConstructionResult(org.olat.core.gui.UserRequest, org.olat.core.gui.control.WindowControl, org.olat.course.run.userview.UserCourseEnvironment, org.olat.course.run.userview.NodeEvaluation)

createPreviewController

public Controller createPreviewController(UserRequest ureq,
                                          WindowControl wControl,
                                          UserCourseEnvironment userCourseEnv,
                                          NodeEvaluation ne)
Description copied from class: GenericCourseNode
default implementation of the previewController

Specified by:
createPreviewController in interface CourseNode
Overrides:
createPreviewController in class GenericCourseNode
Returns:
Controller
See Also:
GenericCourseNode.createPreviewController(org.olat.core.gui.UserRequest, org.olat.core.gui.control.WindowControl, org.olat.course.run.userview.UserCourseEnvironment, org.olat.course.run.userview.NodeEvaluation)

createPeekViewRunController

public Controller createPeekViewRunController(UserRequest ureq,
                                              WindowControl wControl,
                                              UserCourseEnvironment userCourseEnv,
                                              NodeEvaluation ne)
Description copied from class: GenericCourseNode
Default implementation of the peekview controller that returns NULL: no node specific peekview information should be shown
Override this method with a specific implementation if you have something interesting to show in the peekview

Specified by:
createPeekViewRunController in interface CourseNode
Overrides:
createPeekViewRunController in class GenericCourseNode
Returns:
See Also:
GenericCourseNode.createPeekViewRunController(org.olat.core.gui.UserRequest, org.olat.core.gui.control.WindowControl, org.olat.course.run.userview.UserCourseEnvironment, org.olat.course.run.userview.NodeEvaluation)

getUserScoreEvaluation

public ScoreEvaluation getUserScoreEvaluation(UserCourseEnvironment userCourseEnv)
the structure node does not have a score itself, but calculates the score/passed info by evaluating the configured expression in the the (condition)interpreter.

Specified by:
getUserScoreEvaluation in interface AssessableCourseNode
Returns:
null, if this node cannot deliver any useful scoring info (this is not the case for a test never tried or manual scoring: those have default values 0.0f / false for score/passed; currently only the STNode returns null if there are no scoring rules defined.)
See Also:
AssessableCourseNode.getUserScoreEvaluation(org.olat.course.run.userview.UserCourseEnvironment)

isConfigValid

public StatusDescription isConfigValid()
Specified by:
isConfigValid in interface CourseNode
Returns:
true if the course node configuration is correct without the course context.
See Also:
CourseNode.isConfigValid()

isConfigValid

public StatusDescription[] isConfigValid(CourseEditorEnv cev)
Description copied from class: GenericCourseNode
must be implemented in the concrete subclasses as a translator is needed for the errormessages which comes with evaluating condition expressions

Specified by:
isConfigValid in interface CourseNode
Specified by:
isConfigValid in class GenericCourseNode
Returns:
true if the course node configuration is valid for itself and also within the specified course environment.
See Also:
org.olat.course.nodes.CourseNode#isConfigValid(org.olat.course.run.userview.UserCourseEnvironment)

getReferencedRepositoryEntry

public RepositoryEntry getReferencedRepositoryEntry()
Description copied from interface: CourseNode
used by the publish process to ensure the reference counters for a repository entry are correct. (you can only delete Repositoryentries if there are no references to it) returns exception when called even !needsReferenceToARespositoryEntry return the referenced RepositoryEntry if it can be found return null if the referenced RepositoryEntry could not be found

Specified by:
getReferencedRepositoryEntry in interface CourseNode
Returns:
the RepositoryEntry (if it still exists in the repository) which is referenced in this course node if there is a reference, or null otherwise
See Also:
CourseNode.getReferencedRepositoryEntry()

needsReferenceToARepositoryEntry

public boolean needsReferenceToARepositoryEntry()
Specified by:
needsReferenceToARepositoryEntry in interface CourseNode
Returns:
true if this node type potentially has a repository entry reference, false otherwhise. Attention: this method does not test if ther is actually such a reference. Use getReferencedRepository() to get this information.
See Also:
CourseNode.needsReferenceToARepositoryEntry()

getScoreCalculator

public ScoreCalculator getScoreCalculator()
Returns:
Returns the scoreCalculator.

setScoreCalculator

public void setScoreCalculator(ScoreCalculator scoreCalculatorP)
Parameters:
scoreCalculator - The scoreCalculator to set.

getCutValueConfiguration

public java.lang.Float getCutValueConfiguration()
Specified by:
getCutValueConfiguration in interface AssessableCourseNode
Returns:
Returns the passed cut value or null if no such value is defined. A null value means that no cut value is definied and therefor the node can be passed having any score or no score at all. Throws an OLATRuntimeException if hasPassed is set to false, cutValue is undefined in this case
See Also:
AssessableCourseNode.getCutValueConfiguration()

getMaxScoreConfiguration

public java.lang.Float getMaxScoreConfiguration()
Specified by:
getMaxScoreConfiguration in interface AssessableCourseNode
Returns:
Returns the maximal score that can be achieved on this node. Throws an OLATRuntimeException if hasScore set to false, maxScore is undefined in this case
See Also:
AssessableCourseNode.getMaxScoreConfiguration()

getMinScoreConfiguration

public java.lang.Float getMinScoreConfiguration()
Specified by:
getMinScoreConfiguration in interface AssessableCourseNode
Returns:
Returns the minimal score that can be achieved on this node. Throws an OLATRuntimeException if hasScore set to false, maxScore is undefined in this case
See Also:
AssessableCourseNode.getMinScoreConfiguration()

getUserCoachComment

public java.lang.String getUserCoachComment(UserCourseEnvironment userCourseEnvironment)
Specified by:
getUserCoachComment in interface AssessableCourseNode
Returns:
The coach comment for this user for this node (not visible to user)
See Also:
AssessableCourseNode.getUserCoachComment(org.olat.course.run.userview.UserCourseEnvironment)

getUserLog

public java.lang.String getUserLog(UserCourseEnvironment userCourseEnvironment)
Specified by:
getUserLog in interface AssessableCourseNode
Returns:
the users log of this node
See Also:
AssessableCourseNode.getUserLog(org.olat.course.run.userview.UserCourseEnvironment)

getUserUserComment

public java.lang.String getUserUserComment(UserCourseEnvironment userCourseEnvironment)
Specified by:
getUserUserComment in interface AssessableCourseNode
Returns:
the user comment for this user for this node, given by coach
See Also:
AssessableCourseNode.getUserUserComment(org.olat.course.run.userview.UserCourseEnvironment)

hasCommentConfigured

public boolean hasCommentConfigured()
Specified by:
hasCommentConfigured in interface AssessableCourseNode
Returns:
True if this course node produces a comment variable for the learner
See Also:
AssessableCourseNode.hasCommentConfigured()

hasPassedConfigured

public boolean hasPassedConfigured()
Specified by:
hasPassedConfigured in interface AssessableCourseNode
Returns:
True if this course node produces a passed variable for the learner
See Also:
AssessableCourseNode.hasPassedConfigured()

hasScoreConfigured

public boolean hasScoreConfigured()
Specified by:
hasScoreConfigured in interface AssessableCourseNode
Returns:
True if this course node produces a score variable for the learner
See Also:
AssessableCourseNode.hasScoreConfigured()

hasStatusConfigured

public boolean hasStatusConfigured()
Specified by:
hasStatusConfigured in interface AssessableCourseNode
Returns:
True if this course node produces an status variable for the learner
See Also:
AssessableCourseNode.hasStatusConfigured()

isEditableConfigured

public boolean isEditableConfigured()
Specified by:
isEditableConfigured in interface AssessableCourseNode
Returns:
True if score, passed, attempts and comment are editable by the assessment tool
See Also:
AssessableCourseNode.isEditableConfigured()

updateUserCoachComment

public void updateUserCoachComment(java.lang.String coachComment,
                                   UserCourseEnvironment userCourseEnvironment)
Description copied from interface: AssessableCourseNode
Updates the coach comment for this node and this user. This comment is not visible to the user.

Specified by:
updateUserCoachComment in interface AssessableCourseNode
See Also:
AssessableCourseNode.updateUserCoachComment(java.lang.String, org.olat.course.run.userview.UserCourseEnvironment)

updateUserScoreEvaluation

public void updateUserScoreEvaluation(ScoreEvaluation scoreEvaluation,
                                      UserCourseEnvironment userCourseEnvironment,
                                      Identity coachingIdentity,
                                      boolean incrementAttempts)
Specified by:
updateUserScoreEvaluation in interface AssessableCourseNode
Parameters:
scoreEvaluation - if scoreEvaluation.getScore() != null, then the score will be updated, and/or if scoreEvaluation.getPassed() != null, then 'passed' will be updated
See Also:
org.olat.course.nodes.AssessableCourseNode#updateUserScoreEvaluation(org.olat.course.run.scoring.ScoreEvaluation, org.olat.course.run.userview.UserCourseEnvironment, org.olat.core.id.Identity)

updateUserUserComment

public void updateUserUserComment(java.lang.String userComment,
                                  UserCourseEnvironment userCourseEnvironment,
                                  Identity coachingIdentity)
Description copied from interface: AssessableCourseNode
Updates the user comment for this node and this user. This comment is visible to the user.

Specified by:
updateUserUserComment in interface AssessableCourseNode
See Also:
AssessableCourseNode.updateUserUserComment(java.lang.String, org.olat.course.run.userview.UserCourseEnvironment, org.olat.core.id.Identity)

getUserAttempts

public java.lang.Integer getUserAttempts(UserCourseEnvironment userCourseEnvironment)
Specified by:
getUserAttempts in interface AssessableCourseNode
Returns:
the users attempts of this node
See Also:
AssessableCourseNode.getUserAttempts(org.olat.course.run.userview.UserCourseEnvironment)

hasAttemptsConfigured

public boolean hasAttemptsConfigured()
Specified by:
hasAttemptsConfigured in interface AssessableCourseNode
Returns:
True if this course node produces an attempts variable for the learner
See Also:
AssessableCourseNode.hasAttemptsConfigured()

updateUserAttempts

public void updateUserAttempts(java.lang.Integer userAttempts,
                               UserCourseEnvironment userCourseEnvironment,
                               Identity coachingIdentity)
Description copied from interface: AssessableCourseNode
Updates the users attempts for this node and this user.

Specified by:
updateUserAttempts in interface AssessableCourseNode
See Also:
AssessableCourseNode.updateUserAttempts(java.lang.Integer, org.olat.course.run.userview.UserCourseEnvironment, org.olat.core.id.Identity)

incrementUserAttempts

public void incrementUserAttempts(UserCourseEnvironment userCourseEnvironment)
Description copied from interface: AssessableCourseNode
Increments the users attempts for this node and this user + 1.

Specified by:
incrementUserAttempts in interface AssessableCourseNode
See Also:
AssessableCourseNode.incrementUserAttempts(org.olat.course.run.userview.UserCourseEnvironment)

getDetailsEditController

public Controller getDetailsEditController(UserRequest ureq,
                                           WindowControl wControl,
                                           UserCourseEnvironment userCourseEnvironment)
Description copied from interface: AssessableCourseNode
Returns a controller to edit the node specific details

Specified by:
getDetailsEditController in interface AssessableCourseNode
Returns:
a controller or null if hasDetails=false
See Also:
AssessableCourseNode.getDetailsEditController(org.olat.core.gui.UserRequest, org.olat.core.gui.control.WindowControl, org.olat.course.run.userview.UserCourseEnvironment)

getDetailsListView

public java.lang.String getDetailsListView(UserCourseEnvironment userCourseEnvironment)
Specified by:
getDetailsListView in interface AssessableCourseNode
Returns:
the details view for this node and this user. will be displayed in the user list. if hasDetails= false this returns null
See Also:
AssessableCourseNode.getDetailsListView(org.olat.course.run.userview.UserCourseEnvironment)

getDetailsListViewHeaderKey

public java.lang.String getDetailsListViewHeaderKey()
Specified by:
getDetailsListViewHeaderKey in interface AssessableCourseNode
Returns:
the details list view header key that is used to label the table row
See Also:
AssessableCourseNode.getDetailsListViewHeaderKey()

hasDetails

public boolean hasDetails()
Specified by:
hasDetails in interface AssessableCourseNode
Returns:
True if this course node has additional details to be edited / viewed
See Also:
AssessableCourseNode.hasDetails()

updateModuleConfigDefaults

public void updateModuleConfigDefaults(boolean isNewNode)
Update the module configuration to have all mandatory configuration flags set to usefull default values

Specified by:
updateModuleConfigDefaults in interface CourseNode
Overrides:
updateModuleConfigDefaults in class GenericCourseNode
Parameters:
isNewNode - true: an initial configuration is set; false: upgrading from previous node configuration version, set default to maintain previous behaviour

getConditionExpressions

public java.util.List getConditionExpressions()
Specified by:
getConditionExpressions in interface CourseNode
Overrides:
getConditionExpressions in class AbstractAccessableCourseNode
Returns:
empty list, or list with active condition expressions of the course node
See Also:
AbstractAccessableCourseNode.getConditionExpressions()

getDisplayOption

public java.lang.String getDisplayOption()
Specified by:
getDisplayOption in interface CourseNode
Overrides:
getDisplayOption in class GenericCourseNode
Returns:
String with the old behavior (default value if none existing)
See Also:
GenericCourseNode.getDefaultTitleOption()