DraggableProofs

From WeBWorK
(Difference between revisions)
Jump to: navigation, search
 
Line 39: Line 39:
  
 
<td style="background-color:#ccffcc;padding:7px;">
 
<td style="background-color:#ccffcc;padding:7px;">
<p> The draggableProof.pl macro is not yet part of the standard WeBWorK distribution.  You will need to download the macro file [[https://github.com/drjt/pg/blob/feature/SageMacro/macros/sage.pl sage.pl ]] FIX THIS LINK--FOR NOW EMAIL JOHN TRAVIS and place it in your local macros directory for this to work.
+
<p> The draggableProof.pl macro is not yet part of the standard WeBWorK distribution.  You will need to download the macro file  
 +
 
 +
<!-- [[https://github.com/drjt/pg/blob/feature/SageMacro/macros/sage.pl sage.pl ]] FIX THIS LINK -->
 +
(ask John Travis) and place it in your local macros directory for this to work.
 
</p>
 
</p>
 
</td>
 
</td>

Latest revision as of 12:24, 1 July 2014

Using Draggable Statements


This PG code shows how to apply a javascript-enabled collection of drag and drop statements.

Problem Techniques Index

PG problem file Explanation
DOCUMENT();
loadMacros(
"PGstandard.pl",
"MathObjects.pl",
"draggableProof.pl",
);

The draggableProof.pl macro is not yet part of the standard WeBWorK distribution. You will need to download the macro file (ask John Travis) 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],

[ 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.

Templates by Subject Area


Problem Techniques Index

follow us