Skip to content
Snippets Groups Projects
Commit 5107f4db authored by Jan Sladek's avatar Jan Sladek Committed by Björn
Browse files

Worked on #15326. Added my forgotten HttpServletResponse into the controller method.

parent 34abfd0a
No related merge requests found
......@@ -344,7 +344,8 @@ public class LecturerQuestionController extends AbstractController {
@RequestMapping(value = "/{questionId}/thumbs", method = RequestMethod.POST)
public ThumbnailResponse getThumbnails(
@PathVariable final String questionId,
@RequestBody final ThumbnailRequest thumbRequest
@RequestBody final ThumbnailRequest thumbRequest,
final HttpServletResponse response
) {
return questionService.getThumbnails(questionId, thumbRequest);
......@@ -353,7 +354,8 @@ public class LecturerQuestionController extends AbstractController {
@RequestMapping(value = "/{questionId}/answer/{answerId}/image", method = RequestMethod.GET)
public String getImage(
@PathVariable final String questionId,
@PathVariable final String answerId
@PathVariable final String answerId,
final HttpServletResponse response
) {
return questionService.getImage(questionId, answerId);
......
......@@ -540,6 +540,9 @@ public class QuestionService implements IQuestionService, ApplicationEventPublis
}
Answer theAnswer = answer.generateAnswerEntity(user, question);
if ("freetext".equals(theAnswer.getType())) {
ImageUtils.generateThumbnailImage(theAnswer);
}
return databaseDao.saveAnswer(theAnswer, user, question, getSession(question.getSessionKeyword()));
}
......@@ -554,6 +557,9 @@ public class QuestionService implements IQuestionService, ApplicationEventPublis
}
final Question question = getQuestion(answer.getQuestionId());
if ("freetext".equals(answer.getType())) {
ImageUtils.generateThumbnailImage(answer);
}
final Answer result = databaseDao.updateAnswer(realAnswer);
final Session session = databaseDao.getSessionFromKeyword(question.getSessionKeyword());
this.publisher.publishEvent(new NewAnswerEvent(this, session, result, user, question));
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment