From 72e43535ab24d4b9d942b7f2f87be0e3ef207849 Mon Sep 17 00:00:00 2001 From: Olivier Barais Date: Wed, 23 Apr 2025 11:45:40 +0200 Subject: [PATCH 1/2] add export service to get metadaata with image of a question --- .../fr/istic/service/QuestionService.java | 252 ++++++++++++++++-- .../customdto/exportcomments/Answer.java | 38 +++ .../AnswersWithPredictionDto.java | 23 ++ .../customdto/exportcomments/Comment.java | 20 ++ .../customdto/exportcomments/Prediction.java | 15 ++ .../java/fr/istic/web/rest/ExtendedAPI.java | 18 ++ 6 files changed, 344 insertions(+), 22 deletions(-) create mode 100644 src/main/java/fr/istic/service/customdto/exportcomments/Answer.java create mode 100644 src/main/java/fr/istic/service/customdto/exportcomments/AnswersWithPredictionDto.java create mode 100644 src/main/java/fr/istic/service/customdto/exportcomments/Comment.java create mode 100644 src/main/java/fr/istic/service/customdto/exportcomments/Prediction.java diff --git a/src/main/java/fr/istic/service/QuestionService.java b/src/main/java/fr/istic/service/QuestionService.java index c9d1febb..46db1c1f 100644 --- a/src/main/java/fr/istic/service/QuestionService.java +++ b/src/main/java/fr/istic/service/QuestionService.java @@ -3,6 +3,7 @@ import io.quarkus.panache.common.Page; import fr.istic.domain.Answer2HybridGradedComment; import fr.istic.domain.Exam; +import fr.istic.domain.ExamSheet; import fr.istic.domain.GradedComment; import fr.istic.domain.HybridGradedComment; import fr.istic.domain.Question; @@ -10,6 +11,10 @@ import fr.istic.domain.TextComment; import fr.istic.domain.Zone; import fr.istic.domain.enumeration.GradeType; +import fr.istic.service.customdto.exportcomments.Answer; +import fr.istic.service.customdto.exportcomments.AnswersWithPredictionDto; +import fr.istic.service.customdto.exportcomments.Comment; +import fr.istic.service.customdto.exportcomments.Prediction; import fr.istic.service.dto.ExamDTO; import fr.istic.service.dto.QuestionDTO; import fr.istic.service.mapper.ExamMapper; @@ -37,35 +42,33 @@ public class QuestionService { @Inject QuestionMapper questionMapper; - @Inject ExamMapper examMapper; @Inject ZoneService zoneService; - @Transactional public QuestionDTO persistOrUpdate(QuestionDTO questionDTO) { log.debug("Request to save Question : {}", questionDTO); var question = questionMapper.toEntity(questionDTO); - if (question.id!= null){ + if (question.id != null) { Question q2 = Question.findById(question.id); - if (q2 != null && question.gradeType == GradeType.HYBRID && ( - q2.gradeType != question.gradeType || q2.defaultpoint != question.defaultpoint || q2.quarterpoint != q2.quarterpoint - ) ){ + if (q2 != null && question.gradeType == GradeType.HYBRID && (q2.gradeType != question.gradeType + || q2.defaultpoint != question.defaultpoint || q2.quarterpoint != q2.quarterpoint)) { - List sts= StudentResponse.findAllByQuestionIdfetchAnswerfetchHybridCommand(question.id).list(); - for (StudentResponse st : sts ){ - var currentNote = 0.0; + List sts = StudentResponse + .findAllByQuestionIdfetchAnswerfetchHybridCommand(question.id).list(); + for (StudentResponse st : sts) { + var currentNote = 0.0; var absoluteNote2Add = 0.0; double pourcentage = 0.0; - if (question != null && question.defaultpoint != null){ - pourcentage = question.defaultpoint.doubleValue() *4; + if (question != null && question.defaultpoint != null) { + pourcentage = question.defaultpoint.doubleValue() * 4; } - for( Answer2HybridGradedComment an2 : st.hybridcommentsValues){ + for (Answer2HybridGradedComment an2 : st.hybridcommentsValues) { var stepValue = an2.stepValue.doubleValue(); if (stepValue > 0) { var relative = an2.hybridcomments.relative != null ? an2.hybridcomments.relative : false; @@ -73,20 +76,20 @@ public QuestionDTO persistOrUpdate(QuestionDTO questionDTO) { var grade = an2.hybridcomments.grade != null ? an2.hybridcomments.grade.doubleValue() : 0.0; if (relative) { - pourcentage = pourcentage + (stepValue / step) * grade; + pourcentage = pourcentage + (stepValue / step) * grade; } else { - absoluteNote2Add = absoluteNote2Add + (stepValue / step) * grade; + absoluteNote2Add = absoluteNote2Add + (stepValue / step) * grade; } - } + } } - var point = question.quarterpoint !=null ? question.quarterpoint.doubleValue(): 0.0; + var point = question.quarterpoint != null ? question.quarterpoint.doubleValue() : 0.0; currentNote = (point * pourcentage) / 400.0 + absoluteNote2Add; if (currentNote > point && !st.question.canExceedTheMax) { currentNote = point; } else if (currentNote < 0 && !st.question.canBeNegative) { currentNote = 0; } - st.quarternote = Double.valueOf(currentNote*100).intValue(); + st.quarternote = Double.valueOf(currentNote * 100).intValue(); st.persistOrUpdate(); } } @@ -103,13 +106,12 @@ public QuestionDTO cleanAllCorrectionAndComment(QuestionDTO questionDTO) { return questionMapper.toDto(cleanAllCorrectionAndComment(question)); } - public Question cleanAllCorrectionAndComment(Question question) { List gradeComment = new ArrayList(); List textComments = new ArrayList(); gradeComment.addAll(GradedComment.findByQuestionId(question.id).list()); textComments.addAll(TextComment.findByQuestionId(question.id).list()); - Set srs= this.updateCorrectionAndAnswer(question, gradeComment, textComments); + Set srs = this.updateCorrectionAndAnswer(question, gradeComment, textComments); List gradeCommentids = gradeComment.stream().map(gc -> gc.id).collect(Collectors.toList()); List textCommentsids = textComments.stream().map(gc -> gc.id).collect(Collectors.toList()); @@ -123,12 +125,9 @@ public Question cleanAllCorrectionAndComment(Question question) { qids.add(question.id); HybridGradedComment.deleteByQIds(qids); - return question; } - - public Set updateCorrectionAndAnswer(Question question, List gradeComment, List textComments) { Set srs = new HashSet(StudentResponse.findAllByQuestionId(question.id).list()); @@ -225,5 +224,214 @@ public Paged findQuestionbyZoneId(Page page, long zoneId) { .map(question -> questionMapper.toDto((Question) question)); } + public AnswersWithPredictionDto getallcommentsandprediction4qId(long qId) { + log.error("ok"); + try{ + AnswersWithPredictionDto awp = new AnswersWithPredictionDto(); + Question q = Question.findById(qId); + awp.setQid(qId); + var point = q.quarterpoint != null ? q.quarterpoint.doubleValue() : 0.0; + + awp.setMaxgrade(point / 4.0); + List srs = StudentResponse.findAllByQuestionId(qId).list(); + List predictions = fr.istic.domain.Prediction.findByQuestionId(qId).list(); + + for (StudentResponse sr : srs) { + + ExamSheet sh = sr.getCSheet(); + + if (sh != null && sh.pagemin != -1 && sh.pagemax != -1) { + + Answer answer = new Answer(); + awp.getAnswer().add(answer); + answer.setPagemin(sh.pagemin); + answer.setPagemax(sh.pagemax); + answer.setSheetId(sh.id); + answer.setSheetName(sh.name); + predictions.stream().filter(pr -> pr.sheet.id == sh.id).findAny().ifPresent(p -> { + Prediction p1 = new Prediction(); + p1.setPredictionconfidence(p.predictionconfidence); + p1.setText(p.text); + answer.setPrediction(p1); + }); + answer.setGrade(this.computeNote(sr)/100.0); + + for (TextComment t : sr.textcomments) { + Comment comment = new Comment(); + comment.setText(t.text); + comment.setDescription(t.description); + answer.getComments().add(comment); + } + for (GradedComment t : sr.gradedcomments) { + Comment comment = new Comment(); + comment.setText(t.text); + comment.setDescription(t.description); + log.error(""+q.step); + if (!"QCM".equals(q.type.algoName) && q.step > 0) { + if (q.gradeType == GradeType.POSITIVE) { + comment.setNoteComments(t.gradequarter / 4.0 / q.step); + } else if (q.gradeType == GradeType.NEGATIVE) { + comment.setNoteComments(-1.0*t.gradequarter / 4.0 / q.step); + } + } + answer.getComments().add(comment); + } + for (Answer2HybridGradedComment t : sr.hybridcommentsValues) { + Comment comment = new Comment(); + comment.setText(t.hybridcomments.text); + comment.setDescription(t.hybridcomments.description); + comment.setNoteComments(computeNote4HybridComment(sr, t)/4.0); + answer.getComments().add(comment); + } + } + } + return awp; + }catch (Exception e){ + e.printStackTrace(); + log.error("error in getallcommentsandprediction4qId", e); + return null; + } + + } + + private double computeNote(StudentResponse resp){ + if (resp.question.gradeType == GradeType.DIRECT && !"QCM".equals(resp.question.type.algoName)) { + if (resp.question.step > 0) { + return ((resp.quarternote * 100 / 4) / resp.question.step); + }else { + return 0.0; + } + } else if (resp.question.gradeType == GradeType.POSITIVE + && !"QCM".equals(resp.question.type.algoName)) { + int currentNote = 0; + for (var g : resp.gradedcomments) { + if (g.gradequarter != null) { + currentNote = currentNote + g.gradequarter; + } + } + + if (currentNote > (resp.question.quarterpoint) * resp.question.step) { + currentNote = (resp.question.quarterpoint) * resp.question.step; + } + if (resp.question.step > 0) { + return (currentNote * 100 / 4 / resp.question.step); + } else { + return 0.0; + } + + } else if (resp.question.gradeType == GradeType.NEGATIVE + && !"QCM".equals(resp.question.type.algoName)) { + int currentNote = resp.question.quarterpoint * resp.question.step; + for (var g : resp.gradedcomments) { + if (g.gradequarter != null) { + currentNote = currentNote - g.gradequarter; + } + } + ; + if (currentNote < 0) { + currentNote = 0; + } + if (resp.question.step > 0) { + return (currentNote * 100 / 4 / resp.question.step); + } + else { + return 0.0; + } + + } else if (resp.question.gradeType == GradeType.HYBRID + && !"QCM".equals(resp.question.type.algoName)) { + return this.computeNote4Hybrid(resp)/4; + + } else if ("QCM".equals(resp.question.type.algoName) && resp.question.step !=null && resp.question.step > 0) { + int currentNote = 0; + for (var g : resp.gradedcomments) { + if (g.description.startsWith("correct")) { + currentNote = currentNote + resp.question.quarterpoint * resp.question.step; + } else if (g.description.startsWith("incorrect")) { + currentNote = currentNote - resp.question.quarterpoint; + } + } + return (currentNote * 100 / 4 / resp.question.step); + } else if ("QCM".equals(resp.question.type.algoName) && resp.question.step <= 0) { + int currentNote = 0; + for (var g : resp.gradedcomments) { + if (g.description.startsWith("correct")) { + currentNote = currentNote + resp.question.quarterpoint; + } + } + return (currentNote * 100 / 4); + } + else { + return 0.0; + } + } + + private double computeNote4Hybrid(StudentResponse resp) { + var currentNote = 0.0; + var absoluteNote2Add = 0.0; + double pourcentage = 0.0; + if (resp.question != null && resp.question.defaultpoint != null) { + pourcentage = resp.question.defaultpoint.doubleValue() *4; + } + // log.error("default point for question " + resp.question.numero + " " + pourcentage); + + for (Answer2HybridGradedComment an2 : resp.hybridcommentsValues) { + var stepValue = an2.stepValue !=null ? an2.stepValue.doubleValue(): 0.0; + if (stepValue > 0) { + var relative = an2.hybridcomments.relative != null ? an2.hybridcomments.relative : false; + var step = an2.hybridcomments.step != null ? an2.hybridcomments.step.doubleValue() : 1.0; + var grade = an2.hybridcomments.grade != null ? an2.hybridcomments.grade.doubleValue() : 0.0; + + if (relative) { + pourcentage = pourcentage + ((stepValue / step) * grade); + + } else { + absoluteNote2Add = absoluteNote2Add + (stepValue / step) * grade; + + } + } + } + var point = resp.question.quarterpoint != null ? resp.question.quarterpoint.doubleValue() : 0.0; + // log.error("point for question " + resp.question.numero + " " + absoluteNote2Add + " " + point + " " + pourcentage); + + currentNote = ((point * pourcentage) / 400.0) + absoluteNote2Add; + + if (currentNote > point && !resp.question.canExceedTheMax) { +// log.error("currentNote " + currentNote + " " + point + " " + resp.question.numero); + currentNote = point; + } else if (currentNote < 0 && !resp.question.canBeNegative) { + currentNote = 0; + } + + return Double.valueOf(currentNote * 100); + + } + + + private double computeNote4HybridComment(StudentResponse resp, Answer2HybridGradedComment an2) { + var absoluteNote2Add = 0.0; + double pourcentage = 0.0; + if (resp.question != null && resp.question.defaultpoint != null) { + pourcentage = resp.question.defaultpoint.doubleValue() *4; + } + // log.error("default point for question " + resp.question.numero + " " + pourcentage); + + var stepValue = an2.stepValue !=null ? an2.stepValue.doubleValue(): 0.0; + if (stepValue > 0) { + var relative = an2.hybridcomments.relative != null ? an2.hybridcomments.relative : false; + var step = an2.hybridcomments.step != null ? an2.hybridcomments.step.doubleValue() : 1.0; + var grade = an2.hybridcomments.grade != null ? an2.hybridcomments.grade.doubleValue() : 0.0; + + if (relative) { + pourcentage = pourcentage + ((stepValue / step) * grade); + + } else { + absoluteNote2Add = absoluteNote2Add + (stepValue / step) * grade; + + } + } + + return absoluteNote2Add; + } } diff --git a/src/main/java/fr/istic/service/customdto/exportcomments/Answer.java b/src/main/java/fr/istic/service/customdto/exportcomments/Answer.java new file mode 100644 index 00000000..49f5dac5 --- /dev/null +++ b/src/main/java/fr/istic/service/customdto/exportcomments/Answer.java @@ -0,0 +1,38 @@ +package fr.istic.service.customdto.exportcomments; + +import java.util.ArrayList; +import java.util.List; + +import io.quarkus.runtime.annotations.RegisterForReflection; +@RegisterForReflection + +public class Answer { + private Long sheetId; + private String sheetName; + private Double grade; + private Integer pagemin; + private Integer pagemax; + private List comments = new ArrayList<>(); + private Prediction prediction; + + public Long getSheetId() { return sheetId; } + public void setSheetId(Long value) { this.sheetId = value; } + + public String getSheetName() { return sheetName; } + public void setSheetName(String value) { this.sheetName = value; } + + public Double getGrade() { return grade; } + public void setGrade(Double value) { this.grade = value; } + + public Integer getPagemin() { return pagemin; } + public void setPagemin(Integer value) { this.pagemin = value; } + + public Integer getPagemax() { return pagemax; } + public void setPagemax(Integer value) { this.pagemax = value; } + + public List getComments() { return comments; } + public void setComments(List value) { this.comments = value; } + + public Prediction getPrediction() { return prediction; } + public void setPrediction(Prediction value) { this.prediction = value; } +} diff --git a/src/main/java/fr/istic/service/customdto/exportcomments/AnswersWithPredictionDto.java b/src/main/java/fr/istic/service/customdto/exportcomments/AnswersWithPredictionDto.java new file mode 100644 index 00000000..1b4963c7 --- /dev/null +++ b/src/main/java/fr/istic/service/customdto/exportcomments/AnswersWithPredictionDto.java @@ -0,0 +1,23 @@ +package fr.istic.service.customdto.exportcomments; + +import java.util.ArrayList; +import java.util.List; + +import io.quarkus.runtime.annotations.RegisterForReflection; + +@RegisterForReflection + +public class AnswersWithPredictionDto { + private Double maxgrade; + private Long qid; + private List answer = new ArrayList<>(); + + public Double getMaxgrade() { return maxgrade; } + public void setMaxgrade(Double value) { this.maxgrade = value; } + + public Long getQid() { return qid; } + public void setQid(Long value) { this.qid = value; } + + public List getAnswer() { return answer; } + public void setAnswer(List value) { this.answer = value; } +} diff --git a/src/main/java/fr/istic/service/customdto/exportcomments/Comment.java b/src/main/java/fr/istic/service/customdto/exportcomments/Comment.java new file mode 100644 index 00000000..140b69dc --- /dev/null +++ b/src/main/java/fr/istic/service/customdto/exportcomments/Comment.java @@ -0,0 +1,20 @@ +package fr.istic.service.customdto.exportcomments; + +import io.quarkus.runtime.annotations.RegisterForReflection; + +@RegisterForReflection + +public class Comment { + private String text; + private String description; + private Double noteComments; + + public String getText() { return text; } + public void setText(String value) { this.text = value; } + + public String getDescription() { return description; } + public void setDescription(String value) { this.description = value; } + + public Double getNoteComments() { return noteComments; } + public void setNoteComments(Double value) { this.noteComments = value; } +} diff --git a/src/main/java/fr/istic/service/customdto/exportcomments/Prediction.java b/src/main/java/fr/istic/service/customdto/exportcomments/Prediction.java new file mode 100644 index 00000000..304f2032 --- /dev/null +++ b/src/main/java/fr/istic/service/customdto/exportcomments/Prediction.java @@ -0,0 +1,15 @@ +package fr.istic.service.customdto.exportcomments; + +import io.quarkus.runtime.annotations.RegisterForReflection; + +@RegisterForReflection +public class Prediction { + private String text; + private Double predictionconfidence; + + public String getText() { return text; } + public void setText(String value) { this.text = value; } + + public Double getPredictionconfidence() { return predictionconfidence; } + public void setPredictionconfidence(Double value) { this.predictionconfidence = value; } +} diff --git a/src/main/java/fr/istic/web/rest/ExtendedAPI.java b/src/main/java/fr/istic/web/rest/ExtendedAPI.java index c5818c5e..35b38044 100644 --- a/src/main/java/fr/istic/web/rest/ExtendedAPI.java +++ b/src/main/java/fr/istic/web/rest/ExtendedAPI.java @@ -54,6 +54,7 @@ import fr.istic.service.customdto.correctexamstate.MarkingExamStateDTO; import fr.istic.service.customdto.correctexamstate.QuestionStateDTO; import fr.istic.service.customdto.correctexamstate.SheetStateDTO; +import fr.istic.service.customdto.exportcomments.AnswersWithPredictionDto; import fr.istic.service.customdto.exportpdf.ExportPDFDto; import fr.istic.service.customdto.exportpdf.Gradedcommentspdf; import fr.istic.service.customdto.exportpdf.Hybridcommentspdf; @@ -1235,6 +1236,23 @@ public Response scanAndMergeUpload(@MultipartForm MultipartFormDataInput input, return Response.ok().build(); } + @GET + @Path("/getallcommentsandprediction4qId/{qId}") + @RolesAllowed({ AuthoritiesConstants.USER, AuthoritiesConstants.ADMIN }) + @Produces(MediaType.APPLICATION_JSON) + public Response getallcommentsandprediction4qId(@PathParam("qId") long qId, @Context SecurityContext ctx) { + if (!securityService.canAccess(ctx, qId, Question.class)) { + return Response.status(403, "Current user cannot access to this ressource").build(); + } + + try { + AnswersWithPredictionDto dto= questionService.getallcommentsandprediction4qId(qId); + return Response.ok(dto).build(); + } catch (Exception e) { + return Response.serverError().build(); + } + } + @GET @Path("/getCachePageInTemplate/{examId}") @Produces(MediaType.TEXT_PLAIN) From e05ef2e350871c52764ae58d25ff3c25239ba7c8 Mon Sep 17 00:00:00 2001 From: Olivier Barais Date: Wed, 23 Apr 2025 11:50:45 +0200 Subject: [PATCH 2/2] clean imports --- .../java/fr/istic/service/QuestionService.java | 15 --------------- src/main/java/fr/istic/web/rest/ExtendedAPI.java | 8 ++++++++ 2 files changed, 8 insertions(+), 15 deletions(-) diff --git a/src/main/java/fr/istic/service/QuestionService.java b/src/main/java/fr/istic/service/QuestionService.java index 46db1c1f..74b37a66 100644 --- a/src/main/java/fr/istic/service/QuestionService.java +++ b/src/main/java/fr/istic/service/QuestionService.java @@ -2,20 +2,17 @@ import io.quarkus.panache.common.Page; import fr.istic.domain.Answer2HybridGradedComment; -import fr.istic.domain.Exam; import fr.istic.domain.ExamSheet; import fr.istic.domain.GradedComment; import fr.istic.domain.HybridGradedComment; import fr.istic.domain.Question; import fr.istic.domain.StudentResponse; import fr.istic.domain.TextComment; -import fr.istic.domain.Zone; import fr.istic.domain.enumeration.GradeType; import fr.istic.service.customdto.exportcomments.Answer; import fr.istic.service.customdto.exportcomments.AnswersWithPredictionDto; import fr.istic.service.customdto.exportcomments.Comment; import fr.istic.service.customdto.exportcomments.Prediction; -import fr.istic.service.dto.ExamDTO; import fr.istic.service.dto.QuestionDTO; import fr.istic.service.mapper.ExamMapper; import fr.istic.service.mapper.QuestionMapper; @@ -225,8 +222,6 @@ public Paged findQuestionbyZoneId(Page page, long zoneId) { } public AnswersWithPredictionDto getallcommentsandprediction4qId(long qId) { - log.error("ok"); - try{ AnswersWithPredictionDto awp = new AnswersWithPredictionDto(); Question q = Question.findById(qId); awp.setQid(qId); @@ -266,7 +261,6 @@ public AnswersWithPredictionDto getallcommentsandprediction4qId(long qId) { Comment comment = new Comment(); comment.setText(t.text); comment.setDescription(t.description); - log.error(""+q.step); if (!"QCM".equals(q.type.algoName) && q.step > 0) { if (q.gradeType == GradeType.POSITIVE) { comment.setNoteComments(t.gradequarter / 4.0 / q.step); @@ -286,11 +280,6 @@ public AnswersWithPredictionDto getallcommentsandprediction4qId(long qId) { } } return awp; - }catch (Exception e){ - e.printStackTrace(); - log.error("error in getallcommentsandprediction4qId", e); - return null; - } } @@ -373,7 +362,6 @@ private double computeNote4Hybrid(StudentResponse resp) { if (resp.question != null && resp.question.defaultpoint != null) { pourcentage = resp.question.defaultpoint.doubleValue() *4; } - // log.error("default point for question " + resp.question.numero + " " + pourcentage); for (Answer2HybridGradedComment an2 : resp.hybridcommentsValues) { var stepValue = an2.stepValue !=null ? an2.stepValue.doubleValue(): 0.0; @@ -392,12 +380,10 @@ private double computeNote4Hybrid(StudentResponse resp) { } } var point = resp.question.quarterpoint != null ? resp.question.quarterpoint.doubleValue() : 0.0; - // log.error("point for question " + resp.question.numero + " " + absoluteNote2Add + " " + point + " " + pourcentage); currentNote = ((point * pourcentage) / 400.0) + absoluteNote2Add; if (currentNote > point && !resp.question.canExceedTheMax) { -// log.error("currentNote " + currentNote + " " + point + " " + resp.question.numero); currentNote = point; } else if (currentNote < 0 && !resp.question.canBeNegative) { currentNote = 0; @@ -414,7 +400,6 @@ private double computeNote4HybridComment(StudentResponse resp, Answer2HybridGrad if (resp.question != null && resp.question.defaultpoint != null) { pourcentage = resp.question.defaultpoint.doubleValue() *4; } - // log.error("default point for question " + resp.question.numero + " " + pourcentage); var stepValue = an2.stepValue !=null ? an2.stepValue.doubleValue(): 0.0; if (stepValue > 0) { diff --git a/src/main/java/fr/istic/web/rest/ExtendedAPI.java b/src/main/java/fr/istic/web/rest/ExtendedAPI.java index 35b38044..80746f58 100644 --- a/src/main/java/fr/istic/web/rest/ExtendedAPI.java +++ b/src/main/java/fr/istic/web/rest/ExtendedAPI.java @@ -1177,6 +1177,7 @@ public Response fileUploadStudentPdf(@MultipartForm MultipartFormDataInput input try { cacheStudentPdfFService.uploadFile(input, examId); } catch (Exception e) { + e.printStackTrace(); return Response.serverError().build(); } @@ -1191,6 +1192,7 @@ public Response fileUpload(@MultipartForm MultipartFormDataInput input) { try { cacheUploadService.uploadFile(input); } catch (Exception e) { + e.printStackTrace(); return Response.serverError().build(); } @@ -1211,6 +1213,7 @@ public Response scanUpload(@MultipartForm MultipartFormDataInput input, @PathPar try { scanService.uploadFile(input, scanId, false); } catch (Exception e) { + e.printStackTrace(); return Response.serverError().build(); } @@ -1231,6 +1234,7 @@ public Response scanAndMergeUpload(@MultipartForm MultipartFormDataInput input, try { scanService.uploadFile(input, scanId, true); } catch (Exception e) { + e.printStackTrace(); return Response.serverError().build(); } return Response.ok().build(); @@ -1249,6 +1253,7 @@ public Response getallcommentsandprediction4qId(@PathParam("qId") long qId, @Con AnswersWithPredictionDto dto= questionService.getallcommentsandprediction4qId(qId); return Response.ok(dto).build(); } catch (Exception e) { + e.printStackTrace(); return Response.serverError().build(); } } @@ -1265,6 +1270,7 @@ public Response getCachePageInTemplate(@PathParam("examId") long examId) { .build(); } catch (Exception e) { + e.printStackTrace(); return Response.serverError().build(); } @@ -1282,6 +1288,7 @@ public Response getCachePageAlign(@PathParam("examId") long examId, @PathParam(" .build(); } catch (Exception e) { + e.printStackTrace(); return Response.serverError().build(); } @@ -1320,6 +1327,7 @@ public Response getCachePageNoAlign(@PathParam("examId") long examId, @PathParam .build(); } catch (Exception e) { + e.printStackTrace(); return Response.serverError().build(); }