swirl icon indicating copy to clipboard operation
swirl copied to clipboard

Add the ability to cycle through multiple hints (if provided)

Open jonmcalder opened this issue 8 years ago • 7 comments

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.

jonmcalder avatar Oct 26 '16 23:10 jonmcalder

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.

elinw avatar Nov 13 '16 12:11 elinw

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!

stevenhobbs avatar May 30 '20 16:05 stevenhobbs

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?

jonmcalder avatar May 30 '20 22:05 jonmcalder

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. :)

stevenhobbs avatar May 31 '20 01:05 stevenhobbs

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

seankross avatar Jun 09 '20 21:06 seankross

You're very welcome and thank you so much for the reply!

stevenhobbs avatar Jun 09 '20 22:06 stevenhobbs

Thanks @seankross! Makes sense and I had wondered if that (testing for breaking changes) may be the issue.

jonmcalder avatar Jun 10 '20 18:06 jonmcalder