Started model for the assignment system.
This commit is contained in:
parent
bfedbcc932
commit
ab1135d2b5
|
@ -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;
|
||||
}
|
||||
|
||||
|
||||
}
|
|
@ -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;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,7 @@
|
|||
package model;
|
||||
|
||||
import java.util.HashSet;
|
||||
|
||||
public class AssignmentGroup extends HashSet<Assignment> {
|
||||
|
||||
}
|
|
@ -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;
|
||||
}
|
||||
|
||||
}
|
|
@ -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;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,7 @@
|
|||
package model;
|
||||
|
||||
import java.util.HashSet;
|
||||
|
||||
public class CourseGroup extends HashSet<Course> {
|
||||
|
||||
}
|
|
@ -0,0 +1,10 @@
|
|||
package model;
|
||||
|
||||
public class Delivery {
|
||||
protected UserGroup userGroup;
|
||||
protected Assessment assessment;
|
||||
|
||||
public Delivery(UserGroup userGroup){
|
||||
this.userGroup = userGroup;
|
||||
}
|
||||
}
|
|
@ -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;
|
||||
}
|
||||
}
|
|
@ -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;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,9 @@
|
|||
package model;
|
||||
|
||||
public class User {
|
||||
protected String username;
|
||||
|
||||
public User(String username){
|
||||
this.username = username;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,7 @@
|
|||
package model;
|
||||
|
||||
import java.util.HashSet;
|
||||
|
||||
public class UserGroup extends HashSet<User>{
|
||||
|
||||
}
|
|
@ -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
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,7 @@
|
|||
package model.files;
|
||||
|
||||
import java.util.HashSet;
|
||||
|
||||
public class FileGroup extends HashSet<File> {
|
||||
|
||||
}
|
|
@ -0,0 +1,5 @@
|
|||
package model.files;
|
||||
|
||||
public enum FileType {
|
||||
|
||||
}
|
|
@ -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);
|
||||
}
|
||||
|
||||
}
|
|
@ -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;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,5 @@
|
|||
package model.ntnu;
|
||||
|
||||
public enum Semester {
|
||||
SPRING, FALL, SUMMER;
|
||||
}
|
Reference in New Issue