Difference between revisions of "Authoring Best Practices"

From WeBWorK_wiki
Jump to navigation Jump to search
(Initial commit)
 
(More new stuff)
Line 1: Line 1:
 
== Perl Code ==
 
== Perl Code ==
In the future any problems submitted to the OPL will need to have `perltidy` applied to them.
+
In the future any problems submitted to the OPL will need to have <code>perltidy</code> applied to them.
   
 
== Macros ==
 
== Macros ==
Line 14: Line 14:
   
 
== MathObjects and PGML ==
 
== MathObjects and PGML ==
* Any newly authored problem should use MathObjects and PGML
+
* Any newly authored problem should use [[Introduction to MathOjects|MathObjects]] and [[Introduction to PGML|PGML]]
  +
  +
== Obsolete Techniques ==
 
{| class="wikitable"
 
{| class="wikitable"
 
|-
 
|-
 
! Obsolete Technique !! Current Technique
 
! Obsolete Technique !! Current Technique
 
|-
 
|-
| style="background-color:pink;"| Old answer checkers (e.g. `num_cmp`, `fun_cmp`, `str_cmp` || style="background-color:lightgreen;"| MathObjects answer checkers
+
| style="background-color:pink;"| Old answer checkers (e.g. <code>num_cmp</code>, <code>fun_cmp</code>, <code>str_cmp</code>) || style="background-color:lightgreen;"| [[Introduction_to_MathObjects#MathObject_Answer_Checkers|MathObjects answer checkers]]
 
|-
 
|-
| style="background-color:pink;"| `BEGIN_TEXT`/`END_TEXT` || style="background-color:lightgreen;"| `BEGIN_PGML`/`END_PGML`
 
  +
| style="background-color:pink;"| Old text processing (e.g. <code>BEGIN_TEXT</code>/<code>END_TEXT</code>, <code>BEGIN_SOLUTION</code>/<code>END_SOLUTION</code>, <code>BEGIN_HINT</code>/<code>END_HINT</code> || style="background-color:lightgreen;"| [[Introduction to PGML|PGML]]: <code>BEGIN_PGML_SOLUTION</code>/<code>END_PGML_SOLUTION</code>, <code>BEGIN_PGML_HINT</code>/<code>END_PGML_HINT</code>
 
|}
 
|}
   

Revision as of 14:50, 30 May 2023

Perl Code

In the future any problems submitted to the OPL will need to have perltidy applied to them.

Macros

  • Within the problem loadmacros should only be called once, with all of the necessary macros listed one per line.
  • Any macros that are not used by the problem should be removed when copying code from another problem.
  • The first macro loaded should be PGstandard.pl, which loads the following macros, so none of them should be explicitly loaded.
    • PG.pl
    • PGbasicmacros.pl
    • PGanswermacros.pl
    • PGauxiliaryFunctions.pl
    • customizeLaTeX.pl
  • The last macro loaded should be PGcourse.pl.

MathObjects and PGML

Obsolete Techniques

Obsolete Technique Current Technique
Old answer checkers (e.g. num_cmp, fun_cmp, str_cmp) MathObjects answer checkers
Old text processing (e.g. BEGIN_TEXT/END_TEXT, BEGIN_SOLUTION/END_SOLUTION, BEGIN_HINT/END_HINT PGML: BEGIN_PGML_SOLUTION/END_PGML_SOLUTION, BEGIN_PGML_HINT/END_PGML_HINT