##DESCRIPTION
## Algebra problem: true or false for inequality
##ENDDESCRIPTION
##KEYWORDS('algebra', 'inequality', 'fraction')
## DBsubject('Algebra')
## DBchapter('Fundamentals')
## DBsection('Real Numbers')
## Date('6/3/2002')
## Author('')
## Institution('')
## TitleText1('Precalculus')
## EditionText1('3')
## AuthorText1('Stewart, Redlin, Watson')
## Section1('1.1')
## Problem1('22')
########################################################################
DOCUMENT();
loadMacros(
"PGstandard.pl",
"MathObjects.pl",
"unionTables.pl",
"AppletObjects.pl",
"parserNumberWithUnits.pl",
"PGcourse.pl",
);
# Print problem number and point value (weight) for the problem
TEXT(beginproblem());
# Show which answers are correct and which ones are incorrect
$showPartialCorrectAnswers = 1;
##############################################################
#
# Setup
#
#
Context("Numeric")->variables->are(t=>"Real");
$a = random(3,6,1);
$b = random(1,$a-1,1);
$appletName = "ggbApplet";
$applet = JavaApplet(
code => "geogebra.GeoGebraApplet",
archive => "geogebra.jar",
codebase => findAppletCodebase("geogebra.jar"),
appletName => $appletName,
appletId => $appletName,
submitActionAlias => 'getXML', # default getXML
initializeActionAlias => 'setXML', # default setXML
setStateAlias => 'setXML',
getStateAlias => 'getXML',
setConfigAlias => '',
getConfigAlias => '',
returnFieldName => '',
width => 504,
height => 471,
mayscript => "true",
# 0 = no debug, 1 = xml visible, 2 = add alerts thru applet
debugMode => 0,
onInit => 'ggbOnInit',
type => 'geogebra',
# paste parameters in section at the bottom
parameter_string => GEOGEBRA_PARAMS(),
);
$im = image( "graph-a".$a."-b".$b.".png",
width=>486, height=>306, tex_size=>900 );
HEADER_TEXT(
qq!
!);
##############################################################
#
TEXT( MODES(TeX=>'', HTML=><
function setAppletCoefficients() {
var applet=getApplet("$appletName"); // alert("Updating coefficients");
if (typeof(applet)!="undefined") {
if (typeof(applet.setValue)!="undefined") {
////////////////////////////////////////////////////////////////
// List the values of the parameters to be set in the applet here
// Set variables "a" and "b" in GeoGebra to values $c and $d from WebWork
applet.setValue("a", $a);
applet.setValue("b", $b);
applet.setCoordSystem(-2*$a,-$a,2*$a,$a);
} else {
setTimeout("setAppletCoefficients()", 1000);
}
} else {
setTimeout("setAppletCoefficients()",1000);
}
}
ww_applet_list["$appletName"].setConfig = function() {setAppletCoefficients()};
END_SCRIPT
Context()->texStrings;
BEGIN_TEXT
Van Schooten invented the following device for drawing an ellipse.
\{
$BCENTER.
MODES(HTML=>$applet->insertAll(debug=>0, reinitialize_button=>0,
includeAnswerBox=>0,), TeX=>$im).
$PAR.
"Van Schooten's Ellipse Drawer".
$ECENTER
\}
END_TEXT
Context()->normalStrings;
##############################################################
#
# Answers
#
#
sub GEOGEBRA_PARAMS {
$result = qq{
# For persistence of applet state when answers are submitted
# The GeoGebra "source code" from GeoGebra ->
# File -> Export -> Dynamic worksheet as Webpage (html)
};
}
COMMENT('MathObject version. Uses GeoGebra applet.');
ENDDOCUMENT();