This shows you the differences between two versions of the page.
stats:proc:revoketutorrights [2011/11/02 14:39] Patrick Michel |
stats:proc:revoketutorrights [2013/07/10 12:33] |
||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== Revoke Tutor Rights ====== | ||
- | <code xcend> | ||
- | revokeTutorRights(ident uid, ident username, ident exerciseId, ident groupId) { | ||
- | assume exists //accounts/account[uid]/assistant[id]; | ||
- | | ||
- | assume exists //accounts/account[username]/tutor[exerciseId]/group[groupId]; | ||
- | assume exists //exercises/exercise[exerciseId]/groups/group[groupId]/tutor[account]; | ||
- | # implied by integrity and the assumption before | ||
- | |||
- | remove //accounts/account[username]/tutor[exerciseId]/group[groupId]; | ||
- | if size(//accounts/account[username]/tutor[exerciseId]/group) = 0 then # should this be an additional procedure? | ||
- | remove //accounts/account[username]/tutor[exerciseId]; | ||
- | fi | ||
- | remove //exercises/exercise[exerciseId]/groups/group[groupId]/tutor[account]; | ||
- | } | ||
- | </code> |