Khan/khan-exercises — Issue #8049: Graphing systems of inequalities 2 - Exercise is unresponsive
Author: KhanBugz
Created: 2011-12-07 20:00:13+00:00
State: open
Labels: ie8, ie9, not-showing, win7

I've tried using firefox, and now IE but still the page won't load correctly.

This is what it reads:

"Graph the following system of inequalities and determine if the points	(POINT_1[0], POINT_1[1]) or	(POINT_2[0], POINT_2[1]) are solutions:

expr([ "+", [ "*", A_1, "x" ], [ "*", B_1, "y" ] ]) STD_FORM_COMP_1 C_1

y COMP_1 PRETTY_SLOPE_1 x + YINT_1

expr([ "+", [ "*", A_2, "x" ], [ "*", B_2, "y" ] ]) STD_FORM_COMP_2 C_2

y COMP_2 PRETTY_SLOPE_2 x + YINT_2

Inequality 1:	Solid line
Dashed line
Inequality 2:	Solid line
Dashed line

graphInit({
range: 11,
scale: 20,
axisArrows: "<->",
tickStep: 1,
labelStep: 1,
gridOpacity: 0.05,
axisOpacity: 0.2,
tickOpacity: 0.4,
labelOpacity: 0.5
});

label( [ 0, -11 ], "y", "below" );
label( [ 11, 0 ], "x", "right" );

addMouseLayer();
graph.pointA = addMovablePoint({
coord: [ -5, 5 ],
snapX: 0.5,
snapY: 0.5,
normalStyle: {
stroke: KhanUtil.BLUE,
fill: KhanUtil.BLUE
}
});
graph.pointB = addMovablePoint({
coord: [ 5, 5 ],
snapX: 0.5,
snapY: 0.5,
normalStyle: {
stroke: KhanUtil.BLUE,
fill: KhanUtil.BLUE
}
});
graph.pointC = addMovablePoint({
coord: [ -5, -5 ],
snapX: 0.5,
snapY: 0.5,
normalStyle: {
stroke: KhanUtil.BLUE,
fill: KhanUtil.BLUE
}
});
graph.pointD = addMovablePoint({
coord: [ 5, -5 ],
snapX: 0.5,
snapY: 0.5,
normalStyle: {
stroke: KhanUtil.BLUE,
fill: KhanUtil.BLUE
}
});
graph.set = raphael.set();

graph.update = function() {
graph.set.remove();
if ( abs( graph.pointB.coord[0] - graph.pointA.coord[0] ) > 0.001 ) {
var slope = ( graph.pointB.coord[1] - graph.pointA.coord[1] ) / ( graph.pointB.coord[0] - graph.pointA.coord[0] );
var yint = slope * ( 0 - graph.pointA.coord[0] ) + graph.pointA.coord[1];
var shadeEdge = ( ( graph.pointA.coord[0] < graph.pointB.coord[0] ) ? graph.shadetop1 : !graph.shadetop1 ) ? 11 : -11;
style({ stroke: BLUE, strokeWidth: 2, strokeDasharray: graph.dasharray1 }, function() {
graph.set.push( line( [ -11, -11 * slope + yint ], [ 11, 11 * slope + yint ] ) );
});
style({ fill: BLUE, stroke: null, opacity: 0.1 }, function() {
graph.set.push( path([ [ 11, shadeEdge ], [ 11, 11 * slope + yint ], [ -11, -11 * slope + yint ], [ -11, shadeEdge ] ]) );
});

} else {
// vertical line
var x = graph.pointA.coord[0];
var shadeEdge = ( ( graph.pointB.coord[1] < graph.pointA.coord[1] ) ? graph.shadetop1 : !graph.shadetop1 ) ? 11 : -11;
style({ stroke: BLUE, strokeWidth: 2, strokeDasharray: graph.dasharray1 }, function() {
graph.set.push( line( [ x, -11 ], [ x, 11 ] ) );
});
style({ fill: BLUE, stroke: null, opacity: 0.1 }, function() {
graph.set.push( path([ [ x, -11 ], [ x, 11 ], [ shadeEdge, 11 ], [ shadeEdge, -11 ] ]) );
});
}

if ( abs( graph.pointD.coord[0] - graph.pointC.coord[0] ) > 0.001 ) {
var slope = ( graph.pointD.coord[1] - graph.pointC.coord[1] ) / ( graph.pointD.coord[0] - graph.pointC.coord[0] );
var yint = slope * ( 0 - graph.pointC.coord[0] ) + graph.pointC.coord[1];
var shadeEdge = ( ( graph.pointC.coord[0] < graph.pointD.coord[0] ) ? graph.shadetop2 : !graph.shadetop2 ) ? 11 : -11;
style({ stroke: GREEN, strokeWidth: 2, strokeDasharray: graph.dasharray2 }, function() {
graph.set.push( line( [ -11, -11 * slope + yint ], [ 11, 11 * slope + yint ] ) );
});
style({ fill: GREEN, stroke: null, opacity: 0.1 }, function() {
graph.set.push( path([ [ 11, shadeEdge ], [ 11, 11 * slope + yint ], [ -11, -11 * slope + yint ], [ -11, shadeEdge ] ]) );
});

} else {
// vertical line
var x = graph.pointC.coord[0];
var shadeEdge = ( ( graph.pointD.coord[1] < graph.pointC.coord[1] ) ? graph.shadetop2 : !graph.shadetop2 ) ? 11 : -11;
style({ stroke: GREEN, strokeWidth: 2, strokeDasharray: graph.dasharray2 }, function() {
graph.set.push( line( [ x, -11 ], [ x, 11 ] ) );
});
style({ fill: GREEN, stroke: null, opacity: 0.1 }, function() {
graph.set.push( path([ [ x, -11 ], [ x, 11 ], [ shadeEdge, 11 ], [ shadeEdge, -11 ] ]) );
});
}

graph.set.toBack();
};

