swirl
swirl copied to clipboard
Add the ability to cycle through multiple hints (if provided)
This closes issue #561.
The 'Hint' value for questions in lesson.yaml can now be (optionally) populated with a string of hints separated by semi-colons. Each time a question is answered incorrectly one of these hints will be sampled and presented. This update will not affect behavior for questions with only one hint.
That's really great, I feel like I'm writing a book with some of the hints since there are so many possible ways to go wrong.
Thanks for sharing this approach! I'm trying unsuccessfully to set this up. All hints are shown simultaneously even when separated by semicolons in the yaml file. The code written by @jonmcalder is a little beyond me. I tried including it in my initLesson.R file thinking it would add the functionality I seek, but to no avail. Can anyone (@jonmcalder or @elinw) provide more guidance? Thanks!
Hi @stevenhobbs! This was a long time ago and I had completely forgotten about it 🤣
I verified that the above does work when incorporated into {swirl}, and the approach seems simple and reasonable enough (to me at least). Though maybe the randomisation of which hint gets shown (when) still leaves a lot to be desired...
However I can't think of any reasonable way this functionality could be added to a lesson without any changes to {swirl} itself. I think {swirl} already has to do some pretty funky stuff snapshotting user environments etc in order to function the way it does, so I wouldn't even want to try and speculate on how one could possibly inject custom code or response behaviour into the {swirl} evaluation environment via the lesson content itself.
@seankross if you see this maybe you could chime in here? Was this PR ever considered? Was it overlooked for any particular reasons? Could it be feasible in it's current form or something similar?
Thank you for the reply @jonmcalder! I noticed this was a while ago and figured it was a long shot, so I appreciate your re-engagement. I didn't realize the code would be incorporated into swirl directly instead of into a course's initLesson.R file, but I suppose this makes sense. I'm guessing I'm not skilled enough to go into the swirl code and add this though and I'm unclear how this functionality would get into my student's installation of swirl. I think I have a dangerous level of competency, just enough to tinker around and probably wreak havoc. :)
Hi all,
The main impediment to incorporating features like this into swirl is that there is currently no way to test swirl's interactive features. If this were possible, then we could test features like this across existing courses to track breaking changes. Unfortunately building out an interactive testing system is not going to get toward the top of my priority list any time soon. I sincerely appreciate the interest and enthusiasm but right now the scope of my focus for swirl is keeping it running for the greatest number of learners possible.
Sean
You're very welcome and thank you so much for the reply!
Thanks @seankross! Makes sense and I had wondered if that (testing for breaking changes) may be the issue.