Writing Your Own Homework Problems Using PGML

From WeBWorK
(Difference between revisions)
Jump to: navigation, search
(Typical PGML Problem Example)
(Typical PGML Problem Example)
Line 30: Line 30:
 
   $showPartialCorrectAnswers = 1;
 
   $showPartialCorrectAnswers = 1;
 
   ######################################################################
 
   ######################################################################
 
 
   Context("Numeric") ;  
 
   Context("Numeric") ;  
 
   Context()->flags->set(tolerance => 0.01);
 
   Context()->flags->set(tolerance => 0.01);
 
 
   BEGIN_PGML
 
   BEGIN_PGML
 
   Simplify [`2x + 4x + 5x`].
 
   Simplify [`2x + 4x + 5x`].
 
 
   [____________]{Compute("11*x")}
 
   [____________]{Compute("11*x")}
 
   END_PGML
 
   END_PGML
 
 
   ######################################################################
 
   ######################################################################
 
   ENDDOCUMENT();
 
   ENDDOCUMENT();
  
 
asdf asdf a
 
asdf asdf a

Revision as of 02:58, 21 November 2012

(Note: This page is under construction by Christian Seberino... Nov 21, 2012. )


Contents

Writing Your Own Homework Problems Using PGML

Introduction

  • PGML makes writing your own homework problems so much nicer than what came before. Many chores which previously were difficult are now easier, if not automated away. The best part is that there is little to learn to get started. PGML is so elegant and intuitive that you can often get started by simply viewing and tweaking existing PGML based problem files.


So Why Isn't PGML Used Everywhere If It Is So Great?

  • If PGML is so great, you may wonder why you don't see it used everwhere in the publically available WebWork problem libraries. Many of those libraries were written before PGML existed. Since many newcomers base their own custom problems on those same libraries, there is a lot (and a growing!) amount of problems that are not PGML based. However, now that you know the truth you can be one of the fortunate ones to start using PGML now. Even better is the fact that you can convert non-PGML based problems you like to PGML often quite easily.


Typical PGML Problem Example

  DOCUMENT();
  loadMacros(
    "PGstandard.pl",
    "PGML.pl",
    "MathObjects.pl",
    "PGcourse.pl",
    "parserNumberWithUnits.pl",
    "contextArbitraryString.pl",
    "parserMultiAnswer.pl",
    "parserPopUp.pl",
    "contextInequalities.pl",
    "PGgraphmacros.pl",
  );
  TEXT(beginproblem());
  $showPartialCorrectAnswers = 1;
  ######################################################################
  Context("Numeric") ; 
  Context()->flags->set(tolerance => 0.01);
  BEGIN_PGML
  Simplify [`2x + 4x + 5x`].
  [____________]{Compute("11*x")}
  END_PGML
  ######################################################################
  ENDDOCUMENT();

asdf asdf a

follow us