prep_grades_report: Prepare Moodle Grades Report for Analysis

View source: R/prep.R

prep_grades_reportR Documentation

Prepare Moodle Grades Report for Analysis

Description

Prepare a Moodle Grades Report data frame for further analysis (see Details).

Usage

prep_grades_report(
  data,
  sep_name = " ",
  choose_state = c("Finished", "In progress", "all"),
  choose_grade = c("max", "min", "all"),
  choose_time = c("first", "last", "all")
)

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.

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 to Started column with "POSIXct" class.

  • Filter a "State" column by choose_state.

  • Filter a "Grade" column by choose_grade (after choose_state has been applied).

  • Filter a "Started on" or "Started" column by choose_time (after choose_grade has been applied).

Value

A cleaned and (optionally) filtered data frame with class "GradesReport" and "MoodleQuizReport".

Examples

prep_grades_report(grades_df)

Lightbridge-KS/moodleStats documentation built on April 7, 2022, 8:14 p.m.