var questions = new Array();
var choices = new Array();
var answers = new Array();
var prompts = new Array();
var response = new Array();
var CorrAns = new Array();

i=0;
questions[i] = "Balls must be racked with a triangle and the apex ball must be on the head spot.";
choices[i] = new Array();
choices[i][0] = "True  ";
choices[i][1] = "False  ";
prompts[i] = "Any other requirements are dealt with in the rules of the particular game in question";
answers[i] = choices[i][0];
CorrAns[i] == 0;

i++;
questions[i] = "For call-shot games, you must not only call ball and pocket, but must also call combinations, billiards, caroms, banks, kicks, etc.";
choices[i] = new Array();
choices[i][0] = "True  ";
prompts[i] = "All that's required is ball and pocket.";
choices[i][1] = "False  ";
answers[i] = choices[i][1];
CorrAns[i] == 1;

i++;
questions[i] = "Because of the position of the balls on the table, you find it impossible to get a good bridge (even if you use the mechanical bridge).  You notice, however, that since the cue ball is close to a rail, and there's an object ball close to the pocket, you could hit the cue ball with the side of your cue and make the shot more easily than trying to shoot any other way.  So long as you don't double hit the cue ball, this would be legal.";
choices[i] = new Array();
choices[i][0] = "True  ";
prompts[i] = "You must hit the cue ball with the tip for the shot to be legal.";
choices[i][1] = "False  ";
answers[i] = choices[i][1];
CorrAns[i] == 1;

i++;
questions[i] = "Players A & B are lagging for the break.  Player A's shot hits the far rail before player B has even struck his ball.  Player A wins the lag.";
choices[i] = new Array();
choices[i][0] = "True  ";
prompts[i] = "Players will lag again.";
choices[i][1] = "False  ";
answers[i] = choices[i][1];
CorrAns[i] == 1;

i++;
questions[i] = "Your opponent wins the lag for the break and asks you to break.  This is illegal.  Since he won the lag he must break.";
choices[i] = new Array();
choices[i][0] = "True  ";
prompts[i] = "Winner of the lag (or coin toss) gets to choose who breaks.";
choices[i][1] = "False  ";
answers[i] = choices[i][1];
CorrAns[i] == 1;

i++;
questions[i] = "You and your opponent are lagging for the break.  You opponent's ball hits the long rail on its way back to the head end of the table.  This is a foul and you automatically have the choice to break.";
choices[i] = new Array();
choices[i][0] = "True  ";
prompts[i] = "You can't hit the long rail on a lag.";
choices[i][1] = "False  ";
answers[i] = choices[i][0];
CorrAns[i] == 0;

i++;
questions[i] = "You are lagging for the break.  Your ball stops deep within the corner pocket area, does not drop, does not hit the side rail, and is actually past the head rail.  You win the lag.";
choices[i] = new Array();
choices[i][0] = "True  ";
prompts[i] = "If the cue ball is past the head rail it's a loss of the lag.";
choices[i][1] = "False  ";
answers[i] = choices[i][1];
CorrAns[i] == 1;

i++;
questions[i] = "If your opponent's ball on the lag crosses over to your side of the table, but does not interfere with your ball in any way, he would still automatically lose the lag.";
choices[i] = new Array();
choices[i][0] = "True  ";
choices[i][1] = "False  ";
prompts[i] = "Each ball must stay on it's own side of the table.";
answers[i] = choices[i][0];
CorrAns[i] == 0;

i++;
questions[i] = "You're getting ready to lag and you place your ball just a little behind the headstring on your side of the table.  Your opponent places his ball just off the head cushion on his side of the table.  This is legal.";
choices[i] = new Array();
choices[i][0] = "True  ";
prompts[i] = "It's legal, as long as it's behind the head string.";
choices[i][1] = "False  ";
answers[i] = choices[i][0];
CorrAns[i] == 0;

i++;
questions[i] = "Your opponent wins the lag and breaks.  He shoots but completely misses the cue ball.  This is a foul and it's your break.";
choices[i] = new Array();
choices[i][0] = "True  ";
prompts[i] = "It's just an embarrassing form of warm up shot.";
choices[i][1] = "False  ";
answers[i] = choices[i][1];
CorrAns[i] == 1;

