Project

General

Profile

« Previous | Next » 

Revision 5081

allow user to specify the data columns included for the transpose data set (score, response, response file).
decided in today's CC

View differences:

lib/style/skins/first/download.jsp
435 435
		if (temp != null && temp.length > 0) {
436 436
			pivot = Integer.parseInt(temp[0]);
437 437
		}
438
		String[] pivotColumns = null;
439
		temp = params.get("pivotColumns");
440
		if (temp != null && temp.length > 0) {
441
			pivotColumns = temp;
442
		}
438 443
		
439 444
		//get the results as csv file
440 445
		if (qformat != null && qformat.equalsIgnoreCase("csv")) {
......
448 453
			try {
449 454
				if (transpose) {
450 455
					List pivotCols = new ArrayList();
451
					pivotCols.add("studentid");
452
					pivotCols.add("score");
453
					pivotCols.add("response");
454
					pivotCols.add("responsefile");
456
					if (pivotColumns != null) {
457
						for (int i = 0; i < pivotColumns.length; i++) {
458
							pivotCols.add(pivotColumns[i]);
459
						}
460
					} else {
461
						pivotCols.add("studentid");
462
						pivotCols.add("score");
463
						pivotCols.add("response");
464
						pivotCols.add("responsefile");
465
					}
455 466
					List transposedTable = transpose(rs, observation, pivot, pivotCols, true);
456 467
					csv.writeAll(transposedTable);
457 468
				} else {
lib/style/skins/first/first-assessment-resultset.xsl
268 268
				<input type="hidden" name="action" value="read" />
269 269
				<input type="hidden" name="dataquery" />
270 270
				<div id="metadataCountDiv" style="display:none;">
271
					--- Options ---
272
					<br />
271 273
					<select name="metadataCount" id="metadataCount" width="2" >
272 274
						<option>1</option>
273 275
						<option>2</option>
......
287 289
					item metadata fields included
288 290
				</div>
289 291
				<div id="transposeDiv" style="display:none;">
290
					<input type="checkbox" name="transpose" value="true" />Transpose Data
292
					<input type="checkbox" name="transpose" value="true" />Transpose Data, include:
293
					<br />
294
					<input type="hidden" id="pivotColumns" name="pivotColumns" value="studentid" />
295
					<input type="checkbox" id="pivotColumns" name="pivotColumns" value="score" checked="checked" />score
296
					<input type="checkbox" id="pivotColumns" name="pivotColumns" value="response" checked="checked" />response
297
					<input type="checkbox" id="pivotColumns" name="pivotColumns" value="responsefile" checked="checked" />response file
291 298
				</div>
292 299
				<input type="hidden" name="observation" value="3" />
293 300
				<input type="hidden" name="pivot" value="2" />

Also available in: Unified diff