This shows you the differences between two versions of the page.
stats:proc:addresult_task [2011/09/27 20:57] Patrick Michel created |
stats:proc:addresult_task [2013/07/10 12:34] |
||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== Add Result ====== | ||
- | |||
- | <code xcend> | ||
- | addResult(ident id, ident studentId, ident taskId, double points) { | ||
- | assume exists //exams/exam[id]/results/participant[studentId]; # can also be implicitly true in an OO language | ||
- | assume exists //exams/exam[id]/tasks/task[taskId]; | ||
- | | ||
- | assume not exists //exams/exam[id]/results/participant[studentId]/result[taskId]; | ||
- | |||
- | assume points >= 0 && points < //exams/exam[id]/tasks/task[taskId]/maxPoints; | ||
- | |||
- | insert //exams/exam[id]/results/participant[studentId] <result task=[taskId] points=[points] />; | ||
- | } | ||
- | </code> | ||