Parent Directory
|
Revision Log
added problem library as webwork/ww_prob_lib with revision tag prob-lib-2
1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"> 2 <HTML> 3 <HEAD> 4 <TITLE>Source for problem 6</TITLE> 5 <META NAME="generator" CONTENT="BBEdit 5.0"> 6 </HEAD> 7 <BODY BGCOLOR="#FFFFFF"> 8 <PRE> 9 10 DOCUMENT(); 11 12 loadMacros("PG.pl", 13 "PGbasicmacros.pl", 14 "PGchoicemacros.pl", 15 "PGanswermacros.pl", 16 ); 17 18 19 20 21 22 # allow the student to change the seed for this problem. 23 $newProblemSeed = ( defined( ${$inputs_ref}{'newProblemSeed'} ) )? ${$inputs_ref}{'newProblemSeed'} : $problemSeed; 24 $PG_random_generator->srand($newProblemSeed); 25 26 27 28 TEXT(beginproblem()); 29 30 BEGIN_TEXT 31 This problem requires a browser capable of running Java. 32 $PAR 33 To see a different version of the problem change 34 the problem seed and press the 'Submit Answer' button below.$PAR Problem Seed: 35 \{ M3( 36 qq! Change the problem seed to change the problem:$problemSeed!, 37 qq! Change the problem seed to change the problem: 38 \begin{rawhtml} 39 <INPUT NAME="newProblemSeed" VALUE = "$newProblemSeed" SIZE = "10"> 40 \end{rawhtml}!, 41 qq! <INPUT NAME="newProblemSeed" VALUE = "$newProblemSeed" SIZE = "10">! 42 ) 43 \} 44 $PAR 45 This problem illustrates how you can Java applets in a WeBWorK example. 46 This Java applet and data were created using Geometer's Sketchpad. 47 WeBWorK can use existing $BBOLD JavaScript$EBOLD and $BBOLD Java $EBOLD code to augment its capabilities. 48 $HR 49 First view the figure in the 50 \{ htmlLink( "${htmlURL}test2.html", "java applet",q!TARGET="JAVA_APPLET"!)\} 51 . (This may take a minute to load.)$BR 52 The java applet figure illustrates a triangle and its median. 53 You can drag the corners of the triangle to change its shape. 54 $HR 55 Calculate the 56 ratio of the areas of the two colored triangles. 57 $PAR 58 The ratio of the areas = \{ans_rule(5)\} 59 $PAR 60 Will this ratio be different for different triangles?$BR 61 \{ ans_rule(5)\} 62 $PAR 63 We are working on allowing 64 java applets to be included directly in WeBWorK problems 65 without using an external link. This merely requires that we 66 be able to specify the directory in which the java applet resides; 67 for security reasons, it can't reside in the same directory as the 68 problem. 69 $PAR 70 You can view the \{ htmlLink(alias("prob6.html"),"source", q!TARGET="source"!)\} for this problem. 71 or consult the \{ htmlLink("/webwork_system_html/docs/techdescription/pglanguage/index.html","documentation") \} for more details on the PG language. 72 73 END_TEXT 74 75 ANS(num_cmp(1),str_cmp('no')); 76 77 &ENDDOCUMENT; 78 79 80 81 </PRE> 82 </BODY> 83 </HTML>
| aubreyja at gmail dot com | ViewVC Help |
| Powered by ViewVC 1.0.9 |