Skip to content

Commit

Permalink
Change 'challenge' into 'exercises' so questions are correctly counted
Browse files Browse the repository at this point in the history
  • Loading branch information
surister committed Sep 18, 2020
1 parent 7dc878f commit cc848b1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
5 changes: 3 additions & 2 deletions scripts/question_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@ def get_question_list(file_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.
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.
"""
Expand All @@ -63,7 +64,7 @@ def get_answered_questions(question_list: List[List[bytes]]) -> list:


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))


Expand Down
4 changes: 3 additions & 1 deletion scripts/update_question_number.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@
question_list = get_question_list(file_list)
question_count = len(question_list)
total_count = question_count + get_challenges_count()

print(question_count)
print(get_challenges_count())
print(total_count)
for line in file:
if LINE_FLAG in line:
file[file.index(line)] = b':bar_chart:  There are currently **%s** questions\r\n' %\
Expand Down

0 comments on commit cc848b1

Please sign in to comment.