Description Usage Arguments Details Value Author(s) See Also Examples
These functions are used to specify how the result of a comparison between two objects should be converted to a numeric mark.
1 2 3 4 5 | questionMarks(answerNames, maxMark, ...)
rule(answerName, falseMark, ...)
transformRule(pattern, mark)
|
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 |
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()
.
An object of class "questionMarks"
.
Paul Murrell
markQuestions
and
compareFiles
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | # 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)))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.