Web Conference Sample Problem
From WeBWorK
Prep 2011 Main Page > Web Conference 1 > Web Conference Sample Problem
This is a very simple sample WeBWorK problem. Note that it consists of five sections:
- Tagging information - This is a section with commented information that is used if the problem is added to the National Problem Library (NPL), and otherwise serves to describe the problem and its origin.
- Initialization - This is the first section of the problem file that is actually executed, and starts the problem (the
DOCUMENT();
line), loads requisite macros, and runs theTEXT(beginproblem());
command to set up basic problem information. - Problem Setup - This section of the file defines variables and the information that is needed to define the problem and its answer.
- Main Text - This is the text that is displayed to the student when s/he is working the problem.
- Answer Evaluation and Solution - This section of the file determines how the student's answer is checked, and, if it is included, provides a full solution to the problem so that s/he can see how it should be worked once the problem set's due date has passed.
#################################### # Tagging Information ## DESCRIPTION ## Equations for lines ## ENDDESCRIPTION ## KEYWORDS('algebra','line','equationfor line') ## DBsubject('Algebra') ## DBchapter('Basic Algebra') ## DBsection('Lines') ## Date('05/26/2011') ## Author('Paul Pearson') ## Institution('Fort Lewis College') ## TitleText1('Intermediate Algebra') ## EditionText1('3') ## AuthorText1('Dewey, Cheatham, and Howe') ## Section1('2.4') ## Problem1('14') #################################### # Initialization DOCUMENT(); loadMacros( "PGstandard.pl", "MathObjects.pl", "AnswerFormatHelp.pl", ); TEXT(beginproblem()); #################################### # Setup Context("Numeric"); $a = non_zero_random(-5,5,1); $b = random(2,9,1); #################################### # Main text Context()->texStrings; BEGIN_TEXT Find an equation for a line through the point \( ($a,$b) \) and the origin. $BR $BR \( y = \) \{ ans_rule(20) \} \{ AnswerFormatHelp("formulas") \} END_TEXT Context()->normalStrings; #################################### # Answer evaluation and solution $showPartialCorrectAnswers= 1; ANS(Formula("($b/$a) x")->cmp()); COMMENT('Uses MathObjects'); ENDDOCUMENT();