numberCorrect: Determine Number of Correct Student Reponses

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

View source: R/gradeFunctions.R

Description

Determine the number of correct student responses to multiple choice exam items (questions)

Usage

1
numberCorrect(responses, key)

Arguments

responses

A data.frame object (REQUIRED), as created with the loadResponses() function, with in the first column the student registration numbers of students taking the exam. The second column specifies the exam version the student filled. Subsequent columns give the filled in answers to the multiple choice exam test items (questions) as filled by the students, with a maximum of 40 test items (questions).

key

A data.frame object (REQUIRED), as created with the loadKey() function, with in the first column the exam version and the subsequent columns giving the correct answers to the multiple choice exam test items (questions). The dimensions of the key data.frame object are used in the grading process.

Details

ThenumberCorrect() function checks the student's responses to the multiple choice exam test items (questions) with the appropriate version answer key and creates a column No. Correct indicating the number of test items (questions) answered correctly by the particular student. The column No. Correct is added after the last column in the responses data.frame object.

Value

The input responses data.frame object extended with one column (No. Correct) indicating the number of multiple choice exam test items (questions) answered correctly by the students.

Author(s)

Maikel Verouden

See Also

loadResponses(), loadKey()

Other grade functions: gradeExam(), linkNames()

Examples

1
2
3
4
5
6
7
8
## 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)

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