DOCUMENT();
loadMacros("PG.pl",
"PGbasicmacros.pl",
"PGchoicemacros.pl",
"PGanswermacros.pl",
);
# allow the student to change the seed for this problem.
$newProblemSeed = ( defined( ${$inputs_ref}{'newProblemSeed'} ) )? ${$inputs_ref}{'newProblemSeed'} : $problemSeed;
$PG_random_generator->srand($newProblemSeed);
TEXT(beginproblem());
BEGIN_TEXT
This problem requires a browser capable of running Java.
$PAR
To see a different version of the problem change
the problem seed and press the 'Submit Answer' button below.$PAR Problem Seed:
\{ M3(
qq! Change the problem seed to change the problem:$problemSeed!,
qq! Change the problem seed to change the problem:
\begin{rawhtml}
\end{rawhtml}!,
qq! !
)
\}
$PAR
This problem illustrates how you can Java applets in a WeBWorK example.
This Java applet and data were created using Geometer's Sketchpad.
WeBWorK can use existing $BBOLD JavaScript$EBOLD and $BBOLD Java $EBOLD code to augment its capabilities.
$HR
First view the figure in the
\{ htmlLink( "${htmlURL}test2.html", "java applet",q!TARGET="JAVA_APPLET"!)\}
. (This may take a minute to load.)$BR
The java applet figure illustrates a triangle and its median.
You can drag the corners of the triangle to change its shape.
$HR
Calculate the
ratio of the areas of the two colored triangles.
$PAR
The ratio of the areas = \{ans_rule(5)\}
$PAR
Will this ratio be different for different triangles?$BR
\{ ans_rule(5)\}
$PAR
We are working on allowing
java applets to be included directly in WeBWorK problems
without using an external link. This merely requires that we
be able to specify the directory in which the java applet resides;
for security reasons, it can't reside in the same directory as the
problem.
$PAR
You can view the \{ htmlLink(alias("prob6.html"),"source", q!TARGET="source"!)\} for this problem.
or consult the \{ htmlLink("/webwork_system_html/docs/techdescription/pglanguage/index.html","documentation") \} for more details on the PG language.
END_TEXT
ANS(num_cmp(1),str_cmp('no'));
&ENDDOCUMENT;