### Testing "alttext"/Error Message when "testing" randomization

by Regina Souza -in the problem below is working? (Here at UM they are very concerned about accessibility issues).

2) I'm not sure how to interpret the error (see attachment)

I got when "testing the randomization" of the following problem:

# DESCRIPTION

# Recognizing values of the parameters k and p from the graph of y=k x^p (with p<0)

# ENDDESCRIPTION

#Right now stored at MAA-PREP2015

# Homework/Workshop3/Souza/problem4.pg

## DBsubject(’Precalculus’)

## DBchapter(’’)

## DBsection(’’)

## Date(’mm/dd/15’)

## Level(’’)

## Keywords(’’)

## Author(’Regina Souza’)

## Institution(’University of Montana, Missoula’)

## TitleText1(’Functions Modeling Change’)

## EditionText1(5)

## AuthorText1(’Connally’)

## Section1(11.1)

## Problem1()

DOCUMENT();

loadMacros("PGstandard.pl",

"MathObjects.pl",

"PGgraphmacros.pl",

"parserPopUp.pl",

"PGML.pl",

"PGcourse.pl");

Context("Numeric");

#Context()->variables->add(t => "Real");

TEXT(beginproblem());

$showPartialCorrectAnswers = 1;

$refreshCachedImages = 1;

Context("Numeric");

$pixels = 200;

# Create the canvas

$gr = init_graph(-1,-1,6,6, # xmin, ymin, xmax, ymax

axes=>[0,0], grid=>[7,7], size=>[$pixels, $pixels]);

$gr -> lb('reset'); # remove default labels

# axes labels

$gr->lb( new Label(5.5,0,'x', 'black', 'center', 'bottom'));

$gr->lb( new Label(0.1,5.5,'y', 'black', 'left', 'middle'));

# axes labels

foreach my $i (1..5) {

$gr->lb( new Label($i,0, $i, 'black', 'center', 'top'));

$gr->lb( new Label(-0.1,$i, $i, 'black', 'right', 'middle'));

}

# randomize the graph

$c = random(2,4,0.5);

# plot a function

$f = Formula("$c/x");

add_functions($gr, "$f for x in <0,6> using color:blue and weight:2");

install_problem_grader(~~&std_problem_grader);

$showPartialCorrectAnswers = 0;

$popup1 = PopUp(

["choose","a linear function","a quadratic function","an exponential function","a power function"],

"a power function",

);

$popup2 = PopUp(

["choose","0","1","2","2.5","3","3.5","4.0"],

"$c",

);

$popup3 = PopUp(

["choose","d is less than 0", "d is between 0 and 1", "d is greater than 1"],

"d is less than 0",

);

BEGIN_PGML

Consider the function given by the following graph:

>> [@ image(insertGraph($gr), width=>$pixels, height=>$pixels, tex_size=>900,extra_html_tags=>'alt="Graph of a decreasing, concave up function in quadrant I, which passes through (1,'.$c.') " ' ) @]*

[` f(x)=c\cdot x^d `] <<

a. Which type of function is this? This is [_________]{$popup1}

b. What is the value of [` c `] ? [` c = `][____]{$popup2}

c. Choose the best option for [` d `]: [_________]{$popup3}

END_PGML

BEGIN_PGML_SOLUTION

*SOLUTION*

a. This is [@ $popup1->correct_ans() @]* .

b. [` c = [$c] `], the value of the function at 1, and

c. [@ $popup3->correct_ans() @]* , since [` c>0 `] and the power function is decreasing when [` x>0 `].

END_PGML_SOLUTION

ENDDOCUMENT();

### Re: Testing "alttext"/Error Message when "testing" randomization

by Regina Souza -The correct choice must be one of the PopUp menu items The correct choice for popup2 is $c, which is randomly chosen between 2 and 4 with interval 0.5.

### Re: Testing "alttext"/Error Message when "testing" randomization

by Paul Pearson -### Re: Testing "alttext"/strings in popup/using OPL

by Regina Souza -Question 2 from last time: "Strings in pop-up"

Thanks! Living and learning!

Additional Questions (Regarding the OPL):

OPL-1) I would like some pointers on how to use the OPL. I have been using the problems for Connally. I'm having trouble finding what is out there. For example, in the github link you sent, I see that you have created problems Ch9-Tools (Ch9,3e which correspond to Ch11,4e). When I search (advanced search according to the text), this option is not available. Is there a way of directly accessing these problems with the library browser?

OPL-2) When I searched FMC4e, Ch 11, Section 1 there were 44 problems (most of them were listed multiple times). Is this a problem with the way my library browser is set up or is there are problem with the advanced search library browser?