Major updates to spec
This commit is contained in:
parent
bb891242a4
commit
77fc16d97f
6 changed files with 137 additions and 82 deletions
|
|
@ -4,9 +4,9 @@ if (typeof Survey == "undefined") {
|
||||||
|
|
||||||
Survey.Form = new function() {
|
Survey.Form = new function() {
|
||||||
|
|
||||||
var multipleChoice = {'Multiple Choice':1,'Gender':1,'Yes/No':1,'True/False':1,'Ideology':1, 'Race':1,'Party':1,'Education':1};
|
var multipleChoice = {'Multiple Choice':1,'Gender':1,'Yes/No':1,'True/False':1,'Ideology':1, 'Race':1,'Party':1,'Education':1
|
||||||
var scale = {'Scale':1,'Agree/Disagree':1,'Oppose/Support':1,'Importance':1,
|
,'Scale':1,'Agree/Disagree':1,'Oppose/Support':1,'Importance':1,
|
||||||
'Likelihood':1,'Certainty':1,'Satisfaction':1,'Confidence':1,'Effectiveness':1,'Concern':1,'Risk':1,'Threat':1,'Security':1};
|
'Likelihood':1,'Certainty':1,'Satisfaction':1,'Confidence':1,'Effectiveness':1,'Concern':1,'Risk':1,'Threat':1,'Security':1};
|
||||||
var text = {'Text':1, 'Email':1, 'Phone Number':1, 'Text Date':1, 'Currency':1};
|
var text = {'Text':1, 'Email':1, 'Phone Number':1, 'Text Date':1, 'Currency':1};
|
||||||
var slider = {'Slider':1, 'Dual Slider - Range':1, 'Multi Slider - Allocate':1};
|
var slider = {'Slider':1, 'Dual Slider - Range':1, 'Multi Slider - Allocate':1};
|
||||||
var dateType = {'Date':1,'Date Range':1};
|
var dateType = {'Date':1,'Date Range':1};
|
||||||
|
|
@ -19,18 +19,24 @@ Survey.Form = new function() {
|
||||||
|
|
||||||
var toValidate;
|
var toValidate;
|
||||||
|
|
||||||
|
var sliderWidth = 500;
|
||||||
|
|
||||||
|
var sliders;
|
||||||
|
|
||||||
|
|
||||||
this.displayQuestions = function(params){
|
this.displayQuestions = function(params){
|
||||||
|
|
||||||
toValidate = new Array();//clear array
|
toValidate = new Array();//clear array
|
||||||
var qs = params.questions;
|
var qs = params.questions;
|
||||||
var s = params.section;
|
var s = params.section;
|
||||||
|
sliders = new Array();
|
||||||
|
|
||||||
//What to show and where
|
//What to show and where
|
||||||
document.getElementById('survey').innerHTML = params.html;
|
document.getElementById('survey').innerHTML = params.html;
|
||||||
var te = document.createElement('span');
|
//var te = document.createElement('span');
|
||||||
te.innerHTML = "<input type=button id=testB name='Reload Page' value='Reload Page'>";
|
//te.innerHTML = "<input type=button id=testB name='Reload Page' value='Reload Page'>";
|
||||||
document.getElementById('survey').appendChild(te);
|
//document.getElementById('survey').appendChild(te);
|
||||||
YAHOO.util.Event.addListener("testB", "click", function(){Survey.Comm.callServer('','loadQuestions');});
|
//YAHOO.util.Event.addListener("testB", "click", function(){Survey.Comm.callServer('','loadQuestions');});
|
||||||
|
|
||||||
if(qs[0] != undefined){
|
if(qs[0] != undefined){
|
||||||
if(lastSection != s.Survey_sectionId || s.everyPageTitle > 0){
|
if(lastSection != s.Survey_sectionId || s.everyPageTitle > 0){
|
||||||
|
|
@ -86,35 +92,31 @@ YAHOO.util.Event.addListener("testB", "click", function(){Survey.Comm.callServer
|
||||||
//Check if this question should be validated
|
//Check if this question should be validated
|
||||||
if(q.required == 1){
|
if(q.required == 1){
|
||||||
toValidate[q.Survey_questionId] = new Array();
|
toValidate[q.Survey_questionId] = new Array();
|
||||||
|
toValidate[q.Survey_questionId]['type'] = q.questionType;
|
||||||
|
toValidate[q.Survey_questionId]['answers'] = new Array();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if(multipleChoice[q.questionType] || scale[q.questionType]){
|
if(multipleChoice[q.questionType]){
|
||||||
var butts = new Array();
|
var butts = new Array();
|
||||||
verb = 0;
|
verb = 0;
|
||||||
for(var x = 0; x < q.answers.length; x++){
|
for(var x = 0; x < q.answers.length; x++){
|
||||||
|
|
||||||
var a = q.answers[x];
|
var a = q.answers[x];
|
||||||
if(toValidate[a.Survey_questionId]){
|
if(toValidate[a.Survey_questionId]){
|
||||||
toValidate[a.Survey_questionId][a.Survey_answerId] = 1;
|
toValidate[a.Survey_questionId]['answers'][a.Survey_answerId] = 1;
|
||||||
}
|
}
|
||||||
var b;
|
var b = document.getElementById(a.Survey_answerId+'button');
|
||||||
if(scale[q.questionType]){
|
/*
|
||||||
b = new YAHOO.widget.Button({ type: "checkbox", label: a.recordedAnswer, id: a.Survey_answerId+'button', name: a.Survey_answerId+'button',
|
|
||||||
value: a.Survey_answerId,
|
|
||||||
container: a.Survey_answerId+"container", checked: false });
|
|
||||||
b.label=a.recordedAnswer;
|
|
||||||
}else{
|
|
||||||
// b = new YAHOO.widget.Button({ type: "checkbox", id: a.Survey_answerId+'button', name: a.Survey_answerId+'button',
|
|
||||||
b = new YAHOO.widget.Button({ type: "checkbox", label: a.answerText, id: a.Survey_answerId+'button', name: a.Survey_answerId+'button',
|
b = new YAHOO.widget.Button({ type: "checkbox", label: a.answerText, id: a.Survey_answerId+'button', name: a.Survey_answerId+'button',
|
||||||
value: a.Survey_answerId,
|
value: a.Survey_answerId,
|
||||||
container: a.Survey_answerId+"container", checked: false });
|
container: a.Survey_answerId+"container", checked: false });
|
||||||
}
|
*/
|
||||||
//b.set('label',a.answerText);
|
// b.on("click", this.buttonChanged,[b,a.Survey_questionId,q.maxAnswers,butts,qs.length,a.Survey_answerId]);
|
||||||
b.on("click", this.buttonChanged,[b,a.Survey_questionId,q.maxAnswers,butts,qs.length,a.Survey_answerId]);
|
// YAHOO.util.Event.addListener(a.Survey_answerId+'button', "click", this.buttonChanged,[b,a.Survey_questionId,q.maxAnswers,butts,qs.length,a.Survey_answerId]);
|
||||||
if(a.verbatim == 1){
|
if(a.verbatim == 1){
|
||||||
verb = 1;
|
verb = 1;
|
||||||
}
|
}
|
||||||
|
YAHOO.util.Event.addListener(a.Survey_answerId+'button', "click", this.buttonChanged,[b,a.Survey_questionId,q.maxAnswers,butts,qs.length,a.Survey_answerId]);
|
||||||
b.hid = a.Survey_answerId;
|
b.hid = a.Survey_answerId;
|
||||||
butts.push(b);
|
butts.push(b);
|
||||||
}
|
}
|
||||||
|
|
@ -123,7 +125,7 @@ YAHOO.util.Event.addListener("testB", "click", function(){Survey.Comm.callServer
|
||||||
for(var x = 0; x < q.answers.length; x++){
|
for(var x = 0; x < q.answers.length; x++){
|
||||||
var a = q.answers[x];
|
var a = q.answers[x];
|
||||||
if(toValidate[a.Survey_questionId]){
|
if(toValidate[a.Survey_questionId]){
|
||||||
toValidate[a.Survey_questionId][a.Survey_answerId] = 1;
|
toValidate[a.Survey_questionId]['answers'][a.Survey_answerId] = 1;
|
||||||
}
|
}
|
||||||
var calid = a.Survey_answerId+'container';
|
var calid = a.Survey_answerId+'container';
|
||||||
var c = new YAHOO.widget.Calendar(calid,{title:'Choose a date:', close:true});
|
var c = new YAHOO.widget.Calendar(calid,{title:'Choose a date:', close:true});
|
||||||
|
|
@ -142,24 +144,34 @@ YAHOO.util.Event.addListener("testB", "click", function(){Survey.Comm.callServer
|
||||||
}else{
|
}else{
|
||||||
for(var s in q.answers){
|
for(var s in q.answers){
|
||||||
var a = q.answers[s];
|
var a = q.answers[s];
|
||||||
|
YAHOO.util.Event.addListener(a.Survey_answerId, "blur", this.sliderTextSet);
|
||||||
if(a.max - a.min > max){max = a.max - a.min;}
|
if(a.max - a.min > max){max = a.max - a.min;}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(q.questionType == 'Multi Slider - Allocate'){
|
if(q.questionType == 'Multi Slider - Allocate'){
|
||||||
//sliderManagers[sliderManagers.length] = new this.sliderManager(q,max);
|
//sliderManagers[sliderManagers.length] = new this.sliderManager(q,max);
|
||||||
|
for(var x = 0; x < q.answers.length; x++){
|
||||||
|
var a = q.answers[x];
|
||||||
|
if(toValidate[a.Survey_questionId]){
|
||||||
|
toValidate[a.Survey_questionId]['total'] = a.max;
|
||||||
|
toValidate[a.Survey_questionId]['answers'][a.Survey_answerId] = 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
new this.sliderManager(q,max);
|
new this.sliderManager(q,max);
|
||||||
}
|
}
|
||||||
else if(q.questionType == 'Slider'){
|
else if(q.questionType == 'Slider'){
|
||||||
new this.sliders(q);
|
new this.sliders(q);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
else if(fileUpload[q.questionType]){
|
else if(fileUpload[q.questionType]){
|
||||||
hasFile = true;
|
hasFile = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
else if(text[q.questionType]){
|
else if(text[q.questionType]){
|
||||||
var a = q.answers[x];
|
var a = q.answers[x];
|
||||||
if(toValidate[a.Survey_questionId]){
|
if(toValidate[a.Survey_questionId]){
|
||||||
toValidate[a.Survey_questionId][a.Survey_answerId] = 1;
|
toValidate[a.Survey_questionId]['answers'][a.Survey_answerId] = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -171,11 +183,23 @@ YAHOO.util.Event.addListener("testB", "click", function(){Survey.Comm.callServer
|
||||||
var submit = 1;//boolean for if all was good or not
|
var submit = 1;//boolean for if all was good or not
|
||||||
for(var i in toValidate){
|
for(var i in toValidate){
|
||||||
var answered = 0;
|
var answered = 0;
|
||||||
for(var z in toValidate[i]){
|
if(toValidate[i]['type'] == 'Multi Slider - Allocate'){
|
||||||
var v = document.getElementById(z).value;
|
var total = 0;
|
||||||
if(v != '' && v != undefined){
|
for(var z in toValidate[i]['answers']){
|
||||||
answered = 1;
|
total += Math.round(document.getElementById(z).value);
|
||||||
break;
|
}
|
||||||
|
console.log(total+" and "+ toValidate[i]['total']);
|
||||||
|
if(total == toValidate[i]['total']){answered = 1;}
|
||||||
|
}else{
|
||||||
|
for(var z in toValidate[i]['answers']){
|
||||||
|
var v = document.getElementById(z).value;
|
||||||
|
if(v != '' && v != undefined){
|
||||||
|
answered = 1;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
console.log(z+' was not answered');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(answered == 0){
|
if(answered == 0){
|
||||||
|
|
@ -194,11 +218,11 @@ YAHOO.util.Event.addListener("testB", "click", function(){Survey.Comm.callServer
|
||||||
|
|
||||||
|
|
||||||
this.dualSliders = function(q){
|
this.dualSliders = function(q){
|
||||||
var total = 200;
|
var total = sliderWidth;
|
||||||
var sliders = new Array();
|
// var sliders = new Array();
|
||||||
var a1 = q.answers[0];
|
var a1 = q.answers[0];
|
||||||
var a2 = q.answers[1];
|
var a2 = q.answers[1];
|
||||||
var scale = 200/a1.max;
|
var scale = sliderWidth/a1.max;
|
||||||
|
|
||||||
var id = q.Survey_questionId;
|
var id = q.Survey_questionId;
|
||||||
var a1id = a1.Survey_answerId;
|
var a1id = a1.Survey_answerId;
|
||||||
|
|
@ -210,7 +234,8 @@ YAHOO.util.Event.addListener("testB", "click", function(){Survey.Comm.callServer
|
||||||
var a2s = document.getElementById(a2id+'show');
|
var a2s = document.getElementById(a2id+'show');
|
||||||
var s = YAHOO.widget.Slider.getHorizDualSlider(id+'slider-bg',
|
var s = YAHOO.widget.Slider.getHorizDualSlider(id+'slider-bg',
|
||||||
a1id+"slider-min-thumb", a2id+"slider-max-thumb",
|
a1id+"slider-min-thumb", a2id+"slider-max-thumb",
|
||||||
200, 1*scale, [1,200]);
|
sliderWidth, 1*scale, [1,sliderWidth]);
|
||||||
|
sliders[id] = s;
|
||||||
|
|
||||||
s.minRange = 4;
|
s.minRange = 4;
|
||||||
var updateUI = function () {
|
var updateUI = function () {
|
||||||
|
|
@ -228,40 +253,37 @@ YAHOO.util.Event.addListener("testB", "click", function(){Survey.Comm.callServer
|
||||||
s.subscribe('change', updateUI);
|
s.subscribe('change', updateUI);
|
||||||
}
|
}
|
||||||
this.sliders = function(q){
|
this.sliders = function(q){
|
||||||
var total = 200;
|
var total = sliderWidth;
|
||||||
for(var i in q.answers){
|
for(var i in q.answers){
|
||||||
var a = q.answers[i];
|
var a = q.answers[i];
|
||||||
var step = q.answers[i].step;
|
var step = q.answers[i].step;
|
||||||
var scale = 200/q.answers[i].max;
|
var scale = sliderWidth/q.answers[i].max;
|
||||||
var Event = YAHOO.util.Event;
|
var Event = YAHOO.util.Event;
|
||||||
var lang = YAHOO.lang;
|
var lang = YAHOO.lang;
|
||||||
var id = a.Survey_answerId;
|
var id = a.Survey_answerId;
|
||||||
var s = YAHOO.widget.Slider.getHorizSlider(id+'slider-bg', id+'slider-thumb',
|
var s = YAHOO.widget.Slider.getHorizSlider(id+'slider-bg', id+'slider-thumb',
|
||||||
0, 200, (scale*step));
|
0, sliderWidth, (scale*step));
|
||||||
// 0, 200, 1);
|
s.scale = scale;
|
||||||
|
sliders[id] = s;
|
||||||
s.max = a.max*scale;
|
s.max = a.max*scale;
|
||||||
s.input = a.Survey_answerId;
|
s.input = a.Survey_answerId;
|
||||||
s.scale = scale;
|
s.scale = scale;
|
||||||
document.getElementById(id).value = a.min;
|
document.getElementById(id).value = a.min;
|
||||||
var check = function() {
|
var check = function() {
|
||||||
var t = document.getElementById(this.input);
|
var t = document.getElementById(this.input);
|
||||||
var tshow = document.getElementById(this.input+'show');
|
|
||||||
t.value = this.getRealValue();
|
t.value = this.getRealValue();
|
||||||
tshow.innerHTML = this.getRealValue();
|
|
||||||
};
|
};
|
||||||
s.getRealValue = function() {
|
s.getRealValue = function() {
|
||||||
return this.getValue() / this.scale;
|
return this.getValue() / this.scale;
|
||||||
}
|
}
|
||||||
s.subscribe("slideEnd", check);
|
s.subscribe("slideEnd", check);
|
||||||
s.subscribe("change", check);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//an object which creates sliders for allocation type questions and then manages their events and keeps them from overallocating
|
//an object which creates sliders for allocation type questions and then manages their events and keeps them from overallocating
|
||||||
this.sliderManager = function(q,t){
|
this.sliderManager = function(q,t){
|
||||||
var total = 200;
|
var total = sliderWidth;
|
||||||
var step = q.answers[0].step;
|
var step = q.answers[0].step;
|
||||||
var scale = 200/q.answers[0].max;
|
var scale = sliderWidth/q.answers[0].max;
|
||||||
var sliders = new Array();
|
|
||||||
|
|
||||||
for(var i in q.answers){
|
for(var i in q.answers){
|
||||||
var a = q.answers[i];
|
var a = q.answers[i];
|
||||||
|
|
@ -269,9 +291,10 @@ YAHOO.util.Event.addListener("testB", "click", function(){Survey.Comm.callServer
|
||||||
var lang = YAHOO.lang;
|
var lang = YAHOO.lang;
|
||||||
var id = a.Survey_answerId+'slider-bg';
|
var id = a.Survey_answerId+'slider-bg';
|
||||||
var s = YAHOO.widget.Slider.getHorizSlider(id, a.Survey_answerId+'slider-thumb',
|
var s = YAHOO.widget.Slider.getHorizSlider(id, a.Survey_answerId+'slider-thumb',
|
||||||
0, 200, scale*step);
|
0, sliderWidth, scale*step);
|
||||||
s.input = a.Survey_answerId;
|
sliders[a.Survey_answerId] = s;
|
||||||
s.lastValue = 0;
|
s.input = a.Survey_answerId;
|
||||||
|
s.lastValue = 0;
|
||||||
var check = function() {
|
var check = function() {
|
||||||
var t = 0;
|
var t = 0;
|
||||||
for(var x in sliders){
|
for(var x in sliders){
|
||||||
|
|
@ -280,14 +303,12 @@ YAHOO.util.Event.addListener("testB", "click", function(){Survey.Comm.callServer
|
||||||
if(t > total){
|
if(t > total){
|
||||||
t -= this.getValue();
|
t -= this.getValue();
|
||||||
t = Math.round(t);
|
t = Math.round(t);
|
||||||
this.setValue(total-t + scale*step);
|
this.setValue(total-t);// + (scale*step));
|
||||||
}else{
|
}else{
|
||||||
this.lastValue = this.getValue();
|
this.lastValue = this.getValue();
|
||||||
document.getElementById(this.input).value = this.getRealValue();
|
document.getElementById(this.input).value = this.getRealValue();
|
||||||
document.getElementById(this.input+'show').innerHTML = this.getRealValue();
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
s.subscribe("slideEnd", check);
|
|
||||||
s.subscribe("change", check);
|
s.subscribe("change", check);
|
||||||
var manualEntry = function(e){
|
var manualEntry = function(e){
|
||||||
// set the value when the 'return' key is detected
|
// set the value when the 'return' key is detected
|
||||||
|
|
@ -304,14 +325,12 @@ YAHOO.util.Event.addListener("testB", "click", function(){Survey.Comm.callServer
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Event.on(document.getElementById(s.input), "keydown", manualEntry);
|
|
||||||
Event.on(document.getElementById(s.input), "blur", manualEntry);
|
Event.on(document.getElementById(s.input), "blur", manualEntry);
|
||||||
|
|
||||||
s.getRealValue = function() {
|
s.getRealValue = function() {
|
||||||
|
|
||||||
return Math.round(parseInt(this.getValue()) / scale);
|
return Math.round(parseInt(this.getValue()) / scale);
|
||||||
}
|
}
|
||||||
sliders.push(s);
|
|
||||||
document.getElementById(s.input).value = s.getRealValue();
|
document.getElementById(s.input).value = s.getRealValue();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -331,6 +350,11 @@ YAHOO.util.Event.addListener("testB", "click", function(){Survey.Comm.callServer
|
||||||
objs[0].show();
|
objs[0].show();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
this.sliderTextSet = function(event,objs){
|
||||||
|
this.value = this.value * 1;
|
||||||
|
if(this.value == 'NaN'){this.value = 0;}
|
||||||
|
sliders[this.id].setValue(Math.round(this.value * sliders[this.id].scale));
|
||||||
|
}
|
||||||
|
|
||||||
this.buttonChanged = function(event,objs){
|
this.buttonChanged = function(event,objs){
|
||||||
var b = objs[0];
|
var b = objs[0];
|
||||||
|
|
@ -341,32 +365,36 @@ YAHOO.util.Event.addListener("testB", "click", function(){Survey.Comm.callServer
|
||||||
var aid = objs[5];
|
var aid = objs[5];
|
||||||
max = parseInt(max);
|
max = parseInt(max);
|
||||||
if(maxA == 1){
|
if(maxA == 1){
|
||||||
|
if(b.getAttribute('class') == 'mcbutton-selected'){
|
||||||
|
document.getElementById(b.hid).value = 0;
|
||||||
|
b.setAttribute('class','mcbutton');
|
||||||
|
}else{
|
||||||
|
document.getElementById(b.hid).value = 1;
|
||||||
|
b.setAttribute('class','mcbutton-selected');
|
||||||
|
}
|
||||||
for(var i in butts){
|
for(var i in butts){
|
||||||
if(butts[i] != b){
|
if(butts[i] != b){
|
||||||
butts[i].set('checked',false);
|
butts[i].setAttribute('class','mcbutton');
|
||||||
document.getElementById(butts[i].hid).value = '';
|
document.getElementById(butts[i].hid).value = '';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(b.get('checked') == true){
|
|
||||||
document.getElementById(b.hid).value = 1;
|
|
||||||
}else{
|
|
||||||
document.getElementById(b.hid).value = '';
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else if(b.get('checked')){
|
else if(b.getAttribute('class') == 'mcbutton'){
|
||||||
var max = parseInt(document.getElementById(qid+'max').innerHTML);
|
var max = parseInt(document.getElementById(qid+'max').innerHTML);
|
||||||
if(max == 0){
|
if(max == 0){
|
||||||
b.set('checked',false);
|
b.setAttribute('class','mcbutton');
|
||||||
//warn that options used up
|
//warn that options used up
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
document.getElementById(qid+'max').innerHTML = parseInt(max-1);
|
b.setAttribute('class','mcbutton-selected');
|
||||||
document.getElementById(b.hid).value = '';
|
document.getElementById(qid+'max').innerHTML = parseInt(max-1);
|
||||||
}
|
document.getElementById(b.hid).value = 1;
|
||||||
|
}
|
||||||
}else{
|
}else{
|
||||||
|
b.setAttribute('class','mcbutton');
|
||||||
var max = parseInt(document.getElementById(qid+'max').innerHTML);
|
var max = parseInt(document.getElementById(qid+'max').innerHTML);
|
||||||
document.getElementById(qid+'max').innerHTML = parseInt(max+1);
|
document.getElementById(qid+'max').innerHTML = parseInt(max+1);
|
||||||
document.getElementById(b.hid).value = 1;
|
document.getElementById(b.hid).value = '';
|
||||||
}
|
}
|
||||||
if(qsize == 1){
|
if(qsize == 1){
|
||||||
if(! document.getElementById(aid+'verbatim')){
|
if(! document.getElementById(aid+'verbatim')){
|
||||||
|
|
|
||||||
BIN
www/extras/wobject/Survey/bg-fader-500.gif
Normal file
BIN
www/extras/wobject/Survey/bg-fader-500.gif
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.2 KiB |
|
|
@ -23,7 +23,7 @@ Survey.AnswerTemplate = new function(){
|
||||||
<input type='hidden' name='Survey_answerId' value='"+params.Survey_answerId+"'>";
|
<input type='hidden' name='Survey_answerId' value='"+params.Survey_answerId+"'>";
|
||||||
html = html + "<p>Answer Text:\n<textarea name='answerText'>"+params.answerText+"</textArea>\n";
|
html = html + "<p>Answer Text:\n<textarea name='answerText'>"+params.answerText+"</textArea>\n";
|
||||||
html = html + "<p>Recorded Answer\n<textarea name='recordedAnswer'>"+params.recordedAnswer+"</textArea>\n";
|
html = html + "<p>Recorded Answer\n<textarea name='recordedAnswer'>"+params.recordedAnswer+"</textArea>\n";
|
||||||
html = html + "<p>Jump to Question:<input type=text value='"+params.gotoQuestion+"' name=gotoQuestion size=4>";
|
html = html + "<p>Jump to:<input type=text value='"+params.gotoQuestion+"' name=gotoQuestion size=4>";
|
||||||
html = html + "<span id='textParams'><p>Text Answer Cols:<input type=text size=2 value='"+params.textCols+"' name=textCols> Rows: \
|
html = html + "<span id='textParams'><p>Text Answer Cols:<input type=text size=2 value='"+params.textCols+"' name=textCols> Rows: \
|
||||||
<input type=text size=2 value='"+params.textRows+"' name=textRows> </p></span>";
|
<input type=text size=2 value='"+params.textRows+"' name=textRows> </p></span>";
|
||||||
html = html + "<p>Is this the correct answer:\n" +
|
html = html + "<p>Is this the correct answer:\n" +
|
||||||
|
|
@ -41,7 +41,7 @@ Survey.AnswerTemplate = new function(){
|
||||||
}
|
}
|
||||||
|
|
||||||
var form = new YAHOO.widget.Dialog("answer",
|
var form = new YAHOO.widget.Dialog("answer",
|
||||||
{ width : "300px",
|
{ width : "500px",
|
||||||
fixedcenter : true,
|
fixedcenter : true,
|
||||||
visible : false,
|
visible : false,
|
||||||
constraintoviewport : true,
|
constraintoviewport : true,
|
||||||
|
|
|
||||||
|
|
@ -27,7 +27,7 @@ Survey.QuestionTemplate = new function(){
|
||||||
else{
|
else{
|
||||||
html = html + "<textarea name='questionText'>"+params.questionText+"</textArea>\n";
|
html = html + "<textarea name='questionText'>"+params.questionText+"</textArea>\n";
|
||||||
}
|
}
|
||||||
html = html + "<p>Question custom variable name:<input maxlength=35 size=10 type=text value='"+ params.questionVariable +"' name=questionVariable size=2></p>";
|
html = html + "<p>Question variable name:<input maxlength=35 size=10 type=text value='"+ params.questionVariable +"' name=questionVariable size=2></p>";
|
||||||
html = html + "<p>Randomize answers:";
|
html = html + "<p>Randomize answers:";
|
||||||
|
|
||||||
html = html+ this.makeRadio('randomizeAnswers',[{text:'Yes',value:1},{text:'No',value:0}],params.randomizeAnswers);
|
html = html+ this.makeRadio('randomizeAnswers',[{text:'Yes',value:1},{text:'No',value:0}],params.randomizeAnswers);
|
||||||
|
|
@ -48,6 +48,8 @@ Survey.QuestionTemplate = new function(){
|
||||||
<p>Vertical display:";
|
<p>Vertical display:";
|
||||||
|
|
||||||
html = html+ this.makeRadio('verticalDisplay',[{text:'Yes',value:1},{text:'No',value:0}],params.verticalDisplay);
|
html = html+ this.makeRadio('verticalDisplay',[{text:'Yes',value:1},{text:'No',value:0}],params.verticalDisplay);
|
||||||
|
html = html + "<p>Show text in button:";
|
||||||
|
html = html + this.makeRadio('textInButton',[{text:'Yes',value:1},{text:'No',value:0}],params.textInButton);
|
||||||
html = html + "<p>Allow comment:";
|
html = html + "<p>Allow comment:";
|
||||||
html = html + this.makeRadio('allowComment',[{text:'Yes',value:1},{text:'No',value:0}],params.allowComment);
|
html = html + this.makeRadio('allowComment',[{text:'Yes',value:1},{text:'No',value:0}],params.allowComment);
|
||||||
html = html + "<span id='commentParams'><p> Cols:<input type=text size=2 value='"+params.commentCols+"' name=commentCols> Rows: \
|
html = html + "<span id='commentParams'><p> Cols:<input type=text size=2 value='"+params.commentCols+"' name=commentCols> Rows: \
|
||||||
|
|
@ -70,7 +72,7 @@ Survey.QuestionTemplate = new function(){
|
||||||
}
|
}
|
||||||
|
|
||||||
var form = new YAHOO.widget.Dialog("question",
|
var form = new YAHOO.widget.Dialog("question",
|
||||||
{ width : "315px",
|
{ width : "500px",
|
||||||
fixedcenter : true,
|
fixedcenter : true,
|
||||||
visible : false,
|
visible : false,
|
||||||
constraintoviewport : true,
|
constraintoviewport : true,
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,7 @@ Survey.SectionTemplate = new function(){
|
||||||
|
|
||||||
var html = "\
|
var html = "\
|
||||||
<div id='section'>\
|
<div id='section'>\
|
||||||
<div class='hd'>Please enter section formation</div>\
|
<div class='hd'>Please enter section information</div>\
|
||||||
<div class='bd'>\
|
<div class='bd'>\
|
||||||
<form name='form' method='POST' action='?func=submitSectionEdit'>\
|
<form name='form' method='POST' action='?func=submitSectionEdit'>\
|
||||||
<p>Section Number: "+params.sequenceNumber + "\
|
<p>Section Number: "+params.sequenceNumber + "\
|
||||||
|
|
@ -30,6 +30,7 @@ Survey.SectionTemplate = new function(){
|
||||||
<input type='radio' name='randomizeQuestions' value=0 checked>No";
|
<input type='radio' name='randomizeQuestions' value=0 checked>No";
|
||||||
}
|
}
|
||||||
html = html + "<p>Section custom variable name:<input maxlength=35 size=10 type=text value='"+ params.sectionVariable +"' name=sectionVariable size=2></p>";
|
html = html + "<p>Section custom variable name:<input maxlength=35 size=10 type=text value='"+ params.sectionVariable +"' name=sectionVariable size=2></p>";
|
||||||
|
html = html + "<p>Section branch goto variable name:<input maxlength=35 size=10 type=text value='"+ params.goto +"' name=goto size=2></p>";
|
||||||
html = html + "\
|
html = html + "\
|
||||||
<p>Question per Page:\
|
<p>Question per Page:\
|
||||||
<select name='questionsPerPage'>";
|
<select name='questionsPerPage'>";
|
||||||
|
|
@ -53,7 +54,7 @@ Survey.SectionTemplate = new function(){
|
||||||
}
|
}
|
||||||
html = html + "\
|
html = html + "\
|
||||||
<hr>\
|
<hr>\
|
||||||
<p>Section Text:</p> <textarea name=sectionText maxlength=2056 cols=30 rows=5>"+ params.sectionText +"</textarea>\
|
<p>Section Text:</p> <textarea name=sectionText maxlength=2056 cols=50 rows=10>"+ params.sectionText +"</textarea>\
|
||||||
";
|
";
|
||||||
html = html + "<p>Title on every page: " + this.makeRadio('everyPageTitle',[{text:'Yes',value:1},{text:'No',value:0}],params.everyPageTitle);
|
html = html + "<p>Title on every page: " + this.makeRadio('everyPageTitle',[{text:'Yes',value:1},{text:'No',value:0}],params.everyPageTitle);
|
||||||
html = html + "<p>Text on every page: " + this.makeRadio('everyPageText',[{text:'Yes',value:1},{text:'No',value:0}],params.everyPageText);
|
html = html + "<p>Text on every page: " + this.makeRadio('everyPageText',[{text:'Yes',value:1},{text:'No',value:0}],params.everyPageText);
|
||||||
|
|
|
||||||
|
|
@ -3,14 +3,15 @@ div.dateanswer {
|
||||||
}
|
}
|
||||||
div.slider-bg {
|
div.slider-bg {
|
||||||
position: relative;
|
position: relative;
|
||||||
background:url(/extras/wobject/Survey/bg-fader.gif) 5px 0 no-repeat;
|
background:url(/extras/wobject/Survey/bg-fader-500.gif) 5px 0 no-repeat;
|
||||||
height:28px;
|
height:68px;
|
||||||
width:228px;
|
width:529px;
|
||||||
}
|
}
|
||||||
div.slider-thumb {
|
div.slider-thumb {
|
||||||
cursor:default;
|
cursor:default;
|
||||||
position: absolute;
|
position: absolute;
|
||||||
top: 4px;
|
top: 30px;
|
||||||
|
left: 4px;
|
||||||
}
|
}
|
||||||
div.slider-min-thumb {
|
div.slider-min-thumb {
|
||||||
cursor:default;
|
cursor:default;
|
||||||
|
|
@ -31,10 +32,33 @@ div.slider-max-thumb {
|
||||||
#questions {
|
#questions {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
.yui-button{
|
input.mcbutton{
|
||||||
|
font-size: 10px;
|
||||||
|
font-weight: bold;
|
||||||
|
text-decoration: none;
|
||||||
|
background-color: #CCCCCC;
|
||||||
|
background-repeat: repeat-x;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
|
display: block;
|
||||||
|
margin: 0.5em;
|
||||||
|
padding: .8em;
|
||||||
|
width: 60px;
|
||||||
|
font-family: Verdana, Arial, Helvetica, sans-serif;
|
||||||
|
color: #000000;
|
||||||
|
background-image: url(/extras/wobject/Survey/gradient-glossy.png);
|
||||||
}
|
}
|
||||||
.yui-button button{
|
input.mcbutton:hover{
|
||||||
text-align: center;
|
background-color: #B6D2F1;
|
||||||
min-width: 100px;
|
font-family: Verdana, Arial, Helvetica, sans-serif;
|
||||||
|
font-size: 10px;
|
||||||
|
color: #000000;
|
||||||
|
}
|
||||||
|
input.mcbutton-selected{
|
||||||
|
background-color: #172D9D;
|
||||||
|
color: #FFFFFF;
|
||||||
|
font-family: Verdana, Arial, Helvetica, sans-serif;
|
||||||
|
font-size: 10px;
|
||||||
|
font-weight: bold;
|
||||||
|
background-image: url(/extras/wobject/Survey/gradient-glossy.png);
|
||||||
|
background-position: 0px 0px;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue