diff --git a/app.py b/app.py index 3649491..8c83186 100644 --- a/app.py +++ b/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