Difference between revisions of "PGLabs"

From WeBWorK_wiki
Jump to navigation Jump to search
Line 2: Line 2:
 
labs allow you to experiment with
 
labs allow you to experiment with
   
* [http://hosted2.webwork.rochester.edu/webwork2/cervone_course/setAIM-Talk/82/?login_practice_user=true writing problem fragments]
 
  +
* Write problem fragments in PG
* the [http://hosted2.webwork.rochester.edu/webwork2/cervone_course/PGML?login_practice_user=true| PG markup language syntax (PGML)] which simplifies the graphical layout
 
  +
of the mathematics question.
 
  +
http://hosted2.webwork.rochester.edu/webwork2/cervone_course/setAIM-Talk/82/?login_practice_user=true
  +
  +
For example:
  +
  +
Context("Numeric");
  +
$f = Compute("x^2-3x+5");
  +
$fp = $f->D; # calculate the derivative
  +
TEXT($fp->cmp->evaluate("2x-3")->pretty_print );
  +
  +
* On the last line <code>TEXT</code> prints the results of (reading from left to right)
  +
** Constructing the AnswerEvaluator for the contents of the Formula $fp
  +
** Evaluating the string "2x-3" using this AnswerEvaluator to produce an AnswerHash
  +
** Recursively representing the contents of the AnswerHash in a nice table
  +
  +
  +
  +
* Experiment with the new PG markup language syntax (PGML)] which simplifies the graphical layout
  +
of the mathematics question.
  +
  +
http://hosted2.webwork.rochester.edu/webwork2/cervone_course/PGML?login_practice_user=true
   
 
[[Category:Authors]]
 
[[Category:Authors]]

Revision as of 05:55, 17 June 2008

On-line labs for rendering of PG code. These two labs allow you to experiment with

  • Write problem fragments in PG

http://hosted2.webwork.rochester.edu/webwork2/cervone_course/setAIM-Talk/82/?login_practice_user=true

For example:

Context("Numeric");
$f = Compute("x^2-3x+5");
$fp = $f->D; # calculate the derivative
TEXT($fp->cmp->evaluate("2x-3")->pretty_print );
  • On the last line TEXT prints the results of (reading from left to right)
    • Constructing the AnswerEvaluator for the contents of the Formula $fp
    • Evaluating the string "2x-3" using this AnswerEvaluator to produce an AnswerHash
    • Recursively representing the contents of the AnswerHash in a nice table


  • Experiment with the new PG markup language syntax (PGML)] which simplifies the graphical layout

of the mathematics question.

http://hosted2.webwork.rochester.edu/webwork2/cervone_course/PGML?login_practice_user=true