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

Last change on this file since 6850 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
RevLine 
[6651]1"""General helper functions for the student section.
2"""
3
[6662]4from random import SystemRandom as r
[6651]5
[6749]6def generate_student_id(students,letter):
[6651]7    if letter == '?':
[6664]8        letter= r().choice('ABCDEFGHKLMNPQRSTUVWXY')
9    sid = u"%c%d" % (letter,r().randint(99999,1000000))
[6749]10    while sid in students.keys():
[6664]11        sid = u"%c%d" % (letter,r().randint(99999,1000000))
[6662]12    return sid
[6742]13
14def set_returning_data(student):
15    student['studycourse'].current_level += 100
16    student['studycourse'].current_session += 1
17    verdict = student['studycourse'].current_verdict
[6804]18    student['studycourse'].current_verdict = '0'
[6742]19    student['studycourse'].previous_verdict = verdict
20    return
Note: See TracBrowser for help on using the repository browser.