Difference between revisions of "DraggableProofs"
Jump to navigation
Jump to search
Line 73: | Line 73: | ||
<br> |
<br> |
||
[ list of incorrect statements in order], |
[ list of incorrect statements in order], |
||
+ | <br> |
||
options |
options |
||
Revision as of 16:40, 20 November 2013
Using the Sage Cell Server
This PG code shows how to apply a javascript-enabled collection of drag and drop statements.
PG problem file | Explanation |
---|---|
DOCUMENT(); loadMacros( "PGstandard.pl", "draggableProof.pl", ); |
The draggableProof.pl macro is not yet part of the standard WeBWorK distribution. You will need to download the macro file [sage.pl ] FIX THIS LINK and place it 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 statement in order],
|
## Lower WeBWorK text ## ## Problem display following the Sage cell ## 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. |