Last change
on this file since 6785 was
6749,
checked in by Henrik Bettermann, 13 years ago
|
Avoid overkill during batch creation of students.
|
-
Property svn:keywords set to
Id
|
File size:
674 bytes
|
Line | |
---|
1 | """General helper functions for the student section. |
---|
2 | """ |
---|
3 | |
---|
4 | from random import SystemRandom as r |
---|
5 | |
---|
6 | def generate_student_id(students,letter): |
---|
7 | if letter == '?': |
---|
8 | letter= r().choice('ABCDEFGHKLMNPQRSTUVWXY') |
---|
9 | sid = u"%c%d" % (letter,r().randint(99999,1000000)) |
---|
10 | while sid in students.keys(): |
---|
11 | sid = u"%c%d" % (letter,r().randint(99999,1000000)) |
---|
12 | return sid |
---|
13 | |
---|
14 | def set_returning_data(student): |
---|
15 | student['studycourse'].current_level += 100 |
---|
16 | student['studycourse'].current_session += 1 |
---|
17 | verdict = student['studycourse'].current_verdict |
---|
18 | student['studycourse'].current_verdict = '' |
---|
19 | student['studycourse'].previous_verdict = verdict |
---|
20 | return |
---|
Note: See
TracBrowser for help on using the repository browser.