Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Randomized FITB components implemented #476

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

dbrianwalton
Copy link

I took the work the @bjones1 did in the old RunestoneComponents repository for dynamic (randomized) FITB components and reimplemented the work under the new MonoRepo. Hopefully this makes a good starting point to pick up the next step in getting this implemented.

@dbrianwalton
Copy link
Author

Answering some questions @rbeezer posted in the associated PreTeXt PR.

  • As far as I can discern, the updated code looks for the existence of an additional field in the problem JSON structure (dyn_vars). If that is missing, the code uses the old tests. If it is present, then the additional structure for randomization and substitution takes place.
  • One area I don't yet understand on Runestone is storage in the database (maybe localStorage only?). In .../interactives/fitb/js/fitb.js, setLocalStorage and restoreAnswers appear to store and then retrieve a second copy of the problemHTML (lines 411-416). I don't understand the rationale for this if the problem could be regenerated by the seed that was stored (and in fact is evaluated in restoreAnswers (line 369). Perhaps it is more related to formatting of feedback that was previously computed?
  • Old problems would not have this html stored, but it looks like the code just skips this update if that element wasn't present. So I think this also should work fine for author-coded problems.

I did notice on my more careful review of how this interactive was implemented that a spurious change in versions for webpack was introduced due to my own misconceptions about npm and webpack. I've pushed a commit to resolve that so that versioning matches what was there before.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant