Skip to content
Open

6 #26

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
5 changes: 4 additions & 1 deletion src/Main.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
import service.AuthService;

//TIP To <b>Run</b> code, press <shortcut actionId="Run"/> or
// click the <icon src="AllIcons.Actions.Execute"/> icon in the gutter.
public class Main {
public static void main(String[] args) {

AuthService authService = new AuthService();
authService.service();
}
}
7 changes: 2 additions & 5 deletions src/db/DataSource.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,11 @@ public class DataSource {
public static Set<User> teachers = new HashSet<>();
public static Set<Group> groups = new HashSet<>();
static {

User admin = new User("admin","admin","admin", Role.ADMIN);
<<<<<<< HEAD
User teacher1 = new User("teacher1","teacher1","teacher1", Role.STUDENT);
User teacher2 = new User("teacher2","teacher2","teacher2", Role.STUDENT);
=======

User teacher1 = new User("teacher1","teacher1","teacher1", Role.TEACHER);
User teacher2 = new User("teacher2","teacher2","teacher2", Role.TEACHER);
>>>>>>> 58ece0c4f27e49562169e5b09a77c87f9df68306
User a = new User("a","a","a", Role.STUDENT);
User b = new User("b","b","b", Role.STUDENT);
}
Expand Down
1 change: 0 additions & 1 deletion src/entity/Group.java
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ public String toString() {
", name='" + name + '\'' +
", maxLessonInMonth=" + maxLessonInMonth +
", teacher=" + teacher +
", groupStudents=" + groupStudents +
'}';
}
}
5 changes: 4 additions & 1 deletion src/entity/Student.java
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
package entity;

public class Student extends User{
public class Student extends User {
private StringBuilder marks = new StringBuilder();
private String groupId;

public Student() {
}

public Student(String groupId) {
this.groupId = groupId;
}
Expand Down
6 changes: 1 addition & 5 deletions src/entity/StudentAttendanceDaily.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@ public class StudentAttendanceDaily {
private String studentName;
private AttendanceStatus status;

public StudentAttendanceDaily(String studentId, String studentName, AttendanceStatus status) {
this.studentId = studentId;
public StudentAttendanceDaily(String studentName, AttendanceStatus status) {
this.studentName = studentName;
this.status = status;
}
Expand All @@ -19,9 +18,6 @@ public String getStudentId() {
return studentId;
}

public void setStudentId(String studentId) {
this.studentId = studentId;
}

public String getStudentName() {
return studentName;
Expand Down
18 changes: 16 additions & 2 deletions src/ui/StudentUi.java
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
package ui;

import entity.Attendance;
import entity.Group;
import entity.Student;
import entity.User;

import static db.DataSource.*;

public class StudentUi {

public static User currentUser;
public void studentUi(User user) {

currentUser = user;
while (true) {
System.out.println("""
0 exit
Expand All @@ -28,9 +31,20 @@ public void studentUi(User user) {
}

private void myAttendance() {
// Attendance attendance = new Attendance();
// System.out.println(attendance.getAttendedStudents());

for (Group group : groups) {
if (group.getGroupStudents().equals(currentUser)){
System.out.println(group);
}
}
}

private void myMarks() {
Student student = new Student();
for (int i = 0; i < students.size(); i++) {
System.out.println(student.getMarks());
}
}
}