GradeExams: GradeExams

Description Usage Arguments Details Value Extra Points Removing Questions from the exam See Also Examples

View source: R/Grading.R

Description

Grades an exam given a parsed list by WhichAnswerOriginal

Usage

1
2
GradeExams(ExamAnswerParsedList, name.ColCorrect, name.ColIncorrect,
  MaxOutputGrade = 100, ExtraPoints = 0, ExtraPointsForAll = 0)

Arguments

ExamAnswerParsedList

List parsed by WhichAnswerOriginal

name.ColCorrect, name.ColIncorrect

The names of the correct and incorrect columns in each answer sheet of the ExamAnswerParsedList respectively.

MaxOutputGrade

Maximum score that one should get if you get a perfect score, before couning the ExtraPoints

ExtraPoints

Extra points to be added after scoring the exam. This points are added after the scaling is done with MaxOutputGrade.

ExtraPointsForAll

Scalar numeric value, extra points to be given to all student.

Details

The score is first added on the base of the number of questions that are found on every parsed list.

If a question is removed from an exam, not all students may have that question as explained in the "Removing questions from the exam" section. If the total rows of a certain student list is n, the score is

c / n * MaxOutputGrade

, where c is the number of correct answers.

After that is done, the ExtraPoints are added.

Value

It returns the StudentInfo attribute of the parsed list adding the following columns to it

$addedPoints

Individual part of ExtraPoints

$addedAllPoints

Extra Points For All

$maxGrade

Max number of questions for the exam. (It would be different if when removing a question, some students didn't have a question in that exam)

$Grade

Number of correct answers that a student wrote in an exam

$Grade_Total_Exam

This is the total_grade as explained on the Extra Points section.

Extra Points

The structure of ExtraPoints and the convention on how the score is calculated taking it into account is worth mentioning in it's own section. The score is calculated as:

total_{grade} = (c + extra_{all}) / (maxn + extra_{all}) * MaxOutputGrade + extra_{individual}

Where

c

Number of correct questions

extra_all

Number of extra points for all.

This is thought of to be used as a question that you removed from the exam last minute, but that you want to actually count it as correct for every single student. I.e., a question that everyone got correct but it is not taken into consideration in the grading.

extra_individual

Number of extra points for that student.

max_n

Maximum number of questions in the students exam, which may differ from other students if you had to removed a bugged questions that not everyone had

MaxOutputGrade

The scaling to be done. This should be the maximum grade any student "should" get. (The individual extra points are added after the scaling is done)

Removing Questions from the exam

Note that if after creating the exam, you found that a question is bugged and can't be used to grade the exam, all you have to do is tell the student to answer "something" and you only have to remove it from the original/reference version in the Full Answer Sheet. When you apply the grading function, that question will then be ignored.

Notice how this creates output lists with different lengths in the case that two students didn't have that same question in their exam.

For example, if a exam has 15 questions out of a 50 question document. If student A has a bugged question and student B doesn't, the answer sheet produced for student A will have 14 rows while the one for student B will have 15 rows.

See Also

Other Grading Exams: ObtainExamStats

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
#First part coming from FindMatchingRow example

asheet_file <-
    system.file(
        "extdata",
        "ExampleTables",
        "ExampleAnswerSheet.csv",
        package = "TexExamRandomizer")
responses_file <-
    system.file(
        "extdata",
        "ExampleTables",
        "ExampleResponses.csv",
        package = "TexExamRandomizer")
FullAnswerSheet <-
    read.csv(
        asheet_file,
        header = TRUE,
        stringsAsFactors = FALSE,
        na.strings = c("", "NA", "Na"),
        strip.white = TRUE)
Responses <- read.csv(
    responses_file,
    header = TRUE,
    stringsAsFactors = FALSE,
    na.strings = c("", "NA", "Na"),
    strip.white = TRUE)
compiledanswers <-
    WhichAnswerOriginal(
        StudentAnswers = Responses,
        FullExamAnswerSheet = FullAnswerSheet,
        names.StudentAnswerQCols = grep(
            names(Responses),
            pattern = "^Q.*[[:digit:]]",
            value = TRUE),
        names.StudentAnswerExamVersion = grep(
            names(Responses),
            pattern = "Version",
            value = TRUE),
        OriginalExamVersion = 0,
        names.FullExamVersion = "Version",
        names.FullExamOriginalCols = grep(
            names(FullAnswerSheet),
            pattern = "_original",
            value = TRUE),
        names.CorrectAndIncorrectCols = c(
            "choice",
            "CorrectChoice")
    )
# Actual Code


ExtraPoints_individual <- runif(nrow(Responses), min = 1, max = 10)
ExtraPoints_forall <- 2
GradedStudentTable <-
    GradeExams(
        compiledanswers,
        name.ColCorrect = "CorrectChoice",
        name.ColIncorrect = "choice",
        MaxOutputGrade = 100,
        ExtraPoints = ExtraPoints_individual,
        ExtraPointsForAll = ExtraPoints_forall
    )

TexExamRandomizer documentation built on May 2, 2019, 3:18 a.m.