Exemplo n.º 1
0
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)
Exemplo n.º 2
0
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)