Difference between revisions of "EssayAnswer1"
Paultpearson (talk | contribs) (Add link to PGML version in OPL) |
(switch to PGML and remove answerFormatHelp.pl macro) |
||
Line 5: | Line 5: | ||
This PG code shows how to write a question whose answer is an essay. This feature was introduced in [http://webworkgoehle.blogspot.com/2012/09/essay-answers-in-webwork.html Fall 2012]. |
This PG code shows how to write a question whose answer is an essay. This feature was introduced in [http://webworkgoehle.blogspot.com/2012/09/essay-answers-in-webwork.html Fall 2012]. |
||
</p> |
</p> |
||
− | * File location in OPL: [https://github.com/openwebwork/webwork-open-problem-library/blob/master/OpenProblemLibrary/FortLewis/Authoring/Templates/Misc/EssayAnswer1.pg FortLewis/Authoring/Templates/Misc/EssayAnswer1.pg] |
+ | <!--* File location in OPL: [https://github.com/openwebwork/webwork-open-problem-library/blob/master/OpenProblemLibrary/FortLewis/Authoring/Templates/Misc/EssayAnswer1.pg FortLewis/Authoring/Templates/Misc/EssayAnswer1.pg] --> |
* PGML location in OPL: [https://github.com/openwebwork/webwork-open-problem-library/blob/master/OpenProblemLibrary/FortLewis/Authoring/Templates/Misc/EssayAnswer1_PGML.pg FortLewis/Authoring/Templates/Misc/EssayAnswer1_PGML.pg] |
* PGML location in OPL: [https://github.com/openwebwork/webwork-open-problem-library/blob/master/OpenProblemLibrary/FortLewis/Authoring/Templates/Misc/EssayAnswer1_PGML.pg FortLewis/Authoring/Templates/Misc/EssayAnswer1_PGML.pg] |
||
Line 16: | Line 16: | ||
<tr valign="top"> |
<tr valign="top"> |
||
− | <th> PG problem file </th> |
+ | <th width="50%"> PG problem file </th> |
<th> Explanation </th> |
<th> Explanation </th> |
||
</tr> |
</tr> |
||
Line 41: | Line 41: | ||
<pre> |
<pre> |
||
DOCUMENT(); |
DOCUMENT(); |
||
− | loadMacros( |
||
+ | loadMacros('PGstandard.pl','MathObjects.pl','parserPopUp.pl', |
||
− | "PGstandard.pl", |
||
+ | 'PGessaymacros.pl','PGML.pl','PGcourse.pl'); |
||
− | "MathObjects.pl", |
||
− | "parserPopUp.pl", |
||
− | "PGessaymacros.pl", |
||
− | "PGcourse.pl", |
||
− | ); |
||
TEXT(beginproblem()); |
TEXT(beginproblem()); |
||
$showPartialCorrectAnswers = 0; |
$showPartialCorrectAnswers = 0; |
||
− | |||
− | install_problem_grader(~~&std_problem_grader); |
||
</pre> |
</pre> |
||
</td> |
</td> |
||
Line 81: | Line 74: | ||
<td style="background-color:#ffffdd;border:black 1px dashed;"> |
<td style="background-color:#ffffdd;border:black 1px dashed;"> |
||
<pre> |
<pre> |
||
− | Context( |
+ | Context('Numeric'); |
$popup = PopUp( |
$popup = PopUp( |
||
− | [ |
+ | [ 'Choose', 'True', 'False' ], # choices |
− | + | 'False' # corect answer |
|
); |
); |
||
+ | |||
$a = random(2,5,1); |
$a = random(2,5,1); |
||
Line 107: | Line 101: | ||
<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 |
||
+ | Answer the following true / false question and |
||
− | Answer the following true / false question and |
||
+ | then explain your answer. Your answers will be |
||
− | then explain your answer. Your answers will be |
||
read and graded manually at a later time. |
read and graded manually at a later time. |
||
− | $BR |
||
+ | |||
− | $BR |
||
+ | [@ $popup->menu() @]* |
||
− | \{ $popup->menu() \} |
||
+ | For all real numbers [` x `], [` [$f1] = [$f2] `]. |
||
− | For all real numbers \( x \), \( $f1 = $f2 \). |
||
+ | |||
− | $BR |
||
+ | Please explain your reasoning in the answer box below. |
||
− | $BR |
||
+ | [@ essay_box(8,60) @]* |
||
− | Please explain your reasoning in the answer box below. |
||
+ | END_PGML |
||
− | $BR |
||
− | \{ essay_box(8,60) \} |
||
− | END_TEXT |
||
− | Context()->normalStrings; |
||
</pre> |
</pre> |
||
<td style="background-color:#ffcccc;padding:7px;"> |
<td style="background-color:#ffcccc;padding:7px;"> |
||
Line 161: | Line 150: | ||
<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(); |
Revision as of 09:39, 4 April 2023
Essay answer
This PG code shows how to write a question whose answer is an essay. This feature was introduced in Fall 2012.
- PGML location in OPL: FortLewis/Authoring/Templates/Misc/EssayAnswer1_PGML.pg
PG problem file | Explanation |
---|---|
Problem tagging: |
|
DOCUMENT(); loadMacros('PGstandard.pl','MathObjects.pl','parserPopUp.pl', 'PGessaymacros.pl','PGML.pl','PGcourse.pl'); TEXT(beginproblem()); $showPartialCorrectAnswers = 0; |
Initialization:
Use the |
Context('Numeric'); $popup = PopUp( [ 'Choose', 'True', 'False' ], # choices 'False' # corect answer ); $a = random(2,5,1); $f1 = Compute("ln(x (x-$a))"); $f2 = Compute("ln(x) + ln(x-$a)"); |
Setup: Nothing out of the ordinary happens here. |
BEGIN_PGML Answer the following true / false question and then explain your answer. Your answers will be read and graded manually at a later time. [@ $popup->menu() @]* For all real numbers [` x `], [` [$f1] = [$f2] `]. Please explain your reasoning in the answer box below. [@ essay_box(8,60) @]* END_PGML |
Main Text: Clearly communicate to the student the expectations
of the problem and how it will be graded. The |
ANS( $popup->cmp() ); ANS( essay_cmp() ); |
Answer Evaluation: The essay answer is graded manually by the professor. Hand grading is done either (1) by clicking on the homework set and clicking the Grade problem link in the rightmost column of the problem list or (2) by clicking on Statistics inInstructor Tools menu, selecting the homework set, and clicking the Needs grading or Regrade links under the problem number. For more details, please see the initial blog announcement about essay answers.
Note that |
BEGIN_PGML_SOLUTION Solution explanation goes here. END_PGML_SOLUTION ENDDOCUMENT(); |
Solution: |