Get attributes or meta-information from Moodle Quiz report (i.e., Grades or Responses report) such as type of Moodle Quiz report, maximum grade of each quiz, question's number, question's maximum score, or embedded answer (Cloze) column names (if present).
Arguments
- data
A data.frame of Moodle Quiz report.
Value
A List containing Quiz attributes such as:
report_type
: (character) "Grades" for Moodle Grade report or "Responses" for Moodle Responses report.some_nyg
: (logical)TRUE
: If "Grade/xx" column of the Moodle Quiz report contained some grades that are "Not yet graded".FALSE
: If "Grade/xx" column contained all numeric grades.grade_max
: (numeric) Maximum grade of the Quizq_no
: (numeric) Only ifreport_type
is "Grades", thenq_no
shows questions number presented in the Moodle Grades report.q_max
: (numeric) Only ifreport_type
is "Grades", thenq_max
shows maximum scores of correspondingq_no
.resp_no
: (numeric) Only ifreport_type
is "Responses", thenresp_no
shows responses number of the Moodle Responses report.cloze_cols
: (character) Only ifreport_type
is "Responses", thencloze_cols
shows names of the "Responses" column that contained embedded answer (Cloze). If no Cloze column is presented, returnNULL
.
Examples
# Grades Report
get_quiz_attr(grades_ls$Quiz_1)
#> $report_type
#> [1] "Grades"
#>
#> $some_nyg
#> [1] FALSE
#>
#> $grade_max
#> [1] 10
#>
#> $q_no
#> [1] 1 2 3 4 5 6 7 8
#>
#> $q_max
#> [1] 0.79 0.26 2.37 2.11 2.11 0.26 1.05 1.05
#>
# Responses Report
get_quiz_attr(responses_ls$Quiz_1)
#> $report_type
#> [1] "Responses"
#>
#> $some_nyg
#> [1] TRUE
#>
#> $grade_max
#> [1] 2
#>
#> $resp_no
#> [1] 1 2
#>
#> $cloze_cols
#> NULL
#>