From: Mike G. v. a. <we...@ma...> - 2008-06-25 12:12:52
|
Log Message: ----------- Adding the contents of modelCourse templates to rel-2-4-5 Tags: ---- rel-2-4-patches Modified Files: -------------- webwork2/courses.dist/modelCourse/templates: course_info.txt set0.def Added Files: ----------- webwork2/courses.dist/modelCourse/templates: setHeader.pg setOrientation.def setOrientation.pl webwork2/courses.dist/modelCourse/templates/setDemo: nsc2s10p2.pg.bak prob6b.html srw1_9_4.pg.bak srw1_9_4.pg.gage.tmp Revision Data ------------- --- /dev/null +++ courses.dist/modelCourse/templates/setOrientation.pl @@ -0,0 +1,21 @@ +setNumber=Orientation +openDate = 6/26/04 at 11:30am +dueDate = 4/4/05 at 12:20pm +answerDate = 4/5/05 at 12:00pm +screenHeaderFile = unionLibrary/parserOrientation/setHeader.pg +problemList = +unionLibrary/parserOrientation/prob01.pg, 1 +unionLibrary/parserOrientation/prob02.pg, 1 +unionLibrary/parserOrientation/prob03.pg, 1 +unionLibrary/parserOrientation/prob04.pg, 1 +unionLibrary/parserOrientation/prob05/prob05.pg, 1 +unionLibrary/parserOrientation/prob06.pg, 1 +unionLibrary/parserOrientation/prob07.pg, 1 +unionLibrary/parserOrientation/prob08.pg, 1 +unionLibrary/parserOrientation/prob09.pg, 1 +unionLibrary/parserOrientation/prob10.pg, 1 +unionLibrary/parserOrientation/prob11.pg, 1 +unionLibrary/parserOrientation/prob12.pg, 1 +unionLibrary/parserOrientation/prob13.pg, 1 +unionLibrary/parserOrientation/prob14/prob14.pg, 1 +unionLibrary/parserOrientation/prob15.pg, 1 Index: course_info.txt =================================================================== RCS file: /webwork/cvs/system/webwork2/courses.dist/modelCourse/templates/course_info.txt,v retrieving revision 1.1 retrieving revision 1.1.6.1 diff -Lcourses.dist/modelCourse/templates/course_info.txt -Lcourses.dist/modelCourse/templates/course_info.txt -u -r1.1 -r1.1.6.1 --- courses.dist/modelCourse/templates/course_info.txt +++ courses.dist/modelCourse/templates/course_info.txt @@ -1 +1,3 @@ +this information is written in the file: +[coursesDirectory]/courseName/templates/course_info.txt --- /dev/null +++ courses.dist/modelCourse/templates/setOrientation.def @@ -0,0 +1,21 @@ +setNumber=Orientation +openDate = 6/26/04 at 11:30am +dueDate = 4/4/05 at 12:20pm +answerDate = 4/5/05 at 12:00pm +screenHeaderFile = unionLibrary/parserOrientation/setHeader.pg +problemList = +unionLibrary/parserOrientation/prob01.pg, 1 +unionLibrary/parserOrientation/prob02.pg, 1 +unionLibrary/parserOrientation/prob03.pg, 1 +unionLibrary/parserOrientation/prob04.pg, 1 +unionLibrary/parserOrientation/prob05/prob05.pg, 1 +unionLibrary/parserOrientation/prob06.pg, 1 +unionLibrary/parserOrientation/prob07.pg, 1 +unionLibrary/parserOrientation/prob08.pg, 1 +unionLibrary/parserOrientation/prob09.pg, 1 +unionLibrary/parserOrientation/prob10.pg, 1 +unionLibrary/parserOrientation/prob11.pg, 1 +unionLibrary/parserOrientation/prob12.pg, 1 +unionLibrary/parserOrientation/prob13.pg, 1 +unionLibrary/parserOrientation/prob14/prob14.pg, 1 +unionLibrary/parserOrientation/prob15.pg, 1 Index: set0.def =================================================================== RCS file: /webwork/cvs/system/webwork2/courses.dist/modelCourse/templates/set0.def,v retrieving revision 1.1 retrieving revision 1.1.6.1 diff -Lcourses.dist/modelCourse/templates/set0.def -Lcourses.dist/modelCourse/templates/set0.def -u -r1.1 -r1.1.6.1 --- courses.dist/modelCourse/templates/set0.def +++ courses.dist/modelCourse/templates/set0.def @@ -4,10 +4,10 @@ answerDate = 1/21/09 at 6:00am screenHeaderFile = setHeader.pg problemList = -set0/prob1.pg, 1 -set0/prob1a.pg, 1 -set0/prob1b.pg, 1 -set0/prob2.pg, 1 -set0/prob3.pg, 1 -set0/prob4/prob4.pg, 1 -set0/prob5.pg, 1 +rochesterLibrary/set0/prob1.pg, 1 +rochesterLibrary/set0/prob1a.pg, 1 +rochesterLibrary/set0/prob1b.pg, 1 +rochesterLibrary/set0/prob2.pg, 1 +rochesterLibrary/set0/prob3.pg, 1 +rochesterLibrary/set0/prob4/prob4.pg, 1 +rochesterLibrary/set0/prob5.pg, 1 --- /dev/null +++ courses.dist/modelCourse/templates/setHeader.pg @@ -0,0 +1,88 @@ +################################################################################ +# WeBWorK Online Homework Delivery System +# Copyright © 2000-2003 The WeBWorK Project, http://openwebwork.sf.net/ +# $CVSHeader: webwork2/courses.dist/modelCourse/templates/setHeader.pg,v 1.1.2.1 2008/06/25 11:55:31 gage Exp $ +# +# This program is free software; you can redistribute it and/or modify it under +# the terms of either: (a) the GNU General Public License as published by the +# Free Software Foundation; either version 2, or (at your option) any later +# version, or (b) the "Artistic License" which comes with this package. +# +# This program is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +# FOR A PARTICULAR PURPOSE. See either the GNU General Public License or the +# Artistic License for more details. +################################################################################ + +DOCUMENT(); + +loadMacros( + "PG.pl", + "PGbasicmacros.pl", + +); + +TEXT($BEGIN_ONE_COLUMN); + +TEXT(MODES(TeX =>EV3(<<'EOT'),HTML=>"",Latex2HTML=>"")); +\noindent {\large \bf $studentName} +\hfill +\noindent {\large \bf MTH 161 $sectionNumber Fall 2003} +\par + +EOT + +BEGIN_TEXT + +$BBOLD WeBWorK assignment number $setNumber is due : $formattedDueDate. $EBOLD + +$PAR + +$PAR +The +(* home page *) +\{ +#htmlLink(qq!http://www.math.rochester.edu/courses/161/home/!,"home page") +\} +for the course contains the syllabus, grading policy and other information. +$PAR +END_TEXT + +################## +# EDIT BELOW HERE +################## +BEGIN_TEXT +$HR +$PAR +This file is /conf/snippets/setHeader.pg you can use it as +a model for creating files which introduce each problem set. +$PAR +$HR +END_TEXT +################## +# EDIT ABOVE HERE +################## +BEGIN_TEXT +The primary purpose of WeBWorK is to let you know that you are getting the correct answer or to alert +you if you are making some kind of mistake. 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 +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\wedge3 \) instead of 8, \( sin(3*pi/2) \)instead +of -1, \( e\wedge (ln(2)) \) instead of 2, +\( (2+tan(3))*(4-sin(5))\wedge6-7/8 \) instead of 27620.3413, etc. + Here's the +\{ htmlLink(qq!http://webwork.math.rochester.edu/docs/docs/pglanguage/availableFunctions.html!,"list of the functions") \} + which WeBWorK understands. +$PAR +You can use the Feedback button on each problem +page to send e-mail to the professors. + + +$END_ONE_COLUMN +END_TEXT + +ENDDOCUMENT(); # This should be the last executable line in the problem. \ No newline at end of file --- /dev/null +++ courses.dist/modelCourse/templates/setDemo/srw1_9_4.pg.bak @@ -0,0 +1,59 @@ +##DESCRIPTION +## find distance between two points, find coordinates of the midpoint of +## a line segment connecting them +##ENDDESCRIPTION + +##KEYWORDS('algebra', 'coordinate geometry', 'distance', 'midpoint') + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( + "PGbasicmacros.pl", + "PGchoicemacros.pl", + "PGanswermacros.pl", + "PGauxiliaryFunctions.pl" +); + +TEXT(&beginproblem); + +$showPartialCorrectAnswers = 1; + +#install_problem_grader(~~&std_problem_grader); ##uncomment to use std grader +#install_problem_grader(~~&custom_problem_grader); ##uncomment to use custom grader +$x1 = random(1,5,1); +$y1 = random(-5,-1,1); +$x2 = random(-10,-3,1); +$y2 = random(-9,-2,1); +$len1 = sqrt(($x1-$x2)**2 + ($y1-$y2)**2); +$midx = ($x1+$x2)/2; +$midy = ($y1+$y2)/2; + +BEGIN_TEXT +Consider the two points \( ($x1 ,$y1 )\) and \( ($x2 ,$y2 )\). +The distance between them is:$BR +\{ans_rule(30) \} +$BR +END_TEXT + +$ans = $len1; +&ANS(num_cmp($ans)); + +BEGIN_TEXT +The x co-ordinate of the midpoint of the line +segment that joins them is:\{ans_rule(20) \} +$BR +END_TEXT +$ans = $midx; +&ANS(num_cmp($ans)); + +BEGIN_TEXT +The y co-ordinate of the midpoint of the line segment that joins them is: +\{ans_rule(20) \} +$BR +END_TEXT +$ans = $midy; +&ANS(num_cmp($ans)); + +ENDDOCUMENT(); # This should be the last executable line in the problem. + + --- /dev/null +++ courses.dist/modelCourse/templates/setDemo/prob6b.html @@ -0,0 +1,90 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"> +<HTML> +<HEAD> + <TITLE>Source for problem 6</TITLE> + <META NAME="generator" CONTENT="BBEdit 5.0"> +</HEAD> +<BODY BGCOLOR="#FFFFFF"> +<PRE> +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); + +$p = random(2,9,1); # multiplier +$p2 = ( $p % 2 == 0) ? 2*$p : $p; + +TEXT(beginproblem()); + +# The link to the java applet is hard wired to use the java applet +# served from the University of Rochester WeBWorK machine. +# It is possible to set this up so that the java applet is served +# from any machine +# For details use the Feedback button to contact the authors of WeBWorK + +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} + <INPUT NAME="newProblemSeed" VALUE = "$newProblemSeed" SIZE = "10"> + \end{rawhtml}!, +qq! <INPUT NAME="newProblemSeed" VALUE = "$newProblemSeed" SIZE = "10">! +) +\} +$PAR +This problem illustrates how you can Java applets in a WeBWorK example. +$PAR +This polar coordinate grapher was designed at constructed at Mathematics Department +at The Johns Hopkins University +$PAR +WeBWorK can use existing $BBOLD JavaScript$EBOLD and $BBOLD Java $EBOLD code to augment its capabilities. +$HR +END_TEXT +TEXT(TEX("The Johns Hopkins University Mathematics Department's polar graph plotting applet goes here", +qq{ +<APPLET CODE="PolarApplet/PolarApplet.class" WIDTH="250" HEIGHT="350" +CODEBASE="http://xena.mat.jhu.edu/vander/stable/"> +<PARAM NAME="tmin" VALUE="0"> +<PARAM NAME="tmax" VALUE="2*pi"> +<PARAM NAME="showcartesian" VALUE="no"> +<PARAM NAME="showinterval" VALUE="YES"> +</APPLET> +}, + +)); + +BEGIN_TEXT +$PAR +For what value of \( k \) does the graph of \( r = \cos(kt) \) look like a rose with $p2 petals? +$BR +\(k = \) \{ ans_rule(20) \} ; + +$PAR +You can view the \{ htmlLink(alias("prob6b.html"),"source", q!TARGET="source"!)\} for this problem. +or consult the \{ htmlLink("${webworkDocsURL}techdescription/pglanguage/index.html","documentation") \} for more details on the PG language. + +END_TEXT + +ANS(num_cmp($p) ); + +ENDDOCUMENT(); + +</PRE> +</BODY> +</HTML> --- /dev/null +++ courses.dist/modelCourse/templates/setDemo/srw1_9_4.pg.gage.tmp @@ -0,0 +1,111 @@ +##DESCRIPTION +## find distance between two points, find coordinates of the midpoint of +## a line segment connecting them +##ENDDESCRIPTION + +##KEYWORDS('algebra', 'coordinate geometry', 'distance', 'midpoint') + +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; + +#install_problem_grader(~~&std_problem_grader); ##uncomment to use std grader +#install_problem_grader(~~&custom_problem_grader); ##uncomment to use custom grader + + +$x1 = random(1,5,1); +$y1 = random(-5,-1,1); +$x2 = random(-10,-3,1); +$y2 = random(-9,-2,1); +$len1 = sqrt(($x1-$x2)**2 + ($y1-$y2)**2); +$midx = ($x1+$x2)/2; +$midy = ($y1+$y2)/2; + +BEGIN_TEXT +Consider the two points \( ($x1 ,$y1 )\) and \( ($x2 ,$y2 )\). +The distance between them is:$BR +\{ans_rule(30) \} +$BR +END_TEXT + +$ans = $len1; +&ANS(std_num_cmp($ans)); + +BEGIN_TEXT +The x co-ordinate of the midpoint of the line +segment that joins them is:\{ans_rule(20) \} +$BR +END_TEXT +$ans = $midx; +&ANS(std_num_cmp($ans)); + +BEGIN_TEXT +The y co-ordinate of the midpoint of the line segment that joins them is: +\{ans_rule(20) \} +$BR +END_TEXT +$ans = $midy; +&ANS(std_num_cmp($ans)); + + +sub custom_problem_grader { + my $rh_evaluated_answers = shift; + my $rh_problem_state = shift; + my %form_options = @_; + my %evaluated_answers = %{$rh_evaluated_answers}; + # The hash $rh_evaluated_answers typically contains: + # 'answer1' => 34, 'answer2'=> 'Mozart', etc. + + # By default the old problem state is simply passed back out again. + my %problem_state = %$rh_problem_state; + + + # %form_options might include + # The user login name + # The permission level of the user + # The studentLogin name for this psvn. + # Whether the form is asking for a refresh or is submitting a new answer. + + # initial setup of the answer + my $total=0; + my %problem_result = ( score => 0, + errors => '', + type => 'custom_problem_grader', + msg => 'Part 1 is worth 50% and parts 2 and 3 are worth 25% each.', + ); + + # Return unless answers have been submitted + unless ($form_options{answers_submitted} == 1) { + return(~~%problem_result,~~%problem_state); + } + # Answers have been submitted -- process them. + + $total += .5*($evaluated_answers{'AnSwEr1'}->{score}); + $total += .25*($evaluated_answers{'AnSwEr2'}->{score}); + $total += .25*($evaluated_answers{'AnSwEr3'}->{score}); + + + $problem_result{score} = $total; + # increase recorded score if the current score is greater. + $problem_state{recorded_score} = $problem_result{score} if $problem_result{score} > $problem_state{recorded_score}; + + + $problem_state{num_of_correct_ans}++ if $total == 1; + $problem_state{num_of_incorrect_ans}++ if $total < 1 ; + (~~%problem_result, ~~%problem_state); + +} + + +ENDDOCUMENT(); # This should be the last executable line in the problem. + --- /dev/null +++ courses.dist/modelCourse/templates/setDemo/nsc2s10p2.pg.bak @@ -0,0 +1,143 @@ +################################################################## +##########Date:: 9-1-101, 19:17:23################ + + + +#DESCRIPTION +# Identify the graphs of the function and the derivative +#ENDDESCRIPTION + +#KEYWORDS('derivatives', 'graphs') +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( + "PGbasicmacros.pl", + "PGchoicemacros.pl", + "PGanswermacros.pl", + "PGauxiliaryFunctions.pl", + "PGgraphmacros.pl" +); + +TEXT(beginproblem()); +$showPartialCorrectAnswers = 0; + +$a=random(0, 6.3, .1); +$b=random(1.1, 1.5, .1); + +$dom = 4; +@slice = NchooseK(3,3); + +@colors = ("blue", "red", "green"); +@sc = @colors[@slice]; #scrambled colors +@sa = ('A','B','C')[@slice]; + + +$f = "sin($a+$b*cos(x)) for x in <-$dom,$dom> using color:$sc[0] and weight:2"; +$fp = "cos($a+$b*cos(x))*(-$b)*sin(x) for x in <-$dom,$dom> using color=$sc[1] and weight:2"; +$fpp = " -sin($a+$b*cos(x))*$b*$b*sin(x)*sin(x) + cos($a+$b*cos(x))*(-$b)*cos(x) for x in <-$dom,$dom> using color=$sc[2] and weight=2"; + +$graph = init_graph(-4,-4,4,4,'axes'=>[0,0],'grid'=>[8,8]); + +($fRef,$fpRef,$fppRef) = plot_functions( $graph, + $f,$fp,$fpp + ); + +# create labels + +$label_point=-0.75; +$label_f = new Label ( $label_point,&{$fRef->rule}($label_point),$sa[0],"$sc[0]",'left') ; + # NOTE: $fRef->rule is a reference to the subroutine which calculates the + # function. It was defined in the output of plot_functions. It is used here + # to calculate the y value of the label corresponding to the function, + # and below to find the y values for the labels corresponding to the + # first and second derivatives. + +$label_fp = new Label ( $label_point,&{$fpRef->rule}($label_point),$sa[1],"$sc[1]",'left') ; +$label_fpp = new Label ( $label_point,&{$fppRef->rule}($label_point),$sa[2],"$sc[2]",'left'); + +# insert the labels into the graph + +$graph->lb($label_f,$label_fp,$label_fpp); + +BEGIN_TEXT +\{ image(insertGraph($graph))\}$BR +Identify the graphs A (blue), B( red) and C (green) as the graphs of a function and its +derivatives:$PAR +\{ans_rule(4)\} is the graph of the function $PAR +\{ans_rule(4)\} is the graph of the function's first derivative $PAR +\{ans_rule(4)\} is the graph of the function's second derivative $PAR +END_TEXT +ANS(std_str_cmp_list( @sa ) ); + +ENDDOCUMENT(); # This should be the last executable line in the problem. +################################################################## +##########Date:: 9-1-101, 19:18:0################ + + +#DESCRIPTION +# Identify the graphs of the function and the derivative +#ENDDESCRIPTION + +#KEYWORDS('derivatives', 'graphs') +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( + "PGbasicmacros.pl", + "PGchoicemacros.pl", + "PGanswermacros.pl", + "PGauxiliaryFunctions.pl", + "PGgraphmacros.pl" +); + +TEXT(beginproblem()); +$showPartialCorrectAnswers = 0; + +$a=random(0, 6.3, .1); +$b=random(1.1, 1.5, .1); + +$dom = 4; +@slice = NchooseK(3,3); + +@colors = ("blue", "red", "orange"); +@sc = @colors[@slice]; #scrambled colors +@sa = ('A','B','C')[@slice]; + + +$f = "sin($a+$b*cos(x)) for x in <-$dom,$dom> using color:$sc[0] and weight:2"; +$fp = "cos($a+$b*cos(x))*(-$b)*sin(x) for x in <-$dom,$dom> using color=$sc[1] and weight:2"; +$fpp = " -sin($a+$b*cos(x))*$b*$b*sin(x)*sin(x) + cos($a+$b*cos(x))*(-$b)*cos(x) for x in <-$dom,$dom> using color=$sc[2] and weight=2"; + +$graph = init_graph(-4,-4,4,4,'axes'=>[0,0],'grid'=>[8,8]); + +($fRef,$fpRef,$fppRef) = plot_functions( $graph, + $f,$fp,$fpp + ); + +# create labels + +$label_point=-0.75; +$label_f = new Label ( $label_point,&{$fRef->rule}($label_point),$sa[0],"$sc[0]",'left') ; + # NOTE: $fRef->rule is a reference to the subroutine which calculates the + # function. It was defined in the output of plot_functions. It is used here + # to calculate the y value of the label corresponding to the function, + # and below to find the y values for the labels corresponding to the + # first and second derivatives. + +$label_fp = new Label ( $label_point,&{$fpRef->rule}($label_point),$sa[1],"$sc[1]",'left') ; +$label_fpp = new Label ( $label_point,&{$fppRef->rule}($label_point),$sa[2],"$sc[2]",'left'); + +# insert the labels into the graph + +$graph->lb($label_f,$label_fp,$label_fpp); + +BEGIN_TEXT +\{ image(insertGraph($graph))\}$BR +Identify the graphs A (blue), B( red) and C (green) as the graphs of a function and its +derivatives:$PAR +\{ans_rule(4)\} is the graph of the function $PAR +\{ans_rule(4)\} is the graph of the function's first derivative $PAR +\{ans_rule(4)\} is the graph of the function's second derivative $PAR +END_TEXT +ANS(std_str_cmp_list( @sa ) ); + +ENDDOCUMENT(); # This should be the last executable line in the problem. |