This shows you the differences between two versions of the page.
stats:proc:unregisterstudent [2011/10/15 19:38] Patrick Michel |
stats:proc:unregisterstudent [2013/07/10 12:34] |
||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== Unregister Student ====== | ||
- | <code xcend> | ||
- | unregisterStudent(ident uid, ident id, ident studentId) { | ||
- | assume //accounts/account[uid]/student/id = studentId; | ||
- | |||
- | assume exists //exercises/exercise[id]/students/student[studentId]; # implies the exercise exists | ||
- | |||
- | assume //exercises/exercise[id]/open; | ||
- | | ||
- | assume size(//exercises/exercise[id]/students/student[studentId]/result) = 0; # don't allow unregistering if results are there | ||
- | | ||
- | remove //exercises/exercise[id]/students/student[studentId]; | ||
- | } | ||
- | </code> |