# HG changeset patch # User Nicholas Jillings # Date 1477835857 0 # Node ID d83b38564fbb2b1ac537fb314355755590fb7296 # Parent bf17cc19c1c0a0bc5938611dcc4102822db530b0 #137. Modified nodes in pages to have a proper list structure. Differently labelled nodes depending on type , . Added slider and converted project.xml to match new specifications. AB_example.xml shows new slider type diff -r bf17cc19c1c0 -r d83b38564fbb js/core.js --- a/js/core.js Mon Oct 24 11:23:02 2016 +0100 +++ b/js/core.js Sun Oct 30 13:57:37 2016 +0000 @@ -2630,6 +2630,52 @@ this.resize(); }; + this.sliderBox = function (commentQuestion) { + this.specification = commentQuestion; + this.holder = document.createElement("div"); + this.holder.className = 'comment-div'; + this.string = document.createElement("span"); + this.string.innerHTML = commentQuestion.statement; + this.slider = document.createElement("input"); + this.slider.type = "range"; + this.slider.min = commentQuestion.min; + this.slider.max = commentQuestion.max; + this.slider.step = commentQuestion.step; + this.slider.value = commentQuestion.value; + var br = document.createElement('br'); + + this.holder.appendChild(this.string); + this.holder.appendChild(br); + this.holder.appendChild(this.slider); + + this.exportXMLDOM = function (storePoint) { + var root = storePoint.parent.document.createElement('comment'); + root.id = this.specification.id; + root.setAttribute('type', this.specification.type); + console.log("Question: " + this.string.textContent); + console.log("Response: " + this.slider.value); + var question = storePoint.parent.document.createElement('question'); + question.textContent = this.string.textContent; + var response = storePoint.parent.document.createElement('response'); + response.textContent = this.slider.value; + root.appendChild(question); + root.appendChild(response); + storePoint.XMLDOM.appendChild(root); + return root; + }; + this.resize = function () { + var boxwidth = (window.innerWidth - 100) / 2; + if (boxwidth >= 600) { + boxwidth = 600; + } else if (boxwidth < 400) { + boxwidth = 400; + } + this.holder.style.width = boxwidth + "px"; + this.slider.style.width = boxwidth - 24 + "px"; + }; + this.resize(); + }; + this.createCommentQuestion = function (element) { var node; if (element.type == 'question') { @@ -2638,6 +2684,8 @@ node = new this.radioBox(element); } else if (element.type == 'checkbox') { node = new this.checkboxBox(element); + } else if (element.type == 'slider') { + node = new this.sliderBox(element); } this.commentQuestions.push(node); return node; diff -r bf17cc19c1c0 -r d83b38564fbb js/specification.js --- a/js/specification.js Mon Oct 24 11:23:02 2016 +0100 +++ b/js/specification.js Sun Oct 30 13:57:37 2016 +0000 @@ -495,88 +495,87 @@ this.decode = function (parent, xml) { this.parent = parent; - var attributeMap = this.schema.getAllElementsByTagName('xs:attribute'); - for (var i=0; i - - - - - Please enter your name. - - - Please select with which activities you have any experience (example checkbox question) - - - - - - - - This is an example of an 'AB'-style test, with two pages, using the test stimuli in 'example_eval/'. - - - - - Please enter your location. (example mandatory text question) - - - Please enter your age (example non-mandatory number question) - - - Please rate this interface (example radio button question) - - - - - - - Thank you for taking this listening test. Please click 'submit' and your results will appear in the 'saves/' folder. - - - - testTimer - elementTimer - elementInitialPosition - elementTracker - elementFlagListenedTo - elementFlagMoved - elementListenTracker - - - - - - - - - - - - Comment on fragment - - Depth - - - - - - A two way comparison using randomised element order, automatic loudness and synchronised looping. - - - - - Please enter the genre. - - - - - Comment on fragment - - Depth - - - - - - - - - - - A 7 way comparison using randomised element order and synchronised looping. - - - - - Please enter the genre. - - - - \ No newline at end of file + + + + + Please enter your name. + + + Please select with which activities you have any experience (example checkbox question) + + + + + + + + This is an example of an 'AB'-style test, with two pages, using the test stimuli in 'example_eval/'. + + + + + Please enter your location. (example mandatory text question) + + + Please enter your age (example non-mandatory number question) + + + Please rate this interface (example radio button question) + + + + + + + Thank you for taking this listening test. Please click 'submit' and your results will appear in the 'saves/' folder. + + + + testTimer + elementTimer + elementInitialPosition + elementTracker + elementFlagListenedTo + elementFlagMoved + elementListenTracker + + + + + + + + + + + + Comment on fragment + + Depth + + + + + + Test + + + + + A two way comparison using randomised element order, automatic loudness and synchronised looping. + + + + + Please enter the genre. + + + + + Comment on fragment + + Depth + + + + + + + + + + + A 7 way comparison using randomised element order and synchronised looping. + + + + + Please enter the genre. + + + + diff -r bf17cc19c1c0 -r d83b38564fbb tests/examples/project.xml --- a/tests/examples/project.xml Mon Oct 24 11:23:02 2016 +0100 +++ b/tests/examples/project.xml Sun Oct 30 13:57:37 2016 +0000 @@ -111,24 +111,26 @@ - - What is your general experience with numbers? - - - Please enter your overall preference - - - - - - - - Please describe the overall character - - - - - + + + What is your general experience with numbers? + + + Please enter your overall preference + + + + + + + + Please describe the overall character + + + + + + Example of an 'APE' style interface with hidden anchor 'zero' (which needs to be below 20%), looping of the samples, randomisation of marker labels, mandatory moving of every sample, and a forced scale usage of at least 25%-75%. diff -r bf17cc19c1c0 -r d83b38564fbb xml/test-schema.xsd --- a/xml/test-schema.xsd Mon Oct 24 11:23:02 2016 +0100 +++ b/xml/test-schema.xsd Sun Oct 30 13:57:37 2016 +0000 @@ -75,7 +75,7 @@ - + @@ -206,10 +206,21 @@ - + + + + + + + + + + + + - + @@ -222,15 +233,49 @@ - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +