source: main/waeup.sirp/trunk/src/waeup/sirp/students/utils.py @ 6838

Last change on this file since 6838 was 6804, checked in by Henrik Bettermann, 13 years ago

Set default value of verdicts.

  • Property svn:keywords set to Id
File size: 675 bytes
Line 
1"""General helper functions for the student section.
2"""
3
4from random import SystemRandom as r
5
6def 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
14def 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 = '0'
19    student['studycourse'].previous_verdict = verdict
20    return
Note: See TracBrowser for help on using the repository browser.