kyu_8.check_the_exam package

Submodules

kyu_8.check_the_exam.check_exam module

kyu_8.check_the_exam.check_exam.char_processor(char: str, results: list) → None[source]

Processing chars based on specified rule :param char: :param results: :return:

kyu_8.check_the_exam.check_exam.check_exam(arr1, arr2)[source]

The first input array contains the correct answers to an exam, like [“a”, “a”, “b”, “d”]. The second one is “answers” array and contains student’s answers.

The two arrays are not empty and are the same length. Return the score for this array of answers, giving +4 for each correct answer, -1 for each incorrect answer, and +0 for each blank answer(empty string).

If the score < 0, return 0. :param arr1: :param arr2: :return:

kyu_8.check_the_exam.test_check_exam module

class kyu_8.check_the_exam.test_check_exam.CheckExamTestCase(methodName='runTest')[source]

Bases: unittest.case.TestCase

Testing check_exam function

test_check_exam()[source]

Testing check_exam function

The function should return the score for this array of answers, giving +4 for each correct answer, -1 for each incorrect answer, and +0 for each blank answer(empty string). :return:

Module contents