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/09/29 00:26] Patrick Michel |
stats:proc:removeparticipant [2012/01/11 14:40] Patrick Michel |
||
---|---|---|---|
Line 2: | Line 2: | ||
<code xcend> | <code xcend> | ||
- | removeParticipant(ident id, ident studentId) { | + | removeParticipant(ident uid, ident id, ident studentId) { |
+ | assume exists //accounts/account[uid]/student && //accounts/account[uid]/student/id = studentId && //exams/exam[id]/free | ||
+ | || exists //accounts/account[uid]/examiner[id]; | ||
assume exists //exams/exam[id]/results/participant[studentId]; # implies the exam exists, which is implicitly true anyway | 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]; | remove //exams/exam[id]/results/participant[studentId]; | ||
- | } # roles: examiner[id] | + | } |
</code> | </code> | ||