Skip to content

Commit

Permalink
SEBSP-183
Browse files Browse the repository at this point in the history
  • Loading branch information
anhefti committed Jan 6, 2025
1 parent 94aa91d commit 2a042db
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
import ch.ethz.seb.sebserver.webservice.servicelayer.authorization.TeacherAccountService;
import ch.ethz.seb.sebserver.webservice.servicelayer.dao.ExamDAO;
import ch.ethz.seb.sebserver.webservice.servicelayer.dao.UserDAO;
import ch.ethz.seb.sebserver.webservice.servicelayer.session.ExamFinishedEvent;
import ch.ethz.seb.sebserver.webservice.servicelayer.session.ScreenProctoringService;
import ch.ethz.seb.sebserver.webservice.weblayer.oauth.AdminAPIClientDetails;
import io.jsonwebtoken.Claims;
Expand Down Expand Up @@ -134,7 +133,7 @@ public Result<String> getOneTimeTokenForTeacherAccount(
final AdHocAccountData adHocAccountData,
final boolean createIfNotExists) {

if (exam.status != Exam.ExamStatus.RUNNING) {
if (exam.status != Exam.ExamStatus.RUNNING && exam.status != Exam.ExamStatus.TEST_RUN) {
return Result.ofError(new IllegalStateException("Exam is not running"));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -648,18 +648,17 @@ public void streamLightExamConfig(final String modelId, final HttpServletRespons

response.setStatus(HttpStatus.OK.value());

}catch(Exception e){
} catch ( final Exception e ) {
final APIMessage errorMessage = APIMessage.ErrorMessage.GENERIC.of(e.getMessage());
outputStream.write(Utils.toByteArray(this.jsonMapper.writeValueAsString(errorMessage)));
response.setStatus(HttpStatus.INTERNAL_SERVER_ERROR.value());

} finally {

try {
outputStream.flush();
outputStream.close();

} catch (IOException e) {
} catch (final IOException e) {
log.error("error while flushing / closing output stream", e);
}
}
Expand Down

0 comments on commit 2a042db

Please sign in to comment.