From: Mike G. v. a. <we...@ma...> - 2005-07-28 19:48:43
|
Log Message: ----------- Adding final problems for modelCourse Added Files: ----------- webwork2/courses/modelCourse/templates/set0: paperHeaderFile0.pg prob1.pg prob1a.pg prob1b.pg prob1c.pg prob2.pg prob3.pg prob5.pg screenHeaderFile0.pg webwork2/courses/modelCourse/templates/set0/prob4: 1-55141.gif 1-65474.gif 1-75352.gif 1-79226.gif 2-11287.gif 2-63428.gif 2-68382.gif 2-96187.gif 3-18387.gif 3-44144.gif 3-55459.gif 3-69221.gif prob4.pg webwork2/courses/modelCourse/templates/setDemo: calc.html Revision Data ------------- --- /dev/null +++ courses/modelCourse/templates/set0/prob1b.pg @@ -0,0 +1,106 @@ +##DESCRIPTION +## help for leaning precedence +##ENDDESCRIPTION + +##KEYWORDS('functions') + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGauxiliaryFunctions.pl" +); + +TEXT(beginproblem()); +$showPartialCorrectAnswers = 1; + + +BEGIN_TEXT +This problem will help you learn the rules of precedence, i.e. the order in which +mathematical operations are performed. You can use parentheses (and also square brackets +[ ] and/or curly braces $LB $RB) if you want to change the normal way operations work.$PAR + +So first let us review the normal way operations are performed.$PAR + +The rules are simple. Exponentiation is always done before multiplication +and division and multiplication and division are always done before addition +and subtraction. (Mathematically we say exponentiation takes precedence over +multiplication and division, etc.). For example what is 1+2*3? $BR +\{ ans_rule(25) \} +END_TEXT + +$ans = 7; +ANS(std_num_cmp($ans)); + + +BEGIN_TEXT +$BR and what is \( 2\cdot 3^2 \)? $BR +\{ ans_rule(25) \} +END_TEXT + +$ans = 2*3**2; +ANS(std_num_cmp($ans)); + +BEGIN_TEXT + +$BR +Now sometime you want to force things to be done in a different way. This is +what parentheses are used for. The rule is: whatever is enclosed in +parentheses is done before anything else (and things in the inner most +parentheses are done first). + +For example how do you enter \[ \frac {1+\sin(3)}{2+\tan(4)}\quad ? \] Hint: this is a good place to use +[ ]'s and also to use the ${LQ}Preview${RQ} button. $BR +\{ ans_rule(25) \} +END_TEXT + +$ans = (1+sin(3))/(2+tan(4)) ; +ANS(std_num_cmp($ans)); + +BEGIN_TEXT +$BR +Here are some more examples: + +(1+3)9 =36, (2*3)**2 = 6**2 = 36, 3**(2*2) = 3**4 = 81, (2+3)**2 = 5**2 = 25, 3**(2+2) = 3**4 = 81 + +$BR +(Here we have used ** to denote exponentiation and you can also use this instead of a ${LQ}caret${RQ} if you want). Try entering some of these and use the "Preview" button to see the result. The "correct" +result for this answer blank is 36, but by using the ${LQ}Preview${RQ} button, you can enter whatever +you want and use WeBWorK as a hand calculator.$BR +\{ ans_rule(25) \} + +END_TEXT + +$ans =36; + +ANS(std_num_cmp($ans)); + +BEGIN_TEXT +$BR + +There is one other thing to be careful of. Multiplication and division have the +same precedence and there are no universal rules as to which should be done first. +For example, what does 2/3*4 mean? (Note that / is the "division symbol", which +is usually written as a line with two dots, but unfortunately, this "line with +two dots" symbol is not on computer keyboards. Don't think of / as the horizontal +line in a fraction. Ask yourself what 1/2/2 should mean.) WeBWorK and most other +computers read things from left to right, i.e. 2/3*4 means (2/3)*4 or 8/3, IT DOES +NOT MEAN 2/12. Some computers may do operations from right to left. If you +want 2/(3*4) = 2/12, you have to use parentheses. The same thing happens with +addition and subtraction. 1-3+2 = 0 but 1-(3+2) = -4. This is one case where using +parentheses even if they are not needed might be a good idea, e.g. write (2/3)*4 +even though you could write 2/3*4. This is also a case where previewing your answer +can save you a lot a grief since you will be able to see what you entered. + +$BR +Enter 2/3*4 and use the Preview button to see what you get.$BR +\{ ans_rule(25) \} +END_TEXT + +$ans = 8/3; +ANS(std_num_cmp($ans)); + +ENDDOCUMENT(); # This should be the last executable line in the problem. --- /dev/null +++ courses/modelCourse/templates/set0/prob1.pg @@ -0,0 +1,114 @@ +##DESCRIPTION +## A very simple first problem +##ENDDESCRIPTION + +# this is a comment. i just added it. nifty! + +##KEYWORDS('algebra') + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGauxiliaryFunctions.pl" +); + +TEXT(beginproblem()); +$showPartialCorrectAnswers = 1; + +$a = random(-10,-1,1); +$b = random(1,11,1); +$c = random(1,11,1); +$d = random(1,11,1); + +BEGIN_TEXT +This problem demonstrates how you enter numerical answers into WeBWorK. $PAR +Evaluate the expression \(3($a )($b -$c -2($d ))\): + \{ ans_rule(10) \} +$BR + +END_TEXT + + +$ans = 3*($a)*($b-$c-2*($d)); + +ANS(strict_num_cmp($ans)); + +BEGIN_TEXT +In the case above you need to enter a number, since we're testing whether you can multiply +out these numbers. (You can use a calculator if you want.) +$PAR +For most problems, you will be able to get WeBWorK to +do some of the work for you. For example +$BR +Calculate ($a) * ($b): \{ ans_rule()\} +$BR + +END_TEXT + + +$ans = $a*$b; + +ANS(std_num_cmp($ans)); + +BEGIN_TEXT + +The asterisk is what most computers use to denote multiplication and you can use this with WeBWorK. +But WeBWorK will also allow you to use a space to denote multiplication. +You can either \($a * $b\) or \{$a*$b\} or even \($a \ $b\). All will work. Try them. +$PAR +Now try calculating the sine of 45 degrees ( that's sine of pi over 4 in radians +and numerically sin(pi/4) equals \{1/sqrt(2)\} or, more precisely, \(1/\sqrt{2} \) ). +You can enter this as sin(pi/4) , as +sin(3.1415926/4), as 1/sqrt(2), as 2**(-.5), etc. This is because WeBWorK knows about +functions like sin and sqrt (square root). (Note: exponents +can be indicated by either a "caret" or **). Try it.$BR \( \sin(\pi/4) = \) \{ ans_rule(20) \}$PAR + + Here's the +\{ htmlLink(qq!http://webwork.math.rochester.edu/webwork_system_html/docs/docs/pglanguage/availablefunctions.html!,"list of the functions") \} + which WeBWorK understands. WeBWorK ALWAYS uses radian mode for trig functions. + $PAR + +END_TEXT + +ANS( std_num_cmp(sin(3.1415926/4)) ); + +BEGIN_TEXT + +You can also use juxtaposition to denote multiplication. E.g. enter \( 2\sin(3\pi/2) \). +You can enter this as 2*sin(3*pi/2) or more simply as 2sin(3pi/2). Try it: $BR +\{ ans_rule(20) \}$PAR + +END_TEXT + +$pi = 4*atan(1); +ANS( std_num_cmp(2*sin(3*$pi/2)) ); + +BEGIN_TEXT + +Sometimes you need to use ( )'s to make your meaning clear. E.g. 1/2+3 is 3.5, but 1/(2+3) is .2 Why? +Try entering both and use the ${LQ}Preview${RQ} button below to see the difference. In addition to +( )'s, you can also use [ ]'s and $LB ${RB}'s. $BR +\{ ans_rule(20) \}$PAR + + +END_TEXT + +ANS( std_num_cmp(.2)); + +BEGIN_TEXT + +You can always try to enter answers and let WeBWorK do the calculating. +WeBWorK will tell you if the problem requires a strict numerical answer. +The way we use WeBWorK in this class there is no penalty for getting an answer wrong. What counts +is that you get the answer right eventually (before the due date). For complicated answers, +you should use the ${LQ}Preview${RQ} button to check for syntax errors and also to check that the answer +you enter is really what you think it is. + + +END_TEXT + +ENDDOCUMENT(); # This should be the last executable line in the problem. --- /dev/null +++ courses/modelCourse/templates/set0/prob3.pg @@ -0,0 +1,78 @@ +##DESCRIPTION +## sample matching problem +##ENDDESCRIPTION + +##KEYWORDS('sample') + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGauxiliaryFunctions.pl" +); + +TEXT(beginproblem()); +$showPartialCorrectAnswers = 0; + + +$a = random(-10,10,1); +$b = random(1,3,1); +$c = abs($a); +#$indextag = abs(($a < 0) -2) +if ($a <0) {$sgn = "+";} else {$sgn = "-";} +#$sgn = choose(indextag,"+","-") +## If e.g. $a = -3, write |x+3| instead of |x--3| +## Write an ifThenElse macro +$questStr1 = EV2(" \(x\) is less than $a" ); +$ansStr1 = EV2(" \(x \lt $a\)"); +$questStr2 =EV2( " \(x\) is any real number" ); +$ansStr2 = EV2(" \(-\infty \lt x \lt \infty\)"); +$questStr3 = EV2(" \(x\) is greater than $a" ); +$ansStr3 = EV2(" \($a \lt x\)"); +$questStr4 = EV2(" \(x\) is less than or equal to $a" ); +$ansStr4 = EV2(" \(x \leq $a\)"); +$questStr5 = EV2(" \(x\) is greater than or equal to $a"); +$ansStr5 = EV2(" \(x \geq $a\)"); +$questStr6 = EV2(" The distance from \(x\) to $a is less than or equal to $b"); +$ansStr6 = EV2(" \(|x $sgn $c| \leq $b\)"); +$questStr7 = EV2(" The distance from \(x\) to $a is more than $b"); +$ansStr7 = EV2(" \(|x $sgn $c| \gt $b\)"); + +@questions =( $questStr1,$questStr2,$questStr3,$questStr4,$questStr5,$questStr6,$questStr7); +@answers =( $ansStr1,$ansStr2,$ansStr3,$ansStr4,$ansStr5,$ansStr6,$ansStr7); + +# Now randomize the questions: +@slice = &NchooseK(7,5); +@shuffle = &shuffle(scalar(@slice)); +################################################################################ + +TEXT(EV2(<<EOT)); +This problem demonstrates a WeBWorK Matching question. $PAR +Match the statements defined below with the letters labeling their +equivalent expressions. $BR +You must get all of the answers correct to receive credit. +$BR +EOT +TEXT( +&match_questions_list(@questions[@slice]), +&OL(@answers[@slice[@shuffle]]) +); +ANS( str_cmp([ @ALPHABET[&invert(@shuffle)] ] ) ); + ##the correct answers are obtained by applying + ##the inverse (adjoint) permutation to the captions. + +TEXT(<<EOT); +For this problem WeBWorK only tells you that all your answers are correct or that at least one is wrong. +This makes the problem harder and is usually used only for T/F and matching questions. +The idea is to encourage you to think rather than to just try guessing. +$PAR +If you are having trouble reading the mathematics on the screen, this means that you are using "text" mode. +If you are using Netscape or MSIE then you can get an easier to read version of the equations by returning to the +problem list page (use the button at the top of this page) and choosing "formatted-text" or "typeset" instead +of "text". Sometimes there is a 15-20 second delay in viewing a problem in "typeset" mode the first time. +EOT + +ENDDOCUMENT(); # This should be the last executable line in the problem. \ No newline at end of file --- /dev/null +++ courses/modelCourse/templates/set0/screenHeaderFile0.pg @@ -0,0 +1,46 @@ +##Screen set header for set 0, Fall 1998 + +&DOCUMENT; + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl" +); + + + +BEGIN_TEXT; +WeBWorK assignment number $setNumber is due $formatedDueDate. + +$PAR +This first problem set (set 0) is designed to acquaint you with using WeBWorK. +YOUR SCORE ON THIS SET WILL NOT BE COUNTED TOWARD YOUR FINAL GRADE. +In addition to doing the screen problems, practice getting a hard copy print out of the +problem set. You probably won't need it for this problem set, but you may in the future. +If you need software installed on your own computer look +\{ htmlLink("/index.html#software","here")\}. +$PAR +The primary purpose of WeBWorK is to let you know if you are getting the right answer or to alert +you if you get the wrong answer. Usually you can attempt a problem as many times as you want before +the due date. However, if you are having trouble figuring out your error, you should +consult the book, or ask a fellow student, one of the TA's or +your professor for help. Don't spend a lot of time guessing -- it's not very efficient or effective. +$PAR + +You can use the Feedback button on each problem +page to send e-mail to the professors. +$PAR +Give 4 or 5 significant digits for (floating point) numerical answers. +For most problems when entering numerical answers, you can if you wish +enter elementary expressions such as 2^3 instead of 8, sin(3pi/2) instead +of -1, e^(ln(2)) instead of 2, +(2+tan(3))*(4-sin(5))^6-7/8 instead of 27620.3413, etc. + + Here's the +\{ htmlLink(qq!http://webwork.math.rochester.edu/webwork_system_html/docs/docs/pglanguage/availablefunctions.html!,"list of the functions") \} + which WeBWorK understands. +END_TEXT + +&ENDDOCUMENT; --- /dev/null +++ courses/modelCourse/templates/set0/prob5.pg @@ -0,0 +1,44 @@ +##DESCRIPTION +## practice problem +##ENDDESCRIPTION + +##KEYWORDS('sample') + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGauxiliaryFunctions.pl" +); + +TEXT(beginproblem()); +$showPartialCorrectAnswers = 0; + + +$a = random(100,200,1); +$b = random(250,350,1); +$c = random(-31,-3,1); +TEXT(EV2(<<EOT)); +This problem demonstrates a WeBWorK question that requires you to enter a number or a fraction. $PAR +Evaluate the expression \(\frac{|$a-$b|}{|$c|}\). Give your answer in decimal notation +correct to three decimal places or give your answer as a fraction. +$BR $BR \{ANS_RULE(1,10) \} +$BR +EOT +$ans = abs($a-$b)/abs($c); +ANS(arith_num_cmp($ans)); +TEXT(<<EOT); +$PAR +Now that you have finished you can use the "Prob. List" button at the top of the page +to return to the problem list page. You'll see that the problems you have done have been +labeled as correct or incorrect, so you can go back and do problems you skipped or couldn't +get right the first time. Once you have done a problem correctly it is ALWAYS listed as correct +even if you go back and do it incorrectly later. This means you can use WeBWorK to review +course material without any danger of changing your grade. + +EOT + +ENDDOCUMENT(); # This should be the last executable line in the problem. --- /dev/null +++ courses/modelCourse/templates/set0/prob1a.pg @@ -0,0 +1,58 @@ +##DESCRIPTION +## sample of entering functions as answers +##ENDDESCRIPTION + +##KEYWORDS('functions') + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( + "PGbasicmacros.pl", + "PGchoicemacros.pl", + "PGanswermacros.pl", + "PGauxiliaryFunctions.pl" +); + +TEXT(beginproblem()); +$showPartialCorrectAnswers = 1; + + +BEGIN_TEXT +This problem demonstrates how you enter function answers into WeBWorK. $PAR +First enter the function \(\sin\; x\). When entering the function, you should enter +sin(x), but WeBWorK will also accept sin x or even sinx. If you remember your trig +identities, sin(x) = -cos(x+pi/2) and WeBWorK will accept this or any other function +equal to sin(x), +e.g. sin(x) +sin(x)**2+cos(x)**2-1 +$BR\{ans_rule(35) \} + +END_TEXT + +$ans = "sin(x)"; +ANS(function_cmp($ans)); + +BEGIN_TEXT +$PAR +We said you should enter sin(x) even though WeBWorK will also accept sin x or even sinx because you +are less likely to make a mistake. Try entering sin(2x) without the parentheses and you may be surprised +at what you get. Use the Preview button to see what you get. WeBWorK will evaluate functions (such +as sin) before doing anything else, so sin 2x means first apply sin which gives sin(2) and then +mutiple by x. Try it. +$BR\{ans_rule(35) \} + +END_TEXT + + +$ans = "sin(2*x)"; +ANS(function_cmp($ans)); + +TEXT(EV2(<<EOT)); +$PAR Now enter the function \(2\cos t\). Note this is a function of \( t\) and not \( x\). Try entering +2cos x and see what happens. +$BR \{ans_rule(35) \} +EOT + +$ans = "2*cos(t)"; +ANS(function_cmp($ans,'t')); + +ENDDOCUMENT(); # This should be the last executable line the problem. --- /dev/null +++ courses/modelCourse/templates/set0/prob1c.pg @@ -0,0 +1,15 @@ + + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( + "PG.pl", + "PGbasicmacros.pl", + "PGchoicemacros.pl", + "PGanswermacros.pl", + "PGauxiliaryFunctions.pl" +); + +TEXT("Hello world"); + +ENDDOCUMENT(); # This should be the last executable line in the problem. --- /dev/null +++ courses/modelCourse/templates/set0/paperHeaderFile0.pg @@ -0,0 +1,29 @@ +##Problem set header for set 0, Summer 2001 + +&DOCUMENT; + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl" +); + +$dateTime = $formatedDueDate; + +TEXT(EV2(<<EOT)); +$BEGIN_ONE_COLUMN +\noindent {\large \bf $studentName} +\hfill +\noindent {\large \bf MATH Summer 2001} +\par +\noindent{\large \bf Homework Set $setNumber due $dateTime}\par + +\noindent This first set (set 0) is designed to acquaint you with using WeBWorK. +{\bf Your score on this set will not be counted toward your final grade} +\par +\noindent You may need to give 4 or 5 significant digits for some (floating point) numerical answers in order to have them accepted by the computer. +$END_ONE_COLUMN +EOT + +&ENDDOCUMENT; --- /dev/null +++ courses/modelCourse/templates/set0/prob2.pg @@ -0,0 +1,72 @@ +##DESCRIPTION +## sample true-false question +##ENDDESCRIPTION + +##KEYWORDS('true-false') + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGauxiliaryFunctions.pl" +); + +TEXT(beginproblem()); +$showPartialCorrectAnswers = 1; + +TEXT(EV2(<<EOT)); +This problem demonstrates a WeBWorK True/False question. $PAR +Enter a T or an F in each answer space below +to indicate whether the corresponding statement is true or +false.$BR +You must get all of the answers correct to receive credit. +$BR +EOT + +## First we set up our variables. +$a = random(1,5,1); +$b = random(6,10,1); +$c = random(-10,-1,1); +$d = random(-10,-1,1); +$e = random(1,10,1); + +$questStr1 = EV2(" \(-$a \lt -$b\)"); +$ansStr1 = "F"; +$questStr2 = EV2(" \($c \leq $c\)"); +$ansStr2 = "T"; +$questStr3 = EV2(" \($d \lt $d\)"); +$ansStr3 = "F"; +$questStr4 = EV2(" \(\pi \geq 3.1416\)"); +$ansStr4 = "F"; +$questStr5 = EV2(" \($e-1 \leq $e\)"); +$ansStr5 = "T"; + +@questions =( $questStr1,$questStr2,$questStr3,$questStr4,$questStr5); +@answers =( $ansStr1,$ansStr2,$ansStr3,$ansStr4,$ansStr5); + +## Now choose randomly 4 questions out of the 5 question strings above. + +@slice = NchooseK(scalar(@questions),4); + +## Next we output the 4 chosen questions. #match_ +TEXT( +&match_questions_list(@questions[@slice]) +); + +ANS(str_cmp([ @answers[@slice] ] )); +TEXT(<<EOT); +$PAR Notice that if one of your answers is wrong then, in this problem, WeBWorK will tell you which +parts are wrong and which parts are right. This is the behavior for most problems, but for true/false +or multiple choice questions +WeBWorK will usually only tell you whether or not all the answers are correct. +It won't tell you which ones are wrong. The idea is to encourage you to think rather than to just try guessing. +$PAR +In every case all of the +answers must be correct before you get credit for the problem. + + +EOT +ENDDOCUMENT(); # This should be the last executable line in the problem. \ No newline at end of file --- /dev/null +++ courses/modelCourse/templates/set0/prob4/prob4.pg @@ -0,0 +1,99 @@ +##DESCRIPTION +## Goal: Identify that a line represents an increasing, decreasing or constant function +## or is not the graph of a function (when the line is vertical). +## Contains an introduction explaining the importance of linear (affine) functions. +##ENDDESCRIPTION + +##KEYWORDS('graphs') + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGauxiliaryFunctions.pl" +); + +TEXT(beginproblem()); +$showPartialCorrectAnswers = 0; + + +$pictSet = random(1,3,1); #there are three sets of graphs + +$pictNum = random(1,4,1); #each set has 4 graphs the numbers are below + +@pictID = ( +"1-55141.gif", +"1-79226.gif", +"1-75352.gif", +"1-65474.gif", +"2-96187.gif", +"2-11287.gif", +"2-68382.gif", +"2-63428.gif", +"3-44144.gif", +"3-69221.gif", +"3-18387.gif", +"3-55459.gif" +); + +sub pictIndex{ # this gives offsets into @pictID -- I was too laxy to do multidimensional arrays + my ($i,$j)=@_; + return(($i-1)*4+$j-1 ) + } + +@question = (); +@answer =(); + +TEXT( + + qq! This problem demonstrates a WeBWorK problem involving graphics. $PAR + The simplest functions are the linear (or affine) functions --- + the functions whose graphs are + a straight line. They are important because many functions (the so-called + differentiable functions) ${LQ}locally$RQ look like straight lines. + (${LQ}locally$RQ means that + if we zoom in and look at the function at very powerful magnification + it will look like a straight line.) $PAR + !, + "Enter the letter of the graph of the function which corresponds to + each statement. $BR" + ); + +qa(~~@question,~~@answer, +"The graph of the line is increasing", +@pictID[&pictIndex($pictSet,1)], +"The graph of the line is decreasing", +@pictID[&pictIndex($pictSet,2)], +"The graph of the line is constant", +@pictID[&pictIndex($pictSet,3)], +"The graph of the line is not the graph of a function", +@pictID[&pictIndex($pictSet,4)], +); + +@slice = 0..3; # select an ordered subset of the questions and answers +@shuffle = &shuffle(scalar(@slice)); # create a permutation of the right length +@images = @answer[@slice[@shuffle]]; # create a permuted list of the answers +@captions =@ALPHABET[0..3]; # the caption letters are always in order + +TEXT( +&match_questions_list(@question[@slice]), +&imageRow(~~@images,~~@captions) +); + +ANS(std_str_cmp_list( @ALPHABET[&invert(@shuffle ) ] ) ); + +TEXT(EV2(<<EOT)); +This is another problem where you aren't told if some of your answers are right. (With +matching questions and true false questions, this is the standard behavior -- otherwise +it is too easy to guess your way to the answer without learning anything.) +$PAR +If you are having a hard time seeing the picture clearly, click on the picture. It will +expand to a larger picture on its own page so that you can inspect it more closely. +$PAR +Some problems display a link to a web page where you can get additional information +or a hint:\{ htmlLink(alias("testing.html"),"Hint")\} +EOT +ENDDOCUMENT(); # This should be the last executable line in the problem. --- /dev/null +++ courses/modelCourse/templates/setDemo/calc.html @@ -0,0 +1,57 @@ +<HTML> +<HEAD> +<TITLE>The JavaScript Source: Calculators: Basic</TITLE> +<META HTTP-EQUIV="The JavaScript Source" CONTENT="no-cache"> +<META NAME="description" CONTENT="This is a very simple calculator, all done with javascript. Just click the numbers and the operators and use the "=" button to calculate! This is a neat example of the LIMITLESS (!) powers of JavaScript."> +</HEAD> + +<BODY BGCOLOR=#ffffff vlink=#0000ff> + +<P> + + +I took this calculator straight from the web at <A HREF="http://javascriptsource.com">javascriptsource.com</A> +<P> + +This is a very simple calculator, +all done with javascript. +Just click the numbers and +the operators and use the "=" button to calculate! + +<CENTER> +<FORM NAME="Calc"> +<TABLE BORDER=4> +<TR> +<TD> +<INPUT TYPE="text" NAME="Input" Size="16"> +<br> +</TD> +</TR> +<TR> +<TD> +<INPUT TYPE="button" NAME="one" VALUE=" 1 " OnClick="Calc.Input.value += '1'"> +<INPUT TYPE="button" NAME="two" VALUE=" 2 " OnCLick="Calc.Input.value += '2'"> +<INPUT TYPE="button" NAME="three" VALUE=" 3 " OnClick="Calc.Input.value += '3'"> +<INPUT TYPE="button" NAME="plus" VALUE=" + " OnClick="Calc.Input.value += ' + '"> +<br> +<INPUT TYPE="button" NAME="four" VALUE=" 4 " OnClick="Calc.Input.value += '4'"> +<INPUT TYPE="button" NAME="five" VALUE=" 5 " OnCLick="Calc.Input.value += '5'"> +<INPUT TYPE="button" NAME="six" VALUE=" 6 " OnClick="Calc.Input.value += '6'"> +<INPUT TYPE="button" NAME="minus" VALUE=" - " OnClick="Calc.Input.value += ' - '"> +<br> +<INPUT TYPE="button" NAME="seven" VALUE=" 7 " OnClick="Calc.Input.value += '7'"> +<INPUT TYPE="button" NAME="eight" VALUE=" 8 " OnCLick="Calc.Input.value += '8'"> +<INPUT TYPE="button" NAME="nine" VALUE=" 9 " OnClick="Calc.Input.value += '9'"> +<INPUT TYPE="button" NAME="times" VALUE=" x " OnClick="Calc.Input.value += ' * '"> +<br> +<INPUT TYPE="button" NAME="clear" VALUE=" c " OnClick="Calc.Input.value = ''"> +<INPUT TYPE="button" NAME="zero" VALUE=" 0 " OnClick="Calc.Input.value += '0'"> +<INPUT TYPE="button" NAME="DoIt" VALUE=" = " OnClick="Calc.Input.value = eval(Calc.Input.value)"> +<INPUT TYPE="button" NAME="div" VALUE=" / " OnClick="Calc.Input.value += ' / '"> +<br> +</TD> +</TR> +</TABLE> +</FORM> +</CENTER> +</body></html> |