Started model for the assignment system.

This commit is contained in:
Andreas Oppebøen 2011-11-24 19:39:42 +01:00
parent bfedbcc932
commit ab1135d2b5
17 changed files with 224 additions and 0 deletions

17
src/model/Assessment.java Normal file
View 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
View 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;
}
}

View File

@ -0,0 +1,7 @@
package model;
import java.util.HashSet;
public class AssignmentGroup extends HashSet<Assignment> {
}

View 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
View 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;
}
}

View File

@ -0,0 +1,7 @@
package model;
import java.util.HashSet;
public class CourseGroup extends HashSet<Course> {
}

10
src/model/Delivery.java Normal file
View File

@ -0,0 +1,10 @@
package model;
public class Delivery {
protected UserGroup userGroup;
protected Assessment assessment;
public Delivery(UserGroup userGroup){
this.userGroup = userGroup;
}
}

View 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;
}
}

View 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
View 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
View 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
View 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
}
}

View File

@ -0,0 +1,7 @@
package model.files;
import java.util.HashSet;
public class FileGroup extends HashSet<File> {
}

View File

@ -0,0 +1,5 @@
package model.files;
public enum FileType {
}

View 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);
}
}

View 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;
}
}

View File

@ -0,0 +1,5 @@
package model.ntnu;
public enum Semester {
SPRING, FALL, SUMMER;
}