def importStudentsFromCSV(dbname,course,filename): connection = database.createNewDatabase(dbname) with open(filename, 'rb') as csvfile: reader = csv.reader(csvfile, delimiter=',') for row in reader: if len(row) >= 3: database.addUserRole(connection,row[3],course,roles.STUDENT)
def createNewCourse(connection,course,coordinator,tutors,students): # Add course coordinator database.addUserRole(connection,coordinator,course,roles.COORDINATOR) # Add tutors for login in tutors: database.addUserRole(connection,login,course,roles.TUTOR) # Add students for login in students: database.addUserRole(connection,login,course,roles.STUDENT)