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