Delaying Execution of learnr Exercise and Check Chunks on Relaunch

Hi Everyone,

I have an introductory statistics course that I deploy via an R package and prebuild on a Posit.Cloud workspace for students. The package contains a couple of particularly long tutorials that include many exercise code chunks; causing problems if a user attempts part of the tutorial, closes it, and returns later to complete their work.

The issue seems to be that all of the code cells and answer checks in the tutorial attempt to re-run at once on tutorial re-launch. This causes a RAM overflow. I've verified that the available RAM is the issue, because if I bump the available RAM just over the free-tier limit, then the tutorial re-launches just fine. While I know I could just ask students to pay for the student-tiered account, I'm wondering if there is something I can do within the source code for my learnr notebooks to force this execution to be spread out a bit more. I tried adding several calls to Sys.sleep() with different sleep timers to sections of these notebooks (in both -setup and -check blocks), but had no luck.

If anyone has ideas or suggestions, I'd love to hear them.

Cheers!
--Adam