Difference between revisions of "EssayAnswer1"

From WeBWorK_wiki
Jump to navigation Jump to search
m
(link to pg source on github)
Line 6: Line 6:
 
</p>
 
</p>
 
* Download file: [[File:EssayAnswer1.txt]] (change the file extension from txt to pg when you save it)
 
* Download file: [[File:EssayAnswer1.txt]] (change the file extension from txt to pg when you save it)
* File location in OPL: <code>FortLewis/Authoring/Templates/Misc/EssayAnswer1.pg</code>
+
* 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]
   
 
<br clear="all" />
 
<br clear="all" />

Revision as of 22:58, 15 June 2013

Essay answer

Click to enlarge

This PG code shows how to write a question whose answer is an essay. This feature was introduced in Fall 2012.


Templates by Subject Area

PG problem file Explanation

Problem tagging data

Problem tagging:

DOCUMENT(); 
loadMacros(
"PGstandard.pl",
"MathObjects.pl",
"parserPopUp.pl",
"PGessaymacros.pl",
"PGcourse.pl",
);
TEXT(beginproblem());

$showPartialCorrectAnswers = 0;

install_problem_grader(~~&std_problem_grader);

Initialization: Use the PGessaymacros.pl for the essay answer and parserPopUp.pl for the multiple choice drop down menu. Setting $showPartialCorrectAnswers = 0; means that students will not receive feedback on whether their answers are correct. The all-or-nothing problem grader (the standard problem grader) is used in order to withhold assigning any credit when the student submits an answer. This allows the professor to manually determine what percentage the student should get. If the standard problem grader was not used here, then the default problem grader (the average problem grader) would award 50 percent credit to students who answer the multiple choice question correct.

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.

Context()->texStrings;
BEGIN_TEXT
Answer the following true / false question and 
then explain your answer.  Your answers will be 
read and graded manually at a later time.
$BR
$BR
\{ $popup->menu() \} 
For all real numbers \( x \), \( $f1 = $f2 \).
$BR
$BR
Please explain your reasoning in the answer box below.  
$BR
\{ essay_box() \}
END_TEXT
Context()->normalStrings;

Main Text: Clearly communicate to the student the expectations of the problem and how it will be graded. The essay_box() is resizable.

ANS( $popup->cmp() );
ANS( essay_cmp() );

Answer Evaluation: The essay answer is graded manually by the professor. Hand grading is done by clicking on Statistics in Instructor Tools menu, selecting the homework set, and clicking the Needs grading or Regrade links under. For more details, please see the initial blog announcement about essay answers.

Note that essay_cmp() is not associated with any object (i.e., it is not $essay->cmp()).

Context()->texStrings;
BEGIN_SOLUTION
${PAR}SOLUTION:${PAR}
Solution explanation goes here.
END_SOLUTION
Context()->normalStrings;

COMMENT('MathObject version.');

ENDDOCUMENT();

Solution:

Templates by Subject Area