29 |
29 |
if (submitFormObj.docid[i].value != "") {
|
30 |
30 |
var documentObject = new Object();
|
31 |
31 |
documentObject.docid = submitFormObj.docid[i].value;
|
|
32 |
documentObject.demographicData = submitFormObj[documentObject.docid + "demographicData"].value;
|
32 |
33 |
|
33 |
34 |
var questionIds = new Array();
|
34 |
35 |
for (var z = 0; z < submitFormObj[documentObject.docid].length; z++) {
|
... | ... | |
46 |
47 |
if (submitFormObj.docid.value != "") {
|
47 |
48 |
var documentObject = new Object();
|
48 |
49 |
documentObject.docid = submitFormObj.docid.value;
|
49 |
|
|
|
50 |
documentObject.demographicData = submitFormObj[documentObject.docid + "demographicData"].value;
|
|
51 |
|
50 |
52 |
var questionIds = new Array();
|
51 |
53 |
for (var z = 0; z < submitFormObj[documentObject.docid].length; z++) {
|
52 |
54 |
questionIds[z] = submitFormObj[documentObject.docid][z].value;
|
... | ... | |
233 |
235 |
for (var i=0; i < docObjs.length; i++) {
|
234 |
236 |
|
235 |
237 |
var docId = docObjs[i].docid;
|
236 |
|
//alert("docId=" + docId);
|
|
238 |
var containsDemographicData = docObjs[i].demographicData;
|
|
239 |
//alert("containsDemographicData=" + containsDemographicData);
|
237 |
240 |
|
238 |
241 |
//get the question ids for this question
|
239 |
242 |
var questionIds = docObjs[i].questionIds;
|
... | ... | |
257 |
260 |
|
258 |
261 |
tempQuery +=
|
259 |
262 |
"<query>"
|
|
263 |
+ "<selection>";
|
|
264 |
|
260 |
265 |
//select the data
|
261 |
|
+ "<selection>"
|
262 |
|
+ "<datapackage id=\"" + docId + "\">"
|
|
266 |
tempQuery +=
|
|
267 |
"<datapackage id=\"" + docId + "\">"
|
263 |
268 |
+ "<entity index=\"0\">"
|
264 |
269 |
+ "<attribute index=\"0\"/>"
|
265 |
270 |
+ "<attribute index=\"1\"/>"
|
... | ... | |
269 |
274 |
+ "</entity>"
|
270 |
275 |
+ "</datapackage>";
|
271 |
276 |
|
|
277 |
//select the demographic data
|
|
278 |
if (containsDemographicData) {
|
|
279 |
tempQuery +=
|
|
280 |
"<datapackage id=\"" + docId + "\">"
|
|
281 |
+ "<entity index=\"1\">"
|
|
282 |
//omit student id attribute
|
|
283 |
+ "<attribute index=\"1\"/>"
|
|
284 |
+ "<attribute index=\"2\"/>"
|
|
285 |
+ "<attribute index=\"3\"/>"
|
|
286 |
+ "</entity>"
|
|
287 |
+ "</datapackage>";
|
|
288 |
}
|
|
289 |
|
272 |
290 |
//select the metadata
|
273 |
291 |
tempQuery += metadataAttributeSelection;
|
274 |
292 |
|
... | ... | |
292 |
310 |
|
293 |
311 |
tempQuery += "</selection>";
|
294 |
312 |
|
295 |
|
//join to the quesion "table"
|
|
313 |
//join to the question "table"
|
296 |
314 |
if (questionId.length > 0) {
|
297 |
315 |
tempQuery +=
|
298 |
316 |
"<where>"
|
... | ... | |
354 |
372 |
+"<returnfield>assessment/duration</returnfield>"
|
355 |
373 |
+"<returnfield>assessment/title</returnfield>"
|
356 |
374 |
+"<returnfield>assessment/@id</returnfield>"
|
|
375 |
+"<returnfield>dataset/dataTable/entityName</returnfield>"
|
357 |
376 |
+"<returnfield>lom/general/title/string</returnfield>"
|
358 |
377 |
+"<returnfield>lom/general/keyword/string</returnfield>"
|
359 |
378 |
+"<returnfield>individualName/surName</returnfield>"
|
... | ... | |
420 |
439 |
+"<returnfield>assessment/title</returnfield>"
|
421 |
440 |
+"<returnfield>assessment/@id</returnfield>"
|
422 |
441 |
+"<returnfield>assessment/duration</returnfield>"
|
|
442 |
+"<returnfield>dataset/dataTable/entityName</returnfield>"
|
423 |
443 |
+"<returnfield>lom/general/title/string</returnfield>"
|
424 |
444 |
+"<returnfield>lom/general/keyword/string</returnfield>"
|
425 |
445 |
+"<returnfield>individualName/surName</returnfield>"
|
... | ... | |
459 |
479 |
+"<returnfield>assessment/title</returnfield>"
|
460 |
480 |
+"<returnfield>assessment/@id</returnfield>"
|
461 |
481 |
+"<returnfield>assessment/duration</returnfield>"
|
|
482 |
+"<returnfield>dataset/dataTable/entityName</returnfield>"
|
462 |
483 |
+"<returnfield>lom/general/title/string</returnfield>"
|
463 |
484 |
+"<returnfield>lom/general/keyword/string</returnfield>"
|
464 |
485 |
+"<returnfield>individualName/surName</returnfield>"
|
include demographic data if present in the datapackage
TODO: handle a mixture of datapackages when performing the union (i.e. cases when one package as demographic data and the other does not)
http://bugzilla.ecoinformatics.org/show_bug.cgi?id=3519