learnr icon indicating copy to clipboard operation
learnr copied to clipboard

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

Open rpruim opened this issue 7 years ago • 11 comments

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

rpruim avatar Jun 14 '17 21:06 rpruim

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

rpruim avatar Jun 14 '17 21:06 rpruim

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...

coatless avatar Jun 14 '17 21:06 coatless

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).

nicholasjhorton avatar Jun 14 '17 23:06 nicholasjhorton

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 [email protected] 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 .

jjallaire avatar Jun 15 '17 12:06 jjallaire

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)

drizopoulos avatar Aug 02 '17 20:08 drizopoulos

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!

anna-doizy avatar Jul 31 '20 08:07 anna-doizy

Separate buttons for hints and solutions would be great!

lrdegeest avatar May 18 '21 11:05 lrdegeest

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!

monicathieu avatar Jul 27 '21 23:07 monicathieu

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 avatar Aug 13 '21 21:08 keniatw

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.

keniatw avatar Aug 13 '21 21:08 keniatw

@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.

gadenbuie avatar Aug 26 '21 14:08 gadenbuie