-
-
Notifications
You must be signed in to change notification settings - Fork 223
Add: Dynamic problems for fill-in-the-blank questions #1383
base: master
Are you sure you want to change the base?
Conversation
Fix: Use BTM from NPM. Allow local dynamic imports. Add: Another problem written by Brian W. Footnotes that were accidentally deleted. Fix: Correct BTM use per Brian W. Clean: Remove unnecessary import (BTM is dynamically imported). Fix: Update BTM to latest commit. Fix: Correct namespace of dynamic imports. Add: Local copy of bowtie math. Add: dynamic imports supporting bow tie math. Clean: Remove unused import. Squash with prev Fix: Better logic for static seeds. Add: A better RNG. Add: allow a JSON-provided static seed. Fix: Use %[= and ]% tags, but avoid relying on EJS. Revert: Go back to index.rst from 6a33115, which used %[= and %] instead of <script-eval> tags. Fix: For debug, don't use hashed filenames. Fix: Replace ejs with custom tags. Whitespace reformatting / cleanup. Add: Problem written by Brian Walton. Fix: Remove alert classes following 3df1418. Add: Hooks, pass more info to dynamic problems. Add: Dynamic questions. Fix: Make CodeChat indents work.
It looks like unit tests are broken at this point, so I'll not worry about getting those passing. |
I think there are two separate issues with the unit tests.
|
Can we test against the |
First -- Super Cool! Its amazing to see this coming together. OK, so I pulled this down and after an |
Are the changes to the problem representation backward compatible? Currently the problem statement is rendered outside the script tag that contains the json. But it appears that this implementation moves it to json in the "problemHtml" key. The big issue with this is the problems currently in the runestone question bank would all need to be rebuilt somehow or they would cease to work. |
Can we write a code based problem using this dynamic stuff? For example write a for loop to add the numbers starting with 3 and up to and including 11? Where we could randomize 3 and 11 ? I guess one way of doing it would be to have blanks in a call to range. |
@rbeezer I don't think the html is very different from what we have now. With the exception of the problem statement moving to an attribute of the json.
|
Fix them all by hand? ;-) Not clear immediately in my head about the implications of the PreTeXt |
Not for N > 500 😄 |
Actually I just ran across a Jupyter notebook I wrote a couple years ago that solves this problem. I used it the last time we made a breaking change in the parsons problem html. We just have to launch this at a time when I can build all the books and run this script to reparse all of the problems in the database. |
True. It looks like all the unit tests (bookserver, Runestone components, Runestone server) need some maintenance. I'd like to think through these with you: instead of just fixing these, do they need to be re-though/re-directed? Are these tests helpful, or just a maintainance burden? |
Can the dynamic problem code test if problemHtml is absent, and if so the statement is implicitly presumed to have already been written. This would be the case if there were no dynamic substitutions required, because there is no dynamic code. All that really needs to be sure happens is that the feedback testing still works correctly. As far as I understand, that doesn't really depend on the dynamic code—just dynamic code is responsible for creating appropriate scripted functions to do the tests. |
I would like to see how we can extend the dynamic structure to a variety of different problem types. It would be ideal if whatever structure is present for fixed coding problems was present. The trick to the dynamic coding problem is that you need to define variables in dyn_vars for those two values (first and last numbers in a sequence), and then be able to write the test functions for validity/feedback of the solution to depend on those two variables. |
You mean, just run these tests for now, rather than the entire test suite? If so, I was able to do this locally. The dynamic problem didn't pass, so I'll work on that. |
Thanks! I've really enjoyed working with @dbrianwalton on this.
Glad it's working! |
It's the same data for non-dynamic problem, but stored in a different way, as you noted below.
Good point... |
Such as an ActiveCode problem? Probably, but I'd need to think about how to put these pieces together...
|
Fantastic! (I assume it's not easy to simply rebuild all the books using |
The tests now pass locally for me. |
Use a different problem type for dynamic problems.
I've added code per today's drop in that:
|
Note that this test failure is from codelens, not from fitb. |
@dbrianwalton, this is the initial PR for our work on dynamic problems. I'll be force-pushing this until tests pass.