skranz / RTutor

Creating interactive R Problem Sets. Automatic hints and solution checks. (Shiny or RStudio)
https://skranz.github.io/RTutor/
201 stars 57 forks source link

Updates in RTutor Main Branch #34

Open skranz opened 4 years ago

skranz commented 4 years ago

This issue shall describe updates I implemented in my RTutor branch. It is in particular targeted to maintainers of actively developed alternative branches (currently @MartinKies). Active discussion is encouraged.

skranz commented 4 years ago

The newest RTutor version contains a function make.hint.report (see https://github.com/skranz/RTutor/commit/f8e2dded0862b1f1d874f5f3666d5d5b78260373 and https://github.com/skranz/RTutor/commit/d4a4cf66c375faa7570f540b67f5f6abc734d291) It creates an Rmd file from a problem set that shows for every chunk the sample solution, the given task code and the hint() message that would be shown if the task code would not have changed. This helps improving custom hints and to detect weaknesses in automatic hints. I plan to update RTutorSAGI at some point in the future in a similar fashion, so that the hints can be seen in the reports of common mistakes by students.

Based on the reports I updated again considerably the automatic hints (see https://github.com/skranz/RTutor/commit/1d08d42c0932b6bb8f4550c049516eb1037c3ec4). There are small changes like removals of typos in hint messages and larger changes. Importantly, when the user expression has some placeholder ___ in a function call, by default now a scrambled version of the whole function call we be shown. The previous hints() did not fit too well for tasks with placeholders.

skranz commented 4 years ago

Ok, as planned I now reworked the automatic hints again (see here https://github.com/skranz/RTutor/commit/5e03dc0b0adc5475bb525a5f3ba06ed6e3c0b9a6). For ggplot command chains and function calls with placeholders ___, by default the hint now attempts selective scrambling, i.e. it only scrambles the parts that differ in the student's solution from the sample solution. Only works if a single student solution can be matched as candidate. The code in hint.for.call does now look even less elegant, but the resulting hints look nicer, as far as I have tested.

skranz commented 4 years ago

Bugfix in the documentation. For some reason the Manuals link in the RTutor documentation https://skranz.github.io/RTutor/ did not work any longer. Perhaps due to changes in a newer pkgdown version. Corrected the corresponding code in https://github.com/skranz/RTutor/blob/master/_pkgdown.yml and now it works again.

skranz commented 4 years ago

There was a problem with the default svg device used in the shiny version of RTutor. Mac users who have not installed X-Quartz could not correctly show the problem set and got warning about missing Cairo libraries. I programmed a workaround in this commit. Since I don't have a Mac I could not really test it, but I hope it works.

skranz commented 3 years ago

There can appear a strange error in create.ps when called from an Rmd file and the RStudio Option Show output inline for all R Markdown documents is activated. I could not really solve the problem but now an error message is shown that shows how to circumvent the issue:

Note that there is a bug in the interaction of knitr and and RStudio in an RMarkdown document that shows output inline. There are two ways to fix to this proiblem:

1. Go in RStudio -> Tools -> Global Option -> R Markdown
   There turn off the option 'Show output inline for all R Markdown documents'

2. If you don't want to change those global options, put the code to create your RTutor problem set into a separate R file and run it there.