Project

General

Profile

« Previous | Next » 

Revision 4876

include qPrompt and qChoice
need to quote the csv so that commas in the question text do not throw it off

View differences:

lib/style/skins/first/search.js
316 316
						+ "<attribute index=\"2\">"
317 317
							+ "<pathexpr label=\"qLabel\">//assessment/section/item/presentation/@label</pathexpr>"
318 318
						+ "</attribute>"
319
						+ "<attribute index=\"3\">"
320
							+ "<pathexpr label=\"qPrompt\">//assessment/section/item/presentation/flow/response_lid/render_choice/material/mattext</pathexpr>"
321
						+ "</attribute>"
322
						+ "<attribute index=\"4\">"
323
							+ "<pathexpr label=\"qChoice\">//assessment/section/item/presentation/flow/response_lid/render_choice/flow_label/response_label/material/mattext</pathexpr>"
324
						+ "</attribute>"
319 325
					+ "</entity>"
320 326
				+ "</datapackage>";
321 327
			}
lib/style/skins/first/download.jsp
86 86
				if (i != pivotCol) {
87 87
					String colName = rs.getMetaData().getColumnName(i);
88 88
					String value = rs.getString(i);
89
					//clean up the value
90
					value = value.replaceAll("\n", " ");
91
					value = value.replaceAll("<html>", " ");
92
					value = value.replaceAll("</html>", " ");
93
					value = value.replaceAll("<head>", " ");
94
					value = value.replaceAll("</head>", " ");
95
					value = value.replaceAll("<body>", " ");
96
					value = value.replaceAll("</body>", " ");
97
					
89 98
					//do we include this column in the pivot?
90 99
					if (pivotAttributes.contains(colName)) {
91 100
						//annotate the column name with the pivot column value if not the id column
......
239 248
	        response.setHeader("Content-Disposition", "attachment; filename=" + fileName);
240 249
	        
241 250
			Writer writer = new OutputStreamWriter(response.getOutputStream());
242
			CSVWriter csv = new CSVWriter(writer, CSVWriter.DEFAULT_SEPARATOR, CSVWriter.NO_QUOTE_CHARACTER);
251
			//CSVWriter csv = new CSVWriter(writer, CSVWriter.DEFAULT_SEPARATOR, CSVWriter.NO_QUOTE_CHARACTER);
252
			CSVWriter csv = new CSVWriter(writer, CSVWriter.DEFAULT_SEPARATOR, CSVWriter.DEFAULT_QUOTE_CHARACTER, CSVWriter.DEFAULT_ESCAPE_CHARACTER);
243 253
			try {
244 254
				if (transpose) {
245 255
					List pivotCols = new ArrayList();

Also available in: Unified diff