Fix UI bugs: history page fallback, admin page typescript type, cbt page math rendering
This commit is contained in:
@@ -481,17 +481,17 @@ def get_admin_tests(session: Session = Depends(get_session)):
|
||||
return tests
|
||||
|
||||
class ManualQuestionInput(BaseModel):
|
||||
section: str
|
||||
text_en: str
|
||||
text_hi: Optional[str] = None
|
||||
options_en: List[str]
|
||||
options_hi: Optional[List[str]] = None
|
||||
correct_answer: str
|
||||
type: str = "SingleChoice"
|
||||
topic: str = "General"
|
||||
difficulty: str = "Medium"
|
||||
marks: int = 4
|
||||
negative_marks: int = 1
|
||||
section: str = "General"
|
||||
subject: str
|
||||
topic: str
|
||||
subtopic: str
|
||||
difficulty: str
|
||||
type: str
|
||||
question_text: str
|
||||
options: Optional[Dict[str, Any]] = None
|
||||
correct_answer: Dict[str, Any]
|
||||
solution_text: str
|
||||
language: str
|
||||
|
||||
class ManualTestCreate(BaseModel):
|
||||
title: str
|
||||
@@ -574,16 +574,17 @@ def create_manual_test(
|
||||
|
||||
for q_data in data.questions_json:
|
||||
q_obj = models.Question(
|
||||
text_en=q_data.text_en,
|
||||
text_hi=q_data.text_hi,
|
||||
options_en=q_data.options_en,
|
||||
options_hi=q_data.options_hi,
|
||||
correct_answer=q_data.correct_answer,
|
||||
type=q_data.type,
|
||||
subject=q_data.subject,
|
||||
topic=q_data.topic,
|
||||
subtopic=q_data.subtopic,
|
||||
difficulty=q_data.difficulty,
|
||||
marks=q_data.marks,
|
||||
negative_marks=q_data.negative_marks
|
||||
type=models.QuestionTypeEnum(q_data.type),
|
||||
question_text=q_data.question_text,
|
||||
options=q_data.options,
|
||||
correct_answer=q_data.correct_answer,
|
||||
solution_text=q_data.solution_text,
|
||||
language=models.MediumEnum(q_data.language),
|
||||
created_by=data.admin_id
|
||||
)
|
||||
session.add(q_obj)
|
||||
session.commit()
|
||||
|
||||
Reference in New Issue
Block a user