コード例 #1
0
ファイル: compare.py プロジェクト: danmartelly/sketch
totalAnswers = 0
totalDrawings = 0
numberAgreedOn = 0

peopleData = []
for p in people:
   f = open("teacherData/" +p+".txt", 'r')
   personData = eval(f.read())
   f.close()
   peopleData.append(personData)

computerData = dataFuncs.getTeacherData(computer)

for q in questions:
   criteria = dataFuncs.getCriteria(q)
   for k in peopleData[0][q]: # kerberos
      totalDrawings += 1
      for i in range(len(criteria)):
         totalAnswers += 1

         passes = 0
         fails = 0
         c = criteria[i]
         for pd in peopleData:
            if q not in pd: continue
            person_opinion = pd[q][k][i]
            if person_opinion == 'true': passes += 1
            else: fails += 1
         addToAgree(c['type'],max(passes, fails))
         if max(passes, fails) < 5: continue
コード例 #2
0
ファイル: autoGrade.py プロジェクト: danmartelly/sketch
import criteria
import graphUtil

questions = []
questions.extend(['thevenins.q00000'+str(i) for i in range(3)]) # can go up to 3
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')
コード例 #3
0
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')