talx x1.0.5

util
Class Mastery

java.lang.Object
  extended byutil.Mastery
All Implemented Interfaces:
SkillLatticeConstants

public class Mastery
extends java.lang.Object
implements SkillLatticeConstants


Nested Class Summary
static class Mastery.Result
           
 
Field Summary
static java.lang.String BLANK_HISTORY
           
static Mastery.Result CONTINUE
           
static Mastery.Result FAILED
           
static util.Mastery.Condition[] ONCE_CONDITION
           
static Mastery.Result PASSED
           
 
Fields inherited from interface util.SkillLatticeConstants
ALIAS_ELEMENT, ALIAS_ID_ATTR, ALIAS_SKILL_ATTR, CONSTRAINT_ELEMENT, CONSTRAINT_FINAL_TOKEN, CONSTRAINT_NAME_ATTR, CONSTRAINT_ONGOING_TOKEN, CONSTRAINT_PARAM_ATTR, CONSTRAINT_STARTUP_TOKEN, CONSTRAINT_TYPE_ATTR, DESCRIPTION_ELEMENT, DRILL__RIGHT_PTR_ATTR, DRILL_CRITERIA_ATTR, DRILL_ELEMENT, DRILL_LIMIT_ATTR, DRILL_LIMIT_PTR_ATTR, DRILL_MAX_RETRIES_ATTR, DRILL_SKIPPABLE_ATTR, DRILL_WRONG_PTR_ATTR, MASTERY_CORRECT_TOKEN, MASTERY_INCORRECT_TOKEN, MASTERY_INITIAL_TOKEN, MASTERY_ONCE_TOKEN, MASTERY_OUTOF_REGEX, MASTERY_OUTOF_TOKEN, MASTERY_SEPARATOR_TOKEN, PAUSE_ELEMENT, PAUSE_LEVEL_ATTR, PAUSE_NEXT_PTR_ATTR, ROOT_ELEMENT, SKILL_BASE_DRILL_ATTR, SKILL_ELEMENT, SKILL_ID_ATTR, SKILL_PREREQUISITE_ATTR, SKILL_REFRESH_CRITERIA_ATTR, SKILL_REVIEW_CRITERIA_ATTR, STATUS_ATTEMPTED_TOKEN, STATUS_DATE_FORMAT, STATUS_IRRELEVANT_TOKEN, STATUS_LIMIT_COUNT_FORMAT, STATUS_MASTERED_TOKEN, STATUS_NEVER_ATTEMPTED_TOKEN, STATUS_REVIEWED_FAILED_TOKEN, STATUS_REVIEWED_PASSED_TOKEN, TASK_COMPONENT_ATTR, TASK_ELEMENT, TASK_TYPE_ATTR
 
Constructor Summary
Mastery(java.lang.String criteria)
          Constructs a new Mastery object using the given mastery conditions.
 
Method Summary
static java.lang.String appendHistory(java.lang.String history, boolean success)
          Updates the given history with the given task outcome.
 Mastery.Result evaluateHistory(java.lang.String history)
          Decides if the mastery conditions have been met yet.
 int[] getProgress(java.lang.String history)
          Returns int[] format of the current progress.
 java.lang.String getProgressString(java.lang.String history)
          Returns String format of the current progress.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

FAILED

public static final Mastery.Result FAILED

PASSED

public static final Mastery.Result PASSED

CONTINUE

public static final Mastery.Result CONTINUE

BLANK_HISTORY

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

ONCE_CONDITION

public static final util.Mastery.Condition[] ONCE_CONDITION
Constructor Detail

Mastery

public Mastery(java.lang.String criteria)
Constructs a new Mastery object using the given mastery conditions.

Parameters:
criteria - a string from the following BNF grammar:
    CRITERIA ::=   CRITERIA-LIST
                  | <white-space> CRITERIA
                  | initial <n>
                  | correct <n> OUTOF <n>
                  | wrong <n> OUTOF <n>
    OUTOF    ::=  out of | of
 
Where the production is a space or tab character and the production is any non-negative int value.
Throws:
java.lang.IllegalArgumentException - if the criteria do not match the given grammar.
Method Detail

appendHistory

public static java.lang.String appendHistory(java.lang.String history,
                                             boolean success)
Updates the given history with the given task outcome.

Parameters:
history - the previous task history, or null or BLANK_HISTORY if there were no previous tasks.
success - true if the outcome of the latest task was success, false otherwise.
Returns:
a history string with the latest task outcome appended.

evaluateHistory

public Mastery.Result evaluateHistory(java.lang.String history)
Decides if the mastery conditions have been met yet.

Returns:
PASSED if the user has met one of the mastery conditions, FAILED if the user has met one of the failure conditions, or CONTINUE otherwise.

getProgressString

public java.lang.String getProgressString(java.lang.String history)
Returns String format of the current progress.


getProgress

public int[] getProgress(java.lang.String history)
Returns int[] format of the current progress.


talx x1.0.5

© 2001-2005 University of Oregon.
Eugene OR 97403, U.S.A. All Rights Reserved.