diff --git a/src/model/Assessment.java b/src/model/Assessment.java new file mode 100644 index 0000000..0837aeb --- /dev/null +++ b/src/model/Assessment.java @@ -0,0 +1,17 @@ +package model; + +import java.util.Date; + +public class Assessment { + protected UserGroup assessors; + protected String comment; + protected Date assessedDate; + + public Assessment(UserGroup assessors, String comment, Date assessedDate) { + this.assessors = assessors; + this.comment = comment; + this.assessedDate = assessedDate; + } + + +} diff --git a/src/model/Assignment.java b/src/model/Assignment.java new file mode 100644 index 0000000..b229fa2 --- /dev/null +++ b/src/model/Assignment.java @@ -0,0 +1,17 @@ +package model; + +import java.util.ArrayList; +import java.util.Date; + +public class Assignment { + protected String name, description; + protected Date publishedDate, dueDate; + protected ArrayList deliveries; + + public Assignment(String name, String description, Date publishedDate, Date dueDate){ + this.name = name; + this.description = description; + this.publishedDate = publishedDate; + this.dueDate = dueDate; + } +} diff --git a/src/model/AssignmentGroup.java b/src/model/AssignmentGroup.java new file mode 100644 index 0000000..f48c2cb --- /dev/null +++ b/src/model/AssignmentGroup.java @@ -0,0 +1,7 @@ +package model; + +import java.util.HashSet; + +public class AssignmentGroup extends HashSet { + +} diff --git a/src/model/BinaryAssessment.java b/src/model/BinaryAssessment.java new file mode 100644 index 0000000..8429fc7 --- /dev/null +++ b/src/model/BinaryAssessment.java @@ -0,0 +1,15 @@ +package model; + +import java.util.Date; + +public class BinaryAssessment extends Assessment { + + boolean approved; + + public BinaryAssessment(boolean approved, UserGroup assessors, String comment, + Date assessedDate) { + super(assessors, comment, assessedDate); + approved = approved; + } + +} diff --git a/src/model/Course.java b/src/model/Course.java new file mode 100644 index 0000000..81f0638 --- /dev/null +++ b/src/model/Course.java @@ -0,0 +1,12 @@ +package model; + +public class Course { + protected String name; + protected UserGroup owner, students; + protected AssignmentGroup assignments; + + public Course(UserGroup owner, String name){ + this.owner = owner; + this.name = name; + } +} diff --git a/src/model/CourseGroup.java b/src/model/CourseGroup.java new file mode 100644 index 0000000..de636c1 --- /dev/null +++ b/src/model/CourseGroup.java @@ -0,0 +1,7 @@ +package model; + +import java.util.HashSet; + +public class CourseGroup extends HashSet { + +} diff --git a/src/model/Delivery.java b/src/model/Delivery.java new file mode 100644 index 0000000..dc5e5aa --- /dev/null +++ b/src/model/Delivery.java @@ -0,0 +1,10 @@ +package model; + +public class Delivery { + protected UserGroup userGroup; + protected Assessment assessment; + + public Delivery(UserGroup userGroup){ + this.userGroup = userGroup; + } +} diff --git a/src/model/GradedAssessment.java b/src/model/GradedAssessment.java new file mode 100644 index 0000000..b3850ab --- /dev/null +++ b/src/model/GradedAssessment.java @@ -0,0 +1,22 @@ +package model; + +import java.util.Date; + +public class GradedAssessment extends Assessment { + + public enum Grade { + F, E, D, C, B, A; + + public boolean isFail(){ + return this==F; + } + } + + Grade grade; + + public GradedAssessment(Grade grade, UserGroup assessors, String comment, + Date assessedDate) { + super(assessors, comment, assessedDate); + grade = grade; + } +} diff --git a/src/model/ScoreAssessment.java b/src/model/ScoreAssessment.java new file mode 100644 index 0000000..b4715bc --- /dev/null +++ b/src/model/ScoreAssessment.java @@ -0,0 +1,14 @@ +package model; + +import java.util.Date; + +public class ScoreAssessment extends Assessment { + + double score; + + public ScoreAssessment(double score, UserGroup assessors, String comment, + Date assessedDate) { + super(assessors, comment, assessedDate); + this.score = score; + } +} diff --git a/src/model/User.java b/src/model/User.java new file mode 100644 index 0000000..7169973 --- /dev/null +++ b/src/model/User.java @@ -0,0 +1,9 @@ +package model; + +public class User { + protected String username; + + public User(String username){ + this.username = username; + } +} diff --git a/src/model/UserGroup.java b/src/model/UserGroup.java new file mode 100644 index 0000000..15a8e9a --- /dev/null +++ b/src/model/UserGroup.java @@ -0,0 +1,7 @@ +package model; + +import java.util.HashSet; + +public class UserGroup extends HashSet{ + +} diff --git a/src/model/files/File.java b/src/model/files/File.java new file mode 100644 index 0000000..d41c637 --- /dev/null +++ b/src/model/files/File.java @@ -0,0 +1,22 @@ +package model.files; + +public class File { + String name, path, title; + FileType type; + public File(String name, String path, String title, FileType type) { + super(); + this.name = name; + this.path = path; + this.title = title; + this.type = type; + } + + public File(String name, String path, String title) { + super(); + this.name = name; + this.path = path; + this.title = title; + // TODO find type from name + } + +} diff --git a/src/model/files/FileGroup.java b/src/model/files/FileGroup.java new file mode 100644 index 0000000..946b07f --- /dev/null +++ b/src/model/files/FileGroup.java @@ -0,0 +1,7 @@ +package model.files; + +import java.util.HashSet; + +public class FileGroup extends HashSet { + +} diff --git a/src/model/files/FileType.java b/src/model/files/FileType.java new file mode 100644 index 0000000..aaa451e --- /dev/null +++ b/src/model/files/FileType.java @@ -0,0 +1,5 @@ +package model.files; + +public enum FileType { + +} diff --git a/src/model/files/PublishedFileGroup.java b/src/model/files/PublishedFileGroup.java new file mode 100644 index 0000000..833210f --- /dev/null +++ b/src/model/files/PublishedFileGroup.java @@ -0,0 +1,17 @@ +package model.files; + +import java.util.Date; + +public class PublishedFileGroup extends FileGroup { + Date startDate=null, endDate=null; + + public PublishedFileGroup(Date startDate, Date endDate) { + this.startDate = startDate; + this.endDate = endDate; + } + + public boolean isPublished(Date date) { + return date.after(startDate) && date.before(endDate); + } + +} diff --git a/src/model/ntnu/Course.java b/src/model/ntnu/Course.java new file mode 100644 index 0000000..901c76c --- /dev/null +++ b/src/model/ntnu/Course.java @@ -0,0 +1,31 @@ +package model.ntnu; + +import java.util.Date; + +import model.UserGroup; + +public class Course extends model.Course { + + protected model.UserGroup lecturers, vitasses, undasses, studasses; + protected model.UserGroup students; + protected Semester semester; + protected int year; + protected String code; + + public Course(UserGroup owner, String name, String code, Semester semester, int year) { + super(owner, name); + this.code = code; + this.semester = semester; + this.year = year; + } + + public Date getStartDate() { + // TODO implement + return null; + } + + public Date getEndDate() { + // TODO implement + return null; + } +} diff --git a/src/model/ntnu/Semester.java b/src/model/ntnu/Semester.java new file mode 100644 index 0000000..9f5d397 --- /dev/null +++ b/src/model/ntnu/Semester.java @@ -0,0 +1,5 @@ +package model.ntnu; + +public enum Semester { + SPRING, FALL, SUMMER; +}