Difference between revisions of "DraggableProofs"
Jump to navigation
Jump to search
(Updated instructions on where the find the draggableProofs.pl macro file.) |
Fabiangabel (talk | contribs) m (typo) |
||
Line 71: | Line 71: | ||
Notice the format is: |
Notice the format is: |
||
<p> |
<p> |
||
− | [ list of correct |
+ | [ list of correct statements in order], |
</p> |
</p> |
||
<p> |
<p> |
Revision as of 10:01, 20 June 2021
Using Draggable Statements
This PG code shows how to apply a javascript-enabled collection of drag and drop statements.
PG problem file | Explanation |
---|---|
DOCUMENT(); loadMacros( "PGstandard.pl", "MathObjects.pl", "draggableProof.pl", ); |
The draggableProof.pl macro can be found in [OpenProblemLibrary/macros/MC/draggableProof.pl]. It is not yet part of the standard WeBWorK macros, so you have to place the file in your local macros directory for this to work. |
TEXT(beginproblem()); $CorrectProof = DraggableProof([ "Jason Aubrey", "Someone better than Jason but less than everyone else", "John Travis" ], [ "Don't complain about it", "\(x^2\)" ], SourceLabel => "Choose from these", TargetLabel => "Place the people in order of increasing usefulness.", ); |
Notice the format is: [ list of correct statements in order], [ list of incorrect statements in order], options |
Context()->texStrings; BEGIN_TEXT Select \{ $CorrectProof->numNeeded \} of the following. $PAR \{ $CorrectProof->Print \} END_TEXT Context()->normalStrings; # Answer Evaluation ANS($CorrectProof->cmp); ENDDOCUMENT(); |
Notice, $CorrectProof->numNeeded returns the actual number of correct statements provided in the first list from above. |