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))
def test_mutiple_choice(): scores = [0, 0, 0, 0] ref = ['b', 'b', 'b', 'a'] ans_1 = mc.question_1() ans_2 = mc.question_2() ans_3 = mc.question_3() ans_4 = mc.question_4() ans = [ans_1, ans_2, ans_3, ans_4] for i in range(len(ref)): if ref[i] == ans[i]: scores[i] = 1 return scores