adds placeholders for issue 5
This commit is contained in:
parent
6567adbe03
commit
263cd92a1e
|
@ -11,12 +11,12 @@ from rich.markdown import Markdown
|
|||
LEVEL = "LEVEL"
|
||||
QUESTION = "QUESTION"
|
||||
ANSWER = "ANSWER"
|
||||
# EXPLANATION = ""
|
||||
|
||||
|
||||
class Question(object):
|
||||
"""
|
||||
class to hold the question data and methods
|
||||
TODO: needs to json methods for the REST API
|
||||
"""
|
||||
|
||||
def __init__(self, data):
|
||||
|
@ -27,6 +27,7 @@ class Question(object):
|
|||
def _clean_data(self):
|
||||
"""
|
||||
TODO needs quite bit of actual cleanup to make the parsing more robust
|
||||
TODO needs a 'private' variable for issue 5
|
||||
"""
|
||||
self._level = self._data[LEVEL].strip()
|
||||
self._question = self._data[QUESTION].strip()
|
||||
|
@ -37,6 +38,7 @@ class Question(object):
|
|||
def dump_json(self):
|
||||
"""
|
||||
dumps all data to JSON for the REST API
|
||||
TODO needs a key to include the date for issue 5
|
||||
"""
|
||||
data = {
|
||||
"UUID": self.get_uuid(),
|
||||
|
@ -52,6 +54,10 @@ class Question(object):
|
|||
def get_question(self):
|
||||
return self._question
|
||||
|
||||
def get_explanation(self):
|
||||
"""PLACEHOLDER for issue 5"""
|
||||
pass
|
||||
|
||||
def _create_list_of_possibilities(self):
|
||||
"""creates and cleans a list of all the possible answers"""
|
||||
possibilities = []
|
||||
|
|
|
@ -72,6 +72,10 @@ class Tui(object):
|
|||
md = Markdown(md)
|
||||
self._console.print(md)
|
||||
|
||||
def show_explanation(self, question):
|
||||
"""PLACEHOLDER for issue 5"""
|
||||
pass
|
||||
|
||||
def show_success(self, success):
|
||||
md = "# {}".format(random.choice(MSG[success]))
|
||||
md = Markdown(md)
|
||||
|
@ -111,6 +115,7 @@ class Application(object):
|
|||
self._session.update_stats(stat)
|
||||
self._interface.show_success(stat)
|
||||
self._interface.show_response(question)
|
||||
self._interface.show_explanation(question) # will work once issue 5 is addressed
|
||||
self._interface.show_stats(self._session.get_stats())
|
||||
self._number -= 1
|
||||
self.quit()
|
||||
|
|
Loading…
Reference in New Issue