Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prevent a point on a graph being placed on the edge of window with invisible label #1179

Merged
merged 2 commits into from
Dec 19, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 8 additions & 12 deletions OpenProblemLibrary/Rochester/setAlgebra28ExpFunctions/ur_le_1_5.pg
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ DOCUMENT(); # This should be the first executable line in the problem.

loadMacros(
"PGstandard.pl",
"PGML.pl",
"PGchoicemacros.pl",
"PGgraphmacros.pl",
"PGnumericalmacros.pl",
Expand All @@ -30,8 +31,7 @@ TEXT(beginproblem());
$showPartialCorrectAnswers = 1;

$a = random(2,5,1);
$y = random(2,5,1);
if ($y == $a) {$y = $y+1;}
do {$y = random(2,5,1);} until ($y != $a);
$s = random(-1,1,2);
$b = ln($y/$a)/ln(2);
$a = $a*$s;
Expand All @@ -48,19 +48,15 @@ add_functions($graph1, $fn, $pt0, $pt1);
$label_0 = new Label ( 0.5,$a,"(0,$a)",'black','left','middle'); $graph1->lb($label_0);
$label_1 = new Label ( 1.5,$y,"(1,$y)",'black','left','middle'); $graph1->lb($label_1);

BEGIN_TEXT
BEGIN_PGML
Find the exponential function [`f(x)=a\cdot 2^{b x}`] whose graph is shown below

Find the exponential function \(f(x)=a\cdot 2^{b x}\) whose graph is shown below
$BR
\{ image(insertGraph($graph1), width=>200, height=>200) \}
$BR
\(a=\) \{ans_rule(20)\} $BR
\(b=\) \{ans_rule(20)\}
[!Graph of exponential function passing through points (0,[$a]) and (1,[$y])!]{$graph1}{width=>200, height=>200}

END_TEXT
* [`a=`][____________________]{$a}
* [`b=`][____________________]{$b}

ANS(num_cmp($a));
ANS(num_cmp($b));
END_PGML

ENDDOCUMENT(); # This should be the last executable line in the problem.