This shows you the differences between two versions of the page.
stats:proc:signupgroup [2011/09/28 20:34] Patrick Michel created |
stats:proc:signupgroup [2013/07/10 12:34] |
||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== Sign-Up Group ====== | ||
- | <code xcend> | ||
- | signUpGroup(ident id, ident studentId, ident groupId) { | ||
- | assume exists //exercises/exercise[id]/students/student[studentId]; # implies the existence of the exercise | ||
- | assume exists //exercises/exercise[id]/groups/group[groupId]; # also implies it, but once is really enough | ||
- | | ||
- | assume not exists //exercises/exercise[id]/students/student[studentId]/group; | ||
- | assume count(groupId, //exercises/exercise[id]/students/student/group) < //exercises/exercise[id]/groups/group[groupId]/maxSize; | ||
- | | ||
- | insert //exercises/exercise[id]/students/student[studentId]/group groupId; | ||
- | } | ||
- | </code> |