| GradeExams | R Documentation | 
Grades an exam given a parsed list by WhichAnswerOriginal
GradeExams(
  ExamAnswerParsedList,
  name.ColCorrect,
  name.ColIncorrect,
  MaxOutputGrade = 100,
  ExtraPoints = 0,
  ExtraPointsForAll = 0
)
ExamAnswerParsedList | 
 List parsed by   | 
name.ColCorrect, name.ColIncorrect | 
 The names of the correct and incorrect columns in each answer sheet of the   | 
MaxOutputGrade | 
 Maximum score that one should get if you get a perfect score, before couning the   | 
ExtraPoints | 
 Extra points to be added after scoring the exam. This points are added after the scaling is done with   | 
ExtraPointsForAll | 
 Scalar numeric value, extra points to be given to all student.  | 
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.
It returns the StudentInfo attribute of the parsed list adding the following columns to it
$addedPointsIndividual part of ExtraPoints
$addedAllPointsExtra Points For All
$maxGradeMax 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)
$GradeNumber of correct answers that a student wrote in an exam
$Grade_Total_ExamThis is the total_grade as explained on the Extra Points section.
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
cNumber of correct questions
extra_allNumber 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_individualNumber of extra points for that student.
max_nMaximum 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
MaxOutputGradeThe 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)
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.
Other Grading Exams: 
ObtainExamStats()
#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
    )
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.