Prepare a Moodle Grades Report data frame for further analysis (see Details).
Arguments
- data
(Data Frame) A data frame of Moodle Grades Report
- sep_name
(Character) Separator of "First name" and "Surname" column.
- choose_state
(Character) Options to filter a "State" column, must be one of:
Finished: (default) choose only the "Finished" attempts.
In progress: choose only the "In progress" attempts.
all: no filter applied, choose all attempts.
- choose_grade
(Character) Options to filter a "Grade/x.xx" column, must be one of:
max: (default) choose attempts that has maximum score of each students
min: choose attempts that has minimum score of each students
all: no filter applied, choose all attempts.
- choose_time
(Character) Options to filter a "Started on" or "Started" column, must be one of:
first: (default) choose the first attempt of each students
last: choose the last attempt of each students
all: no filter applied, choose all attempts.
Value
A cleaned and (optionally) filtered data frame with class "GradesReport" and "MoodleQuizReport".
Details
Steps to prepare a Moodle Grades Report data frame:
Clean some column names.
Get rid of the last row which contains "Overall average".
Join "First name" and "Surname" into "Name" by
sep_name
.Format "Grade/x.xx" column to numeric ("Not yet graded" and "-" will be
NA
).Format "Q. x /x.xx" column to numeric ("Requires grading" and "-" will be
NA
).Rename and format
Started on
toStarted
column with "POSIXct" class.Filter a "State" column by
choose_state
.Filter a "Grade" column by
choose_grade
(afterchoose_state
has been applied).Filter a "Started on" or "Started" column by
choose_time
(afterchoose_grade
has been applied).
Examples
prep_grades_report(grades_df)
#> # A tibble: 272 × 16
#> Name Institution Department Email State Started Grade Q1
#> <chr> <lgl> <lgl> <chr> <chr> <dttm> <dbl> <dbl>
#> 1 Joshua el… NA NA josh… Fini… 2021-02-12 13:03:00 5 1
#> 2 Leeah Snow NA NA leea… Fini… 2021-02-21 20:09:00 9 1
#> 3 Isaiah el… NA NA isai… Fini… 2021-02-23 19:51:00 6 0
#> 4 Eric Webb NA NA eric… Fini… 2021-02-23 21:57:00 0 0
#> 5 Eugenia B… NA NA euge… Fini… 2021-02-24 12:25:00 7 1
#> 6 Annie Dom… NA NA anni… Fini… 2021-02-25 01:39:00 4 0
#> 7 Ladayza B… NA NA lada… Fini… 2021-02-25 10:17:00 2 1
#> 8 Laderek K… NA NA lade… Fini… 2021-02-25 11:18:00 5 1
#> 9 Haaroon C… NA NA haar… Fini… 2021-02-25 14:06:00 6 1
#> 10 Faith Wade NA NA fait… Fini… 2021-02-25 15:21:00 8 1
#> # … with 262 more rows, and 8 more variables: Q2 <dbl>, Q3 <dbl>, Q4 <dbl>,
#> # Q5 <dbl>, Q6 <dbl>, Q7 <dbl>, Q8 <dbl>, Q9 <dbl>