Advertisement
Guest User

Untitled

a guest
Mar 22nd, 2012
37
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.82 KB | None | 0 0
  1. DOCUMENT();
  2.  
  3. loadMacros(
  4. "PGstandard.pl",
  5. "PGchoicemacros.pl",
  6. "MathObjects.pl",
  7. );
  8. $m=random(-10,10-1);
  9. $b=random(-10,10-1);
  10. $x=random(-10,10-1);
  11. if(random(0,1,1))
  12. {
  13. $y=$m*$x+$b;
  14. $c="Yes";
  15. }
  16. else
  17. {
  18. $y=random(-10,10,1);
  19. $c="No";
  20. }
  21. $line=Compute("$m x+$b");
  22. $m=Compute("$m");
  23. $b=Compute("$b");
  24.  
  25. $mc = new_multiple_choice();
  26. $mc->qa("Is the point \(P($x,$y)\) on this line?",$c);
  27.  
  28. $mc->makeLast("Yes","No");
  29. Context()->texStrings;
  30. BEGIN_TEXT
  31. Given the line \(y=$line\),$BR
  32. What is the slope? \{ans_rule(2)\} $BR
  33. What is the y-intercept? \{ans_rule(2)\} $BR
  34. \{ $mc->print_q() \}
  35. $BR
  36. \{ $mc->print_a() \}
  37. END_TEXT
  38. $showPartialCorrectAnswers = 0;
  39. Context()->normalStrings;
  40.  
  41. ANS($m->cmp());
  42. ANS($b->cmp());
  43. ANS( radio_cmp( $mc->correct_ans() ) );
  44.  
  45. ENDDOCUMENT();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement