diff --git a/README b/README index e69de29..b6d5924 100644 --- a/README +++ b/README @@ -0,0 +1,19 @@ +System for handling assignments. +Mainly developed for use at NTNU. + +Aiming for the following features: +- Users and user login (via innsida at NTNU) +- Publishing assignments, attaching files to publications +- Submitting assignments, attaching files to submissions +- Assessing assignments + +Aiming to replace the following systems (among others): +- it's learning (the delivery part) +- http://www.idi.ntnu.no/emner/tdt4165/?page=deliver +- http://selje.idi.ntnu.no:1234/tdt4120/ +- http://itgk.idi.ntnu.no/oving/ +- http://www.math.ntnu.no/ovsys/?db=MA1101-H2011 + +Suggestions: +- Permissions for files / assignments +- Partitioning students into groups (GUI) diff --git a/src/model/Assignment.java b/src/model/Assignment.java index b229fa2..995faeb 100644 --- a/src/model/Assignment.java +++ b/src/model/Assignment.java @@ -1,12 +1,11 @@ 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 DeliveryGroup deliveries; public Assignment(String name, String description, Date publishedDate, Date dueDate){ this.name = name; diff --git a/src/model/Course.java b/src/model/Course.java index 81f0638..d82f2da 100644 --- a/src/model/Course.java +++ b/src/model/Course.java @@ -3,7 +3,7 @@ package model; public class Course { protected String name; protected UserGroup owner, students; - protected AssignmentGroup assignments; + public AssignmentGroup assignments; public Course(UserGroup owner, String name){ this.owner = owner; diff --git a/src/model/Delivery.java b/src/model/Delivery.java index dc5e5aa..50e950e 100644 --- a/src/model/Delivery.java +++ b/src/model/Delivery.java @@ -2,7 +2,7 @@ package model; public class Delivery { protected UserGroup userGroup; - protected Assessment assessment; + public Assessment assessment; public Delivery(UserGroup userGroup){ this.userGroup = userGroup; diff --git a/src/model/DeliveryGroup.java b/src/model/DeliveryGroup.java new file mode 100644 index 0000000..865aa6c --- /dev/null +++ b/src/model/DeliveryGroup.java @@ -0,0 +1,7 @@ +package model; + +import java.util.HashSet; + +public class DeliveryGroup extends HashSet { + +} diff --git a/src/model/User.java b/src/model/User.java index 7169973..be582e7 100644 --- a/src/model/User.java +++ b/src/model/User.java @@ -6,4 +6,34 @@ public class User { public User(String username){ this.username = username; } + + + + // Generated by Eclipse + + @Override + public int hashCode() { + final int prime = 31; + int result = 1; + result = prime * result + + ((username == null) ? 0 : username.hashCode()); + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) + return true; + if (obj == null) + return false; + if (getClass() != obj.getClass()) + return false; + User other = (User) obj; + if (username == null) { + if (other.username != null) + return false; + } else if (!username.equals(other.username)) + return false; + return true; + } } diff --git a/src/model/ntnu/tdt4165/Assignment.java b/src/model/ntnu/tdt4165/Assignment.java new file mode 100644 index 0000000..c2e6ec4 --- /dev/null +++ b/src/model/ntnu/tdt4165/Assignment.java @@ -0,0 +1,17 @@ +package model.ntnu.tdt4165; + +import java.util.Date; +import model.files.*; + +public class Assignment extends model.Assignment { + PublishedFileGroup problemFiles, solutionFiles; + + public Assignment(String name, String description, Date publishedDate, + Date dueDate, PublishedFileGroup problemFiles, PublishedFileGroup solutionFiles) { + super(name, description, publishedDate, dueDate); + this.problemFiles = problemFiles; + this.solutionFiles = solutionFiles; + } + + +} diff --git a/src/model/ntnu/tdt4165/AssignmentGroup.java b/src/model/ntnu/tdt4165/AssignmentGroup.java new file mode 100644 index 0000000..44140b5 --- /dev/null +++ b/src/model/ntnu/tdt4165/AssignmentGroup.java @@ -0,0 +1,5 @@ +package model.ntnu.tdt4165; + +public class AssignmentGroup extends model.AssignmentGroup { + +} diff --git a/src/model/ntnu/tdt4165/Course.java b/src/model/ntnu/tdt4165/Course.java new file mode 100644 index 0000000..cfb9b8c --- /dev/null +++ b/src/model/ntnu/tdt4165/Course.java @@ -0,0 +1,53 @@ +package model.ntnu.tdt4165; + +import java.util.Date; + +import model.Assessment; +import model.User; +import model.UserGroup; +import model.files.FileGroup; +import model.ntnu.Semester; +import model.files.*; + +public class Course extends model.ntnu.Course { + + public Course(UserGroup owner, String name, String code, Semester semester, + int year) { + super(owner, name, code, semester, year); + name = "progspråk"; + code = "tdt4165"; + + test(); + } + + private void test(){ + // create some users + User andreao = new User("andreao"); + User somaen = new User("somaen"); + students.add(andreao); + studasses.add(somaen); + + // create assignment + Date now = new Date(); + PublishedFileGroup oving1Files = new PublishedFileGroup(now,now); + oving1Files.add(new File("ov1.pdf","ov1.pdf", "Introduksjon til Oz")); + PublishedFileGroup oving1SolutionFiles = new PublishedFileGroup(now,now); + oving1SolutionFiles.add(new File("ov1_lf.pdf","ov1_lf.pdf", "Løsningsforslag")); + oving1SolutionFiles.add(new File("List.oz","List.oz", "")); + Assignment assignment = new Assignment("Øving 1", "Introduksjon til Oz", now,now, oving1Files, oving1SolutionFiles); + assignments.add(assignment); + + // create a delivery + UserGroup gruppe1 = new UserGroup(); + gruppe1.add(andreao); + File fil = new File("oving1.oz","","mitt svar på øving 1"); + FileGroup filer = new FileGroup(); + filer.add(fil); + Delivery levering1 = new Delivery(gruppe1,filer); + assignment.deliveries.add(levering1); + + // create an assessment + Assessment vurdering1 = new Assessment(studasses, "Bra!", now); + levering1.assessment = vurdering1; + } +} diff --git a/src/model/ntnu/tdt4165/Delivery.java b/src/model/ntnu/tdt4165/Delivery.java new file mode 100644 index 0000000..c627be1 --- /dev/null +++ b/src/model/ntnu/tdt4165/Delivery.java @@ -0,0 +1,14 @@ +package model.ntnu.tdt4165; + +import model.UserGroup; +import model.files.FileGroup; + +public class Delivery extends model.Delivery { + FileGroup files; + + public Delivery(UserGroup userGroup, FileGroup files) { + super(userGroup); + this.files = files; + } + +}