Created: 2017-07-20 12:34:15
Depending on the infrastructure there are various ways for collecting the completed assignments from the students. Email can be one or a folder on shared network drive. You can also ask students to push their assignments into Github or similar.
Here we assume that you have gathered the assigments on importing data into a folder ~/rcourse/completed_assignments/week_1/
and each students assignment has a unique file name. The folder structure here is:
~
└─── rcourse
|─── assingment_templates
| └─── week_1.R
|─── completed_assignments
| └───week_1
| | └─── student_x_week_1.R
| | └─── student_y_week_1.R
| | └─── student_z_week_1.R
| └─── week_2
| └─── week_3
└─── summaries
└─── summary_week_1.R
We could then call the function process_assignments()
with following values for attributes in order to get the file ~/rcourse/summaries/summary_week_1.R
.
edu::process_assignments(path_assignments = "~/rcourse/completed_assignments/week_1/",
outfile_name = "summary_week_1",
outfile_path = "~/rcourse/summaries/")
See the gif-image below for the process:
Once the summary is processed, you can either distribute the resulting R-script or you can render it into a html-file using rmarkdown::render()
. If you want chunk of answers to be evaluated, replace the eval = FALSE
with eval = TRUE
. But remember to review the answers before for any security concerns!