questionMarks {compare} | R Documentation |
Define a Marking Scheme
Description
These functions are used to specify how the result of a comparison between two objects should be converted to a numeric mark.
Usage
questionMarks(answerNames, maxMark, ...)
rule(answerName, falseMark, ...)
transformRule(pattern, mark)
Arguments
answerNames |
The names of objects that have been compared. |
maxMark |
The maximum mark for the question. |
answerName |
The name of one object that has been compared. |
falseMark |
How many marks to deduct if the comparison result
was |
pattern |
A regular expression to search for within the comparison transformations. |
mark |
How many marks to deduct if the regular expression is matched. |
... |
For |
Details
These functions are used to define a marking scheme. The
function markQuestions()
can then be used to apply
the results to a set of comparisons, as generated by
compareFiles()
.
Value
An object of class "questionMarks"
.
Author(s)
Paul Murrell
See Also
markQuestions
and
compareFiles
Examples
# Check a comparison involving an object called 'IndianMothers'
# Start with a mark of 1 and deduct 1 if the comparison failed
questionMarks("IndianMothers",
maxMark=1,
rule("IndianMothers", 1))
# Check comparisons involving several objects
# Start with a mark of 2, for each unsuccessful comparison
# deduct 1 mark, and if a comparison involving the object
# 'class' includes a coercion transformation, deduct 1 mark.
questionMarks(c("id", "age", "edu", "class"),
maxMark=2,
rule("id", 1),
rule("age", 1),
rule("edu", 1),
rule("class", 1,
transformRule("coerced", 1)))