i++;
questions[i] = "You break and miscue badly.  Before the cue ball reaches the pack, you reach out with your cue and stop it.  This is a foul and it's your opponent's break.";
choices[i] = new Array();
choices[i][0] = "True  ";
prompts[i] = "Once you hit the cue ball you cannot interfere with it.";
choices[i][1] = "False  ";
answers[i] = choices[i][0];
CorrAns[i] == 0;

i++;
questions[i] = "In a previous game in your match, you interfered with the cue ball on the break as in the last question.  Your opponent reminds you that if you do it again you automatically lose the match.  He's not quite correct, you'd only lose the game.";
choices[i] = new Array();
choices[i][0] = "True  ";
choices[i][1] = "False  ";
prompts[i] = "He's right, you lose the match.";
answers[i] = choices[i][1];
CorrAns[i] == 1;

i++;
questions[i] = "You are breaking.  You inadvertantly place the ball slightly past the headstring.  Your opponent notices but says nothing.  You shoot and your opponent announces that you shot the ball illegally.  It is a foul and he gets to break.";
choices[i] = new Array();
choices[i][0] = "True  ";
choices[i][1] = "False  ";
prompts[i] = "He must advise you of the error before you hit the ball.";
answers[i] = choices[i][1];
CorrAns[i] == 1;

i++;
questions[i] = "In determining whether a ball is correctly positioned behind the headstring, use the edge of the ball closest to the footstring.  It must be on or behind the headstring.";
choices[i] = new Array();
choices[i][0] = "True  ";
choices[i][1] = "False  ";
prompts[i] = "The point where the cue ball touches the table is what matters.";
answers[i] = choices[i][1];
CorrAns[i] == 1;

i++;
questions[i] = "Your opponent is breaking.  He initially positions the ball well back from the headstring.  Inadvertantly during one of his warm-up strokes, he hits the cue ball very lightly.  The cue ball moves forward but does not cross the headstring.  This is a foul and you now get ball in hand per the game you are playing.";
choices[i] = new Array();
choices[i][0] = "True  ";
prompts[i] = "Once the ball is hit there must be a legal safety or it's a foul.";
choices[i][1] = "False  ";
answers[i] = choices[i][0];
CorrAns[i] == 0;

i++;
questions[i] = "You pocket the 6 ball.  It completely disapears from view, then comes back up out of the pocket and back onto the table.  This is not a pocketed ball and your turn is over.";
choices[i] = new Array();
choices[i][0] = "True  ";
choices[i][1] = "False  ";
prompts[i] = "It's where the ball is when it comes to rest that matters.";
answers[i] = choices[i][0];
CorrAns[i] == 0;

i++;
questions[i] = "You must have one foot flat on the floor at the time your tip strikes the cue ball.";
choices[i] = new Array();
choices[i][0] = "True  ";
choices[i][1] = "False  ";
prompts[i] = "On the floor yes, but not necessarily flat on the floor.";
answers[i] = choices[i][1];
CorrAns[i] == 1;

i++;
questions[i] = "Once the cue ball comes to rest you can shoot again.";
choices[i] = new Array();
choices[i][0] = "True  ";
prompts[i] = "All balls must come to rest before you shoot or it's a foul.";
choices[i][1] = "False  ";
answers[i] = choices[i][1];
CorrAns[i] == 1;

i++;
questions[i] = "If a ball is spinning, but not otherwise moving, you still have to wait for it to stop before you can legally shoot.";
choices[i] = new Array();
choices[i][0] = "True  ";
choices[i][1] = "False  ";
prompts[i] = "Spinning balls are moving; no shooting until all balls stop moving.";
answers[i] = choices[i][0];
CorrAns[i] == 0;

i++;
questions[i] = "If the rules of the game you're playing direct you to shoot from behind the headstring, you can place the ball on the headstring, just not in front of it.";
choices[i] = new Array();
choices[i][0] = "True  ";
choices[i][1] = "False  ";
prompts[i] = "Behind it only, not on it.";
answers[i] = choices[i][1];
CorrAns[i] == 1;

i++;
questions[i] = "If you have to shoot from behind the headstring, you can't shoot at a ball on the headstring unless you go past the headstring first and then return.";
choices[i] = new Array();
choices[i][0] = "True  ";
choices[i][1] = "False  ";
prompts[i] = "You can shoot this ball directly.";
answers[i] = choices[i][1];
CorrAns[i] == 1;

