grade.set: Grade Sets

Description Usage Arguments Value Note See Also Examples

View source: R/grade.set.R

Description

Checks a the set (vector in R) studentans against correctans. grade.orderedset enforces order, grade.set does not.

Usage

1
2
3
4
grade.set(correctans, studentans, tolerance=0.01, useeval=TRUE,
          usena=FALSE, useinf=FALSE, quiet=TRUE)
grade.orderedset(correctans, studentans, tolerance=0.01, useeval=TRUE, 
                 usena=FALSE, useinf=FALSE, quiet=TRUE)

Arguments

correctans

a vector of type numeric or a string

studentans

a vector of type numeric or a string

tolerance

a string or numeric representing the accepted component wise tolerance

useeval

TRUE or FALSE indicates whether or not to use 'eval' on strings

usena

TRUE or FALSE indicating whether or not NA is an accepted value

useinf

TRUE or FALSE indicating whether or not Inf and -Inf are accepted values

quiet

TRUE or FALSE. If TRUE there are more warning messages when checks fail. Can be helpful for debugging.

Value

TRUE if the sets match. FALSE otherwise.

Note

The grade main page contains a discussion of the common parameters correctans, studentans, useeval, usena, useinf, quiet.

See Also

grade grade.number

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
grade.set(c(1,2), "[1,2]") # TRUE
grade.orderedset(c(1,2), "[1,2]") # TRUE

grade.set(c(2,1), "[1,2]") # TRUE
grade.orderedset(c(2,1), "[1,2]") # FALSE

grade.set(c(1,2), "[1.1,2]", tolerance=".01") # FALSE

grade.set(c(1,2,3,4,5), "(5,4,3,2,1)") # TRUE
grade.set(c(1,2,3,4,5), "(5,4,3,2)") # FALSE

grade.orderedset("[NA, 1, 2]", c(NA, 1, 2)) #FALSE, usena=F
grade.orderedset("[NA, 1, 2]", c(NA, 1, 2), quiet=FALSE) # FALSE, but with warning
grade.orderedset("[NA, 1, 2]", c(NA, 1, 2), usena=TRUE) # TRUE

grade documentation built on May 2, 2019, 9:15 a.m.