clean_moodle | R Documentation |
Clean Moodle Quiz report for easier manipulation in R
. It extracts student ID from "Email address" column;
unites "First name" and "Surname" column; converts dash ("-"), which can be presented when student not given answer, to NA
;
and forces "Grade" and "Q. x /x" to numeric value (if any of "Not yet graded", "Requires grading", or "-" is presented it will be NA
).
clean_moodle( data, extract_id = TRUE, extract_id_from = c("Email address", "Institution", "Department", "ID number"), id_regex = ".*", sep_name = " ", dash_na = TRUE, force_numeric = TRUE )
data |
A data.frame of Moodle Quiz report. |
extract_id |
(Logical) |
extract_id_from |
(Character) Choose column to extract ID from one of: "Email address", "Institution", "Department", and "ID number" (a custom one). |
id_regex |
(Character) Regular expression used to extract ID from "Email address". The default is ".*" meaning all characters.
If your student email addresses has numeric IDs in them, try " |
sep_name |
(Character) A character in the new "Name" column that separate original "First name" and "Surname". |
dash_na |
(Logical) |
force_numeric |
(Logical) |
A data.frame with cleaner column names and better formatted data.
Although the column names are cleaned, some metadata is lost such as maximum score of quiz and questions.
Check out get_quiz_attr()
for get these metadata.
clean_moodle(grades_ls$Quiz_1, id_regex = "[:digit:]+")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.