This shows you the differences between two versions of the page.
stats:proc:removeparticipant [2011/10/02 10:35] Patrick Michel |
stats:proc:removeparticipant [2013/07/10 12:34] |
||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== Remove Participant ====== | ||
- | |||
- | <code xcend> | ||
- | removeParticipant(ident uid, ident id, ident studentId) { | ||
- | assume exists //accounts/account[uid]/examiner[id]; | ||
- | |||
- | assume exists //exams/exam[id]/results/participant[studentId]; # implies the exam exists, which is implicitly true anyway | ||
- | |||
- | assume size(//exams/exam[id]/results/participant[studentId]/result) = 0; # don't allow to remove if results are there | ||
- | |||
- | remove //exams/exam[id]/results/participant[studentId]; | ||
- | } | ||
- | </code> | ||