def done(self): ''' create formula, update table, create new assignment table->add row for each user ''' self.create_formula() num = self.update_assignments_table() # create the assignment table with it's proper name in the format: a# db.create_assignment_table(num, conn) # get a list of currently existing user ids in the system ids = db.get_user_ids(conn) progress = '' grade = 0 sub_date = 0 # for each user id, create a first attempt entry using a unique set # of questions for uid in ids: # unique set of questions quests = self.create_problem_set(self.formula) # ectract a list of problem ids prob_ids = [] # add all ids to the list for quest in quests: prob_ids.append(quest[0]) # create the user attempt entry db.add_attempt("a" + str(num), uid, prob_ids, progress, grade, sub_date, conn) self.refresh()
def table_functions(self, num, formula): ''' create formula, update table, create new assignment table->add row for each user ''' # create the assignment table with it's proper name in the format: a# db.create_assignment_table(num, conn) # get a list of currently existing user ids in the system ids = db.get_user_ids(conn) # for each user id, create a first attempt entry using a unique set # of questions for uid in ids: # unique set of questions quests = self.create_problem_set(formula) # extract a list of problem ids prob_ids = [] # add all ids to the list for quest in quests: prob_ids.append(quest[0]) # create the user attempt entry db.add_attempt("a" + str(num), uid, prob_ids, "", "", "", conn)
def setUp(self): db.create_assignment_table(row + 1, conn) db.add_attempt("a" + str(row + 1), 200, "[1,2,3]", "[60,0,2]", "100", "8", conn)
def setUp(self): # Create assignments a5 db.create_assignment_table(row + 1, conn)