View source: R/combine_grades.R
combine_grades | R Documentation |
combine_grades()
is a generic function that combine, adjust, and filter student grades from Moodle Grades report(s) (not Responses report).
This function can combine "Grade/xx" columns from multiple Moodle Grades reports into a single data.frame.
Furthermore, you can adjust or weight maximum score of each quizzes and "Total" score will be computed.
If the report contains multiple attempts per student, you can also filter grades of each student by score ("Grade/xx" column) and start time ("Started on" column), e.g. the first best score of each students.
Like check_sub()
, this function also cleans column names for easy manipulation, extracts student ID from "Email address", and unites "First name" and "Surname" column into "Name".
combine_grades( data, extract_id_from = c("Email address", "Institution", "Department", "ID number"), id_regex = ".*", sep_name = " ", new_max_grade = NULL, round_digits = 3, choose_grade = c("max", "min", "mean", "all"), choose_time = c("first", "last", "all"), force_grade = F, sep_col = "_" )
data |
A data.frame or named list of data.frame of Moodle Grades report(s) (not Responses report) |
extract_id_from |
(Character) Choose 1 column to extract ID from |
id_regex |
(Character) A regular expression used to extract ID from column "Email address" in the Moodle Quiz report. The default is " |
sep_name |
A character in the new "Name" column that separate original "First name" and "Surname". |
new_max_grade |
(Numeric) A desired new maximum grade(s) to adjust. If
|
round_digits |
Length 1 numeric vector to indicate digits to round grades. If |
choose_grade |
A character to filter student's attempt by score ("Grade/xx" column), useful when quiz has multiple attempts for each students.
|
choose_time |
A character to filter student's attempt by started time (determined by "Started on" column).
This filter applies after
|
force_grade |
(Logical) If grade of any students was found to be "Not yet graded",
you will get an error message. The purpose of this is to warn you that you might have forgotten to grade some students.
If you want to bypass this behavior, set |
sep_col |
(Character) If |
A data.frame, its output content is determined by class of its first argument: data
.
If the data
is a data.frame; the output is a cleaned data.frame of Moodle Grades report, whether it was adjusted or filtered depends on other arguments.
If the data
is a named list of data.frame; the output is the same as previously described, but all Moodle Grades reports are full-joined together by column "Name" and "ID".
So that, "Grades_" columns from each data.frame are sit together in a single data.frame, and "Total_" column is added at the last column to indicate sum of all quizzes grades.
# Combine and Readjust Grades of Quiz 1 combine_grades(grades_ls$Quiz_1, id_regex = "[:digit:]+", new_max_grade = 100) # Combine Grades of All Quizzes combine_grades(grades_ls, id_regex = "[:digit:]+")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.