-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCourseManagement.java
116 lines (114 loc) · 3.82 KB
/
CourseManagement.java
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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
//package com.project.courseManagement;
//importing library files
import javax.swing.JOptionPane;
//class name
public class CourseManagement {
//main method
public static void main(String[] args) {
//declaring objects
Nsuer nsuer = new Nsuer();
Login user = new Login();
//login panel
String decision = JOptionPane.showInputDialog(null, "Enter <1> to Sign In or <2> to Sign Up: ");
boolean login = false;
if(decision.equals("1")) {
//getting nid to sign in
nsuer.inputNid();
//storing sign in access or denied
login = user.signIn(nsuer.getNid());
}
else {
//getting nid to sign up
nsuer.inputNid();
//calling method to sign up
user.signUp(nsuer.getNid());
//calling sign in method after sign up & store sign in result
login = user.signIn(nsuer.getNid());
}
if(login == true) {
//if user get access to sign in
nsuer.readFile(nsuer.getNid());
//verifying user as student or teacher
if(nsuer.getStatus().equals("Student")) {
//creating new object for a student
Student student = new Student();
//creating menu for users
String homeDicision = JOptionPane.showInputDialog(null, "===Student Panel===\nEnter <1> for Informations\n"
+ "Enter <2> to See Result\nEnter <3> to Play Game");
if(homeDicision.contains("1")) {
String subDicision = JOptionPane.showInputDialog(null, "Enter <1> for See Notice\nEnter <2> to Faculty Evaluation");
if(subDicision.equals("1")) {
//calling method to work
student.seeNotice();
}
else {
student.facultyEvaluation();
}
}
else if (homeDicision.contains("2")){
student.seeResult(nsuer.getNid());
}
else {
//declaring new object
Game newGame = new Game();
//calling object's method
newGame.game();
}
//warning user
JOptionPane.showMessageDialog(null, "Session Expired or Log Out!\nRestart The Program !");
}
else {
//creating new object for a faculty
Faculty faculty = new Faculty();
if(nsuer.checkFileExistence("Result") == false) {
JOptionPane.showMessageDialog(null, "====Notifaction====\nPlease Update Result !");
}
String firstDicision = JOptionPane.showInputDialog(null, "===Faculty Panel===\nEnter <1> for Informations\n"
+ "Enter <2> to Update Result\nEnter <3> to Publish Result");
if(firstDicision.contains("1")) {
String secondDicision = JOptionPane.showInputDialog(null, "Enter <1> to Set Notice\nEnter <2> to See Evaluation");
if(secondDicision.equals("1")) {
faculty.setNotice();
}
else {
faculty.seeEvaluation();
}
}
else if(firstDicision.equals("2")) {
String thirdDicision = JOptionPane.showInputDialog(null, "Enter <1> to Update Attendance Result\n"
+ "Enter <2> to Update Assignment Result\nEnter <3> to Update Quiz Result\n"
+ "Enter <4> to Update Mid Term Result\nEnter <5> to Update Final Result");
if(thirdDicision.equals("1")) {
faculty.setAttendance();
}
else if(thirdDicision.equals("2")) {
faculty.setExamNumber("Assignment");
}
else if(thirdDicision.equals("3")) {
String forthDicision = JOptionPane.showInputDialog(null, "Enter <1> to Update 1st Quiz Result\n"
+ "Enter <2> to Update 2nd Quiz Result\nEnter <3> to Update 3rd Quiz Result");
if(forthDicision.equals("1")) {
faculty.setExamNumber("FirstQuiz");
}
else if(forthDicision.equals("2")) {
faculty.setExamNumber("SecondQuiz");
}
else {
faculty.setExamNumber("ThirdQuiz");
}
}
else if(thirdDicision.equals("4")) {
faculty.setExamNumber("MidTerm");
}
else {
faculty.setExamNumber("Final");
}
}
else {
faculty.publishResult();
}
JOptionPane.showMessageDialog(null, "Session Expired or Log Out!\nRestart The Program !");
}
}
}
}