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
1 change: 0 additions & 1 deletion .classpath
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,5 @@
<classpathentry kind="lib" path="postgresql-42.2.5.jar"/>
<classpathentry kind="con" path="org.eclipse.jdt.USER_LIBRARY/JavaxMail"/>
<classpathentry kind="lib" path="javax.mail.jar"/>
<classpathentry kind="lib" path="C:/Program Files/Java/jdk1.8.0_181/jre/lib/ext/jfxrt.jar"/>
<classpathentry kind="output" path="bin"/>
</classpath>
236 changes: 236 additions & 0 deletions ClassDiagram.ucls
Original file line number Diff line number Diff line change
@@ -0,0 +1,236 @@
<?xml version="1.0" encoding="UTF-8"?>
<class-diagram version="1.2.2" icons="true" always-add-relationships="false" generalizations="true" realizations="true"
associations="true" dependencies="false" nesting-relationships="true" router="FAN">
<class id="1" language="java" name="comm.Connector" project="OOD Project" file="/OOD Project/src/comm/Connector.java"
binary="false" corner="BOTTOM_RIGHT">
<position height="-1" width="-1" x="1583" y="111"/>
<display autosize="true" stereotype="true" package="true" initial-value="false" signature="true"
sort-features="false" accessors="true" visibility="true">
<attributes public="true" package="true" protected="true" private="true" static="true"/>
<operations public="true" package="true" protected="true" private="true" static="true"/>
</display>
</class>
<class id="2" language="java" name="comm.DataBase" project="OOD Project" file="/OOD Project/src/comm/DataBase.java"
binary="false" corner="BOTTOM_RIGHT">
<position height="-1" width="-1" x="1577" y="441"/>
<display autosize="true" stereotype="true" package="true" initial-value="false" signature="true"
sort-features="false" accessors="true" visibility="true">
<attributes public="true" package="true" protected="true" private="true" static="true"/>
<operations public="true" package="true" protected="true" private="true" static="true"/>
</display>
</class>
<class id="3" language="java" name="comm.EmailComm" project="OOD Project" file="/OOD Project/src/comm/EmailComm.java"
binary="false" corner="BOTTOM_RIGHT">
<position height="-1" width="-1" x="1049" y="71"/>
<display autosize="true" stereotype="true" package="true" initial-value="false" signature="true"
sort-features="false" accessors="true" visibility="true">
<attributes public="true" package="true" protected="true" private="true" static="true"/>
<operations public="true" package="true" protected="true" private="true" static="true"/>
</display>
</class>
<class id="4" language="java" name="gui.CheckIP" project="OOD Project" file="/OOD Project/src/gui/CheckIP.java"
binary="false" corner="BOTTOM_RIGHT">
<position height="-1" width="-1" x="995" y="1100"/>
<display autosize="true" stereotype="true" package="true" initial-value="false" signature="true"
sort-features="false" accessors="true" visibility="true">
<attributes public="true" package="true" protected="true" private="true" static="true"/>
<operations public="true" package="true" protected="true" private="true" static="true"/>
</display>
</class>
<class id="5" language="java" name="gui.gradeReport" project="OOD Project"
file="/OOD Project/src/gui/gradeReport.java" binary="false" corner="BOTTOM_RIGHT">
<position height="-1" width="-1" x="1263" y="224"/>
<display autosize="true" stereotype="true" package="true" initial-value="false" signature="true"
sort-features="false" accessors="true" visibility="true">
<attributes public="true" package="true" protected="true" private="true" static="true"/>
<operations public="true" package="true" protected="true" private="true" static="true"/>
</display>
</class>
<class id="6" language="java" name="gui.HelpPage" project="OOD Project" file="/OOD Project/src/gui/HelpPage.java"
binary="false" corner="BOTTOM_RIGHT">
<position height="-1" width="-1" x="431" y="84"/>
<display autosize="true" stereotype="true" package="true" initial-value="false" signature="true"
sort-features="false" accessors="true" visibility="true">
<attributes public="true" package="true" protected="true" private="true" static="true"/>
<operations public="true" package="true" protected="true" private="true" static="true"/>
</display>
</class>
<class id="7" language="java" name="gui.LoginPage" project="OOD Project" file="/OOD Project/src/gui/LoginPage.java"
binary="false" corner="BOTTOM_RIGHT">
<position height="-1" width="-1" x="808" y="1131"/>
<display autosize="true" stereotype="true" package="true" initial-value="false" signature="true"
sort-features="false" accessors="true" visibility="true">
<attributes public="true" package="true" protected="true" private="true" static="true"/>
<operations public="true" package="true" protected="true" private="true" static="true"/>
</display>
</class>
<class id="8" language="java" name="gui.ProfessorGUI" project="OOD Project"
file="/OOD Project/src/gui/ProfessorGUI.java" binary="false" corner="BOTTOM_RIGHT">
<position height="-1" width="-1" x="738" y="99"/>
<display autosize="true" stereotype="true" package="true" initial-value="false" signature="true"
sort-features="false" accessors="true" visibility="true">
<attributes public="true" package="true" protected="true" private="true" static="true"/>
<operations public="true" package="true" protected="true" private="true" static="true"/>
</display>
</class>
<class id="9" language="java" name="gui.Question" project="OOD Project" file="/OOD Project/src/gui/Question.java"
binary="false" corner="BOTTOM_RIGHT">
<position height="-1" width="-1" x="1482" y="982"/>
<display autosize="true" stereotype="true" package="true" initial-value="false" signature="true"
sort-features="false" accessors="true" visibility="true">
<attributes public="true" package="true" protected="true" private="true" static="true"/>
<operations public="true" package="true" protected="true" private="true" static="true"/>
</display>
</class>
<class id="10" language="java" name="gui.QuestionPages" project="OOD Project"
file="/OOD Project/src/gui/QuestionPages.java" binary="false" corner="BOTTOM_RIGHT">
<position height="-1" width="-1" x="1218" y="987"/>
<display autosize="true" stereotype="true" package="true" initial-value="false" signature="true"
sort-features="false" accessors="true" visibility="true">
<attributes public="true" package="true" protected="true" private="true" static="true"/>
<operations public="true" package="true" protected="true" private="true" static="true"/>
</display>
</class>
<class id="11" language="java" name="gui.Quiz" project="OOD Project" file="/OOD Project/src/gui/Quiz.java"
binary="false" corner="BOTTOM_RIGHT">
<position height="-1" width="-1" x="983" y="803"/>
<display autosize="true" stereotype="true" package="true" initial-value="false" signature="true"
sort-features="false" accessors="true" visibility="true">
<attributes public="true" package="true" protected="true" private="true" static="true"/>
<operations public="true" package="true" protected="true" private="true" static="true"/>
</display>
</class>
<class id="12" language="java" name="gui.SendPage" project="OOD Project" file="/OOD Project/src/gui/SendPage.java"
binary="false" corner="BOTTOM_RIGHT">
<position height="-1" width="-1" x="535" y="996"/>
<display autosize="true" stereotype="true" package="true" initial-value="false" signature="true"
sort-features="false" accessors="true" visibility="true">
<attributes public="true" package="true" protected="true" private="true" static="true"/>
<operations public="true" package="true" protected="true" private="true" static="true"/>
</display>
</class>
<class id="13" language="java" name="gui.StartPage" project="OOD Project" file="/OOD Project/src/gui/StartPage.java"
binary="false" corner="BOTTOM_RIGHT">
<position height="-1" width="-1" x="144" y="874"/>
<display autosize="true" stereotype="true" package="true" initial-value="false" signature="true"
sort-features="false" accessors="true" visibility="true">
<attributes public="true" package="true" protected="true" private="true" static="true"/>
<operations public="true" package="true" protected="true" private="true" static="true"/>
</display>
</class>
<class id="14" language="java" name="gui.Styles" project="OOD Project" file="/OOD Project/src/gui/Styles.java"
binary="false" corner="BOTTOM_RIGHT">
<position height="-1" width="-1" x="99" y="159"/>
<display autosize="true" stereotype="true" package="true" initial-value="false" signature="true"
sort-features="false" accessors="true" visibility="true">
<attributes public="true" package="true" protected="true" private="true" static="true"/>
<operations public="true" package="true" protected="true" private="true" static="true"/>
</display>
</class>
<class id="15" language="java" name="gui.VerificationPage" project="OOD Project"
file="/OOD Project/src/gui/VerificationPage.java" binary="false" corner="BOTTOM_RIGHT">
<position height="-1" width="-1" x="914" y="452"/>
<display autosize="true" stereotype="true" package="true" initial-value="false" signature="true"
sort-features="false" accessors="true" visibility="true">
<attributes public="true" package="true" protected="true" private="true" static="true"/>
<operations public="true" package="true" protected="true" private="true" static="true"/>
</display>
</class>
<dependency id="16">
<bendpoint x="514" y="399"/>
<end type="SOURCE" refId="12"/>
<end type="TARGET" refId="14"/>
</dependency>
<association id="17">
<end type="SOURCE" refId="2" navigable="false">
<attribute id="18" name="con">
<position height="0" width="0" x="285" y="-19"/>
</attribute>
<multiplicity id="19" minimum="0" maximum="1">
<position height="0" width="0" x="285" y="-19"/>
</multiplicity>
</end>
<end type="TARGET" refId="1" navigable="true"/>
<display labels="true" multiplicity="true"/>
</association>
<dependency id="20">
<end type="SOURCE" refId="5"/>
<end type="TARGET" refId="1"/>
</dependency>
<dependency id="21">
<end type="SOURCE" refId="6"/>
<end type="TARGET" refId="14"/>
</dependency>
<dependency id="22">
<end type="SOURCE" refId="8"/>
<end type="TARGET" refId="3"/>
</dependency>
<dependency id="23">
<end type="SOURCE" refId="15"/>
<end type="TARGET" refId="14"/>
</dependency>
<dependency id="24">
<end type="SOURCE" refId="7"/>
<end type="TARGET" refId="4"/>
</dependency>
<dependency id="25">
<end type="SOURCE" refId="12"/>
<end type="TARGET" refId="7"/>
</dependency>
<dependency id="26">
<bendpoint x="377" y="392"/>
<end type="SOURCE" refId="8"/>
<end type="TARGET" refId="13"/>
</dependency>
<dependency id="27">
<end type="SOURCE" refId="8"/>
<end type="TARGET" refId="6"/>
</dependency>
<dependency id="28">
<end type="SOURCE" refId="13"/>
<end type="TARGET" refId="14"/>
</dependency>
<dependency id="29">
<end type="SOURCE" refId="11"/>
<end type="TARGET" refId="10"/>
</dependency>
<association id="30">
<end type="SOURCE" refId="10" navigable="false">
<attribute id="31" name="questions"/>
<multiplicity id="32" minimum="0" maximum="2147483647"/>
</end>
<end type="TARGET" refId="9" navigable="true"/>
<display labels="true" multiplicity="true"/>
</association>
<dependency id="33">
<end type="SOURCE" refId="8"/>
<end type="TARGET" refId="15"/>
</dependency>
<dependency id="34">
<end type="SOURCE" refId="8"/>
<end type="TARGET" refId="5"/>
</dependency>
<association id="35">
<bendpoint x="1138" y="316"/>
<end type="SOURCE" refId="8" navigable="false">
<attribute id="36" name="dataBase"/>
<multiplicity id="37" minimum="0" maximum="1"/>
</end>
<end type="TARGET" refId="2" navigable="true"/>
<display labels="true" multiplicity="true"/>
</association>
<dependency id="38">
<end type="SOURCE" refId="8"/>
<end type="TARGET" refId="12"/>
</dependency>
<dependency id="39">
<end type="SOURCE" refId="11"/>
<end type="TARGET" refId="7"/>
</dependency>
<classifier-display autosize="true" stereotype="true" package="true" initial-value="false" signature="true"
sort-features="false" accessors="true" visibility="true">
<attributes public="true" package="true" protected="true" private="true" static="true"/>
<operations public="true" package="true" protected="true" private="true" static="true"/>
</classifier-display>
<association-display labels="true" multiplicity="true"/>
</class-diagram>
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/HelpPage.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$2.class
Binary file not shown.
Binary file modified bin/gui/ProfessorGUI$3.class
Binary file not shown.
Binary file modified bin/gui/ProfessorGUI$4.class
Binary file not shown.
Binary file modified bin/gui/ProfessorGUI$5.class
Binary file not shown.
Binary file modified bin/gui/ProfessorGUI$6.class
Binary file not shown.
Binary file modified bin/gui/ProfessorGUI$7.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.
Binary file modified bin/gui/Quiz$1.class
Binary file not shown.
Binary file modified bin/gui/Quiz$2.class
Binary file not shown.
Binary file modified bin/gui/Quiz.class
Binary file not shown.
Binary file modified bin/gui/SendPage.class
Binary file not shown.
Binary file modified bin/gui/StartPage.class
Binary file not shown.
Binary file modified bin/gui/Styles.class
Binary file not shown.
Binary file modified bin/gui/VerificationPage$1.class
Binary file not shown.
Binary file modified bin/gui/VerificationPage.class
Binary file not shown.
Binary file modified bin/gui/gradeReport.class
Binary file not shown.
5 changes: 3 additions & 2 deletions src/comm/Connector.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,14 @@

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;

