WeBWorK Problems

Error in popup menus when answer chosen is the word Value

Error in popup menus when answer chosen is the word Value

by Murphy Waggoner -
Number of replies: 0
Here is a strange error.  See code below and screen shot attached.

I have 5 popup questions all with text answers.  One of the possible answers in the drop down menu is the word 'Value'.  When it is chosen as the answer and the answers are checked, regardless of whether it is the correct or an incorrect answer, there is an error.

The error message the student sees is 'Can't locate object method "inContext" via package "main" '

I can resolve the problem by removing the capitals and using the word 'value' instead of 'Value'.

Details
Windows machine, Windows 7, ww_version: 2.10 | pg_version: 2.10 

Enjoy!

Code

##DESCRIPTION
##  Math of Art: the elements of art 
##ENDDESCRIPTION

##KEYWORDS('art', 'definitions')

## DBsubject('Math of Art')
## DBchapter('Vocabulary of art')
## DBsection('Elements of art')
## Date('4/8/2016')
## Author('M. E. Waggoner')
## Institution('Simpson College')
## TitleText1('')
## EditionText1('')
## AuthorText1('')
## Section1('')
## Problem1('')

########################################################################

# to ensure that students do not just guess, limit the number of attempts
# it is recommended that the number of attempts not be 1, so that students can learn, but not be more than 3, so that they must work at answering the questions.

DOCUMENT();      

loadMacros(
"PGstandard.pl",
"parserPopUp.pl",
 "PGcourse.pl",      # Customization file for the course
);


# Print problem number and point value (weight) for the problem
TEXT(beginproblem());


##############################################################
#
#  Setup
#
#
Context("Numeric");

# the arguments of PopUp are the elements of art, 
#    correct answer
$popup1 = PopUp(["?", "Texture", "Space", "Shape", "Line", "Value", "Color", "Form"], "Value");
$popup2 = PopUp(["?", "Texture", "Space", "Shape", "Line", "Value", "Color", "Form"], "Space");
$popup3 = PopUp(["?", "Texture", "Space", "Shape", "Line", "Value", "Color", "Form"], "Texture");
$popup4 = PopUp(["?", "Texture", "Space", "Shape", "Line", "Value", "Color", "Form"], "Shape");
$popup5 = PopUp(["?", "True", "False"], "False");

##############################################################
#
#  Text
#
#

Context()->texStrings;
BEGIN_TEXT


1) \{ $popup1->menu() \}  is an element of art that refers to lightness and darkness in an artwork.
$BR
$BR
2) \{ $popup2->menu() \} is an element of art that refers the distance or area between, around, or within things.
$BR
$BR
3)  The element or art that refers to the tactile qualities, either actual or implied, is  \{ $popup2->menu() \}.
$BR
$BR
4)  \{ $popup4->menu() \} may be geometric or organic.
$BR
$BR
5)  \{ $popup5->menu() \}:  All good works of art will demonstrate all the elements of art.

END_TEXT
Context()->normalStrings;

##############################################################
#
#  Answers
#
#


# Show which answers are correct and which ones are incorrect
$showPartialCorrectAnswers = 1;

ANS( $popup1->cmp() );
ANS( $popup2->cmp() );
ANS( $popup3->cmp() );
ANS( $popup4->cmp() );
ANS( $popup5->cmp() );

Context()->texStrings;
SOLUTION(EV3(<<'END_SOLUTION'));
$PAR SOLUTION $PAR

1) Value is an element of art that refers to lightness and darkness in an artwork.  White is the lightest value; black is the darkest. The value halfway between these extremes is called middle gray. 
$BR
$BR
2) Space is an element of art that refers the distance or area between, around, or within things. Space is an area that an artist provides for a particular purpose. Space includes the background, foreground and middle ground.  There are two kinds of space: negative space and positive space.
$BR
$BR
3)  The element or art that refers to the tactile qualities, either actual or implied, is texture.  Artists might depict texture, such as flowing hair, on a flat surface, or they might use the texture of paint or other media to create a tactile texture on the surface as well.
$BR
$BR
4)  Shape may be geometric or organic.  Geometric shapes are precise and regular, like squares, rectangles, and triangles. They are often found in human-made things, like buildings and machines while organic shapes are found in nature. These shapes may look like leaves, flowers, clouds—things that grow, flow, and move. 
$BR
$BR
5)  The statement "All good works of art will demonstrate all the elements of art" is false.  Think of the elements of art as ingredients; just as good food does not require all possible ingredients and the chef will pick and choose, the artist will choose some elements but not others.


END_SOLUTION
Context()->normalStrings;
ENDDOCUMENT();



ENDDOCUMENT();        

Attachment New_Picture.jpg