Fakultas Ilmu Komputer UI

Commit 21b9a4a1 authored by Al Taaj Kautsar Supangkat's avatar Al Taaj Kautsar Supangkat
Browse files

Add exclusive actions for TA and Student

parent 1097f31f
......@@ -23,3 +23,19 @@ orang,table,rpl,adpro
student,name,rpl,adpro
orang,name,rpl,adpro
student,name,rpl,adpro
student,tb,rpl
student,name,rpl
student,tb1,rpl,adpro
orang,tb3,rpl,adpro
st,tb1,rpl,adpro
student,tb2,rpl,adpro
orang,tb3,rpl,adpro
student,tb1,rpl
st,tb2,rpl
orang,tb3,rpl
st,name,rpl
st,name,rpl
st,name,rpl
st,name,rpl
st,name,rpl
st,name,rpl
Softeng/Group3/SiJadwal/utility/InputReader.java
Softeng.Group3.SiJadwal.utility.InputReader
Softeng/Group3/SiJadwal/repository/CSVUser.java
Softeng.Group3.SiJadwal.repository.CSVUser
Softeng/Group3/SiJadwal/actor/RoleType.java
Softeng.Group3.SiJadwal.actor.RoleType
Softeng.Group3.SiJadwal.actor.RoleType$1
Softeng/Group3/SiJadwal/repository/CSVUser.java
Softeng.Group3.SiJadwal.repository.CSVUser
Softeng/Group3/SiJadwal/repository/CSVCourse.java
Softeng.Group3.SiJadwal.repository.CSVCourse
Softeng/Group3/SiJadwal/repository/TimetableList.java
Softeng.Group3.SiJadwal.repository.TimetableList
Softeng/Group3/SiJadwal/actor/Student.java
Softeng.Group3.SiJadwal.actor.Student
Softeng/Group3/SiJadwal/repository/CSVOperator.java
Softeng.Group3.SiJadwal.repository.CSVOperator
Softeng/Group3/SiJadwal/model/Course.java
Softeng.Group3.SiJadwal.model.Course
Softeng/Group3/SiJadwal/repository/CourseList.java
......@@ -19,22 +19,22 @@ Softeng/Group3/SiJadwal/actor/Role.java
Softeng.Group3.SiJadwal.actor.Role
Softeng/Group3/SiJadwal/Main.java
Softeng.Group3.SiJadwal.Main
Softeng/Group3/SiJadwal/actor/User.java
Softeng.Group3.SiJadwal.actor.User
Softeng.Group3.SiJadwal.actor.User$1
Softeng/Group3/SiJadwal/repository/UserList.java
Softeng.Group3.SiJadwal.repository.UserList
Softeng/Group3/SiJadwal/repository/CSVTimetable.java
Softeng.Group3.SiJadwal.repository.CSVTimetable
Softeng/Group3/SiJadwal/repository/AssignmentList.java
Softeng.Group3.SiJadwal.repository.AssignmentList
Softeng/Group3/SiJadwal/actor/Admin.java
Softeng.Group3.SiJadwal.actor.Admin
Softeng/Group3/SiJadwal/repository/AssignmentList.java
Softeng.Group3.SiJadwal.repository.AssignmentList
Softeng/Group3/SiJadwal/model/Assignment.java
Softeng.Group3.SiJadwal.model.Assignment
Softeng/Group3/SiJadwal/model/Timetable.java
Softeng.Group3.SiJadwal.model.Timetable
Softeng/Group3/SiJadwal/actor/Student.java
Softeng.Group3.SiJadwal.actor.Student
Softeng/Group3/SiJadwal/actor/TeachingAssistant.java
Softeng.Group3.SiJadwal.actor.TeachingAssistant
Softeng/Group3/SiJadwal/repository/UserList.java
Softeng.Group3.SiJadwal.repository.UserList
Softeng/Group3/SiJadwal/repository/CSVOperator.java
Softeng.Group3.SiJadwal.repository.CSVOperator
Softeng/Group3/SiJadwal/actor/User.java
Softeng.Group3.SiJadwal.actor.User
Softeng.Group3.SiJadwal.actor.User$1
......@@ -11,6 +11,7 @@ import Softeng.Group3.SiJadwal.repository.UserList;
import java.sql.Time;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.*;
......@@ -25,7 +26,7 @@ public class Student extends Role {
private String assignmentName;
private Course assignmentCourse;
private LocalDate dueDate;
private LocalDateTime dueDate;
private Boolean validated;
private Set<User> validatedBy = new HashSet<>();
private User createdBy;
......@@ -40,6 +41,7 @@ public class Student extends Role {
System.out.println("10. Delete a timetable");
System.out.println("11. Add an assignment");
System.out.println("12. See the list of assignment");
System.out.println("13. Validate an assignment");
}
@Override
......@@ -184,13 +186,18 @@ public class Student extends Role {
courseList.getCourseList().get(Integer.parseInt(s) - 1));
}
System.out.println("Enter due date: yyyy-MM-dd");
String date = in.next();
// DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
dueDate = LocalDate.parse(date);
System.out.println("Enter due date: yyyy-MM-dd HH:mm");
String date = in.nextLine();
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm");
dueDate = LocalDateTime.parse(date, formatter);
assignment.setDueDate(dueDate);
assignment.setCreatedBy(Main.currentUser);
assignment.addValidatedBy(Main.currentUser);
validated = assignment.getValidated();
assignment.setValidated((validated));
assignmentList.addAssignment(assignmentName, assignment);
for (String s: coursesPicked) {
......@@ -208,6 +215,18 @@ public class Student extends Role {
break;
}
case 13:
System.out.println("Pick an assignment to validate: ");
assignmentList.listToString(assignmentList.getAssignmentList());
String[] assignmentsPicked = in.next().split("");
System.out.println("Picked: ");
for (String s: assignmentsPicked) {
System.out.println(s + " " + assignmentList.getAssignmentList().get(Integer.parseInt(s) - 1).getAssignmentName());
assignmentList.getAssignmentList().get(Integer.parseInt(s) - 1).addValidatedBy(Main.currentUser);
validated = assignmentList.getAssignmentList().get(Integer.parseInt(s) - 1).getValidated();
assignmentList.getAssignmentList().get(Integer.parseInt(s) - 1).setValidated(validated);
}
default:
}
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment