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

Solution is showing when entering into an exercise #1

Open
minimum-sauce opened this issue Jan 29, 2025 · 1 comment
Open

Solution is showing when entering into an exercise #1

minimum-sauce opened this issue Jan 29, 2025 · 1 comment

Comments

@minimum-sauce
Copy link

Current behavior

Currently, entering into an exercise will show both the solution and the answer. This becomes a problem, especially for questions without any images, since part of the solution will because parts of the solution gets shown.

Expected behavior

Some form of separation between the question and the solution. Either by hiding the solution initially or having separate slide for the solution.

Proposed solution

From building the repo and testing out possible solutions, one way to solve this problem is by adding a:
``` {toggle}
:view:
solution
```
to each of the exercise solutions. This initially hides the text in the block.
I got this information from https://jupyterbook.org/en/stable/interactive/hiding.html.
testing it out on one of the questions give the following look:

Image

@bonassifabio
Copy link
Owner

bonassifabio commented Jan 29, 2025

Thanks for pointing out the issue. I guess the best solution would be to use collapsable headers, but Jupyter Book does not seem to support them.

According to the Jupyter Book devs, using the {toggle} or {dropdown} directive breaks the compatibility with Jupyter Lab, which would defeat the purpose of the interactive book.

I'll leave the issue open, just in case someone has an idea on how to achieve this.

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