gradeExam: Grade Multiple Choice Exams

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

View source: R/gradeFunctions.R

Description

Grade Multiple Choice Exams with Correction for Guessing

Usage

1
2
3
4
5
gradeExam(
  responses,
  noItems = length(grep("^I", colnames(responses))),
  noOptions = 4
)

Arguments

responses

A data.frame object (REQUIRED), as created with the loadResponses() function modified by the numberCorrect and linkNames functions.

noItems

An integer (OPTIONAL), not exceeding 40, specifying the number of multiple choice exam test items (questions) on the answers sheet to be considered. If a key object has been created with the loadKey() function prior to using the loadResponses() function the noItems function argument requires no specification and will filled automatically.

noOptions

An integer (OPTIONAL), which specifies the number of options for each multiple choice exam test item (question). The default is 4 options (answers "A", "B", "C", and "D").

Details

The gradeExam() function calculates the exam grades achieved based on the correct responses to the multiple choice exam test items (questions). The exam grade is corrected for guessing.

Value

The responses data.frame object extended with a column giving the calculated exam grade (Exam grade) for each student.

Author(s)

Maikel Verouden

See Also

loadResponses(), loadKey()

Other grade functions: linkNames(), numberCorrect()

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
## Load the answer key
key <- loadKey(keyFile = paste0(.libPaths()[1], "/wurmc/examples/keyFile.xlsx"))

## Load the student responses from a Microsoft Excel
responses <- loadResponses(respFile = paste0(.libPaths()[1], "/wurmc/examples/respFile.xlsx"))

## Determine the number of correct student responses
responses <- numberCorrect(responses, key)

## Link Student Names
responses <- linkNames(responses, regFile = paste0(.libPaths()[1], "/wurmc/examples/regFile.xlsx"))

## Grade Multiple Choice Exams
responses <- gradeExam(responses)

mverouden/wurmc documentation built on March 10, 2021, 11:20 a.m.