if form.has_key('submit'): savePresident = form['student'].value saveKerberos = kerberoses[mapping.index(savePresident)] saveQuestion = questions[int(form['questionID'].value)] next_k = dataFuncs.getNextThing(saveKerberos, saveQuestion) next_p = mapping[kerberoses.index(next_k)] criteriaList = dataFuncs.getCriteriaCheckboxList(saveQuestion) user = form['user'].value answers = [] for i in range(1,len(criteriaList)+1): if form.has_key(str(i)): answers.append('true' if form[str(i)].value == 'on' else 'false') else: answers.append('false') dataFuncs.saveTeacherGrade(user, saveQuestion, saveKerberos, answers) print 'Location: ?student=%(next_pres)s&questionID=%(index)s&user=%(user)s'\ % {'next_pres': next_p, 'index': form['questionID'].value, 'user':user} elif form.has_key('selectUsername'): print 'Location: ?student=%(president)s&questionID=%(index)d&user=%(username)s' \ % {'president': president, 'index': questionID, 'username':form['username'].value} question = questions[questionID] next_questionID = (questionID + 1) % len(questions) imageSrc = "images/" + question.replace('.','') + ".png" for i in range(len(kerberoses)): try: studentData = dataFuncs.getStudentData(kerberos, question)
questions.extend(["power.q00000"+str(i) for i in range(1,7)]) questions.append("nyan.q000005") questions.extend(["potLoading.q00000"+str(i) for i in range(5)]) kerberoses = ['diomidov','jtwright','lroberto', 'jrgraves', 'evab','ezhou','habadio','bsnowden','rbuhai','liangx','trattner', 'kelvinlu', 'tschoen', 'ericluu', 'romero', 'lorenzov', 'jdkaplan', 'aboggust', 'wiliamm','keam','hyshwang','txz','akkas','mshum97','dvuong','zhuw','kevzhao','jbergero','shahp','kwlee','efriis','rruiz','simpsonr','pointing','carbaugh'] user = '******' for q in questions: print(q) critDicts = dataFuncs.getCriteria(q) critObjs = [] # create list of criteria for c in critDicts: clazz = getattr(criteria, c['type'] + "Criteria") inst = clazz(c['args']) critObjs.append(inst) for k in kerberoses: graphJSON = dataFuncs.getStudentData(k, q) if graphJSON == None: continue print('\t' + k) graphData = graphUtil.GraphData(graphJSON) answers = [] for c in critObjs: grade = c.grade(graphData)[0] answers.append('true' if grade >= 1 else 'false') dataFuncs.saveTeacherGrade(user, q, k, answers) print("done")
'bsnowden', 'rbuhai', 'liangx', 'trattner', 'kelvinlu', 'tschoen', 'ericluu', 'romero', 'lorenzov', 'jdkaplan', 'aboggust', 'wiliamm', 'keam', 'hyshwang', 'txz', 'akkas', 'mshum97', 'dvuong', 'zhuw', 'kevzhao', 'jbergero', 'shahp', 'kwlee', 'efriis', 'rruiz', 'simpsonr', 'pointing', 'carbaugh' ] user = '******' for q in questions: print(q) critDicts = dataFuncs.getCriteria(q) critObjs = [] # create list of criteria for c in critDicts: clazz = getattr(criteria, c['type'] + "Criteria") inst = clazz(c['args']) critObjs.append(inst) for k in kerberoses: graphJSON = dataFuncs.getStudentData(k, q) if graphJSON == None: continue print('\t' + k) graphData = graphUtil.GraphData(graphJSON) answers = [] for c in critObjs: grade = c.grade(graphData)[0] answers.append('true' if grade >= 1 else 'false') dataFuncs.saveTeacherGrade(user, q, k, answers) print("done")