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

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

Open
rpruim opened this issue Jun 14, 2017 · 11 comments
Open

Comments

@rpruim
Copy link

rpruim commented Jun 14, 2017

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

@rpruim
Copy link
Author

rpruim commented Jun 14, 2017

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

@coatless
Copy link
Contributor

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
Copy link

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
Copy link
Member

jjallaire commented Jun 15, 2017 via email

@drizopoulos
Copy link

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
Copy link

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
Copy link

Separate buttons for hints and solutions would be great!

@monicathieu
Copy link

monicathieu commented Jul 27, 2021

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
Copy link

keniatw commented Aug 13, 2021

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
Copy link

keniatw commented Aug 13, 2021

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
Copy link
Member

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

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

10 participants