Difference between revisions of "FullProblemTemplate"

From WeBWorK_wiki
Jump to navigation Jump to search
m
(switch to PGML and remove answerFormatHelp.pl macro)
 
Line 5: Line 5:
 
This PG code shows how to ...
 
This PG code shows how to ...
 
</p>
 
</p>
* File location in OPL: [https://github.com/openwebwork/webwork-open-problem-library/blob/master/OpenProblemLibrary/FortLewis/Authoring/Templates/ FortLewis/Authoring/Templates/]
+
<!--* File location in OPL: [https://github.com/openwebwork/webwork-open-problem-library/blob/master/OpenProblemLibrary/FortLewis/Authoring/Templates/ FortLewis/Authoring/Templates/] -->
   
 
<br clear="all" />
 
<br clear="all" />
Line 15: Line 15:
   
 
<tr valign="top">
 
<tr valign="top">
<th> PG problem file </th>
+
<th style="width: 50%"> PG problem file </th>
 
<th> Explanation </th>
 
<th> Explanation </th>
 
</tr>
 
</tr>
Line 41: Line 41:
 
DOCUMENT();
 
DOCUMENT();
   
loadMacros(
 
  +
loadMacros('PGstandard.pl','MathObjects.pl','PGML.pl');
"PGstandard.pl",
 
"MathObjects.pl",
 
"AnswerFormatHelp.pl",
 
);
 
   
 
TEXT(beginproblem());
 
TEXT(beginproblem());
Line 80: Line 76:
 
<td style="background-color:#ffdddd;border:black 1px dashed;">
 
<td style="background-color:#ffdddd;border:black 1px dashed;">
 
<pre>
 
<pre>
Context()->texStrings;
 
  +
BEGIN_PGML
BEGIN_TEXT
 
 
Question text
 
Question text
$BR
 
  +
$BR
 
  +
Answer = [__]{$answer}
Answer =
 
  +
\{ ans_rule(20) \}
 
  +
END_PGML
\{ AnswerFormatHelp("formulas") \}
 
END_TEXT
 
Context()->normalStrings;
 
 
</pre>
 
</pre>
 
<td style="background-color:#ffcccc;padding:7px;">
 
<td style="background-color:#ffcccc;padding:7px;">
 
<p>
 
<p>
 
<b>Main Text:</b>
 
<b>Main Text:</b>
</p>
 
</td>
 
</tr>
 
 
<!-- Answer evaluation section -->
 
 
<tr valign="top">
 
<td style="background-color:#eeddff;border:black 1px dashed;">
 
<pre>
 
$showPartialCorrectAnswers = 1;
 
 
ANS( $answer->cmp() );
 
</pre>
 
<td style="background-color:#eeccff;padding:7px;">
 
<p>
 
<b>Answer Evaluation:</b>
 
 
</p>
 
</p>
 
</td>
 
</td>
Line 119: Line 95:
 
<td style="background-color:#ddddff;border:black 1px dashed;">
 
<td style="background-color:#ddddff;border:black 1px dashed;">
 
<pre>
 
<pre>
Context()->texStrings;
 
  +
BEGIN_PGML_SOLUTION
BEGIN_SOLUTION
 
${PAR}SOLUTION:${PAR}
 
 
Solution explanation goes here.
 
Solution explanation goes here.
END_SOLUTION
 
  +
END_PGML_SOLUTION
Context()->normalStrings;
 
 
COMMENT('MathObject version.');
 
   
 
ENDDOCUMENT();
 
ENDDOCUMENT();

Latest revision as of 11:56, 4 April 2023

Insert Title Here

This PG code shows how to ...


Templates by Subject Area

PG problem file Explanation

Problem tagging data

Problem tagging:

DOCUMENT();

loadMacros('PGstandard.pl','MathObjects.pl','PGML.pl');

TEXT(beginproblem());

Initialization:

Context("Numeric");

$answer = Compute("1");

Setup:

BEGIN_PGML
Question text

Answer = [__]{$answer}

END_PGML

Main Text:

BEGIN_PGML_SOLUTION
Solution explanation goes here.
END_PGML_SOLUTION

ENDDOCUMENT();

Solution:

Templates by Subject Area