This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
stats:proc:removeparticipant [2011/10/02 10:35] 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]/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 |
- | assume size(//exams/exam[id]/results/participant[studentId]/result) = 0; # don't allow to remove if results are there | + | assume size(/exam[id]/participant[studentId]/result) = 0; # don't allow to remove if results are there |
- | remove //exams/exam[id]/results/participant[studentId]; | + | remove /exam[id]/participant[studentId]; |
} | } | ||
</code> | </code> | ||