org.olat.course.assessment
Class AssessmentHelper

java.lang.Object
  extended by org.olat.course.assessment.AssessmentHelper

public class AssessmentHelper
extends java.lang.Object

Description:
Helper methods for the course assessment system

Initial Date: Oct 28, 2004

Author:
gnaegi

Field Summary
static java.lang.String DETAILS_NA_VALUE
          String to symbolize 'not available' or 'not assigned' in assessments details *
static java.lang.String KEY_ATTEMPTS
           
static java.lang.String KEY_DETAILS
           
static java.lang.String KEY_IDENTIFYER
           
static java.lang.String KEY_INDENT
           
static java.lang.String KEY_PASSED
           
static java.lang.String KEY_SCORE
           
static java.lang.String KEY_SELECTABLE
           
static java.lang.String KEY_TITLE_LONG
           
static java.lang.String KEY_TITLE_SHORT
           
static java.lang.String KEY_TYPE
           
static float MAX_SCORE_SUPPORTED
          Highes score value supported by OLAT *
static float MIN_SCORE_SUPPORTED
          Lowest score value supported by OLAT *
 
Constructor Summary
AssessmentHelper()
           
 
Method Summary
static boolean checkForAssessableNodes(CourseNode node)
          Checks recursivley a course structure or a part of it for assessable nodes or for structure course nodes (subtype of assessable node), which 'hasPassedConfigured' or 'hasScoreConfigured' is true.
static boolean checkIfNodeIsAssessable(CourseNode node)
          check the given node for assessability.
static java.util.List<CourseNode> getAssessableNodes(CourseEditorTreeModel editorModel, CourseNode excludeNode)
          Get all assessable nodes including the root node (if assessable)
static java.lang.String getRoundedScore(java.lang.Float score)
           
static boolean isResultVisible(ModuleConfiguration modConfig)
          Evaluates if the results are visble or not in respect of the configured CONFIG_KEY_DATE_DEPENDENT_RESULTS parameter.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DETAILS_NA_VALUE

public static final java.lang.String DETAILS_NA_VALUE
String to symbolize 'not available' or 'not assigned' in assessments details *

See Also:
Constant Field Values

MAX_SCORE_SUPPORTED

public static final float MAX_SCORE_SUPPORTED
Highes score value supported by OLAT *

See Also:
Constant Field Values

MIN_SCORE_SUPPORTED

public static final float MIN_SCORE_SUPPORTED
Lowest score value supported by OLAT *

See Also:
Constant Field Values

KEY_TYPE

public static final java.lang.String KEY_TYPE
See Also:
Constant Field Values

KEY_IDENTIFYER

public static final java.lang.String KEY_IDENTIFYER
See Also:
Constant Field Values

KEY_INDENT

public static final java.lang.String KEY_INDENT
See Also:
Constant Field Values

KEY_TITLE_SHORT

public static final java.lang.String KEY_TITLE_SHORT
See Also:
Constant Field Values

KEY_TITLE_LONG

public static final java.lang.String KEY_TITLE_LONG
See Also:
Constant Field Values

KEY_PASSED

public static final java.lang.String KEY_PASSED
See Also:
Constant Field Values

KEY_SCORE

public static final java.lang.String KEY_SCORE
See Also:
Constant Field Values

KEY_ATTEMPTS

public static final java.lang.String KEY_ATTEMPTS
See Also:
Constant Field Values

KEY_DETAILS

public static final java.lang.String KEY_DETAILS
See Also:
Constant Field Values

KEY_SELECTABLE

public static final java.lang.String KEY_SELECTABLE
See Also:
Constant Field Values
Constructor Detail

AssessmentHelper

public AssessmentHelper()
Method Detail

checkIfNodeIsAssessable

public static boolean checkIfNodeIsAssessable(CourseNode node)
check the given node for assessability.

Parameters:
node -
Returns:

checkForAssessableNodes

public static boolean checkForAssessableNodes(CourseNode node)
Checks recursivley a course structure or a part of it for assessable nodes or for structure course nodes (subtype of assessable node), which 'hasPassedConfigured' or 'hasScoreConfigured' is true. If founds the first node that meets the criterias, it returns true.

Parameters:
node -
Returns:
boolean

getAssessableNodes

public static java.util.List<CourseNode> getAssessableNodes(CourseEditorTreeModel editorModel,
                                                            CourseNode excludeNode)
Get all assessable nodes including the root node (if assessable)

Parameters:
editorModel -
excludeNode - Node that should be excluded in the list, e.g. the current node or null if all assessable nodes should be used
Returns:
List of assessable course nodes

getRoundedScore

public static java.lang.String getRoundedScore(java.lang.Float score)
Parameters:
score - The score to be rounded
Returns:
The rounded score for GUI presentation

isResultVisible

public static boolean isResultVisible(ModuleConfiguration modConfig)
Evaluates if the results are visble or not in respect of the configured CONFIG_KEY_DATE_DEPENDENT_RESULTS parameter.
The results are always visible if no date dependent, or if date dependent only in the period: startDate-endDate. EndDate could be null, that is there is no restriction for the end date.

Returns:
true if is visible.