Difference between revisions of "Web Conference Sample Problem"

From WeBWorK_wiki
Jump to navigation Jump to search
(Created page with 'Prep 2011 Main Page > Web Conference 1 > Web Conference Sample Problem #################################### # Tagging Information …')
 
m (added tag)
 
(2 intermediate revisions by one other user not shown)
Line 1: Line 1:
 
[[PREP_2011|Prep 2011 Main Page]] > [[PREP_2011_Web_Conference_I|Web Conference 1]] > Web Conference Sample Problem
 
[[PREP_2011|Prep 2011 Main Page]] > [[PREP_2011_Web_Conference_I|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 <code>DOCUMENT();</code> line), loads requisite macros, and runs the <code>TEXT(beginproblem());</code> 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.
   
 
####################################
 
####################################
Line 58: Line 65:
 
COMMENT('Uses MathObjects');
 
COMMENT('Uses MathObjects');
 
ENDDOCUMENT();
 
ENDDOCUMENT();
  +
  +
[[Category:PREP 2011]]

Latest revision as of 13:06, 16 June 2021

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:

  1. 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.
  2. 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 the TEXT(beginproblem()); command to set up basic problem information.
  3. Problem Setup - This section of the file defines variables and the information that is needed to define the problem and its answer.
  4. Main Text - This is the text that is displayed to the student when s/he is working the problem.
  5. 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();