This shows you the differences between two versions of the page.
stats:proc:addparticipant [2012/06/06 15:32] Patrick Michel |
stats:proc:addparticipant [2013/07/10 12:34] |
||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== Add Participant ====== | ||
- | |||
- | <code xcend> | ||
- | addParticipant(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]; # implicitly true in OO implementations | ||
- | assume count (studentId, //accounts/account/student/id) = 1; | ||
- | | ||
- | assume not exists //exams/exam[id]/results/participant[studentId]; | ||
- | | ||
- | insert //exams/exam[id]/results/participant[studentId]; | ||
- | } | ||
- | </code> | ||
- | |||