Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified bin/comm/Connector.class
Binary file not shown.
Binary file modified bin/comm/DataBase.class
Binary file not shown.
Binary file modified bin/comm/EmailComm$1.class
Binary file not shown.
Binary file modified bin/comm/EmailComm.class
Binary file not shown.
Binary file modified bin/gui/LoginPage.class
Binary file not shown.
Binary file modified bin/gui/ProfessorGUI$1.class
Binary file not shown.
Binary file modified bin/gui/ProfessorGUI.class
Binary file not shown.
Binary file modified bin/gui/Question.class
Binary file not shown.
Binary file modified bin/gui/QuestionPages.class
Binary file not shown.
6 changes: 3 additions & 3 deletions bin/questions.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ Are you here today?
Yes
No

What do you know about OOD so far?
#
Write down what you know about OOD so far
##

How far along are you on your projects with your groups and when do you expect to finish?
Haven't started
Expand All @@ -13,4 +13,4 @@ Already started coding
Need help

Do you feel like all of your team members are contributing enough your team members are contributing enough your team members are contributing enough?
#
##
27 changes: 27 additions & 0 deletions src/gui/CheckIP.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
package gui;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.net.URL;

import javax.swing.JOptionPane;

public class CheckIP {
public static void main() throws Exception {
//goes to http://checkip.amazonaws.com
URL whatismyip = new URL("http://checkip.amazonaws.com");
//reads in IP Address
BufferedReader in = new BufferedReader(new InputStreamReader(whatismyip.openStream()));
//Convert IP to String
String ip = in.readLine();

//Checks if IP is a GSU public IP Address
if (ip.matches("141.165.(.*)")) {
JOptionPane.showMessageDialog(null, ip, "GSU IP Checker", 1);
}
else
JOptionPane.showMessageDialog(null, "Sorry, your IP Address does not match one on Georgia Southern Statesboro Campus. "
+ "\rPlease use a computer on campus to take this quiz.", "GSU IP Checker", 0);
//System.exit(0);
//Uncomment when done with testing
}
}
10 changes: 10 additions & 0 deletions src/gui/LoginPage.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@

