Difference between revisions of "FullProblemTemplate"

From WeBWorK_wiki
Jump to navigation Jump to search
(switch to PGML and remove answerFormatHelp.pl macro)
 
(7 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 
<h2>Insert Title Here</h2>
 
<h2>Insert Title Here</h2>
   
[[File:Filename.png|300px|thumb|right|Click to enlarge]]
+
[[File:GraphicsFilename1.png|300px|thumb|right|Click to enlarge]]
<p style="background-color:#eeeeee;border:black solid 1px;padding:3px;">
+
<p style="background-color:#f9f9f9;border:black solid 1px;padding:3px;">
 
This PG code shows how to ...
 
This PG code shows how to ...
 
</p>
 
</p>
* Download file: [[File:Filename.txt]] (change the file extension from txt to pg when you save it)
 
  +
<!--* File location in OPL: [https://github.com/openwebwork/webwork-open-problem-library/blob/master/OpenProblemLibrary/FortLewis/Authoring/Templates/ FortLewis/Authoring/Templates/] -->
* File location in NPL: <code>FortLewis/Authoring/Templates/...</code>
 
   
  +
<br clear="all" />
 
<p style="text-align:center;">
 
<p style="text-align:center;">
 
[[SubjectAreaTemplates|Templates by Subject Area]]
 
[[SubjectAreaTemplates|Templates by Subject Area]]
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();
Line 143: Line 114:
 
</p>
 
</p>
   
[[Category:Top]]
+
[[Category:Sample Problems]]
[[Category:Authors]]
+
[[Category:Subject Area Templates]]

Latest revision as of 10: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