Example implementation for the course TDT4165. Updated README with some aims and suggestions.

This commit is contained in:
Andreas Oppebøen 2011-11-24 20:50:38 +01:00
parent db082dd1fa
commit 3ab26ccc34
10 changed files with 148 additions and 4 deletions

19
README
View File

@ -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)

View File

@ -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<Delivery> deliveries;
public DeliveryGroup deliveries;
public Assignment(String name, String description, Date publishedDate, Date dueDate){
this.name = name;

View File

@ -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;

View File

@ -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;

View File

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

View File

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

View File

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

View File

@ -0,0 +1,5 @@
package model.ntnu.tdt4165;
public class AssignmentGroup extends model.AssignmentGroup {
}

View File

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

View File

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