Skip to content
This repository has been archived by the owner on Jul 2, 2024. It is now read-only.

Commit

Permalink
Implement display question function
Browse files Browse the repository at this point in the history
  • Loading branch information
shorodilov committed Oct 14, 2023
1 parent 64ed921 commit 9131363
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/quiz/func.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
from __future__ import annotations

import csv
import logging
from typing import List, TYPE_CHECKING, TypedDict, Union

if TYPE_CHECKING:
Expand All @@ -27,6 +28,9 @@
})
Questions = List[Question]

logging.basicConfig(level=logging.INFO, format="%(message)s")
logger = logging.getLogger("quiz")


# noinspection PyTypeChecker
def load_questions_from_file(source: Union[str, pathlib.Path]) -> Questions:
Expand Down Expand Up @@ -64,6 +68,10 @@ def display_question(question: Question) -> None:
"""

logger.info("%s\n" % question["question"])
for opt_idx, option in enumerate(question["options"], 1):
logger.info("%d: %s" % (opt_idx, option))


def gather_answer(question: Question) -> int:
"""
Expand Down

0 comments on commit 9131363

Please sign in to comment.