Closed andre-massing closed 4 years ago
An exercise section is ended on a few conditions, see the code below. I suggest you use a !split
in the line after the end of the solution (!esol
).
# End of exercise? Either 1) new (sub)section with at least ===,
# 2) !split, or 3) end of file
if line_no == len(lines) - 1: # last line?
exer_end = True
elif inside_exer and lines[line_no+1].startswith('!split'):
exer_end = True
elif inside_exer and lines[line_no+1].startswith('====='):
exer_end = True
elif inside_exer and option('sections_down') and lines[line_no+1].startswith('==='):
exer_end = True
Hi Alessandro,
ah indeed, nice suggestion, that fixed my problem. Thanks a lot!
Best, Andre
I observed that whenever I add a solution to an exercise that the solution will not be presented in place but rather be moved to the end of the current subsection. Is this the intended behavior?
Here is a simple example which illustrate that behavior:
The solution is not placed right after the exercise, but rather right before Subsection heading (h2)
Is is possible to change this behavior easily? In my lectures I often give the students some small exercises to work on, and then I would like to present solution and continue with material without being forced to open up a new section.
Best, Andre