Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Major update Branch LeverageData (mostly regarding quizzes) #31

Open
MartinKies opened this issue Aug 7, 2020 · 4 comments
Open

Major update Branch LeverageData (mostly regarding quizzes) #31

MartinKies opened this issue Aug 7, 2020 · 4 comments

Comments

@MartinKies
Copy link
Contributor

I just uploaded a major update to the LeverageData Fork.

The direct effects of the changes can be seen here: https://leveragedata.shinyapps.io/QuizExamples/

In particular I made the following improvements:

  • It is now possible to have a shiny problem set without programming chunks (both locally and on shinyapps)
  • Exercises do no longer throw an error when ending with a chunk.
  • Several improvements regarding quizzes:
    • It is now possible to use a colon (":") in quizzes (question, success/failure message, choices, commentary [see below]) without destroying the yaml structure or having to use any escape characters.
    • Quizzes now support RMD formatting, including MathJax. Beside other things this allows it to bold and italize text as well as the use of Math formulas in all quiz-related texts. Note: An exception has been made with numbered lists. Here I use regular expressions to suppress RMDs urge to fix mislabeled data. This way one can start a quiz with "2." without it being corrected to "1.". This is especially useful in the context of multi-part quizzes.
    • Quizzes also support direct HTML code. This way one can for example change the color of (parts of) the text and use smilies or other fancy characters. In particular it is now possible to have images as choices (!).
    • It is now possible to provide arbitrary commentary to the answers of single choice and multiple choice quizzes depending on all possible user input-combinations. One is therefore not limited to simply tell the user that the input of a mc quiz has been wrong but can also give helpful pointers which particular answers have been wrong or are missing.

All changes are as backwards compatible as possible. All current problem sets should compile as previously and all additional options are stricly optional. The following caveats apply however:

  • Should someone by accident written a quiz where part of the text can be interpreted as either HTML or RMD, than these changes apply. This might for example be if someone has written something like 4*4=2*8 which now becomes 44=28. I nevertheless opted for the RMD behavior of quizzes as the default, as it now behaves as the rest of RTutor which is what one would assume as a new user.
  • In the case of someone having used the string COLON than this gets changed to a ":".

Additionally I changed the commentary in deployapps so that the dataset should be in ./app instead of ./app/work. I am quite confused about this one. ./app./work worked fine until it didn't anymore for newly uploaded problem sets. I am not sure whether this was a change made by myself or by shinyapps. You might want to consider whats happening here seperately from the other changes.

@skranz
Copy link
Owner

skranz commented Aug 9, 2020

Wow thanks for the info and your many changes! I already manually incorporated the bug fixes, i.e.

  • It is now possible to have a shiny problem set without programming chunks (both locally and on shinyapps)
    and
  • Additionally I changed the commentary in deployapps so that the dataset should be in ./app instead of ./app/work. I am quite confused about this one. ./app./work worked fine until it didn't anymore for newly uploaded problem sets.
    (I wrote a comment in your commit)

I also like the new functionality for the quizzes. Your examples look cool. Still I will take some time to implement them and perhaps not implement them all. (I also made some changes to the quizzes to make them usable in RStudio here 0ea201a)

I am particularly not sure about the following of your changes:

It is now possible to use a colon (":") in quizzes (question, success/failure message, choices, commentary [see below]) without destroying the yaml structure or having to use any escape characters.

You could also do this with regular YAML using a | after defining your string, e.g.

question: |
   Here I can now ad arbitrary strings:
   they can be multiline and contain :

For numbering in Rmd, you could just write 3\. instead of 3. to remove auto numbering. In the end there is a cost of having a customized parser in terms of compilation speed (probably not too high) and maintainability. Also it might be good to teach problem set developers how to mitigate these problems in regular YAML and regular markdown. On the other hand your custom parser makes the quiz code easier to read.

Also you probably can get rid of the rmdtools dependence, I just put it into RTutor by accident but removed it again in my commit here: 73ba30f

Using fewer packages makes everything load quicker.

Overall our forks seem to be drifting apart and it may be easier just to incorporate good changes from each other than keeping them identical. You can take a look at my changes here:

LeverageData/RTutor@master...skranz:master

In partiuclar the improvement in the hints for dplyr chains may be quite useful to incorporate in you fork.

@MartinKies
Copy link
Contributor Author

Thank you for your feedback!
I have incorporated most of your changes into our fork and got rid of the rmdtools dependency. Especially given a possible drifting apart of the forks I find the following view a tad better: https://github.com/skranz/RTutor/compare/master..LeverageData:master
Note the .. instead of the … (https://stackoverflow.com/questions/31671585/github-comparing-across-forks)
which I just learned about. This way the forks are compared to as-is instead of the difference given the last branching point.

Yes both YAML and the markdown autonumbering are certainly design choices. As I expect my quizzes to be written by several persons which have to learn the syntax for the first time (think interns and short-time working students) I would much rather have them spend time on the actual quality and content of the courses themselves. My goal is therefore to have the RTutor Syntax as easy to learn and use as possible. From a general didactic point of view (say for an instructor ;) ) being as close as possible to standard syntax absolutely has its merits, I see that. This is one of the reasons why I didn't opt for a pull request.

There are two considerations however I want to highlight if you decide not to incorporate those two particular changes:

  1. The quite powerful commentary system in its current version depends on the possibility to replace the :. Disallowing : within the text of questions is one issue, but the commentary systems allows to write a : as a condition (e.g. "If question is in 2:6"). There are of course ways around this (e.g. using seq) but not beinig able to write sequences with the : operator might be confusing for the problem set developers and makes the system somewhat clunkier to use.
  2. One reason of the existence of the parser (which actually changes the 3. to 3.) is backwards compatibility. Current quizzes are written with the expectation that a number stays a number. In fact your current quiz-code example breaks in the sense that the multi-quiz suddenly has two 1. when only adopting the RMD part of the commit.

@MartinKies
Copy link
Contributor Author

Note my newest commit.

I have changed the structure to the yaml processing, so that the pre and post processing are separated. In this context it is now possible to use negative shorthand commentary (i.e. "Display commentary if a certain answer has not been checken"). I have further disabled yaml functionalities which I didn't know about before and made the expression !any(...) not possible as the ! got interpreted by yaml.

@skranz
Copy link
Owner

skranz commented Sep 11, 2020

Sorry, I just realized that my previous "bugfix" to remove the rmdtools dependence, generated another error, because I wrongly set fragment.only = FALSE. Here is the commit that fixes the fix...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants