This commit is contained in:
Jacob Levine 2019-03-22 08:49:50 -05:00
parent 35f8cd693e
commit 925087886c

View File

@ -233,6 +233,9 @@ function processAndAppendReturn(data, newloc) {
for (var j = 0; j < questions.length; j++) {
document.getElementById(newloc).innerHTML += "<div id='" + newloc + j.toString() + "'></div>";
document.getElementById(newloc + j.toString()).innerHTML += questions[j][0];
if (questions[j][0]=='cycleTimes') {
document.getElementById(newloc + j.toString()).innerHTML += " (on a scale from 0 to 10)"
}
if (questions[j][1]['type'] == 'shortText') {
document.getElementById(newloc + j.toString()).innerHTML += "<input id=''" + questions[j][0] + "' type='text'></input>";
} else if (questions[j][1]['type'] == 'textField') {
@ -240,9 +243,7 @@ function processAndAppendReturn(data, newloc) {
} else if (questions[j][1]['type'] == 'stepper') {
document.getElementById(newloc + j.toString()).innerHTML += "<span id='" + questions[j][0] + "'><input type='button' onclick=\"dec('" + questions[j][0] + "')\" value='-'></input>" + (questions[j][1]['defaultValue']).toString() + "<input type='button' onclick=\"inc('" + questions[j][0] + "')\" value='+'></input></span>";
} else if (questions[j][1]['type'] == 'label') {
document.getElementById(newloc + j.toString()).innerHTML += "&nbsp;&nbsp;" + questions[j][1]['min'] + "&nbsp;&nbsp;";
document.getElementById(newloc + j.toString()).innerHTML += "<input type='range' min='" + questions[j][1]['min'] + "' max='" + questions[j][1]['max'] + "'>";
document.getElementById(newloc + j.toString()).innerHTML += "&nbsp;&nbsp;" + questions[j][1]['max'];
document.getElementById(newloc + j.toString()).innerHTML += "<span id='" + questions[j][0] + "'><input type='button' onclick=\"dec('" + questions[j][0] + "')\" value='-'></input>" + (questions[j][1]['defaultValue']).toString() + "<input type='button' onclick=\"inc('" + questions[j][0] + "')\" value='+'></input></span>";
} else if (questions[j][1]['type'] == 'slider') {
document.getElementById(newloc + j.toString()).innerHTML += "&nbsp;&nbsp;" + questions[j][1]['min'] + "&nbsp;&nbsp;";
document.getElementById(newloc + j.toString()).innerHTML += "<input type='range' min='" + questions[j][1]['min'] + "' max='" + questions[j][1]['max'] + "'>";