rstudio / learnr

Interactive Tutorials with R Markdown
https://pkgs.rstudio.com/learnr
Apache License 2.0
711 stars 240 forks source link

Should it possible to get a solution and a hint for the same code chunk? #90

Open rpruim opened 7 years ago

rpruim commented 7 years ago

This seems to not work at the moment. I only see the hint if there is a hint and a solution.

rpruim commented 7 years ago

In case it matters, the hint was done with <div> and the solution was done with a code chunk.

coatless commented 7 years ago

One or the other :'(

A “Hint” or “Solution” button is added to the left side of the exercise header region

https://rstudio.github.io/learnr/exercises.html#hints_and_solutions

Though, it would be very nice if this was added...

nicholasjhorton commented 7 years ago

Is it the intention that hint-1 might be the hint and hint-2 a solution? From a student standpoint it might be helpful to just indicate that there are no more hints (and the solution is being provided).

jjallaire commented 7 years ago

That's correct, hint 2 is the solution. We try to communicate that there are no more hints by disabling the "next hint" button.

On Wed, Jun 14, 2017 at 7:35 PM, Nicholas Horton notifications@github.com wrote:

Is it the intention that hint-1 might be the hint and hint-2 a solution? From a student standpoint it might be helpful to just indicate that there are no more hints (and the solution is being provided).

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/rstudio/learnr/issues/90#issuecomment-308587523, or mute the thread https://github.com/notifications/unsubscribe-auth/AAGXx9F8E-E0abSGJpucls9jBHsNstAuks5sEG4xgaJpZM4N6cDS .

drizopoulos commented 7 years ago

Though would it be possible to scroll between hints? I want to split the solution in three hints and give the option of progressive show-ups (e.g., a student may want to see the previous hint)

anna-doizy commented 4 years ago

Hello, I would like to push this issue up.

Would it be possible to make both Hint and Solution buttons appear? Would it be possible to scroll between hints (and go back)?

Thank you!

lrdegeest commented 3 years ago

Separate buttons for hints and solutions would be great!

monicathieu commented 3 years ago

Agree!

I am also okay with the final hint being the solution (e.g. hint-1 is hint, hint-2 is solution). However, in learnr tutorials I am writing, I find that for exercises with both div hints (any number) and a solution, you can click through all of the hints but the solution will never appear. For exercises with code hints and a solution, the solution does show up as the final hint per above. However, it would be nice to get similar behavior with div hints somehow!

keniatw commented 3 years ago

Many of these issues were addressed in a new package, learnrLara, developed by The Concord Consortium. It's based (of course) on learnr. Among other things, you can add multiple hints (and scroll between them), a separate solution, and hide the left navigation bar if you want. You can get it by loading (or installing+loading) devtools and then installing with install_github: install_github("concord-consortium/learnrLara") After you install it, go to File >> RMarkdown >> From Template and pick learnrLara instead of learnr.

keniatw commented 3 years ago

Just as a side note, I am having some issues with the package under my Linux machine since I upgraded RStudio from 1.2.1335 to 1.4.1717 (Ubuntu 18.04 and then Ubuntu 20.04). The output comes out empty, no error message to give me a hint (no pun intended). I "downgraded" RStudio (and also R, in multiple combinations) but the problem persists. I assume it is not related directly to the package itself, but some old.vs.new dependency out of place or (sigh!) some Linux-mystery-to-be-solved. I am working on it and will update any solution, in case any Linux user here faces the same problem. Windows and Mac users should have a smooth ride with learnrLara, though.

gadenbuie commented 3 years ago

@keniatw the issue you are experiencing is likely the result of recent changes in rmarkdown. I suspect you could downgrade rmarkdown to find a version where learnrLara works as expected.