i++;
questions[i] = "You have to shoot from behind the headstring. All legal object balls are also behind the headstring.  You can have the object ball nearest the headstring spotted at the foot spot.";
choices[i] = new Array();
choices[i][0] = "True  ";
choices[i][1] = "False  ";
prompts[i] = "And if there are two balls equally close to the headstring, you get to choose.";
answers[i] = choices[i][0];
CorrAns[i] == 0;

i++;
questions[i] = "To make a legal shot, the cue ball must be hit into an object ball, and then either the cue ball or an object ball must hit a cushion or any part of a rail, or be pocketed.";
choices[i] = new Array();
choices[i][0] = "True  ";
choices[i][1] = "False  ";
prompts[i] = "This is a minimum requirement for every shot.";
answers[i] = choices[i][0];
CorrAns[i] == 0;

i++;
questions[i] = "You pocket a ball and the cue ball follows it toward the pocket.  Your ball falls in and the pocket is now full.  The cue ball bounces back off one of the pocketed balls.  This is legal and you should continue shooting.";
choices[i] = new Array();
choices[i][0] = "True  ";
prompts[i] = "This is a foul.";
choices[i][1] = "False  ";
answers[i] = choices[i][1];
CorrAns[i] == 1;

i++;
questions[i] = "You are about to shoot when you see a hair on the cloth directly in front of the cue ball.  You get up from your stance and reach over to remove the hair and accidentally move the cue ball a fraction of an inch.  This is a foul.";
choices[i] = new Array();
choices[i][0] = "True  ";
prompts[i] = "You can't touch the cue ball unless you're in the act of placing it when you have ball in hand.";
choices[i][1] = "False  ";
answers[i] = choices[i][0];
CorrAns[i] == 0;

i++;
questions[i] = "Your opponent has ball in hand and put the cue ball down touching an object ball. This is a foul and it's now your turn.";
choices[i] = new Array();
choices[i][0] = "True  ";
prompts[i] = "You cannot touch another ball with the cue ball.";
choices[i][1] = "False  ";
answers[i] = choices[i][0];
CorrAns[i] == 0;

i++;
questions[i] = "You have ball in hand.  While you are deciding where to place it, you use it to test whether a ball will pass between the rail and another ball.  You don't actually touch the other ball.   This is still a foul.";
choices[i] = new Array();
choices[i][0] = "True  ";
choices[i][1] = "False  ";
prompts[i] = "You can test the cue ball in any position, just don't hit a ball.";
answers[i] = choices[i][1];
CorrAns[i] == 1;

i++;
questions[i] = "The cue ball is touching an object ball.  You can shoot the cue ball directly into the object ball so long as you make a normal stroke, don't keep the tip in contact with the cue ball for more than an instant, and don't hit the cue ball twice.";
choices[i] = new Array();
choices[i][0] = "True  ";
choices[i][1] = "False  ";
prompts[i] = "This is correct but this rule is frequently misunderstood.";
answers[i] = choices[i][0];
CorrAns[i] == 0;

i++;
questions[i] = "If a player drops his chalk onto the table it is a foul.";
choices[i] = new Array();
choices[i][0] = "True  ";
choices[i][1] = "False  ";
prompts[i] = "Only if it hits a ball in play (cue ball in cue ball fouls only games).";
answers[i] = choices[i][1];
CorrAns[i] == 1;

i++;
questions[i] = "You call the 6 Ball in the corner.  In a failed attempt to get extra draw on the ball, you hit the cue ball too low and loft the cue ball over the 6 ball.  The cue ball hits another ball, and then a cushion and you are relieved that at least there was no foul.  Your opponent claims this is a foul becaused you executed an illegal jump shot.  He is mistaken.";
choices[i] = new Array();
choices[i][0] = "True  ";
prompts[i] = "You have to intentionally loft the ball for it to be a foul.";
choices[i][1] = "False  ";
answers[i] = choices[i][0];
CorrAns[i] == 0;

i++;
questions[i] = "You're blocked from making the 7 ball by another ball in the way.  You want to execute a rail first shot, but you're not sure the cue ball will pass between the blocker ball and the rail. You use your stick to measure the space without touching either the blocker ball or the rail.  This is not a foul.";
choices[i] = new Array();
choices[i][0] = "True  ";
prompts[i] = "It's ok as long as you don't touch the ball.";
choices[i][1] = "False  ";
answers[i] = choices[i][0];
CorrAns[i] == 0;

