openwebwork/webwork2 — pull request #342 by cmhughes (2014-03-10 04:40:22+00:00)
Title: showMeAnother button

Hello WeBWorK team,
I humbly submit my first pull request to the project (my first attempt went to the wrong branch).

I have added a button called, 'Show Me Another', which will show the student a different version of the current problem. The behaviour of the button can be configured in a couple of different ways:

- there's a global switch in the course configuration screen that enables/disables the button.
- there's also a maximum number of times that the student can click on the button (or refresh the page) can be specified so that the student is limited by how many different versions they can see.
- from the h/w sets editor, the value of showMeAnother can be specified to dictate how many attempts the student needs to make before the button becomes active. By default, it is set to -1 which means that the button will never be active. This can also be modified on a per-student basis.

When exporting problem sets (into .def) files, and extra entry is added which specifies the value of showMeAnother- a sample output is:

openDate = 02/01/2014 at 11:53pm EST
dueDate = 04/05/2014 at 01:53am EDT
answerDate = 04/05/2014 at 12:00pm EDT
paperHeaderFile = defaultHeader
screenHeaderFile = defaultHeader
problemList =
CAS170/computeAverage.pg, 1, -1, -1
local/CAS170/computeAverage1.pg, 1, -1, 2
local/CAS170/computeAverage2.pg, 1, -1, -1
local/CAS170/function1.pg, 1, -1, -1
local/CAS170/function2.pg, 1, -1, -1
local/CAS170/function3.pg, 1, -1, -1
local/CAS170/function.pg, 1, -1, -1

I've modified the export/import process so that it can handle any combination (button enabled with old-style .def, button disabled with old-style .def, button disabled, button enabled with new-style .def, and button disabled with new-style .def).

I have posted a video demonstration of the feature here:

https://www.youtube.com/watch?v=7F4FvfqnITE&feature=youtu.be

There are a few other features that I plan to add to this button in the future, but I wanted to submit this pull request and see how it is received before investing too much more time.

Please let me know if you have any questions, comments, or concerns; I'm very open to any and all feedback :)

Chris