Opened 5 years ago

Last modified 7 weeks ago

#22508 new enhancement

Allow exercises/questions with folded/hidden solutions/answers/hints in tutorials

Reported by: tmonteil Owned by:
Priority: major Milestone: sage-7.6
Component: documentation Keywords:
Cc: slelievre Merged in:
Authors: Reviewers:
Report Upstream: N/A Work issues:
Branch: Commit:
Dependencies: Stopgaps:

Status badges

Description (last modified by slelievre)

In thematic tutorials, we would like to propose non-trivial exercises, so that we should propose a solution or some hints. However, the solution should not be readable at the first look of the page, but still accessible by the user.

Besides EXAMPLES, TESTS, ... sections, we could provide an EXERCISE type of section, as well as a SOLUTION/ANSWER/HINTS.

This approach might be not flexible enough, so we might prefer the way used in some thematics tutorials (e.g. http://doc.sagemath.org/html/en/thematic_tutorials/tutorial-comprehensions.html):

.. TOPIC:: Exercises

so that we can use the appropriate name (question, exercise, answer, hint...) without creating tons of section types. Hence, another way to complete this ticket would be to have a kind of "FOLDED_TOPIC" or "HIDDEN_TOPIC" that is folded by default.

This folding should work both in sphinx-produced html, and when translating it into ipynb (via sage -rst2ipynb), see e.g. https://github.com/ipython-contrib/jupyter_contrib_nbextensions/tree/master/src/jupyter_contrib_nbextensions/nbextensions/collapsible_headings

Another possibility could be to write solutions in a separate file with links to it.

This description is pretty vague since i do not have any idea on the way to achieve such question/hidden_answer feature.

See this sage-devel thread.

Change History (2)

comment:1 Changed 5 years ago by tmonteil

  • Description modified (diff)

comment:2 Changed 7 weeks ago by slelievre

  • Cc slelievre added
  • Description modified (diff)
  • Summary changed from exercise/quesion sections with folded/hidden solution/answer/hint sections in tutorials to Allow exercises/questions with folded/hidden solutions/answers/hints in tutorials

Reminds me of the LMFDB's knowls and of PreTeXt functionality.

Note: See TracTickets for help on using tickets.