[ww-bugs] Bug 2650: New: parserRadioButtons causing duplication in mathematics
bugzilla-daemon at webwork.maa.org
bugzilla-daemon at webwork.maa.org
Wed Jun 26 17:28:13 EDT 2013
http://bugs.webwork.maa.org/show_bug.cgi?id=2650
Summary: parserRadioButtons causing duplication in mathematics
Product: Problem libraries
Version: unspecified
Platform: PC
URL: /opt/webwork/courses/hope_math_131_pearson/templates/H
ope/Calc1/00-00-Essays/GQ_Limits_11.pg_with_problemSee
d=123456
OS/Version: Windows
Status: NEW
Severity: enhancement
Priority: P5
Component: Library
AssignedTo: jj at asu.edu
ReportedBy: paultpearson at gmail.com
CC: dpvc at union.edu
Web browser ---
version:
Created an attachment (id=149)
--> (http://bugs.webwork.maa.org/attachment.cgi?id=149)
dupliation of math text in radio button list
Hi,
On the testcourses server:
Using mathematics \( stuff \) inside of an option that is part of a radio
buttons list causes duplication of the math text and some other errant
behavior. Below is the source code for the error. I have also attached a
screenshot.
Thanks!
Paul
###################################
# Initialization
DOCUMENT();
loadMacros(
"PGstandard.pl",
"MathObjects.pl",
"PGchoicemacros.pl",
#"PGgraphmacros.pl",
#"parserPopUp.pl",
"parserRadioButtons.pl",
"PGessaymacros.pl",
#"PGunion.pl",
"PGcourse.pl",
);
TEXT(beginproblem());
install_problem_grader(~~&std_problem_grader);
$showPartialCorrectAnswers = 0;
$refreshCachedImages = 1;
# $essay_instructions can be redefined globally by
# creating a string $essay_instructions in a macro
# file "PGcourse.pl" in the course templates/macros/
# directory.
if (!defined($essay_instructions)) {
$essay_instructions =
"Use complete sentences and correct grammar,
spelling, and punctuation. Be specific and
detailed. Write as if you were explaining the
answer to someone else in class.";
}
######################################
# Setup
Context("Numeric");
$a = random(200,299,1);
#do { $b = random(2,9,1); } until ($b != $a);
#SRAND(2); # fix the ordering in the multiple choice
$radio = RadioButtons(
["\( \displaystyle \lim_{x\to $a} f(x) \) cannot exist",
"\( \displaystyle \lim_{x\to $a} f(x) \) could be zero",
"\( \displaystyle \lim_{x\to $a} f(x) \) must approach \( \infty \)",
"None of the above"],
"\( \displaystyle \lim_{x\to $a} f(x) \) could be zero", # correct answer
last => ["None of the above"],
separator=>"$BR$BR"
);
#######################################
# Main text
Context()->texStrings;
BEGIN_TEXT
If a function \(f\) is not defined at \(x=$a\), then
$BR
$BR
\{ $radio->buttons() \}
$BR
$BR
In the answer box below, explain your reasoning for the choice you made above.
$essay_instructions
$BR
\{ essay_box(15,60) \}
END_TEXT
Context()->normalStrings;
#######################################
# Answer evaluation
ANS( $radio->cmp() );
ANS( essay_cmp() );
#######################################
# Solution
Context()->texStrings;
BEGIN_SOLUTION
\(f($a)\) need not be defined in order for \(\displaystyle{\lim_{x\rightarrow
$a}f(x)}\) to exist, and it does not have to approach \(\infty\). However, the
limit could be zero, for example consider \( f(x)=
0\) for all \(x \neq $a\), and \(f($a)\) not defined.
END_SOLUTION
Context()->normalStrings;
COMMENT('Rated Quick. Uses essay answer grader. Multiple choice answers are
always in the same order to make grading easier.');
ENDDOCUMENT();
--
Configure bugmail: http://bugs.webwork.maa.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are watching all bug changes.
More information about the webwork-bugs
mailing list