Index: lams_tool_survey/conf/language/lams/ApplicationResources.properties =================================================================== diff -u -rb1e97a18addd1ba2a621863bedea01ee8223b34b -r4cc9889b48b71ad803aca989f2f595468d5641b2 --- lams_tool_survey/conf/language/lams/ApplicationResources.properties (.../ApplicationResources.properties) (revision b1e97a18addd1ba2a621863bedea01ee8223b34b) +++ lams_tool_survey/conf/language/lams/ApplicationResources.properties (.../ApplicationResources.properties) (revision 4cc9889b48b71ad803aca989f2f595468d5641b2) @@ -184,6 +184,6 @@ label.activity.completion =End of activity label.notifications =Notifications label.summary.downloaded= =Report Downloaded +label.timestamp=Timestamp - #======= End labels: Exported 178 labels for en AU ===== Index: lams_tool_survey/src/java/org/lamsfoundation/lams/tool/survey/web/action/MonitoringAction.java =================================================================== diff -u -r8e090b3ddf269cdffececa4bc55a9333da5b0858 -r4cc9889b48b71ad803aca989f2f595468d5641b2 --- lams_tool_survey/src/java/org/lamsfoundation/lams/tool/survey/web/action/MonitoringAction.java (.../MonitoringAction.java) (revision 8e090b3ddf269cdffececa4bc55a9333da5b0858) +++ lams_tool_survey/src/java/org/lamsfoundation/lams/tool/survey/web/action/MonitoringAction.java (.../MonitoringAction.java) (revision 4cc9889b48b71ad803aca989f2f595468d5641b2) @@ -44,6 +44,7 @@ import org.apache.commons.lang.StringUtils; import org.apache.log4j.Logger; import org.apache.poi.ss.usermodel.Cell; +import org.apache.poi.ss.usermodel.CellStyle; import org.apache.poi.ss.usermodel.Row; import org.apache.poi.ss.usermodel.Sheet; import org.apache.poi.ss.usermodel.Workbook; @@ -84,6 +85,7 @@ private static final String MSG_LABEL_POSSIBLE_ANSWERS = "message.possible.answers"; private static final String MSG_LABEL_LEARNER_NAME = "monitoring.label.user.name"; private static final String MSG_LABEL_LOGIN = "monitoring.label.user.loginname"; + private static final String MSG_LABEL_TIMESTAMP = "label.timestamp"; public static Logger log = Logger.getLogger(MonitoringAction.class); @@ -349,6 +351,11 @@ try { // create an empty excel file Workbook workbook = new SXSSFWorkbook(); + + // Date format for the timestamp field + CellStyle dateStyle = workbook.createCellStyle(); + dateStyle.setDataFormat((short)0x16); // long date/time format e.g. DD/MM/YYYY MM:HH + Sheet sheet = workbook.createSheet("Survey"); sheet.setColumnWidth(0, 5000); Row row; @@ -447,6 +454,9 @@ cellIdx++; cell = row.createCell(cellIdx); cell.setCellValue(resource.getMessage(MonitoringAction.MSG_LABEL_LEARNER_NAME)); + cellIdx++; + cell = row.createCell(cellIdx); + cell.setCellValue(resource.getMessage(MonitoringAction.MSG_LABEL_TIMESTAMP)); int optionsNum = options.size(); @@ -468,6 +478,10 @@ cell = row.createCell(cellIdx); cell.setCellValue( answer.getReplier().getLastName() + ", " + answer.getReplier().getFirstName()); + cellIdx++; + cell = row.createCell(cellIdx); + cell.setCellStyle(dateStyle); + cell.setCellValue(answer.getAnswer().getUpdateDate()); // for answer's options for (SurveyOption option : options) { cellIdx++;