// A and B can't be in the same place
graph.pointA.onMove = function( x, y ) {
if ( x != graph.pointB.coord[0] || y != graph.pointB.coord[1] ) {
graph.pointA.setCoord([ x, y ]);
graph.update();
return true;
} else {
return false;
}
}
graph.pointB.onMove = function( x, y ) {
if ( x != graph.pointA.coord[0] || y != graph.pointA.coord[1] ) {
graph.pointB.setCoord([ x, y, ]);
graph.update();
return true;
} else {
return false;
}
}

// C and D can't be in the same place
graph.pointC.onMove = function( x, y ) {
if ( x != graph.pointD.coord[0] || y != graph.pointD.coord[1] ) {
graph.pointC.setCoord([ x, y ]);
graph.update();
return true;
} else {
return false;
}
}
graph.pointD.onMove = function( x, y ) {
if ( x != graph.pointC.coord[0] || y != graph.pointC.coord[1] ) {
graph.pointD.setCoord([ x, y, ]);
graph.update();
return true;
} else {
return false;
}
}
graph.dasharray1 = "";
graph.dasharray2 = "";
graph.shadetop1 = true;
graph.shadetop2 = false;
graph.update();
graph.pointA.toFront();
graph.pointB.toFront();
graph.pointC.toFront();
graph.pointD.toFront();

Drag the points to move both lines into the correct positions.

[ graph.pointA.coord, graph.pointB.coord,
graph.pointA.coord[0] > graph.pointB.coord[0] ? graph.shadetop1 : !graph.shadetop1,
graph.dasharray1 === "- " ? false : true,
graph.pointC.coord, graph.pointD.coord,
graph.pointC.coord[0] > graph.pointD.coord[0] ? graph.shadetop2 : !graph.shadetop2,
graph.dasharray2 === "- " ? false : true ]

var slope1 = ( guess[1][1] - guess[0][1] ) / ( guess[1][0] - guess[0][0] );
var yint1 = slope1 * ( 0 - guess[0][0] ) + guess[0][1];
var slope2 = ( guess[5][1] - guess[4][1] ) / ( guess[5][0] - guess[4][0] );
var yint2 = slope2 * ( 0 - guess[4][0] ) + guess[4][1];
return abs( SLOPE_1 - slope1 ) < 0.001
&& abs( YINT_1 - yint1 ) < 0.001	&& guess[2] === LESS_THAN_1
&& guess[3] === INCLUSIVE_1	&& abs( SLOPE_2 - slope2 ) < 0.001
&& abs( YINT_2 - yint2 ) < 0.001	&& guess[6] === LESS_THAN_2
&& guess[7] === INCLUSIVE_2;

graph.pointA.setCoord( guess[0] );	graph.pointB.setCoord( guess[1] );
graph.pointC.setCoord( guess[4] );	graph.pointD.setCoord( guess[5] );
graph.shadetop1 = graph.pointA.coord[0] > graph.pointB.coord[0] ? guess[2] : !guess[2];
graph.shadetop2 = graph.pointC.coord[0] > graph.pointD.coord[0] ? guess[6] : !guess[6];
if ( guess[3] ) {	graph.dasharray1 = "";
jQuery( "input[name=dashradio1][value=solid]" ).attr( "checked", true );
} else {	graph.dasharray1 = "- ";
jQuery( "input[name=dashradio1][value=dashed]" ).attr( "checked", true );
}	if ( guess[7] ) {	graph.dasharray2 = "";
jQuery( "input[name=dashradio2][value=solid]" ).attr( "checked", true );
} else {	graph.dasharray2 = "- ";
jQuery( "input[name=dashradio2][value=dashed]" ).attr( "checked", true );
}	graph.update();

POINT_1_SOLUTION(POINT_1[0], POINT_1[1]) is a solution
POINT_2_SOLUTION(POINT_2[0], POINT_2[1]) is a solution

graph the inequalities

make sure the correct sides are shaded

make sure each line is correctly shown as solid or dashed"

[graphing_systems_of_inequalities_2.html?seed=163&problem=0](http://sandcastle.khanacademy.org/media/castles/Khan:master/exercises/graphing_systems_of_inequalities_2.html?seed=163&problem=0&debug)

[Answer timeline](http://sandcastle.khanacademy.org/media/castles/Khan:master/exercises/graphing_systems_of_inequalities_2.html?seed=163&problem=0&debug&activity=undefined)

undefined

Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/5.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; MDDC; .NET4.0C; .NET4.0E)

MathJax is loaded, ready, queue length: 0