public class LoginPage {

static boolean inClass;
private Pane pane;
private Scene scene;
private PasswordField codeField;
Expand All @@ -27,6 +28,15 @@ public class LoginPage {
private DropShadow shadowOff = new DropShadow(20, colorOff);

public LoginPage() {
//Added IP Checker if in class button is selected
if(inClass = true) {
try {
CheckIP.main();
} catch (Exception e1) {
e1.printStackTrace();
}
}

pane = new Pane();
Pane outerPane = new Pane();

Expand Down
25 changes: 19 additions & 6 deletions src/gui/ProfessorGUI.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,9 @@
import java.sql.SQLException;

public class ProfessorGUI extends Application {

private DataBase dataBase = new DataBase();
private String fileName;

//private DataBase dataBase = new DataBase();

private String emailList = "";

Expand Down Expand Up @@ -116,7 +117,7 @@ public void handle(ActionEvent arg0) {
fileChooser.getExtensionFilters().addAll(new FileChooser.ExtensionFilter("Text Files", "*.txt"));

//Remove the .txt from file name
String fileName = startPage.getLblEFile().getText();
fileName = startPage.getLblQFile().getText();
fileName = fileName.substring(0, fileName.length()-4);

//call create report
Expand All @@ -129,6 +130,13 @@ public void handle(ActionEvent arg0) {
e.printStackTrace();
}

AnswerReport.createAnswerReportTxt(fileName);
try {
gradeReport.appendGradeReportTxt(fileName);
}catch (SQLException e) {
e.printStackTrace();
}

File file = fileChooser.showOpenDialog(reportStage);
Desktop openFile = Desktop.getDesktop();
if(file.exists())
Expand Down Expand Up @@ -202,14 +210,19 @@ public void handle(ActionEvent event) {

@Override
public void handle(ActionEvent event) {
fileName = startPage.getLblQFile().getText();
fileName = fileName.substring(0, fileName.length()-4);
EmailComm eCom = new EmailComm();
eCom.sendEmails(vPage.getEmailField().getText(), vPage.getPassField().getText(), "This is a test",
"This is a test for our Project", emailList);

dataBase.Write("CREATE TABLE public.\"" + questionList.getName() + "\"" + "("
/*
dataBase.Write("CREATE TABLE public.\"" + fileName + "\"" + "("
+ "\"studentEmail\" text COLLATE pg_catalog.\"default\","
+ "responses text[] COLLATE pg_catalog.\"default\"," + "\"finalGrade\" double precision" + ")"
+ "WITH (" + "OIDS = FALSE)" + "TABLESPACE pg_default;");
+ "WITH (" + "OIDS = FALSE)" + "TABLESPACE pg_default;" + " " + "INSERT INTO " + "\"QuizCodes\" VALUES ('" + fileName +
"', " + sendPage.getQuizCode().getText() + ");");
*/

}

});
Expand Down
28 changes: 25 additions & 3 deletions src/gui/SendPage.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package gui;

import javafx.collections.FXCollections;

import javafx.event.ActionEvent;
import javafx.event.EventHandler;
import javafx.geometry.Pos;
Expand Down Expand Up @@ -47,6 +48,7 @@ public class SendPage {

private CheckBox cb1;
private CheckBox cb2;
private CheckBox cb3;

private Label errorLabel;

Expand All @@ -64,6 +66,7 @@ public SendPage(Stage parentStage) {

cb1 = new CheckBox("Randomize Questions");
cb2 = new CheckBox("Randomize Answer Choices");
cb3 = new CheckBox("In Class Quiz");

rb1 = new RadioButton("Provide feedback with all questions.");
rb2 = new RadioButton("Provide feedback with only incorrect answers.");
Expand All @@ -86,6 +89,7 @@ public SendPage(Stage parentStage) {
endMin = new ComboBox<>(FXCollections.observableArrayList(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59));

buildSendPage(sendStage, parentStage, sendPane, sendScene);

}

public void buildSendPage(Stage sendStage, Stage parentStage, Pane sendPane, Scene sendScene) {
Expand Down Expand Up @@ -283,11 +287,15 @@ public void buildSendPage(Stage sendStage, Stage parentStage, Pane sendPane, Sce
cb1.setTextFill(Color.WHITE);
cb1.setFont(Font.font("Arial", 13));


cb2.setLayoutX(cb1.getLayoutX() + 160);
cb2.setLayoutY(cb1.getLayoutY());
cb2.setTextFill(Color.WHITE);
cb2.setFont(Font.font("Arial", 13));

cb3.setLayoutX(cb1.getLayoutX());
cb3.setLayoutY(cb1.getLayoutY()+60);
cb3.setTextFill(Color.WHITE);
cb3.setFont(Font.font("Arial", 13));

rb1.setLayoutX(feedbackBox.getLayoutX());
rb2.setLayoutX(feedbackBox.getLayoutX());
Expand All @@ -307,7 +315,10 @@ public void buildSendPage(Stage sendStage, Stage parentStage, Pane sendPane, Sce
send.setFont(Font.font("Arial", FontWeight.BOLD,18));
send.setStyle(Styles.BUTTONSTYLE);
send.setOnMouseEntered(e -> send.setStyle(Styles.BUTTONHOVER));
send.setOnMouseExited(e -> send.setStyle(Styles.BUTTONSTYLE));
send.setOnMouseExited(e -> {send.setStyle(Styles.BUTTONSTYLE);
check();
});
//Added IP Checker if in class button is selected when send is pushed

errorLabel = new Label();
errorLabel.setLayoutX(90);
Expand All @@ -329,12 +340,19 @@ public void buildSendPage(Stage sendStage, Stage parentStage, Pane sendPane, Sce



sendPane.getChildren().addAll(cb1, cb2, send, startMonth, startDay, startHour, startMin, feedbackBox, startDayLabel,
sendPane.getChildren().addAll(cb1, cb2, cb3, send, startMonth, startDay, startHour, startMin, feedbackBox, startDayLabel,
startHourLabel, startMonthLabel, startMinLabel, endDayLabel, endHourLabel, endMonthLabel, endMinLabel, qBox, quizCode, rBox, startTimeBox,
endTimeBox, cancel, endMonth, endDay, endHour, endMin, errorLabel);
sendStage.getIcons().add(Styles.GSIcon);
sendStage.setScene(sendScene);
}
public void check() {
if(cb3.isSelected()) {
LoginPage.inClass = true;
}else {
LoginPage.inClass = false;
}
}

public void showSendPage() {
this.sendStage.show();
Expand Down Expand Up @@ -401,6 +419,10 @@ public CheckBox getCb2() {
return cb2;
}

public CheckBox getCb3() {
return cb3;
}

public TextField getQuizCode() {
return quizCode;
}
Expand Down
9 changes: 6 additions & 3 deletions src/gui/gradeReport.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ public static void appendGradeReportTxt(String fileName) throws SQLException {

try (BufferedWriter bw = new BufferedWriter(new FileWriter(gradeReport))) {

bw.write("\t\t\t\t\t"+fileName+" Scores\n");
bw.write("\t\t\t\t\t"+fileName+" Scores");
bw.newLine();

Connector con = new Connector();
con.connect();
Expand All @@ -40,7 +41,9 @@ public static void appendGradeReportTxt(String fileName) throws SQLException {
while (resultSetAvg.next()) {
Double average = resultSetAvg.getDouble(1);
String saverage = Double.toString(Math.round(average * 100.0)/100.0);
bw.write("The Class Average is "+saverage+"\n\n");
bw.write("The Class Average is "+saverage);
bw.newLine();
bw.newLine();
}

ResultSet resultSet = con.MakeQuery("Select \"studentEmail\",\"finalGrade\" from \""+fileName+"\"");
Expand All @@ -50,7 +53,7 @@ public static void appendGradeReportTxt(String fileName) throws SQLException {
String sgrade = Double.toString(Math.round(grade * 100.0)/100.0);
bw.write(email + " -\t "); //Print email
bw.write(sgrade); //Print grade
bw.write("\n");//Move to the next line to print the next row.
bw.newLine();//Move to the next line to print the next row.
}

System.out.println("Done");
Expand Down