コード例 #1
0
def test_mcq():
    ref = ['b','a','a','a','c']
    ans_1 = mc.question_1()
    ans_2 = mc.question_2()   
    ans_3 = mc.question_3()   
    ans_4 = mc.question_4()   
    ans_5 = mc.question_5()   
    ans = [ans_1,ans_2,ans_3,ans_4,ans_5]
    for i in range(len(ref)):
        closeness_test(np.array(ord(ans[i])),np.array(ord(ref[i])),"mc.question_%d" %(i+1))
コード例 #2
0
ファイル: runner.py プロジェクト: cyyeh/cmu-dl
def test_mutiple_choice():
    scores = [0, 0, 0, 0, 0]

    ref = ['b', 'd', 'b', 'a', 'a']
    ans_1 = mc.question_1()
    ans_2 = mc.question_2()
    ans_3 = mc.question_3()
    ans_4 = mc.question_4()
    ans_5 = mc.question_5()
    ans = [ans_1, ans_2, ans_3, ans_4, ans_5]

    for i in range(len(ref)):
        if ref[i] == ans[i]:
            scores[i] = 1

    return scores