Started model for the assignment system.
This commit is contained in:
parent
bfedbcc932
commit
ab1135d2b5
17
src/model/Assessment.java
Normal file
17
src/model/Assessment.java
Normal file
@ -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;
|
||||
}
|
||||
|
||||
|
||||
}
|
17
src/model/Assignment.java
Normal file
17
src/model/Assignment.java
Normal file
@ -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<Delivery> deliveries;
|
||||
|
||||
public Assignment(String name, String description, Date publishedDate, Date dueDate){
|
||||
this.name = name;
|
||||
this.description = description;
|
||||
this.publishedDate = publishedDate;
|
||||
this.dueDate = dueDate;
|
||||
}
|
||||
}
|
7
src/model/AssignmentGroup.java
Normal file
7
src/model/AssignmentGroup.java
Normal file
@ -0,0 +1,7 @@
|
||||
package model;
|
||||
|
||||
import java.util.HashSet;
|
||||
|
||||
public class AssignmentGroup extends HashSet<Assignment> {
|
||||
|
||||
}
|
15
src/model/BinaryAssessment.java
Normal file
15
src/model/BinaryAssessment.java
Normal file
@ -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;
|
||||
}
|
||||
|
||||
}
|
12
src/model/Course.java
Normal file
12
src/model/Course.java
Normal file
@ -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;
|
||||
}
|
||||
}
|
7
src/model/CourseGroup.java
Normal file
7
src/model/CourseGroup.java
Normal file
@ -0,0 +1,7 @@
|
||||
package model;
|
||||
|
||||
import java.util.HashSet;
|
||||
|
||||
public class CourseGroup extends HashSet<Course> {
|
||||
|
||||
}
|
10
src/model/Delivery.java
Normal file
10
src/model/Delivery.java
Normal file
@ -0,0 +1,10 @@
|
||||
package model;
|
||||
|
||||
public class Delivery {
|
||||
protected UserGroup userGroup;
|
||||
protected Assessment assessment;
|
||||
|
||||
public Delivery(UserGroup userGroup){
|
||||
this.userGroup = userGroup;
|
||||
}
|
||||
}
|
22
src/model/GradedAssessment.java
Normal file
22
src/model/GradedAssessment.java
Normal file
@ -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;
|
||||
}
|
||||
}
|
14
src/model/ScoreAssessment.java
Normal file
14
src/model/ScoreAssessment.java
Normal file
@ -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;
|
||||
}
|
||||
}
|
9
src/model/User.java
Normal file
9
src/model/User.java
Normal file
@ -0,0 +1,9 @@
|
||||
package model;
|
||||
|
||||
public class User {
|
||||
protected String username;
|
||||
|
||||
public User(String username){
|
||||
this.username = username;
|
||||
}
|
||||
}
|
7
src/model/UserGroup.java
Normal file
7
src/model/UserGroup.java
Normal file
@ -0,0 +1,7 @@
|
||||
package model;
|
||||
|
||||
import java.util.HashSet;
|
||||
|
||||
public class UserGroup extends HashSet<User>{
|
||||
|
||||
}
|
22
src/model/files/File.java
Normal file
22
src/model/files/File.java
Normal file
@ -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
|
||||
}
|
||||
|
||||
}
|
7
src/model/files/FileGroup.java
Normal file
7
src/model/files/FileGroup.java
Normal file
@ -0,0 +1,7 @@
|
||||
package model.files;
|
||||
|
||||
import java.util.HashSet;
|
||||
|
||||
public class FileGroup extends HashSet<File> {
|
||||
|
||||
}
|
5
src/model/files/FileType.java
Normal file
5
src/model/files/FileType.java
Normal file
@ -0,0 +1,5 @@
|
||||
package model.files;
|
||||
|
||||
public enum FileType {
|
||||
|
||||
}
|
17
src/model/files/PublishedFileGroup.java
Normal file
17
src/model/files/PublishedFileGroup.java
Normal file
@ -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);
|
||||
}
|
||||
|
||||
}
|
31
src/model/ntnu/Course.java
Normal file
31
src/model/ntnu/Course.java
Normal file
@ -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;
|
||||
}
|
||||
}
|
5
src/model/ntnu/Semester.java
Normal file
5
src/model/ntnu/Semester.java
Normal file
@ -0,0 +1,5 @@
|
||||
package model.ntnu;
|
||||
|
||||
public enum Semester {
|
||||
SPRING, FALL, SUMMER;
|
||||
}
|
Reference in New Issue
Block a user