2022-07-26 10:07:31 +00:00
|
|
|
from typing import List
|
|
|
|
|
|
|
|
from utils.mysql import MySQL
|
2022-08-05 11:14:29 +00:00
|
|
|
from .models import Question, Answer
|
2022-07-26 10:07:31 +00:00
|
|
|
|
|
|
|
|
|
|
|
class QuizRepository:
|
|
|
|
def __init__(self, mysql: MySQL):
|
|
|
|
self.mysql = mysql
|
|
|
|
|
|
|
|
async def get_question_list(self) -> List[Question]:
|
2022-08-04 13:18:23 +00:00
|
|
|
pass
|
2022-07-26 10:07:31 +00:00
|
|
|
|
|
|
|
async def get_answer_form_question_id(self, question_id: int) -> List[Answer]:
|
2022-08-04 13:18:23 +00:00
|
|
|
pass
|
2022-07-26 10:07:31 +00:00
|
|
|
|
|
|
|
async def add_question(self, question: str):
|
2022-08-04 13:18:23 +00:00
|
|
|
pass
|
2022-07-26 10:07:31 +00:00
|
|
|
|
|
|
|
async def get_question(self, question: str) -> Question:
|
2022-08-04 13:18:23 +00:00
|
|
|
pass
|
2022-07-26 10:07:31 +00:00
|
|
|
|
|
|
|
async def add_answer(self, question_id: int, is_correct: int, answer: str):
|
2022-08-04 13:18:23 +00:00
|
|
|
pass
|
2022-07-26 10:07:31 +00:00
|
|
|
|
|
|
|
async def delete_question(self, question_id: int):
|
2022-08-04 13:18:23 +00:00
|
|
|
pass
|
2022-07-26 10:07:31 +00:00
|
|
|
|
|
|
|
async def delete_answer(self, answer_id: int):
|
2022-08-04 13:18:23 +00:00
|
|
|
pass
|
2022-07-26 10:07:31 +00:00
|
|
|
|
|
|
|
async def delete_admin(self, user_id: int):
|
2022-08-04 13:18:23 +00:00
|
|
|
pass
|