public class Connector {

private Connection connect;
public static Connection connect;
private Statement statment;
private ResultSet resultSet;

Expand Down Expand Up @@ -39,7 +40,7 @@ public Connector(String por, String db, String usr, String pass) {
this.user = usr;
this.password = pass;
}

public int connect() {
try {
Class.forName("org.postgresql.Driver");
Expand Down
36 changes: 36 additions & 0 deletions src/gui/InsertIntoQQ.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
package gui;

import java.sql.Array;
import java.sql.PreparedStatement;
import java.sql.SQLException;


import comm.Connector;
import comm.DataBase;

public class InsertIntoQQ {
public static DataBase db = new DataBase();

public static void main(String[] args) {
try {
System.out.println("here1");
String bleh[] = {"d", "b", "c"};
String quizName = "testquiz";
String sql = "INSERT INTO " + quizName + " VALUES (?, ?, ?);";

Connector conn = new Connector();
conn.connect();
Array arrBleh = Connector.connect.createArrayOf("text", bleh);
PreparedStatement p = Connector.connect.prepareStatement(sql);
p.setString(1, "abc@gmail.com"); // Change to email value once stored
p.setArray(2, arrBleh); //Name of array
p.setInt(3, 80); //Final grade once calculated
p.executeUpdate();
} catch (SQLException e) {
e.printStackTrace();
}


}

}
15 changes: 12 additions & 3 deletions src/gui/ProfessorGUI.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

public class ProfessorGUI extends Application {

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 Down Expand Up @@ -206,10 +207,18 @@ public void handle(ActionEvent event) {
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() + "\"" + "("
fileName = startPage.getLblQFile().getText();
fileName = fileName.substring(0, fileName.length()-4);

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() + ");" +
" CREATE TABLE public.\"" + fileName + "questions\"" + "("
+ "\"questions\" text COLLATE pg_catalog.\"default\","
+ "canswers text COLLATE pg_catalog.\"default\"," + "\"panswers\" text[]" + ")"
+ "WITH (" + "OIDS = FALSE)" + "TABLESPACE pg_default;");
}

});
Expand Down
Loading