Commit b204a302 authored by Fabian Gabel's avatar Fabian Gabel
Browse files

bug fixes in create classlist

parent 62251cbc
import mysql.connector
import getpass
import sys
import mysql-config
from sqlconfig import *
from studip import Studip
#useful references:
......@@ -11,12 +11,12 @@ def generateClasslist(mydb):
mycursor = mydb.cursor()
print('Generating Classlist...')
# query database
mycursor.execute("SELECT student_id, last_name, first_name, status, comment, section, recitation, email_address, user_id, password, permission FROM classlist")
mycursor.execute("SELECT last_name, first_name, status, comment, section, recitation, email_address, user_id, password, permission FROM classlist")
myresult = mycursor.fetchall()
# write classlist file, see https://webwork.maa.org/wiki/Classlist_Files#Example_classlist
fo = open("class.lst", "w")
line_template = '{}' + ',{}'*9 + ',{}' '\n'
line_template = ',{}'*9 + ',{}' '\n'
for res in myresult:
line = line_template.format(*res)
fo.write(line)
......@@ -34,7 +34,6 @@ def sendLogin(mydb,lang='en'):
input('Sending Login-Mails. Press ENTER to continue...' )
# prepare template files and subject
switch(lang){
if (lang== 'de'):
template_file='password_template_de.txt'
subject='[WeBWorK] Wilkommen bei WeBWorK!'
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment