Table of Contents

Tutor Role

Tutors mainly add results for sheets, i.e. contribute to the Exercise Management and Sheets section.

Parameter: Exercise Identifier and Group Identifier

Access Rights

With the plain tutor right, a tutor can see all the groups in the corresponding exercise of the Exercise Management and Sheets section, as well as the sheets and other generic information. For each group right he can also see all the students which are signed up and their results.

Procedures

Team Assignment

assignTeam(ident uid, ident id, ident studentId, ident teamId) {
  assume exists /account[uid]/tutor[id]/group[/exercise[id]/student[studentId]/group];
    # implies the existence of the student, the exercise, the group and enough rights by a tutor account
 
  assume not exists /exercise[id]/student[studentId]/team;
 
  insert /exercise[id]/student[studentId]/team teamId;
}
leaveTeam(ident uid, ident id, ident studentId) {
  assume exists /account[uid]/tutor[id]/group[/exercise[id]/student[studentId]/group];
    # implies the existence of the student, the exercise, the group and enough rights by a tutor account
 
  assume exists /exercise[id]/student[studentId]/team;
 
  remove /exercise[id]/student[studentId]/team;
}

Result Management

addResult(ident uid, ident id, ident studentId, ident sheetId, double points) {
  assume exists /account[uid]/assistant[id] 
      || exists /account[uid]/tutor[id]/group[/exercise[id]/student[studentId]/group];
 
  assume exists /exercise[id]/student[studentId]; # implies the existence of the exercise
  assume exists /exercise[id]/sheet[sheetId]; # dito
 
  assume not exists /exercise[id]/student[studentId]/result[sheetId];
 
  assume points >= 0 && points <= /exercise[id]/sheet[sheetId]/maxPoints;
 
  insert /exercise[id]/student[studentId] <result sheet=[sheetId] points=[points] />;
}
changeResult(ident uid, ident id, ident studentId, ident sheetId, double points) {
  assume exists /account[uid]/assistant[id]
      || exists /account[uid]/tutor[id]/group[/exercise[id]/student[studentId]/group];
 
  assume exists /exercise[id]/student[studentId]; # implies the existence of the exercise
  assume exists /exercise[id]/sheet[sheetId]; # dito
 
  assume points >= 0 && points <= /exercise[id]/sheet[sheetId]/maxPoints;
 
  assume exists /exercise[id]/student[studentId]/result[sheetId];
 
  update /exercise[id]/student[studentId]/result[sheetId]/points points;
}
removeResult(ident uid, ident id, ident studentId, ident sheetId) {
  assume exists /account[uid]/assistant[id]
      || exists /account[uid]/tutor[id]/group[/exercise[id]/student[studentId]/group];
 
  assume exists /exercise[id]/student[studentId]/result[sheetId]; # implies the existence of pretty much everything
 
  remove /exercise[id]/student[studentId]/result[sheetId];
}