Update api/router.py
Browse files- api/router.py +3 -1
api/router.py
CHANGED
|
@@ -232,6 +232,7 @@ async def get_exercise(
|
|
| 232 |
ExerciseItem(
|
| 233 |
sentence_id=s['id'],
|
| 234 |
sentence=s['sentence'],
|
|
|
|
| 235 |
tts_audio_b64=audio_results[i],
|
| 236 |
instruction=instruction_text,
|
| 237 |
instruction_audio_b64=instruction_audio,
|
|
@@ -260,6 +261,7 @@ async def score_recording(
|
|
| 260 |
technique_id: str = Form(...),
|
| 261 |
sentence_id: int = Form(...),
|
| 262 |
sentence_text: str = Form(...),
|
|
|
|
| 263 |
language: str = Form(default='english'),
|
| 264 |
scoring_mode: str = Form(...),
|
| 265 |
scoring_config_json: str = Form(default='{}'),
|
|
@@ -281,7 +283,7 @@ async def score_recording(
|
|
| 281 |
|
| 282 |
if scoring_mode == 'cam':
|
| 283 |
cam_test_type = config.get('cam_test_type', tech.get('cam_test_type', 'blocks') if tech else 'blocks')
|
| 284 |
-
result = await score_with_cam(audio_bytes, sentence_text, cam_test_type, language)
|
| 285 |
elif scoring_mode == 'rate':
|
| 286 |
result = analyze_rate(audio_bytes, config)
|
| 287 |
elif scoring_mode == 'phonation':
|
|
|
|
| 232 |
ExerciseItem(
|
| 233 |
sentence_id=s['id'],
|
| 234 |
sentence=s['sentence'],
|
| 235 |
+
cam_sentence_id=s.get('cam_sentence_id'),
|
| 236 |
tts_audio_b64=audio_results[i],
|
| 237 |
instruction=instruction_text,
|
| 238 |
instruction_audio_b64=instruction_audio,
|
|
|
|
| 261 |
technique_id: str = Form(...),
|
| 262 |
sentence_id: int = Form(...),
|
| 263 |
sentence_text: str = Form(...),
|
| 264 |
+
cam_sentence_id: Optional[str] = Form(default=None),
|
| 265 |
language: str = Form(default='english'),
|
| 266 |
scoring_mode: str = Form(...),
|
| 267 |
scoring_config_json: str = Form(default='{}'),
|
|
|
|
| 283 |
|
| 284 |
if scoring_mode == 'cam':
|
| 285 |
cam_test_type = config.get('cam_test_type', tech.get('cam_test_type', 'blocks') if tech else 'blocks')
|
| 286 |
+
result = await score_with_cam(audio_bytes, sentence_text, cam_test_type, language, cam_sentence_id)
|
| 287 |
elif scoring_mode == 'rate':
|
| 288 |
result = analyze_rate(audio_bytes, config)
|
| 289 |
elif scoring_mode == 'phonation':
|