CLARK business rules encapsulated in TypeScript modules
npm install --save clark-entity
npm run test
The standard JSON.stringify function will work on entities, but data will be extraneous. If you are sending an entity over a network, you must first convert its information to a string by:
let serialized = <Entity>.serialize(entity);
On the receiving end, you must unserialize by:
let entity = <Entity>.unserialize(serialized, parent);
If you are not working with a parent entity, pass null
as the second argument.
- User
- LearningObject
- LearningGoal
- LearningOutcome
- StandardOutcome
- InstructionalStrategy
- AssessmentPlan
A class to represent Bloomin' Onion users.
Kind: global class
- User
- new User(username, name)
- .username
- .name
- .pwd
- .objects
- .addObject() ⇒
LearningObject
- .removeObject(i) ⇒
LearningObject
Construct a new User, given starting user id and name.
Param | Type | Description |
---|---|---|
username | string |
the user's unique log-in username |
name | string |
the user's real-life name |
Kind: instance property of User
Properties
Name | Type | Description |
---|---|---|
id | string |
a user's unique log-in username |
Kind: instance property of User
Properties
Name | Type | Description |
---|---|---|
name | string |
a user's real-life name |
Kind: instance property of User
Properties
Name | Type | Description |
---|---|---|
string |
a user's email on file |
Kind: instance property of User
Properties
Name | Type | Description |
---|---|---|
pwdhash | string |
a user's password authentication |
Kind: instance property of User
Properties
Name | Type | Description |
---|---|---|
objects | Array.<LearningObject> |
(immutable) an array of a user's learning objects NOTE: individual elements are freely accessible, but the array reference itself is immutable, and elements canonly be added and removed by the below functions |
Adds a new, blank learning object to this user.
Kind: instance method of User
Returns: LearningObject
- a reference to the new learning object
Removes the user's i-th learning object.
Kind: instance method of User
Returns: LearningObject
- the learning object which was removed
Param | Type | Description |
---|---|---|
i | number |
the index to remove from the objects array |
A class to represent a learning object.
Kind: global class
Construct a new, blank LearningOutcome.
Param | Type | Description |
---|---|---|
source | User |
the author the new object belongs to TODO: current constructor parameters (author required, name optional) are in place for reverse compatibility, but actually they should be backwards (name required, author optional [default to null]) TODO: constructor should confirm uniqueness of name if author is not null |
Kind: instance property of LearningObject
Properties
Name | Type | Description |
---|---|---|
author | User |
(immutable) the user this learning object belongs to |
Kind: instance property of LearningObject
Properties
Name | Type | Description |
---|---|---|
length | string |
the object's identifying name, unique over a user TODO: ensure uniqueness of name if author is not null |
Kind: instance property of LearningObject
Properties
Name | Type | Description |
---|---|---|
length | string |
the object's last-modified date FIXME: if there's a reason to use an actual Date class |
Kind: instance property of LearningObject
Properties
Name | Type | Description |
---|---|---|
length | string |
the object's class, determining its length (eg. module) values are resetricted according to available lengths |
Kind: instance property of LearningObject
Properties
Name | Type | Description |
---|---|---|
goals | Array.<LearningGoal> |
(immutable) goals this learning object should achieve NOTE: individual elements are freely accessible, but the array reference itself is immutable, and elements canonly be added and removed by the below functions |
Kind: instance property of LearningObject
Properties
Name | Type | Description |
---|---|---|
outcomes | Array.<LearningOutcome> |
(immutable) outcomes this object should enable students to achieve NOTE: individual elements are freely accessible, but the array reference itself is immutable, and elements can only be added and removed by the below functions |
Kind: instance property of LearningObject
Properties
Name | Type | Description |
---|---|---|
repository | Repository |
neutrino file/url storage TODO: extend constituents into full-fledged entities |
Adds a new learning goal to this object.
Kind: instance method of LearningObject
learningObject.removeGoal(i) ⇒ LearningObject
Removes the object's i-th learning goal.
Kind: instance method of LearningObject
Returns: LearningObject
- the goal which was removed
Param | Type | Description |
---|---|---|
i | number |
the index to remove from the goals array |
Adds a new, blank learning outcome to this object.
Kind: instance method of LearningObject
Returns: AssessmentPlan
- a reference to the new outcome
learningObject.removeOutcome(i) ⇒ LearningObject
Removes the object's i-th learning outcome.
Kind: instance method of LearningObject
Returns: LearningObject
- the learning outcome which was removed
Param | Type | Description |
---|---|---|
i | number |
the index to remove from the outcomes array |
A class to represent a learning object's learning goal.
Kind: global class
Construct a new Learning Goal with text.
Param | Type | Description |
---|---|---|
text | string |
the text of the new Learning Goal |
Kind: instance property of LearningGoal
Properties
Name | Type | Description |
---|---|---|
text | string |
text content of this learning goal |
A class to represent a learning outcome.
Kind: global class
- LearningOutcome
- new LearningOutcome(source)
- .source
- .tag
- .bloom
- .verb
- .text
- .mappings
- .assessments
- .strategies
- .author
- .mapTo() ⇒
number
- .unmap(i) ⇒
Outcome
- .addAssessment() ⇒
AssessmentPlan
- .removeAssessment(i) ⇒
LearningObject
- .addStrategy() ⇒
InstructionalStrategy
- .removeStrategy(i) ⇒
LearningObject
Construct a new, blank LearningOutcome.
Param | Type | Description |
---|---|---|
source | LearningObject |
the learning object the new learning outcome belongs to TODO: constructor should take EITHER source OR tag (the other should be null) If tag is given (0 allowed), If source exists, validate that tag is unique, Otherwise, trust it Otherwise, auto-increment tag as necessary based on source The order of parameters should be consistent with LearningObject, ultimatelythat should be (tag, source) |
Kind: instance property of LearningOutcome
Properties
Name | Type | Description |
---|---|---|
source | LearningOutcomeSource |
(immutable) the author, name, and date of the learning object this outcome belongs to |
Kind: instance property of LearningOutcome
Properties
Name | Type | Description |
---|---|---|
tag | number |
(immutable) a unique (over the source) identifier |
Kind: instance property of LearningOutcome
Properties
Name | Type | Description |
---|---|---|
instruction | string |
the bloom taxon of this learning outcome values are resetricted according to available levels |
Kind: instance property of LearningOutcome
Properties
Name | Type | Description |
---|---|---|
instruction | string |
the verb this outcome text starts with (eg. define) values are resetricted according to the bloom taxon |
Kind: instance property of LearningOutcome
Properties
Name | Type | Description |
---|---|---|
text | string |
full text description of this outcome, except the verb |
Kind: instance property of LearningOutcome
Properties
Name | Type | Description |
---|---|---|
mappings | Array.<Outcome> |
(immutable) outcomes which presumably achieve similar things as this NOTE: individual elements are freely accessible, but the array reference itself is immutable, andelements can only be added and removed by the below functions |
Kind: instance property of LearningOutcome
Properties
Name | Type | Description |
---|---|---|
assessments | Array.<AssessmentPlan> |
(immutable) plans to assess how well the outcome is achieved NOTE: individual elements are freely accessible, but the array reference itself is immutable, and elements can only be added and removed by the below functions |
Kind: instance property of LearningOutcome
Properties
Name | Type | Description |
---|---|---|
strategies | Array.<InstructionalStrategy> |
(immutable) strategies on how to achieve the outcome NOTE: individual elements are freely accessible, but the array reference itself is immutable, andelements can only be added and removed by the below functions |
properties for consistency with the Outcome interface
Kind: instance property of LearningOutcome
Properties
Name | Type |
---|---|
author | string |
name | string |
date | string |
outcome | string |
Maps an outcome to this learning outcome.
Kind: instance method of LearningOutcome
Returns: number
- the new length of the mappings array
Removes the outcome's i-th mapping.
Kind: instance method of LearningOutcome
Returns: Outcome
- the outcome which was removed
Param | Type | Description |
---|---|---|
i | number |
the index to remove from the mappings array |
Adds a new, blank assessment plan to this outcome.
Kind: instance method of LearningOutcome
Returns: AssessmentPlan
- a reference to the new assessment plan
Removes the outcome's i-th assessment plan.
Kind: instance method of LearningOutcome
Returns: LearningObject
- the assessment plan which was removed
Param | Type | Description |
---|---|---|
i | number |
the index to remove from the assessments array |
Adds a new, blank instructional strategy to this outcome.
Kind: instance method of LearningOutcome
Returns: InstructionalStrategy
- a reference to the new strategy
Removes the outcome's i-th instructional strategy.
Kind: instance method of LearningOutcome
Returns: LearningObject
- the strategy which was removed
Param | Type | Description |
---|---|---|
i | number |
the index to remove from the strategies array |
A class to represent a standard outcome. Immutable.
Kind: global class
Create a new StandardOutcome.
Param | Type | Description |
---|---|---|
author | string |
the new outcome's source |
name | string |
the new outcome's label |
outcome | string |
the new outcome's text |
Kind: instance property of StandardOutcome
Properties
Name | Type | Description |
---|---|---|
source | string |
the organization or document this outcome is drawn from |
Kind: instance property of StandardOutcome
Properties
Name | Type | Description |
---|---|---|
name | string |
the label or unit of the outcome |
Kind: instance property of StandardOutcome
Properties
Name | Type | Description |
---|---|---|
date | string |
the year this standard was established |
Kind: instance property of StandardOutcome
Properties
Name | Type | Description |
---|---|---|
outcome | string |
the text of the outcome |
A class to represent a learning outcome's instructional strategy.
Kind: global class
Construct a new, blank InstructionalStrategy.
Param | Type | Description |
---|---|---|
source | LearningOutcome |
the learning outcome the new instructional strategy belongs to |
Kind: instance property of InstructionalStrategy
Properties
Name | Type | Description |
---|---|---|
sourceBloom | string |
(immutable) the outcome's bloom taxon this assessment plan belongs to |
Kind: instance property of InstructionalStrategy
Properties
Name | Type | Description |
---|---|---|
instruction | string |
the class of this instructional strategy (eg. lecture) values are resetricted according to source's bloom taxon |
Kind: instance property of InstructionalStrategy
Properties
Name | Type | Description |
---|---|---|
text | string |
full text description of this instructional strategy |
A class to represent a learning outcome's assessment plan.
Kind: global class
Construct a new, blank AssessmentPlan.
Param | Type | Description |
---|---|---|
source | LearningOutcome |
the learning outcome the new assessment plan belongs to |
Kind: instance property of AssessmentPlan
Properties
Name | Type | Description |
---|---|---|
sourceBloom | string |
(immutable) the outcome's bloom taxon this assessment plan belongs to |
Kind: instance property of AssessmentPlan
Properties
Name | Type | Description |
---|---|---|
instruction | string |
the class of this assessment plan (essay, test, etc.) values are resetricted according to source's bloom taxon |
Kind: instance property of AssessmentPlan
Properties
Name | Type | Description |
---|---|---|
text | string |
full text description of this instructional strategy |