diff --git a/www/extras/wobject/Survey/administersurvey.js b/www/extras/wobject/Survey/administersurvey.js index d19381e85..a6c39025a 100644 --- a/www/extras/wobject/Survey/administersurvey.js +++ b/www/extras/wobject/Survey/administersurvey.js @@ -5,7 +5,7 @@ if (typeof Survey == "undefined") { 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 scale = {'Agree/Disagree':1,'Oppose/Support':1,'Importance':1, + var scale = {'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}; 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}; @@ -17,8 +17,11 @@ Survey.Form = new function() { var verb = 0; var lastSection = 'first'; + var toValidate; + this.displayQuestions = function(params){ + toValidate = new Array();//clear array var qs = params.questions; var s = params.section; @@ -34,12 +37,10 @@ YAHOO.util.Event.addListener("testB", "click", function(){Survey.Comm.callServer document.getElementById('headertitle').style.display='block'; } if(lastSection != s.Survey_sectionId || s.everyPageText > 0){ - //if(qs[0].sequenceNumber == '1' || s.everyPageText > 0){ document.getElementById('headertext').style.display = 'block'; } - if((lastSection != s.Survey_sectionId && lastSection != 'first') || s.questionsOnSectionPage != '1'){ -// if(qs[0].sequenceNumber == '1' && s.questionsOnSectionPage != '1'){ + if(lastSection != s.Survey_sectionId && s.questionsOnSectionPage != '1'){ var span = document.createElement("div"); span.innerHTML = ""; span.style.display = 'block'; @@ -55,9 +56,11 @@ YAHOO.util.Event.addListener("testB", "click", function(){Survey.Comm.callServer document.getElementById('headertext').style.display = 'none'; } document.getElementById('questions').style.display='inline'; + Survey.Form.addWidgets(qs); }); }else{ document.getElementById('questions').style.display='inline'; + Survey.Form.addWidgets(qs); } lastSection = s.Survey_sectionId; }else{ @@ -65,10 +68,9 @@ YAHOO.util.Event.addListener("testB", "click", function(){Survey.Comm.callServer document.getElementById('headertext').style.display = 'block'; document.getElementById('questions').style.display='inline'; } - + } //Display questions - - var html; + this.addWidgets = function(qs){ hasFile = false; for(var i = 0; i < qs.length; i++){ var q = qs[i]; @@ -80,14 +82,21 @@ YAHOO.util.Event.addListener("testB", "click", function(){Survey.Comm.callServer } } - html += "
Answer Text:\n\n"; html = html + "
Recorded Answer\n\n"; html = html + "
Jump to Question:";
+ html = html + " Text Answer Cols: Rows: \
+
Is this the correct answer:\n" + this.makeRadio('isCorrect',[{text:'Yes',value:1},{text:'No',value:0}],params.isCorrect); html = html + "
Min:"; diff --git a/www/extras/wobject/Survey/editsurvey/question.js b/www/extras/wobject/Survey/editsurvey/question.js index 097505aa8..b03b6d7ae 100644 --- a/www/extras/wobject/Survey/editsurvey/question.js +++ b/www/extras/wobject/Survey/editsurvey/question.js @@ -31,11 +31,10 @@ Survey.QuestionTemplate = new function(){ html = html + "
Randomize answers:"; html = html+ this.makeRadio('randomizeAnswers',[{text:'Yes',value:1},{text:'No',value:0}],params.randomizeAnswers); - html = html + "
Previous answers to display:"; html = html + "
Question type:"; var questions = ['Agree/Disagree','Certainty','Concern','Confidence','Currency','Date','Date Range','Dual Slider - Range','Education','Effectiveness', 'Email','File Upload','Gender','Hidden','Ideology','Importance','Likelihood','Multi Slider - Allocate','Multiple Choice','Oppose/Support', - 'Party','Phone Number','Race','Risk','Satisfaction','Security','Slider','Text','Text Date','Threat','True/False','Yes/No']; + 'Party','Phone Number','Race','Risk','Satisfaction','Scale','Security','Slider','Text','Text Date','Threat','True/False','Yes/No']; // var questions = ['Multiple Choice','Gender','Yes/No','True/False','Agree/Disagree','Oppose/Support','Importance','Likelihood','Certainty','Satisfaction', // 'Confidence','Effectiveness','Concern','Risk','Threat','Security','Ideology','Race','Party','Education', // 'Text', 'Email', 'Phone Number', 'Text Date', 'Currency', @@ -50,7 +49,9 @@ Survey.QuestionTemplate = new function(){ html = html+ this.makeRadio('verticalDisplay',[{text:'Yes',value:1},{text:'No',value:0}],params.verticalDisplay); html = html + "
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}]);
+ html = html + " Cols: Rows: \
+
Maximum number of answers:"; html = html + "
Required:";
html = html+ this.makeRadio('required',[{text:'Yes',value:1},{text:'No',value:0}],params.required);
@@ -97,9 +98,9 @@ Survey.QuestionTemplate = new function(){
var html = '';
for(var i in values){
if(checked == values[i]['value']){
- html = html+ "" + values[i]['text'];
+ html = html+ "" + values[i]['text'];
}else{
- html = html+ "" + values[i]['text'];
+ html = html+ "" + values[i]['text'];
}
}
html = html + "\n";
diff --git a/www/extras/wobject/Survey/templates/takeSurvey.html b/www/extras/wobject/Survey/templates/takeSurvey.html
index fcc57391b..5eaa2b1a0 100644
--- a/www/extras/wobject/Survey/templates/takeSurvey.html
+++ b/www/extras/wobject/Survey/templates/takeSurvey.html
@@ -9,7 +9,7 @@
-
-
+
+