User Tools

Site Tools


stats:proc:removeparticipant

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
stats:proc:removeparticipant [2011/09/29 19:24]
Patrick Michel
stats:proc:removeparticipant [2013/07/10 12:34] (current)
Line 3: Line 3:
 <code xcend> <code xcend>
 removeParticipant(ident uid, ident id, ident studentId) { removeParticipant(ident uid, ident id, ident studentId) {
-  assume exists //accounts/​account[uid]/​admin || exists ​//accounts/​account[uid]/​examiner[id];​+  assume exists /account[uid]/student && ​/​account[uid]/​student/id = studentId && /​exam[id]/​free 
 +      ​|| exists /​account[uid]/​examiner[id];​
  
-  assume exists ​//exams/exam[id]/results/​participant[studentId];​ # implies the exam exists, which is implicitly true anyway+  assume exists /​exam[id]/​participant[studentId];​ # implies the exam exists, which is implicitly true anyway
  
-  ​remove //exams/​exam[id]/​results/​participant[studentId];​+  ​assume size(/exam[id]/participant[studentId]/​result) = 0; # don't allow to remove if results ​are there 
 + 
 +  remove /exam[id]/​participant[studentId];​
 } }
 </​code>​ </​code>​
  
stats/proc/removeparticipant.1317317095.txt.gz · Last modified: 2011/09/29 19:24 by Patrick Michel