Index: lams_common/src/java/org/lamsfoundation/lams/tool/ToolOutputDefinition.java =================================================================== RCS file: /usr/local/cvsroot/lams_common/src/java/org/lamsfoundation/lams/tool/ToolOutputDefinition.java,v diff -u -r1.4 -r1.4.6.1 --- lams_common/src/java/org/lamsfoundation/lams/tool/ToolOutputDefinition.java 26 Mar 2008 06:23:37 -0000 1.4 +++ lams_common/src/java/org/lamsfoundation/lams/tool/ToolOutputDefinition.java 20 Apr 2009 04:37:37 -0000 1.4.6.1 @@ -32,29 +32,26 @@ import org.lamsfoundation.lams.learningdesign.BranchCondition; /** - * Each tool that has outputs will define a set of output definitions. Some definitions will be - * "predefined" for a tool, e.g. "Learner's Mark". Others may be created for a specific tool activity, - * via a Conditions/Output tab in monitoring, e.g. Second answer contains the word "Mercury". + * Each tool that has outputs will define a set of output definitions. Some + * definitions will be "predefined" for a tool, e.g. "Learner's Mark". Others + * may be created for a specific tool activity, via a Conditions/Output tab in + * monitoring, e.g. Second answer contains the word "Mercury". *

- * If the tool contains generated definitions, then they must be copied when the tool content is copied, - * as the conditions may be modified via Live Edit. This must not modify the original design. + * If the tool contains generated definitions, then they must be copied when the + * tool content is copied, as the conditions may be modified via Live Edit. This + * must not modify the original design. *

- * For 2.1, we will not deal with complex outputs, so for now we will not define how a complex definition - * is defined. The field is placed in the object so that we have the place for it when we do design the - * complex output definitions. + * For 2.1, we will not deal with complex outputs, so for now we will not define + * how a complex definition is defined. The field is placed in the object so + * that we have the place for it when we do design the complex output + * definitions. *

- * Sample ToolOutputDefinition: - * ToolOutputDefinition { - * name = "LEARNERS_MARK", - * description = "Mark for an individual learner"; - * type = "NUMERIC"; - * startValue = "0.0"; - * endValue = "10.0"; - * complexDefinition = null; - * } + * Sample ToolOutputDefinition: ToolOutputDefinition { name = "LEARNERS_MARK", + * description = "Mark for an individual learner"; type = "NUMERIC"; startValue = + * "0.0"; endValue = "10.0"; complexDefinition = null; } */ public class ToolOutputDefinition implements Comparable { - + private String name; private String description; private OutputType type; @@ -63,117 +60,130 @@ private Object complexDefinition; private Boolean showConditionNameOnly; private List defaultConditions; - - /** Name must be unique within the current tool content. This will be used to identify the output. - * If the definition is a predefined definition then the name will always be the same (e.g. LEARNER_MARK) but - * if it is defined in authoring then it will need to made unique for this tool content (e.g. ANSWER_2_CONTAINS_1). - * At lesson time, the tool will be given back the name and will need to be able to uniquely identify the required - * output based on name, the tool session id and possibly the learner's user id. + + /** + * Name must be unique within the current tool content. This will be used to + * identify the output. If the definition is a predefined definition then + * the name will always be the same (e.g. LEARNER_MARK) but if it is defined + * in authoring then it will need to made unique for this tool content (e.g. + * ANSWER_2_CONTAINS_1). At lesson time, the tool will be given back the + * name and will need to be able to uniquely identify the required output + * based on name, the tool session id and possibly the learner's user id. */ - public String getName() { - return name; - } - public void setName(String name) { - this.name = name; - } - /** Description: Description is an internationalised text string which is displayed to the - * user as the output "name". It is the responsibility of the tool to internationalise the - * string. We suggest that the key for each predefined definition follow the convention - * OUTPUT_DESC_ - */ - public String getDescription() { - return description; - } - public void setDescription(String description) { - this.description = description; - } - /** - * The type of the output value. - */ - public OutputType getType() { - return type; - } - public void setType(OutputType type) { - this.type = type; - } - /** If the output value may be compared to a range, then startValue and endValue are the inclusive start values and end values - * for the range. This may be used to customise fixed definitions to ranges appropriate for the current data. - */ - public Object getStartValue() { - return startValue; - } - public void setStartValue(Object startValue) { - this.startValue = startValue; - } - /** See getStartValue() */ - public Object getEndValue() { - return endValue; - } - public void setEndValue(Object endValue) { - this.endValue = endValue; - } - public Object getComplexDefinition() { - return complexDefinition; - } - public void setComplexDefinition(Object complexDefinition) { - this.complexDefinition = complexDefinition; - } - - public String toString() { - return new ToStringBuilder(this) - .append("name", name) - .append("description", description) - .append("type", type) - .append("startValue", startValue) - .append("endValue", endValue) - .toString(); - } + public String getName() { + return name; + } - public boolean equals(Object other) { - if ( (this == other ) ) return true; - if ( !(other instanceof ToolOutputDefinition) ) return false; - ToolOutputDefinition castOther = (ToolOutputDefinition) other; - return new EqualsBuilder() - .append(this.name, castOther.name) - .append(this.type, castOther.type) - .isEquals(); - } + public void setName(String name) { + this.name = name; + } - public int hashCode() { - return new HashCodeBuilder() - .append(name) - .append(type) - .toHashCode(); - } + /** + * Description: Description is an internationalised text string which is + * displayed to the user as the output "name". It is the responsibility of + * the tool to internationalise the string. We suggest that the key for each + * predefined definition follow the convention OUTPUT_DESC_ + */ + public String getDescription() { + return description; + } - public int compareTo(Object o) { - - ToolOutputDefinition myClass = (ToolOutputDefinition) o; - return new CompareToBuilder() - .append(this.name, myClass.name) - .append(this.type, myClass.type) - .toComparison(); - } - /** Default Conditions are sample conditions that should be presented to the user as a starting point - * for using this OutputDefinition - * @return - */ - public List getDefaultConditions() { - return defaultConditions; - } - public void setDefaultConditions(List defaultConditions) { - this.defaultConditions = defaultConditions; - } - /** - * Should Flash show the definition of the branch conditions (e.g. Range from blah to blah) or just the name of the condition. - * Set to true if the definition relates to an internal parameter and will mean nothing to the user - */ - public Boolean isShowConditionNameOnly() { - return showConditionNameOnly; - } - public void setShowConditionNameOnly(Boolean showConditionNameOnly) { - this.showConditionNameOnly = showConditionNameOnly; - } + public void setDescription(String description) { + this.description = description; + } + /** + * The type of the output value. + */ + public OutputType getType() { + return type; + } + public void setType(OutputType type) { + this.type = type; + } + + /** + * If the output value may be compared to a range, then startValue and + * endValue are the inclusive start values and end values for the range. + * This may be used to customise fixed definitions to ranges appropriate for + * the current data. + */ + public Object getStartValue() { + return startValue; + } + + public void setStartValue(Object startValue) { + this.startValue = startValue; + } + + /** See getStartValue() */ + public Object getEndValue() { + return endValue; + } + + public void setEndValue(Object endValue) { + this.endValue = endValue; + } + + public Object getComplexDefinition() { + return complexDefinition; + } + + public void setComplexDefinition(Object complexDefinition) { + this.complexDefinition = complexDefinition; + } + + public String toString() { + return new ToStringBuilder(this).append("name", name).append("description", description).append("type", type) + .append("startValue", startValue).append("endValue", endValue).toString(); + } + + public boolean equals(Object other) { + if ((this == other)) + return true; + if (!(other instanceof ToolOutputDefinition)) + return false; + ToolOutputDefinition castOther = (ToolOutputDefinition) other; + return new EqualsBuilder().append(this.name, castOther.name).append(this.type, castOther.type).isEquals(); + } + + public int hashCode() { + return new HashCodeBuilder().append(name).append(type).toHashCode(); + } + + public int compareTo(Object o) { + + ToolOutputDefinition myClass = (ToolOutputDefinition) o; + return new CompareToBuilder().append(this.name, myClass.name).append(this.type, myClass.type).toComparison(); + } + + /** + * Default Conditions are sample conditions that should be presented to the + * user as a starting point for using this OutputDefinition + * + * @return + */ + public List getDefaultConditions() { + return defaultConditions; + } + + public void setDefaultConditions(List defaultConditions) { + this.defaultConditions = defaultConditions; + } + + /** + * Should Flash show the definition of the branch conditions (e.g. Range + * from blah to blah) or just the name of the condition. Set to true if the + * definition relates to an internal parameter and will mean nothing to the + * user + */ + public Boolean isShowConditionNameOnly() { + return showConditionNameOnly; + } + + public void setShowConditionNameOnly(Boolean showConditionNameOnly) { + this.showConditionNameOnly = showConditionNameOnly; + } + }