Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # DESCRIPTION
- # Find the slope, intercept, and a point on a line.
- # This is just an example;
- # I'm well aware that the third part could be waiting for a "no"
- # when the correct answer would be "yes."
- # ENDDESCRIPTION
- ## DBsubject('Algebra')
- ## DBchapter('Linear Equations')
- ## DBsection('Graphing')
- ## KEYWORDS('linear','graph')
- ## TitleText1('')
- ## EditionText1('')
- ## AuthorText1('')
- ## Section1('')
- ## Problem1('')
- ## Author('')
- ## Institution('')
- DOCUMENT();
- loadMacros(
- "PGstandard.pl",
- "MathObjects.pl",
- "PGchoicemacros.pl",
- );
- Context("Numeric");
- $m=random(-10,10-1);
- $b=random(-10,10-1);
- $x=random(-10,10-1);
- if(random(0,1,1))
- {
- $y=$m*$x+$b;
- $c="Yes";
- }
- else
- {
- $y=random(-10,10,1);
- $c="No";
- }
- $line=Compute("$m x+$b");
- $m=Compute("$m");
- $b=Compute("$b");
- $mc = new_multiple_choice();
- $mc->qa("Is the point \(P($x,$y)\) on this line?",$c);
- $mc->makeLast("Yes","No");
- TEXT(beginproblem());
- Context()->texStrings;
- BEGIN_TEXT
- Given the line \(y=$line\),$BR
- What is the slope? \{ans_rule(2)\} $BR
- What is the y-intercept? \{ans_rule(2)\} $BR
- \{ $mc->print_q() \}
- $BR
- \{ $mc->print_a() \}
- END_TEXT
- Context()->normalStrings;
- ANS($m->cmp());
- ANS($b->cmp());
- ANS( radio_cmp( $mc->correct_ans() ) );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement