Advertisement
Guest User

Untitled

a guest
Nov 25th, 2014
177
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 55.82 KB | None | 0 0
  1. static String[] Q = new String[30];{
  2. Q[0] = "Which of the following is a requirement in order to vote in a Canadian federal election?";
  3. Q[1] = "What major sporting event was held in Canada in 2010?";
  4. Q[2] = "Which of the following is not a province of Canada?";
  5. Q[3] = "Who was the first Prime Minister of Canada? ";
  6. Q[4] = "How many Oceans border Canada? ";
  7. Q[5] = "What is the status of Canada? ";
  8. Q[6] = "Which of the following islands is not part of Canada? ";
  9. Q[7] = "Which is the longest river in Canada? ";
  10. Q[8] = "Which Canadian province is the country’s largest producer and exporter of maple syrup? ";
  11. Q[9] = "Who donated the Stanley Cup to the National Hockey League? ";
  12. Q[10] = "Why did Ottawa establish the Mounted Police in 1873? ";
  13. Q[11] = "Which famous Canadian composed the Canadian national anthem? ";
  14. Q[12] = "Who is the Head of State of Canada? ";
  15. Q[13] = "Who after winning gold medal in 100 metres race in Seoul Olympics 1988 tested positive for drugs and was thrown out? ";
  16. Q[14] = "What university developed the world’s first anti-gravity suit? ";
  17. Q[15] = "O Canada! Our home and ______ land!";
  18. Q[16] = "Red and _____ are the national colours of Canada.";
  19. Q[17] = "The national animal of Canada is the ______ .";
  20. Q[18] = "Lacrosse is Canada’s national summer sport, _____ is the national winter sport.";
  21. Q[19] = "English and ______ are Canada’s national languages.";
  22. Q[20] = "The _____ leaf is featured on Canada’s national flag.";
  23. Q[21] = "Royal Canadian _______ Police are the federal police force of Canada.";
  24. Q[22] = "Canada’s newest territory is _______ .";
  25. Q[23] = "Canada celebrates its independence on ____ 1st every year.";
  26. Q[24] = "On one side of a quarter in The Queen, on the other side is a _____ .";
  27. Q[25] = "Wilfrid _______ is the man on the $5 bill.";
  28. Q[26] = "The name Canada originally meant _______ or settlement.";
  29. Q[27] = "The $2 coin of Canada is called a Toonie, the $1 coin is called a ______ .";
  30. Q[28] = "Mount _____ is the highest mountain in Canada.";
  31. Q[29] = "In Canada you may not publicly remove a ________ . ";}
  32.  
  33. static String[] optionA = new String[15];{
  34.  
  35. optionA[0]= " a) Your are at least 18 years old on election day";
  36. optionA[1]= " a) Summer Olympics ";
  37. optionA[2]= " a) Alberta ";
  38. optionA[3]= " a) Alexander Mackenzie ";
  39. optionA[4]= " a) 1";
  40. optionA[5]= " a) Republic";
  41. optionA[6]= " a) Greenland";
  42. optionA[7]= " a) St. Lawrence";
  43. optionA[8]= " a) Ontario";
  44. optionA[9]= " a) Bill Stanley";
  45. optionA[10]=" a) To perform equestrian shows";
  46. optionA[11]=" a) Ceiline Dion";
  47. optionA[12]=" a) President";
  48. optionA[13]=" a) Donovan Bailey";
  49. optionA[14]=" a) University of Toronto";}
  50.  
  51. static String[] optionB = new String [15];{
  52.  
  53. optionB[0]= " b) You are a Canadian citizen" ;
  54. optionB[1]= " b) Winter Olympics";
  55. optionB[2]= " b) British Columbia";
  56. optionB[3]= " b) John A. MacDonald";
  57. optionB[4]= " b) 2";
  58. optionB[5]= " b) Dominion";
  59. optionB[6]= " b) Baffin Island";
  60. optionB[7]= " b) Mackenzie";
  61. optionB[8]= " b) British Columbia";
  62. optionB[9]= " b) Governor General Lord Stanley";
  63. optionB[10]= " b) To pacify the West and negotiate with the Indians";
  64. optionB[11]= " b) Calixa Lavallee";
  65. optionB[12]= " b) Governor General";
  66. optionB[13]= " b) Ben Johnson";
  67. optionB[14]= " b) Simon Fraser University"; }
  68.  
  69. static String[] optionC = new String [15];{
  70.  
  71. optionC[0]= " c) You can prove your identity and address";
  72. optionC[1]= " c) World Cup ";
  73. optionC[2]= " c) Rhode Island ";
  74. optionC[3]= " c) Louis Riel ";
  75. optionC[4]= " c) 3 ";
  76. optionC[5]= " c) Kingdom ";
  77. optionC[6]= " c) Victoria Island ";
  78. optionC[7]= " c) Nelson ";
  79. optionC[8]= " c) Quebec ";
  80. optionC[9]= " c) Stanley Lord ";
  81. optionC[10]= " c) To arrest Louis Riel ";
  82. optionC[11]= " c) Bryan Adams ";
  83. optionC[12]= " c) Monarch of United Kingdom ";
  84. optionC[13]= " c) Carl Lewis ";
  85. optionC[14]= " c) University of British Columbia "; }
  86.  
  87.  
  88. static String[] optionD = new String [15];{
  89.  
  90.  
  91. optionD[0]= " d) All of the above";
  92. optionD[1]= " d) Commonwealth Games ";
  93. optionD[2]= " d) Quebec ";
  94. optionD[3]= " d) Wilfred Laurier ";
  95. optionD[4]= " d) 4 ";
  96. optionD[5]= " d) Commonwealth ";
  97. optionD[6]= " d) Prince Edward Island ";
  98. optionD[7]= " d) Fraser ";
  99. optionD[8]= " d) New Brunswick ";
  100. optionD[9]= " d) Stanley Bill ";
  101. optionD[10]= " d) To drive the Metis out of Canada ";
  102. optionD[11]= " d) Gordon Lightfoot ";
  103. optionD[12]= " d) Prime Minister ";
  104. optionD[13]= " d) Roger Bannister ";
  105. optionD[14]= " d) Queen’s University "; }
  106.  
  107. static String[] answer = new String [30];{
  108.  
  109. answer[0]= "D";
  110. answer[1]= "B";
  111. answer[2]= "C";
  112. answer[3]= "B";
  113. answer[4]= "C";
  114. answer[5]= "B";
  115. answer[6]= "A";
  116. answer[7]= "B";
  117. answer[8]= "C";
  118. answer[9]= "B";
  119. answer[10]= "B";
  120. answer[11]= "B";
  121. answer[12]= "C";
  122. answer[13]= "C";
  123. answer[14]= "A";
  124. answer[15]= "native";
  125. answer[16]= "white" ;
  126. answer[17]= "beaver" ;
  127. answer[18]= "hockey";
  128. answer[19]= "French";
  129. answer[20]= "maple";
  130. answer[21]= "Mounted";
  131. answer[22]= "Nunavut";
  132. answer[23]= "July";
  133. answer[24]= "moose";
  134. answer[25]= "Laurier";
  135. answer[26]= "village";
  136. answer[27]= "Loonie";
  137. answer[28]= "Logan";
  138. answer[29]= "Band-Aid";}
  139.  
  140.  
  141.  
  142. //first screen to be seen, asks user if they would like to open tutorial window
  143. public static void introScreen(){ //Main Programmer: Amarnath Parthiban
  144.  
  145. JPanel introScreen = new JPanel();
  146. introScreen.setLayout(null);
  147.  
  148. final JFrame introFrame = new JFrame("Welcome");
  149. introFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
  150. introFrame.add(introScreen);
  151.  
  152. //text to be displayed on screen
  153. JLabel introTitle = new JLabel("So you think you're Canadian, eh?");
  154. introTitle.setFont(new Font("Calibri", Font.PLAIN, 20));
  155. introTitle.setBounds(5, 0, 500, 25);
  156.  
  157. JLabel introText1 = new JLabel("Welcome to the CIA Canadian trivia quiz.");
  158. introText1.setFont(new Font("Calibri", Font.PLAIN, 16));
  159. introText1.setBounds(15, 25, 500, 25);
  160.  
  161. JLabel introText2 = new JLabel("Would you like to take the tutorial?");
  162. introText2.setFont(new Font("Calibri", Font.PLAIN, 16));
  163. introText2.setBounds(25, 50, 500, 25);
  164.  
  165. //buttons for user input
  166. JButton yesTutorial = new JButton("YES");
  167. yesTutorial.setFont(new Font("Calibri", Font.PLAIN, 16));
  168. yesTutorial.setBounds(55, 75, 70, 30);
  169.  
  170. JButton noTutorial = new JButton("NO");
  171. noTutorial.setFont(new Font("Calibri", Font.PLAIN, 16));
  172. noTutorial.setBounds(165, 75, 70, 30);
  173.  
  174. introScreen.add(introTitle);
  175. introScreen.add(introText1);
  176. introScreen.add(introText2);
  177. introScreen.add(yesTutorial);
  178. introScreen.add(noTutorial);
  179.  
  180. introFrame.setSize(310,160);
  181. introFrame.setVisible(true);
  182.  
  183. yesTutorial.addActionListener(new ActionListener(){
  184.  
  185. public void actionPerformed(ActionEvent e){
  186.  
  187. //removes first window and opens the tutorial window
  188. introFrame.dispose();
  189. tutorial();
  190.  
  191. }
  192. });
  193.  
  194. noTutorial.addActionListener(new ActionListener(){
  195.  
  196. public void actionPerformed(ActionEvent e){
  197.  
  198. //removes first window and opens main quiz window
  199. introFrame.dispose();
  200. quiz();
  201.  
  202. }
  203. });
  204.  
  205. }
  206.  
  207. //static panel and frame to allow only one instance of the window to be open
  208. static JPanel mainQuiz = new JPanel();
  209. static JFrame mainFrame = new JFrame("CAI Quiz");
  210. static CardLayout card1 = new CardLayout();
  211.  
  212. //used to determine if the main quiz screen is open, defaulted to false for safety
  213. static boolean quizState = false;
  214.  
  215. public static void quiz(){ //Main Programmer: Amarnath Parthiban
  216.  
  217. mainQuiz.setLayout(card1);
  218. mainFrame.add(mainQuiz);
  219.  
  220. JPanel quiz = new JPanel();
  221. //allows use of (x,y) positions on JPanel
  222. quiz.setLayout(null);
  223.  
  224. //changes the state to inform that main quiz is open and other windows can be closed without ending the program
  225. quizState = true;
  226.  
  227. mainFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
  228. mainQuiz.add(quiz, "a");
  229.  
  230. //title
  231. JLabel mainTitle = new JLabel("CAI CANADIAN QUIZ");
  232. mainTitle.setFont(new Font("Calibri", Font.PLAIN, 75));
  233. mainTitle.setBounds(190, 25, 700, 60);
  234.  
  235. //buttons for each question type and level including a random and tutorial button
  236. JButton MCLevel1 = new JButton("Multiple Choice Level 1");
  237. MCLevel1.setFont(new Font("Calibri", Font.PLAIN, 25));
  238. MCLevel1.setBounds(150, 200, 300, 100);
  239.  
  240. JButton MCLevel2 = new JButton("Multiple Choice Level 2");
  241. MCLevel2.setFont(new Font("Calibri", Font.PLAIN, 25));
  242. MCLevel2.setBounds(150, 350, 300, 100);
  243.  
  244. JButton MCLevel3 = new JButton("Multiple Choice Level 3");
  245. MCLevel3.setFont(new Font("Calibri", Font.PLAIN, 25));
  246. MCLevel3.setBounds(150, 500, 300, 100);
  247.  
  248. JButton FIBLevel1 = new JButton("Fill in The Blank Level 1");
  249. FIBLevel1.setFont(new Font("Calibri", Font.PLAIN, 25));
  250. FIBLevel1.setBounds(550, 200, 300, 100);
  251.  
  252. JButton FIBLevel2 = new JButton("Fill in The Blank Level 2");
  253. FIBLevel2.setFont(new Font("Calibri", Font.PLAIN, 25));
  254. FIBLevel2.setBounds(550, 350, 300, 100);
  255.  
  256. JButton FIBLevel3 = new JButton("Fill in The Blank Level 3");
  257. FIBLevel3.setFont(new Font("Calibri", Font.PLAIN, 25));
  258. FIBLevel3.setBounds(550, 500, 300, 100);
  259.  
  260. JButton random = new JButton("Random");
  261. random.setFont(new Font("Calibri", Font.PLAIN, 25));
  262. random.setBounds(350, 650, 300, 100);
  263.  
  264. JButton tutorial = new JButton("Tutorial");
  265. tutorial.setFont(new Font("Calibri", Font.PLAIN, 20));
  266. tutorial.setBounds(10, 650, 100, 100);
  267.  
  268. quiz.add(mainTitle);
  269. quiz.add(MCLevel1);
  270. quiz.add(MCLevel2);
  271. quiz.add(MCLevel3);
  272. quiz.add(FIBLevel1);
  273. quiz.add(FIBLevel2);
  274. quiz.add(FIBLevel3);
  275. quiz.add(random);
  276. quiz.add(tutorial);
  277.  
  278. mainFrame.setSize(1000,800);
  279. mainFrame.setVisible(true);
  280. card1.show(mainQuiz, "a");
  281.  
  282. MCLevel1.addActionListener(new ActionListener(){
  283.  
  284. public void actionPerformed(ActionEvent e){
  285.  
  286. MCLevel1();
  287.  
  288. }
  289. });
  290.  
  291. MCLevel2.addActionListener(new ActionListener(){
  292.  
  293. public void actionPerformed(ActionEvent e){
  294.  
  295. MCLevel2();
  296.  
  297. }
  298. });
  299.  
  300. MCLevel3.addActionListener(new ActionListener(){
  301.  
  302. public void actionPerformed(ActionEvent e){
  303.  
  304. MCLevel3();
  305.  
  306. }
  307. });
  308.  
  309. FIBLevel1.addActionListener(new ActionListener(){
  310.  
  311. public void actionPerformed(ActionEvent e){
  312.  
  313. FIBLevel1();
  314.  
  315. }
  316. });
  317.  
  318. FIBLevel2.addActionListener(new ActionListener(){
  319.  
  320. public void actionPerformed(ActionEvent e){
  321.  
  322. FIBLevel2();
  323.  
  324. }
  325. });
  326.  
  327. FIBLevel3.addActionListener(new ActionListener(){
  328.  
  329. public void actionPerformed(ActionEvent e){
  330.  
  331. FIBLevel3();
  332.  
  333. }
  334. });
  335.  
  336. tutorial.addActionListener(new ActionListener(){
  337.  
  338. public void actionPerformed(ActionEvent e){
  339.  
  340. //allows user to open tutorial when needed
  341. tutorial();
  342.  
  343. }
  344. });
  345.  
  346. }
  347.  
  348. static int x;
  349. static int questionsTotal = 0;
  350. static int correct = 0;
  351. static JLabel totalScore = new JLabel("Total Score: N/A");
  352.  
  353. public static void MCLevel1(){ //Main Programmer: Amarnath Parthiban
  354.  
  355. questionsTotal += 5;
  356. totalScore.setText("Session Score: " + correct + " / " + questionsTotal);
  357.  
  358. final JPanel MC1 = new JPanel();
  359. MC1.setLayout(null);
  360.  
  361. mainQuiz.add(MC1, "b");
  362.  
  363. JLabel MC1Title = new JLabel("Multiple Choice Level 1");
  364. MC1Title.setFont(new Font("Calibri", Font.PLAIN, 50));
  365. MC1Title.setBounds(10, -30, 700, 120);
  366.  
  367.  
  368. totalScore.setFont(new Font("Calibri", Font.PLAIN, 25));
  369. totalScore.setBounds(710, 650, 300, 120);
  370.  
  371. JButton MC1Back = new JButton("Return");
  372. MC1Back.setFont(new Font("Calibri", Font.PLAIN, 32));
  373. MC1Back.setBounds(5, 650, 300, 100);
  374.  
  375. JLabel question = new JLabel();
  376. JRadioButton A = new JRadioButton();
  377. JRadioButton B = new JRadioButton();
  378. JRadioButton C = new JRadioButton();
  379. JRadioButton D = new JRadioButton();
  380.  
  381. question.setText("<html>Which of the following is a requirement in order to vote in a Canadian federal election?</html>");
  382. question.setFont(new Font("Calibri", Font.PLAIN, 15));
  383. question.setBounds(50, 50, 270, 70);
  384.  
  385. A.setText(optionA[0]);
  386. A.setBounds(55, 140, 300, 15);
  387. A.setActionCommand("A");
  388.  
  389. B.setText(optionB[0]);
  390. B.setBounds(55, 155, 300, 15);
  391. B.setActionCommand("B");
  392.  
  393. C.setText(optionC[0]);
  394. C.setBounds(55, 170, 300, 15);
  395. C.setActionCommand("C");
  396.  
  397. D.setText(optionD[0]);
  398. D.setBounds(55, 185, 300, 15);
  399. D.setActionCommand("D");
  400.  
  401. ButtonGroup Q1Group = new ButtonGroup();
  402. Q1Group.add(A);
  403. Q1Group.add(B);
  404. Q1Group.add(C);
  405. Q1Group.add(D);
  406.  
  407. JLabel question2 = new JLabel();
  408. JRadioButton A2 = new JRadioButton();
  409. JRadioButton B2 = new JRadioButton();
  410. JRadioButton C2 = new JRadioButton();
  411. JRadioButton D2 = new JRadioButton();
  412.  
  413. question2.setText("<html>What major sporting event was held in Canada in 2010?</html>");
  414. question2.setFont(new Font("Calibri", Font.PLAIN, 15));
  415. question2.setBounds(350, 50, 270, 70);
  416.  
  417. A2.setText(optionA[1]);
  418. A2.setBounds(355, 140, 300, 15);
  419. A2.setActionCommand("A");
  420.  
  421. B2.setText(optionB[1]);
  422. B2.setBounds(355, 155, 300, 15);
  423. B2.setActionCommand("B");
  424.  
  425. C2.setText(optionC[1]);
  426. C2.setBounds(355, 170, 300, 15);
  427. C2.setActionCommand("C");
  428.  
  429. D2.setText(optionD[1]);
  430. D2.setBounds(355, 185, 300, 15);
  431. D2.setActionCommand("D");
  432.  
  433. ButtonGroup Q2Group = new ButtonGroup();
  434. Q2Group.add(A2);
  435. Q2Group.add(B2);
  436. Q2Group.add(C2);
  437. Q2Group.add(D2);
  438.  
  439. JLabel question3 = new JLabel();
  440. JRadioButton A3 = new JRadioButton();
  441. JRadioButton B3 = new JRadioButton();
  442. JRadioButton C3 = new JRadioButton();
  443. JRadioButton D3 = new JRadioButton();
  444.  
  445. question3.setText("<html>Which of the following is not a province of Canada?</html>");
  446. question3.setFont(new Font("Calibri", Font.PLAIN, 15));
  447. question3.setBounds(650, 50, 270, 70);
  448.  
  449. A3.setText(optionA[2]);
  450. A3.setBounds(655, 140, 300, 15);
  451. A3.setActionCommand("A");
  452.  
  453. B3.setText(optionB[2]);
  454. B3.setBounds(655, 155, 300, 15);
  455. B3.setActionCommand("B");
  456.  
  457. C3.setText(optionC[2]);
  458. C3.setBounds(655, 170, 300, 15);
  459. C3.setActionCommand("C");
  460.  
  461. D3.setText(optionD[2]);
  462. D3.setBounds(655, 185, 300, 15);
  463. D3.setActionCommand("D");
  464.  
  465. ButtonGroup Q3Group = new ButtonGroup();
  466. Q3Group.add(A3);
  467. Q3Group.add(B3);
  468. Q3Group.add(C3);
  469. Q3Group.add(D3);
  470.  
  471. JLabel question4 = new JLabel();
  472. JRadioButton A4 = new JRadioButton();
  473. JRadioButton B4 = new JRadioButton();
  474. JRadioButton C4 = new JRadioButton();
  475. JRadioButton D4 = new JRadioButton();
  476.  
  477. question4.setText("<html>Who was the first Prime Minister of Canada?</html>");
  478. question4.setFont(new Font("Calibri", Font.PLAIN, 15));
  479. question4.setBounds(50, 350, 270, 70);
  480.  
  481. A4.setText(optionA[3]);
  482. A4.setBounds(55, 440, 300, 15);
  483. A4.setActionCommand("A");
  484.  
  485. B4.setText(optionB[3]);
  486. B4.setBounds(55, 455, 300, 15);
  487. B4.setActionCommand("B");
  488.  
  489. C4.setText(optionC[3]);
  490. C4.setBounds(55, 470, 300, 15);
  491. C4.setActionCommand("C");
  492.  
  493. D4.setText(optionD[3]);
  494. D4.setBounds(55, 485, 300, 15);
  495. D4.setActionCommand("D");
  496.  
  497. ButtonGroup Q4Group = new ButtonGroup();
  498. Q4Group.add(A4);
  499. Q4Group.add(B4);
  500. Q4Group.add(C4);
  501. Q4Group.add(D4);
  502.  
  503. JLabel question5 = new JLabel();
  504. JRadioButton A5 = new JRadioButton();
  505. JRadioButton B5 = new JRadioButton();
  506. JRadioButton C5 = new JRadioButton();
  507. JRadioButton D5 = new JRadioButton();
  508.  
  509. question5.setText("<html>How many Oceans border Canada?</html>");
  510. question5.setFont(new Font("Calibri", Font.PLAIN, 15));
  511. question5.setBounds(350, 350, 270, 70);
  512.  
  513. A5.setText(optionA[4]);
  514. A5.setBounds(355, 440, 300, 15);
  515. A5.setActionCommand("A");
  516.  
  517. B5.setText(optionB[4]);
  518. B5.setBounds(355, 455, 300, 15);
  519. B5.setActionCommand("B");
  520.  
  521. C5.setText(optionC[4]);
  522. C5.setBounds(355, 470, 300, 15);
  523. C5.setActionCommand("C");
  524.  
  525. D5.setText(optionD[4]);
  526. D5.setBounds(355, 485, 300, 15);
  527. D5.setActionCommand("D");
  528.  
  529. ButtonGroup Q5Group = new ButtonGroup();
  530. Q5Group.add(A5);
  531. Q5Group.add(B5);
  532. Q5Group.add(C5);
  533. Q5Group.add(D5);
  534.  
  535. JButton submit = new JButton("Reset");
  536. submit.setFont(new Font("Calibri", Font.PLAIN, 32));
  537. submit.setBounds(705, 450, 200, 100);
  538.  
  539. MC1.add(MC1Title);
  540. MC1.add(question);
  541. MC1.add(question2);
  542. MC1.add(question3);
  543. MC1.add(question4);
  544. MC1.add(question5);
  545. MC1.add(MC1Back);
  546. MC1.add(A);
  547. MC1.add(B);
  548. MC1.add(C);
  549. MC1.add(D);
  550. MC1.add(A2);
  551. MC1.add(B2);
  552. MC1.add(C2);
  553. MC1.add(D2);
  554. MC1.add(A3);
  555. MC1.add(B3);
  556. MC1.add(C3);
  557. MC1.add(D3);
  558. MC1.add(A4);
  559. MC1.add(B4);
  560. MC1.add(C4);
  561. MC1.add(D4);
  562. MC1.add(A5);
  563. MC1.add(B5);
  564. MC1.add(C5);
  565. MC1.add(D5);
  566. MC1.add(totalScore);
  567. MC1.add(submit);
  568.  
  569. card1.show(mainQuiz, "b");
  570.  
  571. MC1Back.addActionListener(new ActionListener(){
  572.  
  573. public void actionPerformed(ActionEvent e){
  574.  
  575. questionsTotal -= 5;
  576. quiz();
  577.  
  578. }
  579. });
  580.  
  581. A.addActionListener(new ActionListener(){
  582.  
  583. public void actionPerformed(ActionEvent e){
  584.  
  585. MC1.remove(A);
  586. MC1.remove(B);
  587. MC1.remove(C);
  588. MC1.remove(D);
  589. MC1.repaint();
  590.  
  591. }
  592. });
  593.  
  594. B.addActionListener(new ActionListener(){
  595.  
  596. public void actionPerformed(ActionEvent e){
  597.  
  598. MC1.remove(A);
  599. MC1.remove(B);
  600. MC1.remove(C);
  601. MC1.remove(D);
  602. MC1.repaint();
  603.  
  604. }
  605. });
  606.  
  607. C.addActionListener(new ActionListener(){
  608.  
  609. public void actionPerformed(ActionEvent e){
  610.  
  611. MC1.remove(A);
  612. MC1.remove(B);
  613. MC1.remove(C);
  614. MC1.remove(D);
  615. MC1.repaint();
  616.  
  617. }
  618. });
  619.  
  620.  
  621. D.addActionListener(new ActionListener(){
  622.  
  623. public void actionPerformed(ActionEvent e){
  624.  
  625. correct++;
  626. scoreCalculate();
  627. MC1.remove(A);
  628. MC1.remove(B);
  629. MC1.remove(C);
  630. MC1.remove(D);
  631. MC1.repaint();
  632.  
  633. }
  634. });
  635.  
  636. A2.addActionListener(new ActionListener(){
  637.  
  638. public void actionPerformed(ActionEvent e){
  639.  
  640. MC1.remove(A2);
  641. MC1.remove(B2);
  642. MC1.remove(C2);
  643. MC1.remove(D2);
  644. MC1.repaint();
  645.  
  646. }
  647. });
  648.  
  649. B2.addActionListener(new ActionListener(){
  650.  
  651. public void actionPerformed(ActionEvent e){
  652.  
  653. correct++;
  654. scoreCalculate();
  655. MC1.remove(A2);
  656. MC1.remove(B2);
  657. MC1.remove(C2);
  658. MC1.remove(D2);
  659. MC1.repaint();
  660.  
  661. }
  662. });
  663.  
  664. C2.addActionListener(new ActionListener(){
  665.  
  666. public void actionPerformed(ActionEvent e){
  667.  
  668. MC1.remove(A2);
  669. MC1.remove(B2);
  670. MC1.remove(C2);
  671. MC1.remove(D2);
  672. MC1.repaint();
  673.  
  674. }
  675. });
  676.  
  677.  
  678. D2.addActionListener(new ActionListener(){
  679.  
  680. public void actionPerformed(ActionEvent e){
  681.  
  682. MC1.remove(A2);
  683. MC1.remove(B2);
  684. MC1.remove(C2);
  685. MC1.remove(D2);
  686. MC1.repaint();
  687.  
  688. }
  689. });
  690.  
  691. A3.addActionListener(new ActionListener(){
  692.  
  693. public void actionPerformed(ActionEvent e){
  694.  
  695. MC1.remove(A3);
  696. MC1.remove(B3);
  697. MC1.remove(C3);
  698. MC1.remove(D3);
  699. MC1.repaint();
  700.  
  701. }
  702. });
  703.  
  704. B3.addActionListener(new ActionListener(){
  705.  
  706. public void actionPerformed(ActionEvent e){
  707.  
  708. MC1.remove(A3);
  709. MC1.remove(B3);
  710. MC1.remove(C3);
  711. MC1.remove(D3);
  712. MC1.repaint();
  713.  
  714. }
  715. });
  716.  
  717. C3.addActionListener(new ActionListener(){
  718.  
  719. public void actionPerformed(ActionEvent e){
  720.  
  721. correct++;
  722. scoreCalculate();
  723. MC1.remove(A3);
  724. MC1.remove(B3);
  725. MC1.remove(C3);
  726. MC1.remove(D3);
  727. MC1.repaint();
  728.  
  729. }
  730. });
  731.  
  732.  
  733. D3.addActionListener(new ActionListener(){
  734.  
  735. public void actionPerformed(ActionEvent e){
  736.  
  737.  
  738. MC1.remove(A3);
  739. MC1.remove(B3);
  740. MC1.remove(C3);
  741. MC1.remove(D3);
  742. MC1.repaint();
  743.  
  744. }
  745. });
  746. A4.addActionListener(new ActionListener(){
  747.  
  748. public void actionPerformed(ActionEvent e){
  749.  
  750. MC1.remove(A4);
  751. MC1.remove(B4);
  752. MC1.remove(C4);
  753. MC1.remove(D4);
  754. MC1.repaint();
  755.  
  756. }
  757. });
  758.  
  759. B4.addActionListener(new ActionListener(){
  760.  
  761. public void actionPerformed(ActionEvent e){
  762.  
  763. correct++;
  764. scoreCalculate();
  765. MC1.remove(A4);
  766. MC1.remove(B4);
  767. MC1.remove(C4);
  768. MC1.remove(D4);
  769. MC1.repaint();
  770.  
  771. }
  772. });
  773.  
  774. C4.addActionListener(new ActionListener(){
  775.  
  776. public void actionPerformed(ActionEvent e){
  777.  
  778. MC1.remove(A4);
  779. MC1.remove(B4);
  780. MC1.remove(C4);
  781. MC1.remove(D4);
  782. MC1.repaint();
  783.  
  784. }
  785. });
  786.  
  787.  
  788. D4.addActionListener(new ActionListener(){
  789.  
  790. public void actionPerformed(ActionEvent e){
  791.  
  792.  
  793. MC1.remove(A4);
  794. MC1.remove(B4);
  795. MC1.remove(C4);
  796. MC1.remove(D4);
  797. MC1.repaint();
  798.  
  799. }
  800. });
  801.  
  802. A5.addActionListener(new ActionListener(){
  803.  
  804. public void actionPerformed(ActionEvent e){
  805.  
  806. MC1.remove(A5);
  807. MC1.remove(B5);
  808. MC1.remove(C5);
  809. MC1.remove(D5);
  810. MC1.repaint();
  811.  
  812. }
  813. });
  814.  
  815. B5.addActionListener(new ActionListener(){
  816.  
  817. public void actionPerformed(ActionEvent e){
  818.  
  819. MC1.remove(A5);
  820. MC1.remove(B5);
  821. MC1.remove(C5);
  822. MC1.remove(D5);
  823. MC1.repaint();
  824.  
  825. }
  826. });
  827.  
  828. C5.addActionListener(new ActionListener(){
  829.  
  830. public void actionPerformed(ActionEvent e){
  831.  
  832. correct++;
  833. scoreCalculate();
  834. MC1.remove(A5);
  835. MC1.remove(B5);
  836. MC1.remove(C5);
  837. MC1.remove(D5);
  838. MC1.repaint();
  839.  
  840. }
  841. });
  842.  
  843.  
  844. D5.addActionListener(new ActionListener(){
  845.  
  846. public void actionPerformed(ActionEvent e){
  847.  
  848. MC1.remove(A5);
  849. MC1.remove(B5);
  850. MC1.remove(C5);
  851. MC1.remove(D5);
  852. MC1.repaint();
  853.  
  854. }
  855. });
  856.  
  857.  
  858.  
  859. }
  860.  
  861. public static void scoreCalculate(){
  862.  
  863. totalScore.setText("Session Score: " + correct + " / " + questionsTotal);
  864.  
  865.  
  866. }
  867.  
  868. public static void MCLevel2(){ //Main Programmer: Amarnath Parthiban
  869.  
  870. JPanel MC2 = new JPanel();
  871. MC2.setLayout(null);
  872.  
  873. mainQuiz.add(MC2, "c");
  874.  
  875. JLabel MC1Title = new JLabel("Multiple Choice Level 2");
  876. MC1Title.setFont(new Font("Calibri", Font.PLAIN, 50));
  877. MC1Title.setBounds(10, -30, 700, 120);
  878.  
  879.  
  880. totalScore.setFont(new Font("Calibri", Font.PLAIN, 25));
  881. totalScore.setBounds(710, 650, 300, 120);
  882. totalScore.setText("Session Score: " + correct + " / " + questionsTotal);
  883.  
  884. JButton MC1Back = new JButton("Return");
  885. MC1Back.setFont(new Font("Calibri", Font.PLAIN, 32));
  886. MC1Back.setBounds(5, 650, 300, 100);
  887.  
  888. JLabel question = new JLabel();
  889. JRadioButton A = new JRadioButton();
  890. JRadioButton B = new JRadioButton();
  891. JRadioButton C = new JRadioButton();
  892. JRadioButton D = new JRadioButton();
  893.  
  894. question.setText("<html>What is the status of Canada?</html>");
  895. question.setFont(new Font("Calibri", Font.PLAIN, 15));
  896. question.setBounds(50, 50, 270, 70);
  897.  
  898. A.setText(optionA[10]);
  899. A.setBounds(55, 140, 300, 15);
  900. A.setActionCommand("A");
  901.  
  902. B.setText(optionB[10]);
  903. B.setBounds(55, 155, 300, 15);
  904. B.setActionCommand("B");
  905.  
  906. C.setText(optionC[10]);
  907. C.setBounds(55, 170, 300, 15);
  908. C.setActionCommand("C");
  909.  
  910. D.setText(optionD[10]);
  911. D.setBounds(55, 185, 300, 15);
  912. D.setActionCommand("D");
  913.  
  914. ButtonGroup Q1Group = new ButtonGroup();
  915. Q1Group.add(A);
  916. Q1Group.add(B);
  917. Q1Group.add(C);
  918. Q1Group.add(D);
  919.  
  920. JLabel question2 = new JLabel();
  921. JRadioButton A2 = new JRadioButton();
  922. JRadioButton B2 = new JRadioButton();
  923. JRadioButton C2 = new JRadioButton();
  924. JRadioButton D2 = new JRadioButton();
  925.  
  926. question2.setText("<html>Which of the following islands is not part of Canada?</html>");
  927. question2.setFont(new Font("Calibri", Font.PLAIN, 15));
  928. question2.setBounds(350, 50, 270, 70);
  929.  
  930. A2.setText(optionA[11]);
  931. A2.setBounds(355, 140, 300, 15);
  932. A2.setActionCommand("A");
  933.  
  934. B2.setText(optionB[11]);
  935. B2.setBounds(355, 155, 300, 15);
  936. B2.setActionCommand("B");
  937.  
  938. C2.setText(optionC[11]);
  939. C2.setBounds(355, 170, 300, 15);
  940. C2.setActionCommand("C");
  941.  
  942. D2.setText(optionD[11]);
  943. D2.setBounds(355, 185, 300, 15);
  944. D2.setActionCommand("D");
  945.  
  946. ButtonGroup Q2Group = new ButtonGroup();
  947. Q2Group.add(A2);
  948. Q2Group.add(B2);
  949. Q2Group.add(C2);
  950. Q2Group.add(D2);
  951.  
  952. JLabel question3 = new JLabel();
  953. JRadioButton A3 = new JRadioButton();
  954. JRadioButton B3 = new JRadioButton();
  955. JRadioButton C3 = new JRadioButton();
  956. JRadioButton D3 = new JRadioButton();
  957.  
  958. question3.setText("<html>Which is the longest river in Canada?</html>");
  959. question3.setFont(new Font("Calibri", Font.PLAIN, 15));
  960. question3.setBounds(650, 50, 270, 70);
  961.  
  962. A3.setText(optionA[12]);
  963. A3.setBounds(655, 140, 300, 15);
  964. A3.setActionCommand("A");
  965.  
  966. B3.setText(optionB[12]);
  967. B3.setBounds(655, 155, 300, 15);
  968. B3.setActionCommand("B");
  969.  
  970. C3.setText(optionC[12]);
  971. C3.setBounds(655, 170, 300, 15);
  972. C3.setActionCommand("C");
  973.  
  974. D3.setText(optionD[12]);
  975. D3.setBounds(655, 185, 300, 15);
  976. D3.setActionCommand("D");
  977.  
  978. ButtonGroup Q3Group = new ButtonGroup();
  979. Q3Group.add(A3);
  980. Q3Group.add(B3);
  981. Q3Group.add(C3);
  982. Q3Group.add(D3);
  983.  
  984. JLabel question4 = new JLabel();
  985. JRadioButton A4 = new JRadioButton();
  986. JRadioButton B4 = new JRadioButton();
  987. JRadioButton C4 = new JRadioButton();
  988. JRadioButton D4 = new JRadioButton();
  989.  
  990. question4.setText("<html>Which Canadian province is the country’s largest producer and exporter of maple syrup?<html>");
  991. question4.setFont(new Font("Calibri", Font.PLAIN, 15));
  992. question4.setBounds(50, 350, 270, 70);
  993.  
  994. A4.setText(optionA[13]);
  995. A4.setBounds(55, 440, 300, 15);
  996. A4.setActionCommand("A");
  997.  
  998. B4.setText(optionB[13]);
  999. B4.setBounds(55, 455, 300, 15);
  1000. B4.setActionCommand("B");
  1001.  
  1002. C4.setText(optionC[13]);
  1003. C4.setBounds(55, 470, 300, 15);
  1004. C4.setActionCommand("C");
  1005.  
  1006. D4.setText(optionD[13]);
  1007. D4.setBounds(55, 485, 300, 15);
  1008. D4.setActionCommand("D");
  1009.  
  1010. ButtonGroup Q4Group = new ButtonGroup();
  1011. Q4Group.add(A4);
  1012. Q4Group.add(B4);
  1013. Q4Group.add(C4);
  1014. Q4Group.add(D4);
  1015.  
  1016. JLabel question5 = new JLabel();
  1017. JRadioButton A5 = new JRadioButton();
  1018. JRadioButton B5 = new JRadioButton();
  1019. JRadioButton C5 = new JRadioButton();
  1020. JRadioButton D5 = new JRadioButton();
  1021.  
  1022. question5.setText("<html>Who donated the Stanley Cup to the National Hockey League?</html>");
  1023. question5.setFont(new Font("Calibri", Font.PLAIN, 15));
  1024. question5.setBounds(350, 350, 270, 70);
  1025.  
  1026. A5.setText(optionA[14]);
  1027. A5.setBounds(355, 440, 300, 15);
  1028. A5.setActionCommand("A");
  1029.  
  1030. B5.setText(optionB[14]);
  1031. B5.setBounds(355, 455, 300, 15);
  1032. B5.setActionCommand("B");
  1033.  
  1034. C5.setText(optionC[14]);
  1035. C5.setBounds(355, 470, 300, 15);
  1036. C5.setActionCommand("C");
  1037.  
  1038. D5.setText(optionD[14]);
  1039. D5.setBounds(355, 485, 300, 15);
  1040. D5.setActionCommand("D");
  1041.  
  1042. ButtonGroup Q5Group = new ButtonGroup();
  1043. Q5Group.add(A5);
  1044. Q5Group.add(B5);
  1045. Q5Group.add(C5);
  1046. Q5Group.add(D5);
  1047.  
  1048. JButton submit = new JButton("Submit");
  1049. submit.setFont(new Font("Calibri", Font.PLAIN, 32));
  1050. submit.setBounds(705, 450, 200, 100);
  1051.  
  1052. MC2.add(MC1Title);
  1053. MC2.add(question);
  1054. MC2.add(question2);
  1055. MC2.add(question3);
  1056. MC2.add(question4);
  1057. MC2.add(question5);
  1058. MC2.add(MC1Back);
  1059. MC2.add(A);
  1060. MC2.add(B);
  1061. MC2.add(C);
  1062. MC2.add(D);
  1063. MC2.add(A2);
  1064. MC2.add(B2);
  1065. MC2.add(C2);
  1066. MC2.add(D2);
  1067. MC2.add(A3);
  1068. MC2.add(B3);
  1069. MC2.add(C3);
  1070. MC2.add(D3);
  1071. MC2.add(A4);
  1072. MC2.add(B4);
  1073. MC2.add(C4);
  1074. MC2.add(D4);
  1075. MC2.add(A5);
  1076. MC2.add(B5);
  1077. MC2.add(C5);
  1078. MC2.add(D5);
  1079. MC2.add(totalScore);
  1080. MC2.add(submit);
  1081.  
  1082. card1.show(mainQuiz, "c");
  1083.  
  1084. MC1Back.addActionListener(new ActionListener(){
  1085.  
  1086. public void actionPerformed(ActionEvent e){
  1087.  
  1088. questionsTotal -= 5;
  1089. quiz();
  1090.  
  1091. }
  1092. });
  1093.  
  1094. A.addActionListener(new ActionListener(){
  1095.  
  1096. public void actionPerformed(ActionEvent e){
  1097.  
  1098. MC2.remove(A);
  1099. MC2.remove(B);
  1100. MC2.remove(C);
  1101. MC2.remove(D);
  1102. MC2.repaint();
  1103.  
  1104. }
  1105. });
  1106.  
  1107. B.addActionListener(new ActionListener(){
  1108.  
  1109. public void actionPerformed(ActionEvent e){
  1110.  
  1111. correct++;
  1112. scoreCalculate();
  1113. MC2.remove(A);
  1114. MC2.remove(B);
  1115. MC2.remove(C);
  1116. MC2.remove(D);
  1117. MC2.repaint();
  1118.  
  1119. }
  1120. });
  1121.  
  1122. C.addActionListener(new ActionListener(){
  1123.  
  1124. public void actionPerformed(ActionEvent e){
  1125.  
  1126. MC2.remove(A);
  1127. MC2.remove(B);
  1128. MC2.remove(C);
  1129. MC2.remove(D);
  1130. MC2.repaint();
  1131.  
  1132. }
  1133. });
  1134.  
  1135.  
  1136. D.addActionListener(new ActionListener(){
  1137.  
  1138. public void actionPerformed(ActionEvent e){
  1139.  
  1140. MC2.remove(A);
  1141. MC2.remove(B);
  1142. MC2.remove(C);
  1143. MC2.remove(D);
  1144. MC2.repaint();
  1145.  
  1146. }
  1147. });
  1148.  
  1149. A2.addActionListener(new ActionListener(){
  1150.  
  1151. public void actionPerformed(ActionEvent e){
  1152.  
  1153. MC2.remove(A2);
  1154. MC2.remove(B2);
  1155. MC2.remove(C2);
  1156. MC2.remove(D2);
  1157. MC2.repaint();
  1158.  
  1159. }
  1160. });
  1161.  
  1162. B2.addActionListener(new ActionListener(){
  1163.  
  1164. public void actionPerformed(ActionEvent e){
  1165.  
  1166. correct++;
  1167. scoreCalculate();
  1168. MC2.remove(A2);
  1169. MC2.remove(B2);
  1170. MC2.remove(C2);
  1171. MC2.remove(D2);
  1172. MC2.repaint();
  1173.  
  1174. }
  1175. });
  1176.  
  1177. C2.addActionListener(new ActionListener(){
  1178.  
  1179. public void actionPerformed(ActionEvent e){
  1180.  
  1181. MC2.remove(A2);
  1182. MC2.remove(B2);
  1183. MC2.remove(C2);
  1184. MC2.remove(D2);
  1185. MC2.repaint();
  1186.  
  1187. }
  1188. });
  1189.  
  1190.  
  1191. D2.addActionListener(new ActionListener(){
  1192.  
  1193. public void actionPerformed(ActionEvent e){
  1194.  
  1195. MC2.remove(A2);
  1196. MC2.remove(B2);
  1197. MC2.remove(C2);
  1198. MC2.remove(D2);
  1199. MC2.repaint();
  1200.  
  1201. }
  1202. });
  1203.  
  1204. A3.addActionListener(new ActionListener(){
  1205.  
  1206. public void actionPerformed(ActionEvent e){
  1207.  
  1208. MC2.remove(A3);
  1209. MC2.remove(B3);
  1210. MC2.remove(C3);
  1211. MC2.remove(D3);
  1212. MC2.repaint();
  1213.  
  1214. }
  1215. });
  1216.  
  1217. B3.addActionListener(new ActionListener(){
  1218.  
  1219. public void actionPerformed(ActionEvent e){
  1220.  
  1221. MC2.remove(A3);
  1222. MC2.remove(B3);
  1223. MC2.remove(C3);
  1224. MC2.remove(D3);
  1225. MC2.repaint();
  1226.  
  1227. }
  1228. });
  1229.  
  1230. C3.addActionListener(new ActionListener(){
  1231.  
  1232. public void actionPerformed(ActionEvent e){
  1233.  
  1234. correct++;
  1235. scoreCalculate();
  1236. MC2.remove(A3);
  1237. MC2.remove(B3);
  1238. MC2.remove(C3);
  1239. MC2.remove(D3);
  1240. MC2.repaint();
  1241.  
  1242. }
  1243. });
  1244.  
  1245.  
  1246. D3.addActionListener(new ActionListener(){
  1247.  
  1248. public void actionPerformed(ActionEvent e){
  1249.  
  1250.  
  1251. MC2.remove(A3);
  1252. MC2.remove(B3);
  1253. MC2.remove(C3);
  1254. MC2.remove(D3);
  1255. MC2.repaint();
  1256.  
  1257. }
  1258. });
  1259. A4.addActionListener(new ActionListener(){
  1260.  
  1261. public void actionPerformed(ActionEvent e){
  1262.  
  1263. MC2.remove(A4);
  1264. MC2.remove(B4);
  1265. MC2.remove(C4);
  1266. MC2.remove(D4);
  1267. MC2.repaint();
  1268.  
  1269. }
  1270. });
  1271.  
  1272. B4.addActionListener(new ActionListener(){
  1273.  
  1274. public void actionPerformed(ActionEvent e){
  1275.  
  1276. MC2.remove(A4);
  1277. MC2.remove(B4);
  1278. MC2.remove(C4);
  1279. MC2.remove(D4);
  1280. MC2.repaint();
  1281.  
  1282. }
  1283. });
  1284.  
  1285. C4.addActionListener(new ActionListener(){
  1286.  
  1287. public void actionPerformed(ActionEvent e){
  1288.  
  1289. correct++;
  1290. scoreCalculate();
  1291. MC2.remove(A4);
  1292. MC2.remove(B4);
  1293. MC2.remove(C4);
  1294. MC2.remove(D4);
  1295. MC2.repaint();
  1296.  
  1297. }
  1298. });
  1299.  
  1300.  
  1301. D4.addActionListener(new ActionListener(){
  1302.  
  1303. public void actionPerformed(ActionEvent e){
  1304.  
  1305.  
  1306. MC2.remove(A4);
  1307. MC2.remove(B4);
  1308. MC2.remove(C4);
  1309. MC2.remove(D4);
  1310. MC2.repaint();
  1311.  
  1312. }
  1313. });
  1314.  
  1315. A5.addActionListener(new ActionListener(){
  1316.  
  1317. public void actionPerformed(ActionEvent e){
  1318.  
  1319. correct++;
  1320. scoreCalculate();
  1321. MC2.remove(A5);
  1322. MC2.remove(B5);
  1323. MC2.remove(C5);
  1324. MC2.remove(D5);
  1325. MC2.repaint();
  1326.  
  1327. }
  1328. });
  1329.  
  1330. B5.addActionListener(new ActionListener(){
  1331.  
  1332. public void actionPerformed(ActionEvent e){
  1333.  
  1334. MC2.remove(A5);
  1335. MC2.remove(B5);
  1336. MC2.remove(C5);
  1337. MC2.remove(D5);
  1338. MC2.repaint();
  1339.  
  1340. }
  1341. });
  1342.  
  1343. C5.addActionListener(new ActionListener(){
  1344.  
  1345. public void actionPerformed(ActionEvent e){
  1346.  
  1347. MC2.remove(A5);
  1348. MC2.remove(B5);
  1349. MC2.remove(C5);
  1350. MC2.remove(D5);
  1351. MC2.repaint();
  1352.  
  1353. }
  1354. });
  1355.  
  1356.  
  1357. D5.addActionListener(new ActionListener(){
  1358.  
  1359. public void actionPerformed(ActionEvent e){
  1360.  
  1361. MC2.remove(A5);
  1362. MC2.remove(B5);
  1363. MC2.remove(C5);
  1364. MC2.remove(D5);
  1365. MC2.repaint();
  1366.  
  1367. }
  1368. });
  1369.  
  1370.  
  1371. }
  1372.  
  1373. public static void MCLevel3(){ //Main Programmer: Amarnath Parthiban
  1374.  
  1375. JPanel MC3 = new JPanel();
  1376. MC3.setLayout(null);
  1377.  
  1378. mainQuiz.add(MC3, "d");
  1379.  
  1380. JLabel MC1Title = new JLabel("Multiple Choice Level 3");
  1381. MC1Title.setFont(new Font("Calibri", Font.PLAIN, 50));
  1382. MC1Title.setBounds(10, -30, 700, 120);
  1383.  
  1384.  
  1385. totalScore.setFont(new Font("Calibri", Font.PLAIN, 25));
  1386. totalScore.setBounds(710, 650, 300, 120);
  1387. totalScore.setText("Session Score: " + correct + " / " + questionsTotal);
  1388.  
  1389. JButton MC1Back = new JButton("Return");
  1390. MC1Back.setFont(new Font("Calibri", Font.PLAIN, 32));
  1391. MC1Back.setBounds(5, 650, 300, 100);
  1392.  
  1393. JLabel question = new JLabel();
  1394. JRadioButton A = new JRadioButton();
  1395. JRadioButton B = new JRadioButton();
  1396. JRadioButton C = new JRadioButton();
  1397. JRadioButton D = new JRadioButton();
  1398.  
  1399. question.setText("<html>Why did Ottawa establish the Mounted Police in 1873?</html>");
  1400. question.setFont(new Font("Calibri", Font.PLAIN, 15));
  1401. question.setBounds(50, 50, 270, 70);
  1402.  
  1403. A.setText(optionA[5]);
  1404. A.setBounds(55, 140, 300, 15);
  1405. A.setActionCommand("A");
  1406.  
  1407. B.setText(optionB[5]);
  1408. B.setBounds(55, 155, 300, 15);
  1409. B.setActionCommand("B");
  1410.  
  1411. C.setText(optionC[5]);
  1412. C.setBounds(55, 170, 300, 15);
  1413. C.setActionCommand("C");
  1414.  
  1415. D.setText(optionD[5]);
  1416. D.setBounds(55, 185, 300, 15);
  1417. D.setActionCommand("D");
  1418.  
  1419. ButtonGroup Q1Group = new ButtonGroup();
  1420. Q1Group.add(A);
  1421. Q1Group.add(B);
  1422. Q1Group.add(C);
  1423. Q1Group.add(D);
  1424.  
  1425. JLabel question2 = new JLabel();
  1426. JRadioButton A2 = new JRadioButton();
  1427. JRadioButton B2 = new JRadioButton();
  1428. JRadioButton C2 = new JRadioButton();
  1429. JRadioButton D2 = new JRadioButton();
  1430.  
  1431. question2.setText("<html>Which famous Canadian composed the Canadian national anthem?</html>");
  1432. question2.setFont(new Font("Calibri", Font.PLAIN, 15));
  1433. question2.setBounds(350, 50, 270, 70);
  1434.  
  1435. A2.setText(optionA[6]);
  1436. A2.setBounds(355, 140, 300, 15);
  1437. A2.setActionCommand("A");
  1438.  
  1439. B2.setText(optionB[6]);
  1440. B2.setBounds(355, 155, 300, 15);
  1441. B2.setActionCommand("B");
  1442.  
  1443. C2.setText(optionC[6]);
  1444. C2.setBounds(355, 170, 300, 15);
  1445. C2.setActionCommand("C");
  1446.  
  1447. D2.setText(optionD[6]);
  1448. D2.setBounds(355, 185, 300, 15);
  1449. D2.setActionCommand("D");
  1450.  
  1451. ButtonGroup Q2Group = new ButtonGroup();
  1452. Q2Group.add(A2);
  1453. Q2Group.add(B2);
  1454. Q2Group.add(C2);
  1455. Q2Group.add(D2);
  1456.  
  1457. JLabel question3 = new JLabel();
  1458. JRadioButton A3 = new JRadioButton();
  1459. JRadioButton B3 = new JRadioButton();
  1460. JRadioButton C3 = new JRadioButton();
  1461. JRadioButton D3 = new JRadioButton();
  1462.  
  1463. question3.setText("<html>Who is the Head of State of Canada?</html>");
  1464. question3.setFont(new Font("Calibri", Font.PLAIN, 15));
  1465. question3.setBounds(650, 50, 270, 70);
  1466.  
  1467. A3.setText(optionA[7]);
  1468. A3.setBounds(655, 140, 300, 15);
  1469. A3.setActionCommand("A");
  1470.  
  1471. B3.setText(optionB[7]);
  1472. B3.setBounds(655, 155, 300, 15);
  1473. B3.setActionCommand("B");
  1474.  
  1475. C3.setText(optionC[7]);
  1476. C3.setBounds(655, 170, 300, 15);
  1477. C3.setActionCommand("C");
  1478.  
  1479. D3.setText(optionD[7]);
  1480. D3.setBounds(655, 185, 300, 15);
  1481. D3.setActionCommand("D");
  1482.  
  1483. ButtonGroup Q3Group = new ButtonGroup();
  1484. Q3Group.add(A3);
  1485. Q3Group.add(B3);
  1486. Q3Group.add(C3);
  1487. Q3Group.add(D3);
  1488.  
  1489. JLabel question4 = new JLabel();
  1490. JRadioButton A4 = new JRadioButton();
  1491. JRadioButton B4 = new JRadioButton();
  1492. JRadioButton C4 = new JRadioButton();
  1493. JRadioButton D4 = new JRadioButton();
  1494.  
  1495. question4.setText("<html>Who after winning gold medal in 100 metres race in Seoul Olympics 1988 tested positive for drugs and was thrown out?<html>");
  1496. question4.setFont(new Font("Calibri", Font.PLAIN, 15));
  1497. question4.setBounds(50, 350, 270, 70);
  1498.  
  1499. A4.setText(optionA[8]);
  1500. A4.setBounds(55, 440, 300, 15);
  1501. A4.setActionCommand("A");
  1502.  
  1503. B4.setText(optionB[8]);
  1504. B4.setBounds(55, 455, 300, 15);
  1505. B4.setActionCommand("B");
  1506.  
  1507. C4.setText(optionC[8]);
  1508. C4.setBounds(55, 470, 300, 15);
  1509. C4.setActionCommand("C");
  1510.  
  1511. D4.setText(optionD[8]);
  1512. D4.setBounds(55, 485, 300, 15);
  1513. D4.setActionCommand("D");
  1514.  
  1515. ButtonGroup Q4Group = new ButtonGroup();
  1516. Q4Group.add(A4);
  1517. Q4Group.add(B4);
  1518. Q4Group.add(C4);
  1519. Q4Group.add(D4);
  1520.  
  1521. JLabel question5 = new JLabel();
  1522. JRadioButton A5 = new JRadioButton();
  1523. JRadioButton B5 = new JRadioButton();
  1524. JRadioButton C5 = new JRadioButton();
  1525. JRadioButton D5 = new JRadioButton();
  1526.  
  1527. question5.setText("<html>What university developed the world’s first anti-gravity suit?</html>");
  1528. question5.setFont(new Font("Calibri", Font.PLAIN, 15));
  1529. question5.setBounds(350, 350, 270, 70);
  1530.  
  1531. A5.setText(optionA[9]);
  1532. A5.setBounds(355, 440, 300, 15);
  1533. A5.setActionCommand("A");
  1534.  
  1535. B5.setText(optionB[9]);
  1536. B5.setBounds(355, 455, 300, 15);
  1537. B5.setActionCommand("B");
  1538.  
  1539. C5.setText(optionC[9]);
  1540. C5.setBounds(355, 470, 300, 15);
  1541. C5.setActionCommand("C");
  1542.  
  1543. D5.setText(optionD[9]);
  1544. D5.setBounds(355, 485, 300, 15);
  1545. D5.setActionCommand("D");
  1546.  
  1547. ButtonGroup Q5Group = new ButtonGroup();
  1548. Q5Group.add(A5);
  1549. Q5Group.add(B5);
  1550. Q5Group.add(C5);
  1551. Q5Group.add(D5);
  1552.  
  1553. JButton submit = new JButton("Submit");
  1554. submit.setFont(new Font("Calibri", Font.PLAIN, 32));
  1555. submit.setBounds(705, 450, 200, 100);
  1556.  
  1557. MC3.add(MC1Title);
  1558. MC3.add(question);
  1559. MC3.add(question2);
  1560. MC3.add(question3);
  1561. MC3.add(question4);
  1562. MC3.add(question5);
  1563. MC3.add(MC1Back);
  1564. MC3.add(A);
  1565. MC3.add(B);
  1566. MC3.add(C);
  1567. MC3.add(D);
  1568. MC3.add(A2);
  1569. MC3.add(B2);
  1570. MC3.add(C2);
  1571. MC3.add(D2);
  1572. MC3.add(A3);
  1573. MC3.add(B3);
  1574. MC3.add(C3);
  1575. MC3.add(D3);
  1576. MC3.add(A4);
  1577. MC3.add(B4);
  1578. MC3.add(C4);
  1579. MC3.add(D4);
  1580. MC3.add(A5);
  1581. MC3.add(B5);
  1582. MC3.add(C5);
  1583. MC3.add(D5);
  1584. MC3.add(totalScore);
  1585. MC3.add(submit);
  1586.  
  1587. card1.show(mainQuiz, "d");
  1588.  
  1589. MC1Back.addActionListener(new ActionListener(){
  1590.  
  1591. public void actionPerformed(ActionEvent e){
  1592.  
  1593. questionsTotal -= 5;
  1594. quiz();
  1595.  
  1596. }
  1597. });
  1598.  
  1599. A.addActionListener(new ActionListener(){
  1600.  
  1601. public void actionPerformed(ActionEvent e){
  1602.  
  1603. MC3.remove(A);
  1604. MC3.remove(B);
  1605. MC3.remove(C);
  1606. MC3.remove(D);
  1607. MC3.repaint();
  1608.  
  1609. }
  1610. });
  1611.  
  1612. B.addActionListener(new ActionListener(){
  1613.  
  1614. public void actionPerformed(ActionEvent e){
  1615.  
  1616. correct++;
  1617. scoreCalculate();
  1618. MC3.remove(A);
  1619. MC3.remove(B);
  1620. MC3.remove(C);
  1621. MC3.remove(D);
  1622. MC3.repaint();
  1623.  
  1624. }
  1625. });
  1626.  
  1627. C.addActionListener(new ActionListener(){
  1628.  
  1629. public void actionPerformed(ActionEvent e){
  1630.  
  1631. MC3.remove(A);
  1632. MC3.remove(B);
  1633. MC3.remove(C);
  1634. MC3.remove(D);
  1635. MC3.repaint();
  1636.  
  1637. }
  1638. });
  1639.  
  1640.  
  1641. D.addActionListener(new ActionListener(){
  1642.  
  1643. public void actionPerformed(ActionEvent e){
  1644.  
  1645. MC3.remove(A);
  1646. MC3.remove(B);
  1647. MC3.remove(C);
  1648. MC3.remove(D);
  1649. MC3.repaint();
  1650.  
  1651. }
  1652. });
  1653.  
  1654. A2.addActionListener(new ActionListener(){
  1655.  
  1656. public void actionPerformed(ActionEvent e){
  1657.  
  1658. correct++;
  1659. scoreCalculate();
  1660. MC3.remove(A2);
  1661. MC3.remove(B2);
  1662. MC3.remove(C2);
  1663. MC3.remove(D2);
  1664. MC3.repaint();
  1665.  
  1666. }
  1667. });
  1668.  
  1669. B2.addActionListener(new ActionListener(){
  1670.  
  1671. public void actionPerformed(ActionEvent e){
  1672.  
  1673. MC3.remove(A2);
  1674. MC3.remove(B2);
  1675. MC3.remove(C2);
  1676. MC3.remove(D2);
  1677. MC3.repaint();
  1678.  
  1679. }
  1680. });
  1681.  
  1682. C2.addActionListener(new ActionListener(){
  1683.  
  1684. public void actionPerformed(ActionEvent e){
  1685.  
  1686. MC3.remove(A2);
  1687. MC3.remove(B2);
  1688. MC3.remove(C2);
  1689. MC3.remove(D2);
  1690. MC3.repaint();
  1691.  
  1692. }
  1693. });
  1694.  
  1695.  
  1696. D2.addActionListener(new ActionListener(){
  1697.  
  1698. public void actionPerformed(ActionEvent e){
  1699.  
  1700. MC3.remove(A2);
  1701. MC3.remove(B2);
  1702. MC3.remove(C2);
  1703. MC3.remove(D2);
  1704. MC3.repaint();
  1705.  
  1706. }
  1707. });
  1708.  
  1709. A3.addActionListener(new ActionListener(){
  1710.  
  1711. public void actionPerformed(ActionEvent e){
  1712.  
  1713. MC3.remove(A3);
  1714. MC3.remove(B3);
  1715. MC3.remove(C3);
  1716. MC3.remove(D3);
  1717. MC3.repaint();
  1718.  
  1719. }
  1720. });
  1721.  
  1722. B3.addActionListener(new ActionListener(){
  1723.  
  1724. public void actionPerformed(ActionEvent e){
  1725.  
  1726. correct++;
  1727. scoreCalculate();
  1728. MC3.remove(A3);
  1729. MC3.remove(B3);
  1730. MC3.remove(C3);
  1731. MC3.remove(D3);
  1732. MC3.repaint();
  1733.  
  1734. }
  1735. });
  1736.  
  1737. C3.addActionListener(new ActionListener(){
  1738.  
  1739. public void actionPerformed(ActionEvent e){
  1740.  
  1741. MC3.remove(A3);
  1742. MC3.remove(B3);
  1743. MC3.remove(C3);
  1744. MC3.remove(D3);
  1745. MC3.repaint();
  1746.  
  1747. }
  1748. });
  1749.  
  1750.  
  1751. D3.addActionListener(new ActionListener(){
  1752.  
  1753. public void actionPerformed(ActionEvent e){
  1754.  
  1755.  
  1756. MC3.remove(A3);
  1757. MC3.remove(B3);
  1758. MC3.remove(C3);
  1759. MC3.remove(D3);
  1760. MC3.repaint();
  1761.  
  1762. }
  1763. });
  1764. A4.addActionListener(new ActionListener(){
  1765.  
  1766. public void actionPerformed(ActionEvent e){
  1767.  
  1768. MC3.remove(A4);
  1769. MC3.remove(B4);
  1770. MC3.remove(C4);
  1771. MC3.remove(D4);
  1772. MC3.repaint();
  1773.  
  1774. }
  1775. });
  1776.  
  1777. B4.addActionListener(new ActionListener(){
  1778.  
  1779. public void actionPerformed(ActionEvent e){
  1780.  
  1781. MC3.remove(A4);
  1782. MC3.remove(B4);
  1783. MC3.remove(C4);
  1784. MC3.remove(D4);
  1785. MC3.repaint();
  1786.  
  1787. }
  1788. });
  1789.  
  1790. C4.addActionListener(new ActionListener(){
  1791.  
  1792. public void actionPerformed(ActionEvent e){
  1793.  
  1794. correct++;
  1795. scoreCalculate();
  1796. MC3.remove(A4);
  1797. MC3.remove(B4);
  1798. MC3.remove(C4);
  1799. MC3.remove(D4);
  1800. MC3.repaint();
  1801.  
  1802. }
  1803. });
  1804.  
  1805.  
  1806. D4.addActionListener(new ActionListener(){
  1807.  
  1808. public void actionPerformed(ActionEvent e){
  1809.  
  1810.  
  1811. MC3.remove(A4);
  1812. MC3.remove(B4);
  1813. MC3.remove(C4);
  1814. MC3.remove(D4);
  1815. MC3.repaint();
  1816.  
  1817. }
  1818. });
  1819.  
  1820. A5.addActionListener(new ActionListener(){
  1821.  
  1822. public void actionPerformed(ActionEvent e){
  1823.  
  1824. MC3.remove(A5);
  1825. MC3.remove(B5);
  1826. MC3.remove(C5);
  1827. MC3.remove(D5);
  1828. MC3.repaint();
  1829.  
  1830. }
  1831. });
  1832.  
  1833. B5.addActionListener(new ActionListener(){
  1834.  
  1835. public void actionPerformed(ActionEvent e){
  1836.  
  1837. correct++;
  1838. scoreCalculate();
  1839. MC3.remove(A5);
  1840. MC3.remove(B5);
  1841. MC3.remove(C5);
  1842. MC3.remove(D5);
  1843. MC3.repaint();
  1844.  
  1845. }
  1846. });
  1847.  
  1848. C5.addActionListener(new ActionListener(){
  1849.  
  1850. public void actionPerformed(ActionEvent e){
  1851.  
  1852. MC3.remove(A5);
  1853. MC3.remove(B5);
  1854. MC3.remove(C5);
  1855. MC3.remove(D5);
  1856. MC3.repaint();
  1857.  
  1858. }
  1859. });
  1860.  
  1861.  
  1862. D5.addActionListener(new ActionListener(){
  1863.  
  1864. public void actionPerformed(ActionEvent e){
  1865.  
  1866. MC3.remove(A5);
  1867. MC3.remove(B5);
  1868. MC3.remove(C5);
  1869. MC3.remove(D5);
  1870. MC3.repaint();
  1871.  
  1872. }
  1873. });
  1874.  
  1875.  
  1876.  
  1877. }
  1878.  
  1879. public static void FIBLevel1(){ //Main Programmer: Amarnath Parthiban
  1880.  
  1881. JPanel FIB1 = new JPanel();
  1882. FIB1.setLayout(null);
  1883.  
  1884. mainQuiz.add(FIB1, "e");
  1885.  
  1886. JLabel MC1Title = new JLabel("Fill in the Blanks Level 1");
  1887. MC1Title.setFont(new Font("Calibri", Font.PLAIN, 50));
  1888. MC1Title.setBounds(10, -30, 700, 120);
  1889.  
  1890. JLabel scoreDescription = new JLabel("<html>Your score, displayed as a percentage, will directly repersent the amount of question you answerd correnctl compared to the total amount of questions you've answered."
  1891. + " On the main menu your score will be displayed once as your overall score."
  1892. + " When in a session your total score as well as your session score will be visible."
  1893. + " These scores will automaticly updated as you continue on with your session."
  1894. + " If you choose to end session prematurely (before you have answered all the questions) your session pregress will not be saved and will not be added to your total score. </html>");
  1895. scoreDescription.setFont(new Font("Calibri", Font.PLAIN, 25));
  1896. scoreDescription.setBounds(150, 50, 700, 500);
  1897.  
  1898. JButton scoreBack = new JButton("Return");
  1899. scoreBack.setFont(new Font("Calibri", Font.PLAIN, 32));
  1900. scoreBack.setBounds(350, 600, 300, 100);
  1901.  
  1902. FIB1.add(MC1Title);
  1903. FIB1.add(scoreDescription);
  1904. FIB1.add(scoreBack);
  1905.  
  1906. card1.show(mainQuiz, "e");
  1907.  
  1908. scoreBack.addActionListener(new ActionListener(){
  1909.  
  1910. public void actionPerformed(ActionEvent e){
  1911.  
  1912. quiz();
  1913.  
  1914. }
  1915. });
  1916.  
  1917. }
  1918.  
  1919. public static void FIBLevel2(){ //Main Programmer: Amarnath Parthiban
  1920.  
  1921. JPanel FIB2 = new JPanel();
  1922. FIB2.setLayout(null);
  1923.  
  1924. mainQuiz.add(FIB2, "f");
  1925.  
  1926. JLabel MC1Title = new JLabel("Score");
  1927. MC1Title.setFont(new Font("Calibri", Font.PLAIN, 75));
  1928. MC1Title.setBounds(380, 25, 700, 120);
  1929.  
  1930. JLabel scoreDescription = new JLabel("<html>Your score, displayed as a percentage, will directly repersent the amount of question you answerd correnctl compared to the total amount of questions you've answered."
  1931. + " On the main menu your score will be displayed once as your overall score."
  1932. + " When in a session your total score as well as your session score will be visible."
  1933. + " These scores will automaticly updated as you continue on with your session."
  1934. + " If you choose to end session prematurely (before you have answered all the questions) your session pregress will not be saved and will not be added to your total score. </html>");
  1935. scoreDescription.setFont(new Font("Calibri", Font.PLAIN, 25));
  1936. scoreDescription.setBounds(150, 50, 700, 500);
  1937.  
  1938. JButton scoreBack = new JButton("Return");
  1939. scoreBack.setFont(new Font("Calibri", Font.PLAIN, 32));
  1940. scoreBack.setBounds(350, 600, 300, 100);
  1941.  
  1942. FIB2.add(MC1Title);
  1943. FIB2.add(scoreDescription);
  1944. FIB2.add(scoreBack);
  1945.  
  1946. card1.show(mainQuiz, "f");
  1947.  
  1948. scoreBack.addActionListener(new ActionListener(){
  1949.  
  1950. public void actionPerformed(ActionEvent e){
  1951.  
  1952. quiz();
  1953.  
  1954. }
  1955. });
  1956.  
  1957. }
  1958.  
  1959. public static void FIBLevel3(){ //Main Programmer: Amarnath Parthiban
  1960.  
  1961. JPanel FIB3 = new JPanel();
  1962. FIB3.setLayout(null);
  1963.  
  1964. mainQuiz.add(FIB3, "g");
  1965.  
  1966. JLabel MC1Title = new JLabel("Score");
  1967. MC1Title.setFont(new Font("Calibri", Font.PLAIN, 75));
  1968. MC1Title.setBounds(380, 25, 700, 120);
  1969.  
  1970. JLabel scoreDescription = new JLabel("<html>Your score, displayed as a percentage, will directly repersent the amount of question you answerd correnctl compared to the total amount of questions you've answered."
  1971. + " On the main menu your score will be displayed once as your overall score."
  1972. + " When in a session your total score as well as your session score will be visible."
  1973. + " These scores will automaticly updated as you continue on with your session."
  1974. + " If you choose to end session prematurely (before you have answered all the questions) your session pregress will not be saved and will not be added to your total score. </html>");
  1975. scoreDescription.setFont(new Font("Calibri", Font.PLAIN, 25));
  1976. scoreDescription.setBounds(150, 50, 700, 500);
  1977.  
  1978. JButton scoreBack = new JButton("Return");
  1979. scoreBack.setFont(new Font("Calibri", Font.PLAIN, 75));
  1980. scoreBack.setBounds(350, 600, 300, 100);
  1981.  
  1982. FIB3.add(MC1Title);
  1983. FIB3.add(scoreDescription);
  1984. FIB3.add(scoreBack);
  1985.  
  1986. card1.show(mainQuiz, "g");
  1987.  
  1988. scoreBack.addActionListener(new ActionListener(){
  1989.  
  1990. public void actionPerformed(ActionEvent e){
  1991.  
  1992. quiz();
  1993.  
  1994. }
  1995. });
  1996.  
  1997. }
  1998.  
  1999. //static panel and frame to allow only one instance of the window to be open
  2000. static JPanel mainTutorial = new JPanel();
  2001. static JFrame tutorialFrame = new JFrame("Tutorial");
  2002.  
  2003. //allows for multiple JPanels on one JFrame
  2004. static CardLayout card2 = new CardLayout();
  2005.  
  2006. public static void tutorial(){ //Main Programmer: Amarnath Parthiban
  2007.  
  2008. mainTutorial.setLayout(card2);
  2009. tutorialFrame.add(mainTutorial);
  2010.  
  2011. //additional panel to set on top and interchange between other panels
  2012. JPanel tutorial = new JPanel();
  2013. tutorial.setLayout(null);
  2014.  
  2015. mainTutorial.add(tutorial, "one");
  2016.  
  2017. //determine if the tutorial window needs to stop the program or not
  2018. if (quizState == true)
  2019. tutorialFrame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
  2020. else
  2021. tutorialFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
  2022.  
  2023. //title for the panel
  2024. JLabel tutorialTitle = new JLabel("Tutorial");
  2025. tutorialTitle.setFont(new Font("Calibri", Font.PLAIN, 75));
  2026. tutorialTitle.setBounds(380, 25, 700, 60);
  2027.  
  2028. //buttons for each topic, including a quiz button
  2029. JButton score = new JButton("Score");
  2030. score.setFont(new Font("Calibri", Font.PLAIN, 32));
  2031. score.setBounds(150, 200, 300, 100);
  2032.  
  2033. JButton level = new JButton("Level");
  2034. level.setFont(new Font("Calibri", Font.PLAIN, 32));
  2035. level.setBounds(150, 400, 300, 100);
  2036.  
  2037. JButton type = new JButton("Type");
  2038. type.setFont(new Font("Calibri", Font.PLAIN, 32));
  2039. type.setBounds(550, 200, 300, 100);
  2040.  
  2041. JButton answering = new JButton("Answering");
  2042. answering.setFont(new Font("Calibri", Font.PLAIN, 32));
  2043. answering.setBounds(550, 400, 300, 100);
  2044.  
  2045. JButton main = new JButton("QUIZ SCREEN");
  2046. main.setFont(new Font("Calibri", Font.PLAIN, 32));
  2047. main.setBounds(350, 600, 300, 100);
  2048.  
  2049. tutorial.add(tutorialTitle);
  2050. tutorial.add(score);
  2051. tutorial.add(level);
  2052. tutorial.add(type);
  2053. tutorial.add(answering);
  2054. tutorial.add(main);
  2055.  
  2056. tutorialFrame.setSize(1000,800);
  2057. tutorialFrame.setVisible(true);
  2058.  
  2059. //displays the home tutorial panel
  2060. card2.show(mainTutorial, "one");
  2061.  
  2062. //calling methods for each of the topics depending on button pushed
  2063. score.addActionListener(new ActionListener(){
  2064.  
  2065. public void actionPerformed(ActionEvent e){
  2066.  
  2067. score();
  2068.  
  2069. }
  2070. });
  2071.  
  2072. level.addActionListener(new ActionListener(){
  2073.  
  2074. public void actionPerformed(ActionEvent e){
  2075.  
  2076. level();
  2077.  
  2078. }
  2079. });
  2080.  
  2081. type.addActionListener(new ActionListener(){
  2082.  
  2083. public void actionPerformed(ActionEvent e){
  2084.  
  2085. type();
  2086.  
  2087. }
  2088. });
  2089.  
  2090. answering.addActionListener(new ActionListener(){
  2091.  
  2092. public void actionPerformed(ActionEvent e){
  2093.  
  2094. answering();
  2095.  
  2096. }
  2097. });
  2098.  
  2099. main.addActionListener(new ActionListener(){
  2100.  
  2101. public void actionPerformed(ActionEvent e){
  2102.  
  2103. //open the quiz window, make the tutoral window disposible without ending the program
  2104. tutorialFrame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
  2105. quiz();
  2106.  
  2107. }
  2108. });
  2109.  
  2110. }
  2111.  
  2112. //START: methods used by the tutorial screen exclusively
  2113.  
  2114. //each method contains a title, a brief description and a button to return to the main tutorial screen
  2115. public static void score(){ //Main Programmer: Amarnath Parthiban
  2116.  
  2117. JPanel scoreTutorial = new JPanel();
  2118. scoreTutorial.setLayout(null);
  2119.  
  2120. mainTutorial.add(scoreTutorial, "two");
  2121.  
  2122. JLabel scoreTitle = new JLabel("Score");
  2123. scoreTitle.setFont(new Font("Calibri", Font.PLAIN, 75));
  2124. scoreTitle.setBounds(380, 25, 700, 120);
  2125.  
  2126. JLabel scoreDescription = new JLabel("<html>Your score, displayed as a percentage, will directly repersent the amount of question you answerd correnctl compared to the total amount of questions you've answered."
  2127. + " On the main menu your score will be displayed once as your overall score."
  2128. + " When in a session your total score as well as your session score will be visible."
  2129. + " These scores will automaticly updated as you continue on with your session."
  2130. + " If you choose to end session prematurely (before you have answered all the questions) your session pregress will not be saved and will not be added to your total score. </html>");
  2131. scoreDescription.setFont(new Font("Calibri", Font.PLAIN, 25));
  2132. scoreDescription.setBounds(150, 50, 700, 500);
  2133.  
  2134. JButton scoreBack = new JButton("Return");
  2135. scoreBack.setFont(new Font("Calibri", Font.PLAIN, 32));
  2136. scoreBack.setBounds(350, 600, 300, 100);
  2137.  
  2138. scoreTutorial.add(scoreTitle);
  2139. scoreTutorial.add(scoreDescription);
  2140. scoreTutorial.add(scoreBack);
  2141.  
  2142. card2.show(mainTutorial, "two");
  2143.  
  2144. scoreBack.addActionListener(new ActionListener(){
  2145.  
  2146. public void actionPerformed(ActionEvent e){
  2147.  
  2148. tutorial();
  2149.  
  2150. }
  2151. });
  2152.  
  2153. }
  2154.  
  2155. public static void level(){ //Main Programmer: Amarnath Parthiban
  2156.  
  2157. JPanel levelTutorial = new JPanel();
  2158. levelTutorial.setLayout(null);
  2159.  
  2160. mainTutorial.add(levelTutorial, "three");
  2161.  
  2162. JLabel levelTitle = new JLabel("Level");
  2163. levelTitle.setFont(new Font("Calibri", Font.PLAIN, 75));
  2164. levelTitle.setBounds(380, 25, 700, 120);
  2165.  
  2166. JLabel levelDescription = new JLabel("<html> Every type has 3 levels; easy, medium and hard."
  2167. + " The easy questions are basic questions, the answers to these questions should come from the top of you head."
  2168. + " Medium-leveled questions modertaley difficult. They require some background knowledge of Canada."
  2169. + " In each level, there will be five questions."
  2170. + " After answering a new one , under the same level will appear. "
  2171. + " The hard questions have a high difficulty rating. You will need to know every inch of Canadian history, geography and culture."
  2172. + " Don't worry about the level. I think you can do it. </html>");
  2173. levelDescription.setFont(new Font("Calibri", Font.PLAIN, 25));
  2174. levelDescription.setBounds(150, 50, 700, 500);
  2175.  
  2176. JButton levelBack = new JButton("Return");
  2177. levelBack.setFont(new Font("Calibri", Font.PLAIN, 32));
  2178. levelBack.setBounds(350, 600, 300, 100);
  2179.  
  2180. levelTutorial.add(levelTitle);
  2181. levelTutorial.add(levelDescription);
  2182. levelTutorial.add(levelBack);
  2183.  
  2184. card2.show(mainTutorial, "three");
  2185.  
  2186. levelBack.addActionListener(new ActionListener(){
  2187.  
  2188. public void actionPerformed(ActionEvent e){
  2189.  
  2190. tutorial();
  2191.  
  2192. }
  2193. });
  2194.  
  2195. }
  2196.  
  2197. public static void type(){ //Main Programmer: Amarnath Parthiban
  2198.  
  2199. JPanel typeTutorial = new JPanel();
  2200. typeTutorial.setLayout(null);
  2201.  
  2202. mainTutorial.add(typeTutorial, "four");
  2203.  
  2204. JLabel typeTitle = new JLabel("Type");
  2205. typeTitle.setFont(new Font("Calibri", Font.PLAIN, 75));
  2206. typeTitle.setBounds(380, 25, 700, 120);
  2207.  
  2208. JLabel typeDescription = new JLabel("<html>In this quiz, there are three types of questions; multiple choice, fill in the blanks and random."
  2209. + " If you choose a multiple choice question the options will be given to you along with the question ."
  2210. + " The fill in the blanks will require you to type in the missing word of the phrase."
  2211. + " Random is a type where the computer chooses a question type for you and."
  2212. + " If you choose to end session prematurely (before you have answered all the questions) your session pregress will not be saved and will not be added to your total score. </html>");
  2213. typeDescription.setFont(new Font("Calibri", Font.PLAIN, 25));
  2214. typeDescription.setBounds(150, 50, 700, 500);
  2215.  
  2216. JButton typeBack = new JButton("Return");
  2217. typeBack.setFont(new Font("Calibri", Font.PLAIN, 32));
  2218. typeBack.setBounds(350, 600, 300, 100);
  2219.  
  2220. typeTutorial.add(typeTitle);
  2221. typeTutorial.add(typeDescription);
  2222. typeTutorial.add(typeBack);
  2223.  
  2224. card2.show(mainTutorial, "four");
  2225.  
  2226. typeBack.addActionListener(new ActionListener(){
  2227.  
  2228. public void actionPerformed(ActionEvent e){
  2229.  
  2230. tutorial();
  2231.  
  2232. }
  2233. });
  2234.  
  2235. }
  2236.  
  2237. public static void answering(){ //Main Programmer: Amarnath Parthiban
  2238.  
  2239. JPanel answeringTutorial = new JPanel();
  2240. answeringTutorial.setLayout(null);
  2241.  
  2242. mainTutorial.add(answeringTutorial, "five");
  2243.  
  2244. JLabel answeringTitle = new JLabel("Answering");
  2245. answeringTitle.setFont(new Font("Calibri", Font.PLAIN, 75));
  2246. answeringTitle.setBounds(320, 25, 700, 120);
  2247.  
  2248. JLabel answeringDescription = new JLabel("<html> Answering a question varies by it's type."
  2249. + " For the multiple choice questions, your answer will be taken in once you click on one of the options."
  2250. + " For the fill in the blank questions will give you a box to type in your answer."
  2251. + " Remember, this quiz case sensitive."
  2252. + " Make sure to use captials only on pronouns and correct casing (beggining of a sentence).");
  2253. answeringDescription.setFont(new Font("Calibri", Font.PLAIN, 25));
  2254. answeringDescription.setBounds(150, 50, 700, 500);
  2255.  
  2256. JButton answeringBack = new JButton("Return");
  2257. answeringBack.setFont(new Font("Calibri", Font.PLAIN, 32));
  2258. answeringBack.setBounds(350, 600, 300, 100);
  2259.  
  2260. answeringTutorial.add(answeringTitle);
  2261. answeringTutorial.add(answeringDescription);
  2262. answeringTutorial.add(answeringBack);
  2263.  
  2264. card2.show(mainTutorial, "five");
  2265.  
  2266. answeringBack.addActionListener(new ActionListener(){
  2267.  
  2268. public void actionPerformed(ActionEvent e){
  2269.  
  2270. tutorial();
  2271.  
  2272. }
  2273. });
  2274.  
  2275. }
  2276. //END: methods used by the tutorial screen exclusively
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement