Index: lams_common/src/java/org/lamsfoundation/lams/util/ExcelCell.java =================================================================== diff -u -r7475d08afc280b5e2e5ddf04e8bf35e3166aaf80 -r00528c91be5dfb45899641f6e1cc6f06e2559da9 --- lams_common/src/java/org/lamsfoundation/lams/util/ExcelCell.java (.../ExcelCell.java) (revision 7475d08afc280b5e2e5ddf04e8bf35e3166aaf80) +++ lams_common/src/java/org/lamsfoundation/lams/util/ExcelCell.java (.../ExcelCell.java) (revision 00528c91be5dfb45899641f6e1cc6f06e2559da9) @@ -40,15 +40,25 @@ public final static int ALIGN_CENTER = 3; public final static int ALIGN_RIGHT = 4; + public final static int CELL_FORMAT_DEFAULT = 0; + public final static int CELL_FORMAT_NUMBER = 1; + public final static int CELL_FORMAT_DATE = 2; + public final static int CELL_FORMAT_TIME = 3; + public final static int CELL_FORMAT_PERCENTAGE = 4; + private Object cellValue; - private Boolean isBold; - private Boolean isPercentage = false; + private int cellFormat = ExcelCell.CELL_FORMAT_DEFAULT;//default format is 0 + private Boolean isBold = false; private IndexedColors color; private int borderStyle = 0; private int alignment = 0; public ExcelCell() { } + + public ExcelCell(Object cellValue) { + this.cellValue = cellValue; + } public ExcelCell(Object cellValue, Boolean isBold) { this.cellValue = cellValue; @@ -80,7 +90,15 @@ public void setCellValue(Object cellValue) { this.cellValue = cellValue; } + + public int getCellFormat() { + return cellFormat; + } + public void setCellFormat(int cellFormat) { + this.cellFormat = cellFormat; + } + public Boolean isBold() { return isBold; } @@ -89,15 +107,6 @@ this.isBold = isBold; } - public Boolean isPercentage() { - return isPercentage; - } - - public ExcelCell setIsPercentage(Boolean isPercentage) { - this.isPercentage = isPercentage; - return this; - } - public IndexedColors getColor() { return color; } Index: lams_common/src/java/org/lamsfoundation/lams/util/ExcelUtil.java =================================================================== diff -u -r62aaf160878735888d077bf28fac3c1989bb8fbd -r00528c91be5dfb45899641f6e1cc6f06e2559da9 --- lams_common/src/java/org/lamsfoundation/lams/util/ExcelUtil.java (.../ExcelUtil.java) (revision 62aaf160878735888d077bf28fac3c1989bb8fbd) +++ lams_common/src/java/org/lamsfoundation/lams/util/ExcelUtil.java (.../ExcelUtil.java) (revision 00528c91be5dfb45899641f6e1cc6f06e2559da9) @@ -27,7 +27,10 @@ import java.io.OutputStream; import java.util.Date; import java.util.LinkedHashMap; +import java.util.TimeZone; +import javax.servlet.http.HttpSession; + import org.apache.commons.lang.StringUtils; import org.apache.poi.hssf.usermodel.HSSFWorkbook; import org.apache.poi.ss.usermodel.BorderStyle; @@ -42,8 +45,12 @@ import org.apache.poi.ss.usermodel.Workbook; import org.apache.poi.ss.util.CellUtil; import org.apache.poi.ss.util.WorkbookUtil; +import org.apache.poi.util.LocaleUtil; import org.apache.poi.xssf.streaming.SXSSFSheet; import org.apache.poi.xssf.streaming.SXSSFWorkbook; +import org.lamsfoundation.lams.usermanagement.dto.UserDTO; +import org.lamsfoundation.lams.web.session.SessionManager; +import org.lamsfoundation.lams.web.util.AttributeNames; /** * Utilities for producing .xlsx files. @@ -52,8 +59,15 @@ private static CellStyle defaultStyle; private static CellStyle boldStyle; + + //other built in formats https://poi.apache.org/apidocs/dev/org/apache/poi/ss/usermodel/BuiltinFormats.html + private static final String FORMAT_NUMBER = "#.##"; + private static final String FORMAT_PERCENTAGE = "0.00%"; + + private static CellStyle numberStyle; + private static CellStyle dateStyle; + private static CellStyle timeStyle; private static CellStyle percentageStyle; - private static String percentageStyleFormatString = "0.00%"; private static CellStyle greenColor; private static CellStyle blueColor; @@ -117,6 +131,12 @@ */ public static void createExcel(OutputStream out, LinkedHashMap dataToExport, String dateHeader, boolean displaySheetTitle) throws IOException { + //set user time zone, which is required for outputting cells of time format + HttpSession ss = SessionManager.getSession(); + UserDTO user = (UserDTO) ss.getAttribute(AttributeNames.USER); + TimeZone userTimeZone = user.getTimeZone(); + LocaleUtil.setUserTimeZone(userTimeZone); + Workbook workbook = new SXSSFWorkbook(100); // keep 100 rows in memory, exceeding rows will be flushed to disk create(workbook, out, dataToExport, dateHeader, displaySheetTitle); } @@ -159,9 +179,21 @@ yellowColor.setFillPattern(FillPatternType.SOLID_FOREGROUND); yellowColor.setFont(defaultFont); + // create number style + numberStyle = workbook.createCellStyle(); + numberStyle.setDataFormat((short)1); // built-in 1 format - "0" + + // create date style + dateStyle = workbook.createCellStyle(); + dateStyle.setDataFormat((short)14);// built-in 0xe format - "m/d/yy" + + // create time style + timeStyle = workbook.createCellStyle(); + timeStyle.setDataFormat((short)19);// built-in 0x13 format - "h:mm:ss AM/PM" + // create percentage style percentageStyle = workbook.createCellStyle(); - short percentageDataFormatId = workbook.createDataFormat().getFormat(percentageStyleFormatString); + short percentageDataFormatId = workbook.createDataFormat().getFormat(FORMAT_PERCENTAGE); percentageStyle.setDataFormat(percentageDataFormatId); //create border style @@ -222,7 +254,6 @@ public static void createSheet(Workbook workbook, String sheetName, String sheetTitle, int sheetIndex, String dateHeader, ExcelCell[][] data) throws IOException { - // Modify sheet name if required. It should contain only allowed letters and sheets are not allowed with // the same names (case insensitive) sheetName = WorkbookUtil.createSafeSheetName(sheetName); @@ -277,23 +308,28 @@ for (int i = 0; i < maxColumnSize; i++) { sheet.autoSizeColumn(i); } - } - } public static void createCell(ExcelCell excelCell, int cellnum, Row row, Workbook workbook) { - if (excelCell != null) { Cell cell = row.createCell(cellnum); - if (excelCell.getCellValue() != null && excelCell.getCellValue() instanceof Date) { + if (excelCell.getCellValue() != null && excelCell.getCellFormat() == ExcelCell.CELL_FORMAT_TIME + && excelCell.getCellValue() instanceof Date) { + cell.setCellValue((Date) excelCell.getCellValue()); + + } else if (excelCell.getCellValue() != null && excelCell.getCellValue() instanceof Date) { cell.setCellValue(FileUtil.EXPORT_TO_SPREADSHEET_CELL_DATE_FORMAT.format(excelCell.getCellValue())); + } else if (excelCell.getCellValue() != null && excelCell.getCellValue() instanceof java.lang.Double) { cell.setCellValue((Double) excelCell.getCellValue()); + } else if (excelCell.getCellValue() != null && excelCell.getCellValue() instanceof java.lang.Long) { cell.setCellValue(((Long) excelCell.getCellValue()).doubleValue()); + } else if (excelCell.getCellValue() != null && excelCell.getCellValue() instanceof java.lang.Integer) { cell.setCellValue(((Integer) excelCell.getCellValue()).doubleValue()); + } else if (excelCell.getCellValue() != null) { cell.setCellValue(excelCell.getCellValue().toString()); } @@ -305,8 +341,23 @@ cell.setCellStyle(boldStyle); } - if ( excelCell.isPercentage() ) { - cell.setCellStyle(percentageStyle); + boolean isPercentageFormat = excelCell.getCellFormat() == ExcelCell.CELL_FORMAT_PERCENTAGE; + switch (excelCell.getCellFormat()) { + case 0: + //default - do nothing + break; + case ExcelCell.CELL_FORMAT_NUMBER: + cell.setCellStyle(numberStyle); + break; + case ExcelCell.CELL_FORMAT_DATE: + cell.setCellStyle(dateStyle); + break; + case ExcelCell.CELL_FORMAT_TIME: + cell.setCellStyle(timeStyle); + break; + case ExcelCell.CELL_FORMAT_PERCENTAGE: + cell.setCellStyle(percentageStyle); + break; } if (excelCell.getColor() != null) { @@ -332,11 +383,11 @@ switch (excelCell.getBorderStyle()) { case ExcelCell.BORDER_STYLE_LEFT_THIN: - if (excelCell.isBold() && excelCell.isPercentage()) { + if (excelCell.isBold() && isPercentageFormat) { cell.setCellStyle(borderStyleLeftThinBoldFontPercentage); } else if (excelCell.isBold()) { cell.setCellStyle(borderStyleLeftThinBoldFont); - } else if (excelCell.isPercentage()) { + } else if (isPercentageFormat) { cell.setCellStyle(borderStyleLeftThinPercentage); } else { cell.setCellStyle(borderStyleLeftThin); @@ -350,11 +401,11 @@ } break; case ExcelCell.BORDER_STYLE_RIGHT_THICK: - if (excelCell.isBold() && excelCell.isPercentage() ) { + if (excelCell.isBold() && isPercentageFormat ) { cell.setCellStyle(borderStyleRightThickBoldFontPercentage); } else if (excelCell.isBold() ) { cell.setCellStyle(borderStyleRightThickBoldFont); - } else if (excelCell.isPercentage() ) { + } else if (isPercentageFormat ) { cell.setCellStyle(borderStyleRightThickPercentage); } else { cell.setCellStyle(borderStyleRightThick); Index: lams_gradebook/src/java/org/lamsfoundation/lams/gradebook/util/GradebookUtil.java =================================================================== diff -u -r9f491bfb157944ee893c52fa819fad27de872f51 -r00528c91be5dfb45899641f6e1cc6f06e2559da9 --- lams_gradebook/src/java/org/lamsfoundation/lams/gradebook/util/GradebookUtil.java (.../GradebookUtil.java) (revision 9f491bfb157944ee893c52fa819fad27de872f51) +++ lams_gradebook/src/java/org/lamsfoundation/lams/gradebook/util/GradebookUtil.java (.../GradebookUtil.java) (revision 00528c91be5dfb45899641f6e1cc6f06e2559da9) @@ -200,7 +200,7 @@ } ExcelCell userMarkCell = new ExcelCell(convertedMark, isBold, borderStyle); - userMarkCell.setIsPercentage(true); + userMarkCell.setCellFormat(ExcelCell.CELL_FORMAT_PERCENTAGE); return userMarkCell; } Index: lams_tool_assessment/conf/language/lams/ApplicationResources_en_AU.properties =================================================================== diff -u -r1ba75f43a383fb925aae69975d748d0a8dfdf9a5 -r00528c91be5dfb45899641f6e1cc6f06e2559da9 --- lams_tool_assessment/conf/language/lams/ApplicationResources_en_AU.properties (.../ApplicationResources_en_AU.properties) (revision 1ba75f43a383fb925aae69975d748d0a8dfdf9a5) +++ lams_tool_assessment/conf/language/lams/ApplicationResources_en_AU.properties (.../ApplicationResources_en_AU.properties) (revision 00528c91be5dfb45899641f6e1cc6f06e2559da9) @@ -349,4 +349,5 @@ outcome.authoring.remove.confirm =Are you sure you want to remove this learning outcome? label.close =Close +label.export.time.attempted =Time attempted #======= End labels: Exported 343 labels for en AU ===== Index: lams_tool_assessment/src/java/org/lamsfoundation/lams/tool/assessment/service/AssessmentServiceImpl.java =================================================================== diff -u -rd0031eadc1ee66ed82eade3ffa5c039016d999eb -r00528c91be5dfb45899641f6e1cc6f06e2559da9 --- lams_tool_assessment/src/java/org/lamsfoundation/lams/tool/assessment/service/AssessmentServiceImpl.java (.../AssessmentServiceImpl.java) (revision d0031eadc1ee66ed82eade3ffa5c039016d999eb) +++ lams_tool_assessment/src/java/org/lamsfoundation/lams/tool/assessment/service/AssessmentServiceImpl.java (.../AssessmentServiceImpl.java) (revision 00528c91be5dfb45899641f6e1cc6f06e2559da9) @@ -1491,9 +1491,9 @@ float grade = userDto.getGrade(); ExcelCell[] userResultRow = new ExcelCell[3]; - userResultRow[0] = new ExcelCell(userDto.getLogin(), false); - userResultRow[1] = new ExcelCell(userDto.getFirstName() + " " + userDto.getLastName(), false); - userResultRow[2] = new ExcelCell(grade, false); + userResultRow[0] = new ExcelCell(userDto.getLogin()); + userResultRow[1] = new ExcelCell(userDto.getFirstName() + " " + userDto.getLastName()); + userResultRow[2] = new ExcelCell(grade); summaryTabLearnerList.add(userResultRow); if (grade < minGrade || minGrade == -9999999) { @@ -1519,15 +1519,15 @@ summaryTab.add(EMPTY_ROW); ExcelCell[] minMaxRow = new ExcelCell[2]; minMaxRow[0] = new ExcelCell(getMessage("label.number.learners"), true); - minMaxRow[1] = new ExcelCell(totalNumEntries, false); + minMaxRow[1] = new ExcelCell(totalNumEntries); summaryTab.add(minMaxRow); minMaxRow = new ExcelCell[2]; minMaxRow[0] = new ExcelCell(getMessage("label.lowest.mark"), true); - minMaxRow[1] = new ExcelCell((double) minGrade, false); + minMaxRow[1] = new ExcelCell((double) minGrade); summaryTab.add(minMaxRow); minMaxRow = new ExcelCell[2]; minMaxRow[0] = new ExcelCell(getMessage("label.highest.mark"), true); - minMaxRow[1] = new ExcelCell((double) maxGrade, false); + minMaxRow[1] = new ExcelCell((double) maxGrade); summaryTab.add(minMaxRow); summaryTab.add(EMPTY_ROW); @@ -1542,8 +1542,8 @@ float totalNumEntriesAsFloat = totalNumEntries; for (Map.Entry entry : markSummary.entrySet()) { binSummaryRow = new ExcelCell[3]; - binSummaryRow[0] = new ExcelCell(entry.getKey(), false); - binSummaryRow[1] = new ExcelCell(entry.getValue(), false); + binSummaryRow[0] = new ExcelCell(entry.getKey()); + binSummaryRow[1] = new ExcelCell(entry.getValue()); binSummaryRow[2] = new ExcelCell(Math.round(entry.getValue() / totalNumEntriesAsFloat * 100), false); summaryTab.add(binSummaryRow); @@ -1577,7 +1577,7 @@ int count = 0; // question row title - ExcelCell[] questionTitleRow = showUserNames ? new ExcelCell[10] : new ExcelCell[9]; + ExcelCell[] questionTitleRow = showUserNames ? new ExcelCell[11] : new ExcelCell[10]; questionTitleRow[count++] = new ExcelCell(getMessage("label.monitoring.question.summary.question"), true, ExcelCell.BORDER_STYLE_BOTTOM_THIN); questionTitleRow[count++] = new ExcelCell(getMessage("label.authoring.basic.list.header.type"), true, @@ -1594,6 +1594,8 @@ } questionTitleRow[count++] = new ExcelCell(getMessage("label.export.date.attempted"), true, ExcelCell.BORDER_STYLE_BOTTOM_THIN); + questionTitleRow[count++] = new ExcelCell(getMessage("label.export.time.attempted"), true, + ExcelCell.BORDER_STYLE_BOTTOM_THIN); questionTitleRow[count++] = new ExcelCell(getMessage("label.authoring.basic.option.answer"), true, ExcelCell.BORDER_STYLE_BOTTOM_THIN); questionTitleRow[count++] = new ExcelCell(getMessage("label.export.time.taken"), true, @@ -1604,7 +1606,7 @@ int questionNumber = 1; for (AssessmentQuestion question : questions) { - int colsNum = showUserNames ? 10 : 9; + int colsNum = showUserNames ? 11 : 10; ExcelCell[] questionTitle = new ExcelCell[1]; questionTitle[0] = new ExcelCell( @@ -1649,6 +1651,7 @@ getMessage("label.monitoring.user.summary.user.name"), true); } hedgeQuestionTitleRow[count++] = new ExcelCell(getMessage("label.export.date.attempted"), true); + hedgeQuestionTitleRow[count++] = new ExcelCell(getMessage("label.export.time.attempted"), true); for (AssessmentQuestionOption option : options) { hedgeQuestionTitleRow[count++] = new ExcelCell( option.getOptionString().replaceAll("\\<.*?\\>", ""), true); @@ -1664,7 +1667,6 @@ } QuestionSummary questionSummary = questionSummaries.get(question.getUid()); - List> allResultsForQuestion = questionSummary .getQuestionResultsPerSession(); @@ -1674,60 +1676,66 @@ int timeTakenTotal = 0; for (List resultList : allResultsForQuestion) { for (AssessmentQuestionResult questionResult : resultList) { - ExcelCell[] userResultRow = new ExcelCell[colsNum]; count = 0; userResultRow[count++] = new ExcelCell(questionResult.getAssessmentQuestion().getTitle(), false); userResultRow[count++] = new ExcelCell( - getQuestionTypeLanguageLabel(questionResult.getAssessmentQuestion().getType()), false); + getQuestionTypeLanguageLabel(questionResult.getAssessmentQuestion().getType())); userResultRow[count++] = new ExcelCell( - Float.valueOf(questionResult.getAssessmentQuestion().getPenaltyFactor()), false); + Float.valueOf(questionResult.getAssessmentQuestion().getPenaltyFactor())); Float maxMark = (questionResult.getMaxMark() == null) ? 0 : Float.valueOf(questionResult.getMaxMark()); - userResultRow[count++] = new ExcelCell(maxMark, false); + userResultRow[count++] = new ExcelCell(maxMark); if (showUserNames) { - userResultRow[count++] = new ExcelCell(questionResult.getUser().getLoginName(), false); - userResultRow[count++] = new ExcelCell(questionResult.getUser().getFullName(), false); + userResultRow[count++] = new ExcelCell(questionResult.getUser().getLoginName()); + userResultRow[count++] = new ExcelCell(questionResult.getUser().getFullName()); } else { - userResultRow[count++] = new ExcelCell(questionResult.getUser().getUserId(), false); + userResultRow[count++] = new ExcelCell(questionResult.getUser().getUserId()); } - userResultRow[count++] = new ExcelCell(questionResult.getFinishDate(), false); + + //date and time + userResultRow[count] = new ExcelCell(questionResult.getFinishDate()); + userResultRow[count++].setCellFormat(ExcelCell.CELL_FORMAT_DATE); + userResultRow[count] = new ExcelCell(questionResult.getFinishDate()); + userResultRow[count++].setCellFormat(ExcelCell.CELL_FORMAT_TIME); + //answer if (question.getType() == AssessmentConstants.QUESTION_TYPE_MARK_HEDGING) { - Set optionAnswers = questionResult.getOptionAnswers(); for (AssessmentQuestionOption option : question.getOptions()) { for (AssessmentOptionAnswer optionAnswer : optionAnswers) { if (option.getUid().equals(optionAnswer.getOptionUid())) { - userResultRow[count++] = new ExcelCell(optionAnswer.getAnswerInt(), false); + userResultRow[count++] = new ExcelCell(optionAnswer.getAnswerInt()); break; } } } + } else { userResultRow[count++] = new ExcelCell( - AssessmentEscapeUtils.printResponsesForExcelExport(questionResult), false); + AssessmentEscapeUtils.printResponsesForExcelExport(questionResult)); if (doSummaryTable) { summaryNACount = updateSummaryCounts(question, questionResult, summaryOfAnswers, summaryNACount); } - } + //time taken if (questionResult.getAssessmentResult() != null) { Date startDate = questionResult.getAssessmentResult().getStartDate(); Date finishDate = questionResult.getFinishDate(); if ((startDate != null) && (finishDate != null)) { Long seconds = (finishDate.getTime() - startDate.getTime()) / 1000; - userResultRow[count++] = new ExcelCell(seconds, false); + userResultRow[count++] = new ExcelCell(seconds); timeTakenCount++; timeTakenTotal += seconds; } } + //mark - userResultRow[count++] = new ExcelCell(questionResult.getMark(), false); + userResultRow[count++] = new ExcelCell(questionResult.getMark()); questionSummaryTabTemp.add(userResultRow); //calculating markCount & markTotal @@ -1753,26 +1761,26 @@ averageRow[7] = new ExcelCell(getMessage("label.export.average"), true); if (timeTakenTotal > 0) { - averageRow[8] = new ExcelCell(Long.valueOf(timeTakenTotal / timeTakenCount), false); + averageRow[8] = new ExcelCell(Long.valueOf(timeTakenTotal / timeTakenCount)); } if (markTotal > 0) { Float averageMark = Float.valueOf(markTotal / markCount); - averageRow[9] = new ExcelCell(averageMark, false); + averageRow[9] = new ExcelCell(averageMark); } else { - averageRow[9] = new ExcelCell(0.0F, false); + averageRow[9] = new ExcelCell(0.0F); } } else { averageRow = new ExcelCell[9]; averageRow[6] = new ExcelCell(getMessage("label.export.average"), true); if (timeTakenTotal > 0) { - averageRow[7] = new ExcelCell(Long.valueOf(timeTakenTotal / timeTakenCount), false); + averageRow[7] = new ExcelCell(Long.valueOf(timeTakenTotal / timeTakenCount)); } if (markTotal > 0) { Float averageMark = Float.valueOf(markTotal / markCount); - averageRow[8] = new ExcelCell(averageMark, false); + averageRow[8] = new ExcelCell(averageMark); } else { - averageRow[8] = new ExcelCell(0.0F, false); + averageRow[8] = new ExcelCell(0.0F); } } @@ -1845,20 +1853,20 @@ totalGradesPossible += maxGrade; ExcelCell[] questCell = new ExcelCell[5]; - questCell[0] = new ExcelCell(title, false); - questCell[1] = new ExcelCell(questionType, false); - questCell[2] = new ExcelCell(penaltyFactor, false); - questCell[3] = new ExcelCell(maxGrade, false); - questCell[4] = new ExcelCell(averageMark, false); + questCell[0] = new ExcelCell(title); + questCell[1] = new ExcelCell(questionType); + questCell[2] = new ExcelCell(penaltyFactor); + questCell[3] = new ExcelCell(maxGrade); + questCell[4] = new ExcelCell(averageMark); userSummaryTab.add(questCell); } if (totalGradesPossible.floatValue() > 0) { ExcelCell[] totalCell = new ExcelCell[5]; totalCell[2] = new ExcelCell(getMessage("label.monitoring.summary.total"), true); - totalCell[3] = new ExcelCell(totalGradesPossible, false); - totalCell[4] = new ExcelCell(totalAverage, false); + totalCell[3] = new ExcelCell(totalGradesPossible); + totalCell[4] = new ExcelCell(totalAverage); userSummaryTab.add(totalCell); } userSummaryTab.add(EMPTY_ROW); @@ -1921,26 +1929,24 @@ if (showUserNames) { ExcelCell[] userResultRow = new ExcelCell[6]; - userResultRow[0] = new ExcelCell(assessmentUser.getLoginName(), false); - userResultRow[1] = new ExcelCell(assessmentUser.getFullName(), false); - userResultRow[2] = new ExcelCell(assessmentResult.getStartDate(), false); + userResultRow[0] = new ExcelCell(assessmentUser.getLoginName()); + userResultRow[1] = new ExcelCell(assessmentUser.getFullName()); + userResultRow[2] = new ExcelCell(assessmentResult.getStartDate()); userResultRow[3] = new ExcelCell( - questionResult.getAssessmentQuestion().getTitle(), false); + questionResult.getAssessmentQuestion().getTitle()); userResultRow[4] = new ExcelCell( - AssessmentEscapeUtils.printResponsesForExcelExport(questionResult), - false); - userResultRow[5] = new ExcelCell(questionResult.getMark(), false); + AssessmentEscapeUtils.printResponsesForExcelExport(questionResult)); + userResultRow[5] = new ExcelCell(questionResult.getMark()); userSummaryTab.add(userResultRow); } else { ExcelCell[] userResultRow = new ExcelCell[5]; - userResultRow[0] = new ExcelCell(assessmentUser.getUserId(), false); - userResultRow[1] = new ExcelCell(assessmentResult.getStartDate(), false); + userResultRow[0] = new ExcelCell(assessmentUser.getUserId()); + userResultRow[1] = new ExcelCell(assessmentResult.getStartDate()); userResultRow[2] = new ExcelCell( - questionResult.getAssessmentQuestion().getTitle(), false); + questionResult.getAssessmentQuestion().getTitle()); userResultRow[3] = new ExcelCell( - AssessmentEscapeUtils.printResponsesForExcelExport(questionResult), - false); - userResultRow[4] = new ExcelCell(questionResult.getMark(), false); + AssessmentEscapeUtils.printResponsesForExcelExport(questionResult)); + userResultRow[4] = new ExcelCell(questionResult.getMark()); userSummaryTab.add(userResultRow); } } @@ -1950,11 +1956,11 @@ if (showUserNames) { userTotalRow = new ExcelCell[6]; userTotalRow[4] = new ExcelCell(getMessage("label.monitoring.summary.total"), true); - userTotalRow[5] = new ExcelCell(assessmentResult.getGrade(), false); + userTotalRow[5] = new ExcelCell(assessmentResult.getGrade()); } else { userTotalRow = new ExcelCell[5]; userTotalRow[3] = new ExcelCell(getMessage("label.monitoring.summary.total"), true); - userTotalRow[4] = new ExcelCell(assessmentResult.getGrade(), false); + userTotalRow[4] = new ExcelCell(assessmentResult.getGrade()); } userSummaryTab.add(userTotalRow); @@ -1986,19 +1992,19 @@ } else { bldr.append(option.getOptionString().replaceAll("\\<.*?\\>", "")); } - summaryTable[i] = new ExcelCell(bldr.toString(), false); + summaryTable[i] = new ExcelCell(bldr.toString()); i++; } if (question.getType() == AssessmentConstants.QUESTION_TYPE_MULTIPLE_CHOICE) { - summaryTable[i++] = new ExcelCell(getMessage("label.not.answered"), false); + summaryTable[i++] = new ExcelCell(getMessage("label.not.answered")); } else { - summaryTable[i++] = new ExcelCell(getMessage("label.other"), false); + summaryTable[i++] = new ExcelCell(getMessage("label.other")); } } else { summaryTable = new ExcelCell[3]; - summaryTable[0] = new ExcelCell(getMessage("label.authoring.true.false.true"), false); - summaryTable[1] = new ExcelCell(getMessage("label.authoring.true.false.false"), false); - summaryTable[2] = new ExcelCell(getMessage("label.not.answered"), false); + summaryTable[0] = new ExcelCell(getMessage("label.authoring.true.false.true")); + summaryTable[1] = new ExcelCell(getMessage("label.authoring.true.false.false")); + summaryTable[2] = new ExcelCell(getMessage("label.not.answered")); summaryOfAnswers.put(trueKey, 0); summaryOfAnswers.put(falseKey, 0); } @@ -2074,18 +2080,18 @@ || question.getType() == AssessmentConstants.QUESTION_TYPE_SHORT_ANSWER || question.getType() == AssessmentConstants.QUESTION_TYPE_NUMERICAL) { for (AssessmentQuestionOption option : question.getOptions()) { - summaryTable[i] = new ExcelCell(valueAsPercentage(summaryOfAnswers.get(option.getUid()), total), false); + summaryTable[i] = new ExcelCell(valueAsPercentage(summaryOfAnswers.get(option.getUid()), total)); if (option.getGrade() > 0) { summaryTable[i].setColor(IndexedColors.GREEN); } i++; } - summaryTable[i++] = new ExcelCell(valueAsPercentage(summaryNACount, total), false); + summaryTable[i++] = new ExcelCell(valueAsPercentage(summaryNACount, total)); } else { summaryTable = new ExcelCell[3]; - summaryTable[0] = new ExcelCell(valueAsPercentage(summaryOfAnswers.get(trueKey), total), false); - summaryTable[1] = new ExcelCell(valueAsPercentage(summaryOfAnswers.get(falseKey), total), false); - summaryTable[2] = new ExcelCell(valueAsPercentage(summaryNACount, total), false); + summaryTable[0] = new ExcelCell(valueAsPercentage(summaryOfAnswers.get(trueKey), total)); + summaryTable[1] = new ExcelCell(valueAsPercentage(summaryOfAnswers.get(falseKey), total)); + summaryTable[2] = new ExcelCell(valueAsPercentage(summaryNACount, total)); summaryTable[question.getCorrectAnswer() ? 0 : 1].setColor(IndexedColors.GREEN); } return summaryTable;