File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -146,7 +146,7 @@ async def handle_import_from_excel(data: BinaryIO, user: User) -> Quiz:
146
146
for a , answer in enumerate (answers ):
147
147
if answer is None :
148
148
continue
149
- if len (answer ) > 150 :
149
+ if len (str ( answer ) ) > 150 :
150
150
raise HTTPException (status_code = 400 , detail = f"Answer { a + 1 } in Question { i + 1 } is longer than 150" )
151
151
if len (answers ) < 2 :
152
152
raise HTTPException (status_code = 400 , detail = f"Less than 2 answers in Question { i + 1 } " )
@@ -155,7 +155,7 @@ async def handle_import_from_excel(data: BinaryIO, user: User) -> Quiz:
155
155
for a , answer in enumerate (answers ):
156
156
if answer is None :
157
157
continue
158
- answers_list .append (ABCDQuizAnswer (answer = answer , right = str (a + 1 ) in correct_answers ))
158
+ answers_list .append (ABCDQuizAnswer (answer = str ( answer ) , right = str (a + 1 ) in correct_answers ))
159
159
160
160
existing_question : dict | None = None
161
161
if existing_quiz is not None :
You can’t perform that action at this time.
0 commit comments