Skip to content

Commit

Permalink
Bugfix in ExerciseEvaluator, closing inputStream.
Browse files Browse the repository at this point in the history
  • Loading branch information
ms@Nicro authored and ms@Nicro committed Jan 13, 2024
1 parent 34d787d commit c6be18a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/main/java/controller/ExerciseEvaluator.java
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,7 @@ private int evaluateAudio(int exerciseId, int userId, Date d) throws IOException
if (audioExecution!=null){
SpeechRecognition s = new SpeechRecognition();
audioText = s.azureSTT(audioExecution);
audioExecution.close();
}

if(audioText != null) {
Expand Down Expand Up @@ -189,7 +190,6 @@ private int evaluateAudio(int exerciseId, int userId, Date d) throws IOException
right++;
}
}

double result = ((right/total)*100);

return (int) Math.round(result);
Expand Down

0 comments on commit c6be18a

Please sign in to comment.