questionMarks: Define a Marking Scheme

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/mark.R

Description

These functions are used to specify how the result of a comparison between two objects should be converted to a numeric mark.

Usage

1
2
3
4
5
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 FALSE.

pattern

A regular expression to search for within the comparison transformations.

mark

How many marks to deduct if the regular expression is matched.

...

For questionMarks, zero or more marking rules (as generated by the the rule() function); for rule(), zero or more transformation rules (as generated by the transformRule() function.

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

 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)))

compare documentation built on May 2, 2019, 10:24 a.m.