User Tools

Site Tools


stats:proc:addresult_task

Add Result (Task)

addResult(ident uid, ident id, ident studentId, ident taskId, double points) {
  assume exists /account[uid]/examiner[id];
 
  assume exists /exam[id]/participant[studentId]; # can also be implicitly true in an OO language
  assume exists /exam[id]/task[taskId];
 
  assume not exists /exam[id]/participant[studentId]/result[taskId];
 
  assume points >= 0 && points <= /exam[id]/task[taskId]/maxPoints;
 
  insert /exam[id]/participant[studentId] <result task=[taskId] points=[points] />;
}
stats/proc/addresult_task.txt · Last modified: 2013/07/10 12:34 (external edit)