Virtually all problems in 6.002x were parameterized this way. The syntax is based on LON-CAPA, but with Python scripts instead of Perl scripts (and LON-CAPA documents this nicely). Jerry Sussman (who did the plurality of the work on the course, including writing all of these problems) released a copy of the course under a free and open license a couple of years ago, so it's a good place to look for examples:
http://groups.csail.mit.edu/mac/users/gjs/6.002x/ When we were first developing the course, each time you submitted a problem, the values changed. While this works well with simple one-concept Khan-style questions, it was a disaster for problems with a lot of algebra. One of the first platform enhancement was to do it such that randomization could be set to per-student, so each student saw different values (to prevent cheating), but a student's values remained constant. That had issues for student collaboration, so we set the course to use the same random number seed for all students and all problems. The settings are documented here: https://github.com/edx/edx-platform/blob/e03b3914f858a654507cd988412b0865cbea39cc/common/lib/xmodule/xmodule/capa_base.py#L159 If you just want to use this type of problem, an easy platform enhancement would be to modify this setting to include an additional option to look for a run, or better yet, to look for a good estimate of mastery (assuming both occasionally errors and correct guesses). Piotr On Wednesday, April 19, 2017 at 3:47:58 AM UTC-4, Mattijs Joosten wrote: > > Thank you very much for your post, Piotr. I really appreciate it. > > My idea for a block actually started with parameterized problems with > variables to be substituted with a value from a list. > > For example: > "$firstname $lastname (age $age) has Dutch basic health insurance and no > supplementary insurance." > > to generate: > "Liam Jansen (age 62) has Dutch basic health insurance and no > supplementary insurance." > > I figured I'd generate the problems outside of Open edX and then import > them. > But you've had parameterized problems for years. Is there a way to use > lists, like for $firstname and $lastname in the example? > > About the block: > Instead of generating new problems until students get one right, I'd like > to keep the same problem in front of the student until they get that right. > And then generate (or select) a new problem until they get X right in a > row. > > I think a good place to start for me would be numerical input questions, > followed by checkboxes and multiple choice. > With numerical input a student might guess one right, but the odds of > guessing five or six right in a row would be low. > > I'm not really comfortable yet rewriting client side event handling. I > love Open edX, but I'm relatively new to coding. > Where I could start is by taking "Numerical Input with Hints and Feedback" > and adding the "Get X right in a row" functionality. > Then I could apply what I learned to other question types or to an > overarching block that handles its children's events. > > I'd love to use parameters and lists from the start to generate questions > on the fly. > This avoids filling a question bank with a hundred or so problems while > most students might only use ten. > > The name could be more descriptive, like "X correct in a row", just > "correct in a row" or something containing "serial" or "streak". > > What do you think? > -- You received this message because you are subscribed to the Google Groups "General Open edX discussion" group. To view this discussion on the web visit https://groups.google.com/d/msgid/edx-code/5b95cce9-2eb1-4481-8f65-8730e337f0bc%40googlegroups.com.