Add verification for words in speaking grading.
This commit is contained in:
22
app.py
22
app.py
@@ -208,7 +208,16 @@ def grade_speaking_task_1():
|
||||
os.remove(sound_file_name)
|
||||
return response
|
||||
else:
|
||||
raise Exception("The audio recorded does not contain any english words.")
|
||||
return {
|
||||
"comment": "The audio recorded does not contain any english words.",
|
||||
"overall": 0,
|
||||
"task_response": {
|
||||
"Fluency and Coherence": 0,
|
||||
"Lexical Resource": 0,
|
||||
"Grammatical Range and Accuracy": 0,
|
||||
"Pronunciation": 0
|
||||
}
|
||||
}
|
||||
except Exception as e:
|
||||
os.remove(sound_file_name)
|
||||
return str(e), 400
|
||||
@@ -247,7 +256,16 @@ def grade_speaking_task_2():
|
||||
os.remove(sound_file_name)
|
||||
return response
|
||||
else:
|
||||
raise Exception("The audio recorded does not contain any english words.")
|
||||
return {
|
||||
"comment": "The audio recorded does not contain any english words.",
|
||||
"overall": 0,
|
||||
"task_response": {
|
||||
"Fluency and Coherence": 0,
|
||||
"Lexical Resource": 0,
|
||||
"Grammatical Range and Accuracy": 0,
|
||||
"Pronunciation": 0
|
||||
}
|
||||
}
|
||||
except Exception as e:
|
||||
os.remove(sound_file_name)
|
||||
return str(e), 400
|
||||
|
||||
Reference in New Issue
Block a user