Change 'challenge' into 'exercises' so questions are correctly counted

This commit is contained in:
surister 2020-09-18 10:20:12 +02:00
parent 7dc878fb55
commit cc848b135d
2 changed files with 6 additions and 3 deletions

View File

@ -41,7 +41,8 @@ def get_question_list(file_list: List[bytes]) -> list:
def get_answered_questions(question_list: List[List[bytes]]) -> list: def get_answered_questions(question_list: List[List[bytes]]) -> list:
"""Dont let the type hint confuse you, problem of not using classes. """Dont let the type hint confuse you, problem of not using classes.
It needs the result of get_question_list(file_list)
It takes the result of get_question_list(file_list)
Returns a list of questions that are answered. Returns a list of questions that are answered.
""" """
@ -63,7 +64,7 @@ def get_answered_questions(question_list: List[List[bytes]]) -> list:
def get_challenges_count() -> int: def get_challenges_count() -> int:
challenges_path = pathlib.Path(__file__).parent.parent.joinpath('challenges').glob('*.md') challenges_path = pathlib.Path(__file__).parent.parent.joinpath('exercises').glob('*.md')
return len(list(challenges_path)) return len(list(challenges_path))

View File

@ -21,7 +21,9 @@ file_list = [line.rstrip() for line in file]
question_list = get_question_list(file_list) question_list = get_question_list(file_list)
question_count = len(question_list) question_count = len(question_list)
total_count = question_count + get_challenges_count() total_count = question_count + get_challenges_count()
print(question_count)
print(get_challenges_count())
print(total_count)
for line in file: for line in file:
if LINE_FLAG in line: if LINE_FLAG in line:
file[file.index(line)] = b':bar_chart:  There are currently **%s** questions\r\n' %\ file[file.index(line)] = b':bar_chart:  There are currently **%s** questions\r\n' %\