*
* SSCCEOfProblemView.java
*/
package sscceofproblem;
import org.jdesktop.application.Action;
import org.jdesktop.application.ResourceMap;
import org.jdesktop.application.SingleFrameApplication;
import org.jdesktop.application.FrameView;
import org.jdesktop.application.TaskMonitor;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.Timer;
import javax.swing.Icon;
import javax.swing.JDialog;
import javax.swing.JFrame;
/**
* The application's main frame.
*/
public class SSCCEOfProblemView extends FrameView {
Integer[] solutions={0,1,2,4,3,4};
Integer answer;
Integer totalquestions=-1;;
int score, correct;
Integer step=1;
Integer A=1;
Integer B=2;
Integer C=3;
Integer D=4;
public Integer buttonPressA(){
answer=A;
if(A.equals(solutions)){
totalquestions=totalquestions+1;
}
else {
totalquestions=totalquestions+1;
}
System.out.println(""+totalquestions);
System.out.println("3 Score: "+score);
return answer;
}
public Integer buttonPressB(){
answer=B;
if(B.equals(solutions)){
totalquestions=totalquestions+1;
}
else {
totalquestions=totalquestions+1;
}
System.out.println("3 Score: "+score);
System.out.println(""+totalquestions);
return answer;
}
public Integer buttonPressC(){
answer=C;
if (C.equals(solutions)){
totalquestions=totalquestions+1;
}
else{
totalquestions=totalquestions+1;
}
System.out.println("3 Score: "+score);
System.out.println(""+totalquestions);
return answer;
}
public Integer buttonPressD(){
answer=D;
if(D.equals(solutions)){
totalquestions=totalquestions+1;
}
else{
totalquestions=totalquestions+1;
}
System.out.println(""+totalquestions);
return answer;
}
public SSCCEOfProblemView(SingleFrameApplication app) {
super(app);
initComponents();
// status bar initialization - message timeout, idle icon and busy animation, etc
ResourceMap resourceMap = getResourceMap();
int messageTimeout = resourceMap.getInteger("StatusBar.messageTimeout");
messageTimer = new Timer(messageTimeout, new ActionListener() {
public void actionPerformed(ActionEvent e) {
statusMessageLabel.setText("");
}
});
messageTimer.setRepeats(false);
int busyAnimationRate = resourceMap.getInteger("StatusBar.busyAnimationRate");
for (int i = 0; i < busyIcons.length; i++) {
busyIcons[i] = resourceMap.getIcon("StatusBar.busyIcons[" + i + "]");
}
busyIconTimer = new Timer(busyAnimationRate, new ActionListener() {
public void actionPerformed(ActionEvent e) {
busyIconIndex = (busyIconIndex + 1) % busyIcons.length;
statusAnimationLabel.setIcon(busyIcons[busyIconIndex]);
}
});
idleIcon = resourceMap.getIcon("StatusBar.idleIcon");
statusAnimationLabel.setIcon(idleIcon);
progressBar.setVisible(false);
// connecting action tasks to status bar via TaskMonitor
TaskMonitor taskMonitor = new TaskMonitor(getApplication().getContext());
taskMonitor.addPropertyChangeListener(new java.beans.PropertyChangeListener() {
public void propertyChange(java.beans.PropertyChangeEvent evt) {
String propertyName = evt.getPropertyName();
if ("started".equals(propertyName)) {
if (!busyIconTimer.isRunning()) {
statusAnimationLabel.setIcon(busyIcons[0]);
busyIconIndex = 0;
busyIconTimer.start();
}
progressBar.setVisible(true);
progressBar.setIndeterminate(true);
} else if ("done".equals(propertyName)) {
busyIconTimer.stop();
statusAnimationLabel.setIcon(idleIcon);
progressBar.setVisible(false);
progressBar.setValue(0);
} else if ("message".equals(propertyName)) {
String text = (String)(evt.getNewValue());
statusMessageLabel.setText((text == null) ? "" : text);
messageTimer.restart();
} else if ("progress".equals(propertyName)) {
int value = (Integer)(evt.getNewValue());
progressBar.setVisible(true);
progressBar.setIndeterminate(false);
progressBar.setValue(value);
}
}
});
}
@Action
public void showAboutBox() {
if (aboutBox == null) {
JFrame mainFrame = SSCCEOfProblemApp.getApplication().getMainFrame();
aboutBox = new SSCCEOfProblemAboutBox(mainFrame);
aboutBox.setLocationRelativeTo(mainFrame);
}
SSCCEOfProblemApp.getApplication().show(aboutBox);
}
/** This method is called from within the constructor to
* initialize the form.
* WARNING: Do NOT modify this code. The content of this method is
* always regenerated by the Form Editor.
*/
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">
private void initComponents() {
mainPanel = new javax.swing.JPanel();
btn_A = new javax.swing.JButton();
btn_B = new javax.swing.JButton();
btn_C = new javax.swing.JButton();
btn_D = new javax.swing.JButton();
jScrollPane1 = new javax.swing.JScrollPane();
txta_display = new javax.swing.JTextArea();
btn_quiz = new javax.swing.JButton();
btn_quiz1 = new javax.swing.JButton();
menuBar = new javax.swing.JMenuBar();
javax.swing.JMenu fileMenu = new javax.swing.JMenu();
javax.swing.JMenuItem exitMenuItem = new javax.swing.JMenuItem();
javax.swing.JMenu helpMenu = new javax.swing.JMenu();
javax.swing.JMenuItem aboutMenuItem = new javax.swing.JMenuItem();
statusPanel = new javax.swing.JPanel();
javax.swing.JSeparator statusPanelSeparator = new javax.swing.JSeparator();
statusMessageLabel = new javax.swing.JLabel();
statusAnimationLabel = new javax.swing.JLabel();
progressBar = new javax.swing.JProgressBar();
mainPanel.setName("mainPanel"); // NOI18N
org.jdesktop.application.ResourceMap resourceMap = org.jdesktop.application.Application.getInstance(sscceofproblem.SSCCEOfProblemApp.class).getContext().getResourceMap(SSCCEOfProblemView.class);
btn_A.setText(resourceMap.getString("btn_A.text")); // NOI18N
btn_A.setName("btn_A"); // NOI18N
btn_A.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btn_AActionPerformed(evt);
}
});
btn_B.setText(resourceMap.getString("btn_B.text")); // NOI18N
btn_B.setName("btn_B"); // NOI18N
btn_B.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btn_BActionPerformed(evt);
}
});
btn_C.setText(resourceMap.getString("btn_C.text")); // NOI18N
btn_C.setName("btn_C"); // NOI18N
btn_C.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btn_CActionPerformed(evt);
}
});
btn_D.setText(resourceMap.getString("btn_D.text")); // NOI18N
btn_D.setName("btn_D"); // NOI18N
btn_D.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btn_DActionPerformed(evt);
}
});
jScrollPane1.setName("jScrollPane1"); // NOI18N
txta_display.setColumns(20);
txta_display.setLineWrap(true);
txta_display.setRows(5);
txta_display.setWrapStyleWord(true);
txta_display.setName("txta_display"); // NOI18N
jScrollPane1.setViewportView(txta_display);
btn_quiz.setText(resourceMap.getString("btn_quiz.text")); // NOI18N
btn_quiz.setName("btn_quiz"); // NOI18N
btn_quiz1.setText(resourceMap.getString("btn_quiz1.text")); // NOI18N
btn_quiz1.setName("btn_quiz1"); // NOI18N
btn_quiz1.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btn_quiz1ActionPerformed(evt);
}
});
javax.swing.GroupLayout mainPanelLayout = new javax.swing.GroupLayout(mainPanel);
mainPanel.setLayout(mainPanelLayout);
mainPanelLayout.setHorizontalGroup(
mainPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(mainPanelLayout.createSequentialGroup()
.addGap(153, 153, 153)
.addComponent(btn_A)
.addGap(18, 18, 18)
.addComponent(btn_B)
.addGap(18, 18, 18)
.addComponent(btn_C)
.addGap(18, 18, 18)
.addComponent(btn_D)
.addContainerGap(37, Short.MAX_VALUE))
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, mainPanelLayout.createSequentialGroup()
.addGap(20, 20, 20)
.addComponent(btn_quiz1)
.addGap(18, 18, 18)
.addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 261, Short.MAX_VALUE)
.addGap(20, 20, 20))
.addGroup(mainPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(mainPanelLayout.createSequentialGroup()
.addGap(0, 159, Short.MAX_VALUE)
.addComponent(btn_quiz)
.addGap(0, 160, Short.MAX_VALUE)))
);
mainPanelLayout.setVerticalGroup(
mainPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(mainPanelLayout.createSequentialGroup()
.addContainerGap(12, Short.MAX_VALUE)
.addGroup(mainPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, mainPanelLayout.createSequentialGroup()
.addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 183, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(18, 18, 18)
.addGroup(mainPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(btn_A)
.addComponent(btn_B)
.addComponent(btn_C)
.addComponent(btn_D))
.addGap(18, 18, 18))
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, mainPanelLayout.createSequentialGroup()
.addComponent(btn_quiz1)
.addGap(93, 93, 93))))
.addGroup(mainPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(mainPanelLayout.createSequentialGroup()
.addGap(0, 115, Short.MAX_VALUE)
.addComponent(btn_quiz)
.addGap(0, 116, Short.MAX_VALUE)))
);
menuBar.setName("menuBar"); // NOI18N
fileMenu.setText(resourceMap.getString("fileMenu.text")); // NOI18N
fileMenu.setName("fileMenu"); // NOI18N
javax.swing.ActionMap actionMap = org.jdesktop.application.Application.getInstance(sscceofproblem.SSCCEOfProblemApp.class).getContext().getActionMap(SSCCEOfProblemView.class, this);
exitMenuItem.setAction(actionMap.get("quit")); // NOI18N
exitMenuItem.setName("exitMenuItem"); // NOI18N
fileMenu.add(exitMenuItem);
menuBar.add(fileMenu);
helpMenu.setText(resourceMap.getString("helpMenu.text")); // NOI18N
helpMenu.setName("helpMenu"); // NOI18N
aboutMenuItem.setAction(actionMap.get("showAboutBox")); // NOI18N
aboutMenuItem.setName("aboutMenuItem"); // NOI18N
helpMenu.add(aboutMenuItem);
menuBar.add(helpMenu);
statusPanel.setName("statusPanel"); // NOI18N
statusPanelSeparator.setName("statusPanelSeparator"); // NOI18N
statusMessageLabel.setName("statusMessageLabel"); // NOI18N
statusAnimationLabel.setHorizontalAlignment(javax.swing.SwingConstants.LEFT);
statusAnimationLabel.setName("statusAnimationLabel"); // NOI18N
progressBar.setName("progressBar"); // NOI18N
javax.swing.GroupLayout statusPanelLayout = new javax.swing.GroupLayout(statusPanel);
statusPanel.setLayout(statusPanelLayout);
statusPanelLayout.setHorizontalGroup(
statusPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(statusPanelSeparator, javax.swing.GroupLayout.DEFAULT_SIZE, 400, Short.MAX_VALUE)
.addGroup(statusPanelLayout.createSequentialGroup()
.addContainerGap()
.addComponent(statusMessageLabel)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 230, Short.MAX_VALUE)
.addComponent(progressBar, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(statusAnimationLabel)
.addContainerGap())
);
statusPanelLayout.setVerticalGroup(
statusPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(statusPanelLayout.createSequentialGroup()
.addComponent(statusPanelSeparator, javax.swing.GroupLayout.PREFERRED_SIZE, 2, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addGroup(statusPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(statusMessageLabel)
.addComponent(statusAnimationLabel)
.addComponent(progressBar, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(3, 3, 3))
);
setComponent(mainPanel);
setMenuBar(menuBar);
setStatusBar(statusPanel);
}// </editor-fold>
private void btn_AActionPerformed(java.awt.event.ActionEvent evt) {
//This begins the answer buttons
buttonPressA();
txta_display.setText("Press an answer button to begin");
if (totalquestions==4){
txta_display.setText("What is the slope of a line containing (2,4) and (4,8)?\n A. 2\n B. 3\n C. 13\n D. 1");
if (answer==solutions[1]){
score=score+1;
}
System.out.println("answer:"+answer);
System.out.println("solution:"+ java.util.Arrays.toString(solutions));
System.out.println("question"+totalquestions);
if (totalquestions==5){
txta_display.setText("What is the slope of the line containing (3,9) and (2,6)?\n A. 4\n B. 3\n C. 6\n D. 1");
if (answer==solutions[2]){
score=score+1;
System.out.println("answer:"+answer);
System.out.println("solution:"+ java.util.Arrays.toString(solutions));
System.out.println("1 Score: "+score);
System.out.println("question"+totalquestions);
}
}
else if(totalquestions==6){
txta_display.setText("What does a statement like x=4 mean?\n A. nothing\n B. straight line through a y value\n C. No line exists.\nD. The line passes thrrough an x value");
if (answer==solutions[3]) {
score=score+1;
}
System.out.println("answer:"+answer);
System.out.println("solution:"+ java.util.Arrays.toString(solutions));
System.out.println("1 Score: "+score);
System.out.println("question"+totalquestions);
}
if (totalquestions==7){
txta_display.setText("What is the slope of a line segment from (6,12)to (12,36)?\n A. 5\n B. 2\n C.4\n D. 1");
if (answer==solutions[4]){
score=score+1;
System.out.println("answer:"+answer);
System.out.println("solution:"+ java.util.Arrays.toString(solutions));
}
System.out.println("2 Score: "+score);
System.out.println("question"+totalquestions);
}
else if (totalquestions==8){
txta_display.setText("What is the slope of a line segment from (6,12)to (12,36)?\n A. 5\n B. 2\n C.4\n D. 1");
if (answer==solutions[5]){
score=score+1;
System.out.println("answer:"+answer);
System.out.println("solution:"+ java.util.Arrays.toString(solutions));
}
System.out.println("3 Score: "+score);
System.out.println("question"+totalquestions);
}
else if (totalquestions>8){
txta_display.setText("You have finished! Your score is "+score+" out of 5");
}
}
}
private void btn_BActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
buttonPressB();
txta_display.setText("Press an answer button to begin");
if (totalquestions==4){
txta_display.setText("What is the slope of a line containing (2,4) and (4,8)?\n A. 2\n B. 3\n C. 13\n D. 1");
if (answer==solutions[1]){
score=score+1;
}
System.out.println("answer:"+answer);
System.out.println("solution:"+ java.util.Arrays.toString(solutions));
System.out.println("question"+totalquestions);
if (totalquestions==5){
txta_display.setText("What is the slope of the line containing (3,9) and (2,6)?\n A. 4\n B. 3\n C. 6\n D. 1");
if (answer==solutions[2]){
score=score+1;
System.out.println("answer:"+answer);
System.out.println("solution:"+ java.util.Arrays.toString(solutions));
System.out.println("1 Score: "+score);
System.out.println("question"+totalquestions);
}
}
else if(totalquestions==6){
txta_display.setText("What does a statement like x=4 mean?\n A. nothing\n B. straight line through a y value\n C. No line exists.\nD. The line passes thrrough an x value");
if (answer==solutions[3]) {
score=score+1;
}
System.out.println("answer:"+answer);
System.out.println("solution:"+ java.util.Arrays.toString(solutions));
System.out.println("1 Score: "+score);
System.out.println("question"+totalquestions);
}
if (totalquestions==7){
txta_display.setText("What is the slope of a line segment from (6,12)to (12,36)?\n A. 5\n B. 2\n C.4\n D. 1");
if (answer==solutions[4]){
score=score+1;
System.out.println("answer:"+answer);
System.out.println("solution:"+ java.util.Arrays.toString(solutions));
}
System.out.println("2 Score: "+score);
System.out.println("question"+totalquestions);
}
else if (totalquestions==8){
txta_display.setText("What is the slope of a line segment from (6,12)to (12,36)?\n A. 5\n B. 2\n C.4\n D. 1");
if (answer==solutions[5]){
score=score+1;
System.out.println("answer:"+answer);
System.out.println("solution:"+ java.util.Arrays.toString(solutions));
}
System.out.println("3 Score: "+score);
System.out.println("question"+totalquestions);
}
else if (totalquestions>8){
txta_display.setText("You have finished! Your score is "+score+" out of 5");
}
}
}
private void btn_CActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
buttonPressC();
txta_display.setText("Press an answer button to begin");
if (totalquestions==4){
txta_display.setText("What is the slope of a line containing (2,4) and (4,8)?\n A. 2\n B. 3\n C. 13\n D. 1");
if (answer==solutions[1]){
score=score+1;
System.out.println("answer:"+answer);
System.out.println("solution:"+ java.util.Arrays.toString(solutions));
System.out.println("question"+totalquestions);
}
else if (totalquestions==5){
txta_display.setText("What is the slope of the line containing (3,9) and (2,6)?\n A. 4\n B. 3\n C. 6\n D. 1");
if (answer==solutions[2]){
score=score+1;
System.out.println("answer:"+answer);
System.out.println("solution:"+ java.util.Arrays.toString(solutions));
System.out.println("1 Score: "+score);
System.out.println("question"+totalquestions);
}
}
else if(totalquestions==6){
txta_display.setText("What does a statement like x=4 mean?\n A. nothing\n B. straight line through a y value\n C. No line exists.\nD. The line passes thrrough an x value");
if (answer==solutions[3]) {
score=score+1;
}
System.out.println("answer:"+answer);
System.out.println("solution:"+ java.util.Arrays.toString(solutions));
System.out.println("1 Score: "+score);
System.out.println("question"+totalquestions);
}
if (totalquestions==7){
txta_display.setText("What is the slope of a line segment from (6,12)to (12,36)?\n A. 5\n B. 2\n C.4\n D. 1");
if (answer==solutions[4]){
score=score+1;
System.out.println("answer:"+answer);
System.out.println("solution:"+ java.util.Arrays.toString(solutions));
}
System.out.println("2 Score: "+score);
System.out.println("question"+totalquestions);
}
else if (totalquestions==8){
txta_display.setText("What is the slope of a line segment from (6,12)to (12,36)?\n A. 5\n B. 2\n C.4\n D. 1");
if (answer==solutions[5]){
score=score+1;
System.out.println("answer:"+answer);
System.out.println("solution:"+ java.util.Arrays.toString(solutions));
}
System.out.println("3 Score: "+score);
System.out.println("question"+totalquestions);
}
else if (totalquestions>8){
txta_display.setText("You have finished! Your score is "+score+" out of 5");
}
}
}
private void btn_DActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
buttonPressD();
txta_display.setText("Press an answer button to begin");
if (totalquestions==4){
txta_display.setText("What is the slope of a line containing (2,4) and (4,8)?\n A. 2\n B. 3\n C. 13\n D. 1");
if (answer==solutions[1]){
System.out.println("answer:"+answer);
System.out.println("solution:"+ java.util.Arrays.toString(solutions));
System.out.println("1 Score: "+score);
System.out.println("question"+totalquestions);
score=score+1;
}
System.out.println("answer:"+answer);
System.out.println("solution:"+ java.util.Arrays.toString(solutions));
System.out.println("question"+totalquestions);
if (totalquestions==5){
txta_display.setText("What is the slope of the line containing (3,9) and (2,6)?\n A. 4\n B. 3\n C. 6\n D. 1");
if (answer==solutions[2]){
score=score+1;
System.out.println("answer:"+answer);
System.out.println("solution:"+ java.util.Arrays.toString(solutions));
System.out.println("1 Score: "+score);
System.out.println("question"+totalquestions);
}
}
else if(totalquestions==6){
txta_display.setText("What does a statement like x=4 mean?\n A. nothing\n B. straight line through a y value\n C. No line exists.\nD. The line passes thrrough an x value");
if (answer==solutions[3]) {
score=score+1;
}
System.out.println("answer:"+answer);
System.out.println("solution:"+ java.util.Arrays.toString(solutions));
System.out.println("1 Score: "+score);
System.out.println("question"+totalquestions);
}
if (totalquestions==7){
txta_display.setText("What is the slope of a line segment from (6,12)to (12,36)?\n A. 5\n B. 2\n C.4\n D. 1");
if (answer==solutions[4]){
score=score+1;
System.out.println("answer:"+answer);
System.out.println("solution:"+ java.util.Arrays.toString(solutions));
}
System.out.println("2 Score: "+score);
System.out.println("question"+totalquestions);
}
else if (totalquestions==8){
txta_display.setText("What is the slope of a line segment from (6,12)to (12,36)?\n A. 5\n B. 2\n C.4\n D. 1");
if (answer==solutions[5]){
score=score+1;
System.out.println("answer:"+answer);
System.out.println("solution:"+ java.util.Arrays.toString(solutions));
}
System.out.println("3 Score: "+score);
System.out.println("question"+totalquestions);
}
else if (totalquestions>8){
txta_display.setText("You have finished! Your score is "+score+" out of 5");
}
}
}
private void btn_quiz1ActionPerformed(java.awt.event.ActionEvent evt) {
// The quiz is started by pressing this.
buttonPressA();
buttonPressB();
buttonPressC();
buttonPressD();
answer=solutions[0];//Counter iterates once inexpicably, this is a countermeasure
txta_display.setText("Press an answer button to begin");
if (totalquestions==4){
txta_display.setText("What is the slope of a line containing (2,4) and (4,8)?\n A. 2\n B. 3\n C. 13\n D. 1");
if (answer==solutions[1]){
score=score+1;
System.out.println("answer:"+answer);
System.out.println("solution:"+ java.util.Arrays.toString(solutions));
System.out.println("question"+totalquestions);
}
else if (totalquestions==5){
txta_display.setText("What is the slope of the line containing (3,9) and (2,6)?\n A. 4\n B. 3\n C. 6\n D. 1");
if (answer==solutions[2]){
score=score+1;
}
}
else if(totalquestions==6){
txta_display.setText("What does a statement like x=4 mean?\n A. nothing\n B. straight line through a y value\n C. No line exists.\nD. The line passes thrrough an x value");
if (answer==solutions[3]) {
score=score+1;
}
System.out.println("answer:"+answer);
System.out.println("solution:"+ java.util.Arrays.toString(solutions));
System.out.println("1 Score: "+score);
System.out.println("question"+totalquestions);
}
if (totalquestions==7){
txta_display.setText("What is the slope of a line segment from (6,12)to (12,36)?\n A. 5\n B. 2\n C.4\n D. 1");
if (answer==solutions[4]){
score=score+1;
System.out.println("answer:"+answer);
System.out.println("solution:"+ java.util.Arrays.toString(solutions));
}
System.out.println("2 Score: "+score);
System.out.println("question"+totalquestions);
}
else if (totalquestions==8){
txta_display.setText("What is the slope of a line segment from (6,12)to (12,36)?\n A. 5\n B. 2\n C.4\n D. 1");
if (answer==solutions[5]){
score=score+1;
System.out.println("answer:"+answer);
System.out.println("solution:"+ java.util.Arrays.toString(solutions));
}
System.out.println("3 Score: "+score);
System.out.println("question"+totalquestions);
}
else if (totalquestions>8){
txta_display.setText("You have finished! Your score is "+score+" out of 5");
}
}