Index: lams_tool_scratchie/src/java/org/lamsfoundation/lams/tool/scratchie/dao/hibernate/ScratchieAnswerVisitDAOHibernate.java =================================================================== diff -u -r9908e067a5350bea350dea231dbe734558e67be8 -reb5846868ef426639cefa14bfb5881f2cb68ad63 --- lams_tool_scratchie/src/java/org/lamsfoundation/lams/tool/scratchie/dao/hibernate/ScratchieAnswerVisitDAOHibernate.java (.../ScratchieAnswerVisitDAOHibernate.java) (revision 9908e067a5350bea350dea231dbe734558e67be8) +++ lams_tool_scratchie/src/java/org/lamsfoundation/lams/tool/scratchie/dao/hibernate/ScratchieAnswerVisitDAOHibernate.java (.../ScratchieAnswerVisitDAOHibernate.java) (revision eb5846868ef426639cefa14bfb5881f2cb68ad63) @@ -38,7 +38,7 @@ + " as r where r.sessionId=? and r.scratchieAnswer.scratchieItem.uid = ? order by r.accessDate asc"; private static final String FIND_FIRST_SCRATCHED_ANSWER_BY_SESSION_AND_ITEM = "SELECT r.scratchieAnswer from " + ScratchieAnswerVisitLog.class.getName() - + " as r where r.sessionId=? and r.scratchieAnswer.scratchieItem.uid = ? order by r.accessDate asc LIMIT 1;"; + + " as r where r.sessionId=? and r.scratchieAnswer.scratchieItem.uid = ? order by r.accessDate asc LIMIT 1"; private static final String FIND_BY_SESSION = "from " + ScratchieAnswerVisitLog.class.getName() + " as r where r.sessionId=? order by r.accessDate asc"; Index: lams_tool_scratchie/src/java/org/lamsfoundation/lams/tool/scratchie/service/ScratchieServiceImpl.java =================================================================== diff -u -r9aad33f52b06632e7a8ed3705a7708338bcc00f8 -reb5846868ef426639cefa14bfb5881f2cb68ad63 --- lams_tool_scratchie/src/java/org/lamsfoundation/lams/tool/scratchie/service/ScratchieServiceImpl.java (.../ScratchieServiceImpl.java) (revision 9aad33f52b06632e7a8ed3705a7708338bcc00f8) +++ lams_tool_scratchie/src/java/org/lamsfoundation/lams/tool/scratchie/service/ScratchieServiceImpl.java (.../ScratchieServiceImpl.java) (revision eb5846868ef426639cefa14bfb5881f2cb68ad63) @@ -1455,7 +1455,40 @@ ExcelCell[][] fourthPageData = rowList.toArray(new ExcelCell[][] {}); dataToExport.put(getMessage("label.spss.analysis"), fourthPageData); + + // ======================================================= Burning questions page + // ======================================= + + if (scratchie.isBurningQuestionsEnabled()) { + rowList = new LinkedList(); + row = new ExcelCell[1]; + row[0] = new ExcelCell(getMessage("label.burning.questions"), true); + rowList.add(row); + rowList.add(ScratchieServiceImpl.EMPTY_ROW); + + List burningQuestionDtos = getBurningQuestionDtos(scratchie); + for (BurningQuestionDTO burningQuestionDto : burningQuestionDtos) { + ScratchieItem item = burningQuestionDto.getItem(); + row = new ExcelCell[1]; + row[0] = new ExcelCell(item.getTitle(), false); + rowList.add(row); + + Map groupNameToBurningQuestion = burningQuestionDto.getGroupNameToBurningQuestion(); + for (String groupName : groupNameToBurningQuestion.keySet()) { + String burningQuestion = groupNameToBurningQuestion.get(groupName); + row = new ExcelCell[2]; + row[0] = new ExcelCell(groupName, false); + row[1] = new ExcelCell(burningQuestion, false); + rowList.add(row); + } + rowList.add(ScratchieServiceImpl.EMPTY_ROW); + } + + ExcelCell[][] fifthPageData = rowList.toArray(new ExcelCell[][] {}); + dataToExport.put(getMessage("label.burning.questions"), fifthPageData); + } + return dataToExport; }