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

Global option to show/hide solution #402

Closed
mine-cetinkaya-rundel opened this issue Jul 20, 2020 · 3 comments · Fixed by #470
Closed

Global option to show/hide solution #402

mine-cetinkaya-rundel opened this issue Jul 20, 2020 · 3 comments · Fixed by #470
Assignees

Comments

@mine-cetinkaya-rundel
Copy link
Collaborator

Currently, an exercise chunk will show the model solution if a chunk with -solution is provided. If you have hints, you scroll through all fo them and then the solution is shown.

I would love to be able to set some global option which, if set to FALSE, will show the hints but not the model solution, and if set to TRUE, it will show it. This would allow me to develop the learnr tutorial with the solution chunks in place, hide them until a deadline, and then redeploy with the option turned on to show the solutions.

I realize that right now I can achieve this result by going back after the deadline and adding the solution chunks in (or uncommenting them), but it would be nice to write the whole tutorial at once and then just flip a switch later.

@davidkane9
Copy link
Contributor

I would make use of this option as well.

@ColinFay
Copy link
Contributor

ColinFay commented Sep 2, 2020

Current hacky way to do that for anyone passing by:

Append:

<script>
$(function(){
  $('a[title="Solution"]').remove()
})
</script>

to the end of the Rmd

@garrettgman
Copy link
Member

Can we expedite this issue? We're writing more sophisticated grading code that requires the author to provide a solution to each exercise, but we'd usually prefer not to make the solutions accessible to the students.

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

Successfully merging a pull request may close this issue.

5 participants