i++;
questions[i] = "You cause an object ball to leave the table and it comes to rest on the floor.  This is a foul.";
choices[i] = new Array();
choices[i][0] = "True  ";
choices[i][1] = "False  ";
prompts[i] = "If it doesn't return to the table it's a foul.";
answers[i] = choices[i][0];
CorrAns[i] == 0;

i++;
questions[i] = "You have to spot a ball.  There is an object ball blocking the foot spot, but the area is otherwise clear.  You must place the spotted ball on the centerline, behind and as close as possible to the foot spot and in contact with the interfering ball.";
choices[i] = new Array();
choices[i][0] = "True  ";
choices[i][1] = "False  ";
prompts[i] = "It must be touching the interfering ball.";
answers[i] = choices[i][0];
CorrAns[i] == 0;

i++;
questions[i] = "You have to spot a ball.  The cue ball is blocking the foot spot, but the area is otherwise clear.  You must place the spotted ball on the centerline, behind and as close as possible to the foot spot but not in contact with the cue ball.";
choices[i] = new Array();
choices[i][0] = "True  ";
choices[i][1] = "False  ";
prompts[i] = "The cue ball must not be touched.";
answers[i] = choices[i][0];
CorrAns[i] == 0;

i++;
questions[i] = "On your break shot the cue ball hits the head ball and goes straight up, hitting the overhead light.  It falls straight down and comes to rest on the table.  This is legal and if you otherwise made a ball you keep shooting.";
choices[i] = new Array();
choices[i][0] = "True  ";
choices[i][1] = "False  ";
prompts[i] = "It hit something other than the table; it's a foul.";
answers[i] = choices[i][1];
CorrAns[i] == 1;

i++;
questions[i] = "You rattle a ball in the pocket and it comes to rest hanging over the lip.  While your opponent is walking to the table, ~10 seconds after the balls have come to rest, the ball spontaneously falls into the pocket.  The ball must be respotted on the lip of the pocket.";
choices[i] = new Array();
choices[i][1] = "True  ";
choices[i][0] = "False  ";
prompts[i] = "After 5 seconds the ball is considered not pocketed; spot it.";
answers[i] = choices[i][1];
CorrAns[i] == 1;

i++;
questions[i] = "You are shooting and someone walking behind you bumps into your stick as you stroke.  This is interference and you should return all balls to their original spots and replay the shot without penalty.";
choices[i] = new Array();
choices[i][0] = "True  ";
prompts[i] = "As close as you can, that is.";
choices[i][1] = "False  ";
answers[i] = choices[i][0];
CorrAns[i] == 0;

i++;
questions[i] = "You intend to play safe.  You hit into a ball frozen to the cushion and it bounces out a few inches.  No other ball hits any cushion.  This is a foul.";
choices[i] = new Array();
choices[i][0] = "True  ";
choices[i][1] = "False  ";
prompts[i] = "Another cushion must be hit by some ball.";
answers[i] = choices[i][0];
CorrAns[i] == 0;

i++;
questions[i] = "It is unsportsmanlike conduct to practice during a match.  This could result in loss of game, set or match at the discretion of the referee.";
choices[i] = new Array();
choices[i][0] = "True  ";
choices[i][1] = "False  ";
prompts[i] = "When you're not shooting you should be quietly sitting in your chair.";
answers[i] = choices[i][0];
CorrAns[i] == 0;

// response for getting 100%
response[0] = "Excellent, a perfect score, consider referee school!";
// response for getting 95% or more
response[1] = "Excellent, top marks!"
// response for getting 90% or more
response[2] = "Well done, that is a good score, can you do better?";
// response for getting over 85%
response[3] = "Nice one, but you can do better.";
// response for getting 80% or more
response[4] = "Good, but you still got 1 in 5 incorrect.  You should study more.";
// response for getting 75% or more
response[5] = "Not too bad, but there's a lot of room for improvement.  Why not try again!?";
// response for getting 70% or more
response[6] = "This is a passing score, but barely.  Try again to improve!";
// response for getting less than 70%
response[7] = "Sorry, this is not a passing score. I suggest you try again!";