FullProblemTemplate: Difference between revisions

From WeBWorK_wiki
Jump to navigation Jump to search
No edit summary
(switch to PGML and remove answerFormatHelp.pl macro)
 
(10 intermediate revisions by 2 users not shown)
Line 1: Line 1:
<h2>Insert Title Here</h2>
<h2>Insert Title Here</h2>


<p style="background-color:#eeeeee;border:black solid 1px;padding:3px;">
[[File:GraphicsFilename1.png|300px|thumb|right|Click to enlarge]]
<p style="background-color:#f9f9f9;border:black solid 1px;padding:3px;">
This PG code shows how to ...
This PG code shows how to ...
<ul>
<li>Download file: [[File:filename.txt]] (change the file extension from txt to pg)</li>
<li>File location in NPL: <code>NationalProblemLibrary/FortLewis/Authoring/Templates/...</code></li>
</ul>
</p>
</p>
<!--* File location in OPL: [https://github.com/openwebwork/webwork-open-problem-library/blob/master/OpenProblemLibrary/FortLewis/Authoring/Templates/ FortLewis/Authoring/Templates/] -->


<br clear="all" />
<p style="text-align:center;">
<p style="text-align:center;">
[[SubjectAreaTemplates|Templates by Subject Area]]
[[SubjectAreaTemplates|Templates by Subject Area]]
Line 16: 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 40:
<pre>
<pre>
DOCUMENT();
DOCUMENT();
loadMacros(
 
"PGstandard.pl",
loadMacros('PGstandard.pl','MathObjects.pl','PGML.pl');
"MathObjects.pl",
 
"AnswerFormatHelp.pl",
);
TEXT(beginproblem());
TEXT(beginproblem());
</pre>
</pre>
Line 79: 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 118: Line 95:
<td style="background-color:#ddddff;border:black 1px dashed;">
<td style="background-color:#ddddff;border:black 1px dashed;">
<pre>
<pre>
 
BEGIN_PGML_SOLUTION
Context()->texStrings;
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();
Line 136: Line 107:
</td>
</td>
</tr>
</tr>
</table>
</table>


Line 142: Line 114:
</p>
</p>


[[Category:Top]]
[[Category:Sample Problems]]
[[Category:Authors]]
[[Category:Subject Area Templates]]

Latest revision as of 15:56, 4 April 2023

Insert Title Here

File:GraphicsFilename1.png
Click to enlarge

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