WeBWork Problem Authoring and Development 2 — Questions and Answers
Question 1: In WeBWork PG code, what does the `BEGIN_PGML ... END_PGML` block define?
- The problem's metadata and OPL tags
- The problem text and answer blanks formatted using PGML syntax (Correct answer)
- The block where random variables are initialized
- The grading rubric and partial credit rules
Correct answer: The problem text and answer blanks formatted using PGML syntax
BEGIN_PGML ... END_PGML marks the student-facing problem text section where PGML syntax is used to format mathematical content and embed answer entry fields.
Question 2: How do you insert an answer blank in a PGML problem for a numerical answer stored in `$ans`?
- [_____]{$ans} (Correct answer)
- <input name='$ans'>
- ANSWER($ans)
- [ans]{$ans}
Correct answer: [_____]{$ans}
In PGML, [_____]{$ans} creates an answer blank linked to the variable $ans, where the underscores represent the visual width of the input field.
Question 3: What is the role of `Context('Numeric')` in a WeBWork PG problem?
- It sets the display to show numeric answers only in the gradebook
- It configures the mathematical parsing environment for numeric expressions and answers (Correct answer)
- It restricts students to entering only integers
- It formats all output numbers to two decimal places
Correct answer: It configures the mathematical parsing environment for numeric expressions and answers
Context('Numeric') sets up the mathematical parsing environment, controlling what operations and functions are valid when WeBWork evaluates student answers.
Question 4: What is a 'seed' in the context of WeBWork problem randomization?
- A keyword used to tag problems in the OPL
- A number that initializes the random number generator to produce consistent but unique student versions (Correct answer)
- The default placeholder value shown in an answer blank
- A template identifier for importing problems from external sources
Correct answer: A number that initializes the random number generator to produce consistent but unique student versions
Each student is assigned a unique seed that initializes random variable generation, ensuring their problem has specific values that differ from other students but remain consistent on reload.
Question 5: Which PG macro enables assigning different point weights to individual parts of a multi-part problem?
- partialCredit.pl
- weightedGrader.pl (Correct answer)
- splitPoints.pl
- multiGrade.pl
Correct answer: weightedGrader.pl
weightedGrader.pl allows problem authors to assign custom percentage weights to each answer blank in a multi-part problem.
Question 6: What PG block syntax is used to define a hint that WeBWork can display conditionally after multiple failed attempts?
- HINT() function call
- showHint() with attempt count
- BEGIN_HINT ... END_HINT block (Correct answer)
- displayHint() with threshold parameter
Correct answer: BEGIN_HINT ... END_HINT block
BEGIN_HINT ... END_HINT defines hint text that WeBWork displays conditionally based on the number of attempts, as configured in course settings.
Question 7: How can tolerance be specified when checking an approximate numerical answer using MathObjects in WeBWork?
- setTolerance(0.01) called on the context
- approx(value, tolerance) function
- Real(5)->with(tolerance => 0.01) (Correct answer)
- checkTol(ans, 0.01) in the answer section
Correct answer: Real(5)->with(tolerance => 0.01)
MathObjects like Real() can have tolerance set using the ->with(tolerance => value) method, allowing answers within a specified range to be accepted as correct.
In WeBWork PG code, what does the `BEGIN_PGML ...
END_PGML` block define?