This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
stats:proc:addstudentid [2011/09/27 20:55] Patrick Michel |
stats:proc:addstudentid [2013/07/10 12:32] (current) |
||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== Set Student ID ====== | + | ====== Add Student ID ====== |
<code xcend> | <code xcend> | ||
- | # pretty much the canonical addStudent procedure | + | addStudentId(ident uid, ident username, ident id) { |
- | addStudentId(ident username, string id) { | + | assume exists /account[uid]/admin; |
- | assume exists //accounts/account[username]; # implicitly true in OO implementations | + | |
- | assume not exists //accounts/account[username]/student; | + | assume exists /account[username]; # implicitly true in OO implementations |
- | assume count(id, //accounts/account/student/id) = 0; | + | assume not exists /account[username]/student; |
+ | assume count(id, /account/student/id) = 0; | ||
- | insert //accounts/account[username] <student id=[id] />; | + | insert /account[username] <student id=[id] />; |
} | } | ||
</code> | </code> |