count_resp | R Documentation |
count_resp()
is a generic function that count responses per student from Moodle Responses report(s) (not Grades report).
Similar to combine_resp()
, if the Moodle responses report has response column(s) that contained embedded answers (Cloze),
you have an option to count them as a whole (1 Cloze column = 1 count) or as individual parts (count each parts of Cloze column, individually).
Other functionality are similar to check_sub()
such as: encode & filter student's attempts by state (i.e., "Finished" or "In progress") and started time ("Started on" column),
cleans column names for easy manipulation, extracts student ID from "Email address", and unites "First name" and "Surname" column into "Name".
count_resp( data, extract_id_from = c("Email address", "Institution", "Department", "ID number"), id_regex = ".*", sep_name = " ", state = c("Finished", "In progress"), encode = c(1, 0), choose_encode = c("max", "min", "all"), choose_time = c("first", "last", "all"), count_cloze_parts = F, filter_count = c("max", "all"), sep_col = "_" )
data |
A data.frame or named list of data.frame of Moodle Responses report(s) (not Grades 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". |
state |
A character vector to match values in "State" column of the Moodle Quiz report |
encode |
An encoding numeric vector corresponding to |
choose_encode |
A character to filter student's attempt by the
|
choose_time |
A character to filter student's attempt by started time (determined by "Started on" column in Moodle Quiz report).
This filter applies after
|
count_cloze_parts |
(Logical) If a Moodle Responses report has at least one response column(s) that contained embedded answers (Cloze),
set |
filter_count |
(Character) One of "max" or "all". This filter option will apply after filter by
|
sep_col |
(Character) If |
Counting Mechanism:
count_resp()
gives 1 count to 1 responses cell if one or more characters were found.
Blank or "-" (dash) response will not be counted.
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 an encoded, filtered, and cleaned data.frame of Moodle Responses report.
And the "Count_resp" column is added with maximum number of count appended at the column name.
If the data
is a named list of data.frame; the output is the same as previously described, but all Moodle Quiz reports are full-joined together by column "Name" and "ID".
So that, "Count_resp" columns from each data.frame are sit together in a single data.frame, and "Total" column is added at the last column to indicate total count.
# Count Responses of Quiz 1 count_resp(responses_ls$Quiz_1, id_regex = "[:digit:]+") # Count Responses from All Quizzes count_resp(responses_ls, id_regex = "[:digit:]+")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.