This shows you the differences between two versions of the page.
stats:proc:signupgroup [2011/09/29 16:24] Patrick Michel |
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 //exercises/exercise[id]/groups/group[groupId]/curSize < //exercises/exercise[id]/groups/group[groupId]/maxSize; | ||
- | | ||
- | insert //exercises/exercise[id]/students/student[studentId]/group groupId; | ||
- | update //exercises/exercise[id]/groups/group[groupId]/curSize (//exercises/exercise[id]/groups/group[groupId]/curSize + 1); | ||
- | } # roles: assistant[id], student[studentId] | ||
- | </code> |