Index: lams_tool_survey/conf/language/ApplicationResources.properties =================================================================== RCS file: /usr/local/cvsroot/lams_tool_survey/conf/language/Attic/ApplicationResources.properties,v diff -u -r1.3 -r1.4 --- lams_tool_survey/conf/language/ApplicationResources.properties 15 Sep 2006 07:18:30 -0000 1.3 +++ lams_tool_survey/conf/language/ApplicationResources.properties 18 Sep 2006 02:14:04 -0000 1.4 @@ -26,6 +26,7 @@ label.authoring.basic.instruction =Instruction # Survey question label.question =Question +label.optional= Optional label.authoring.basic.add.survey.question =Add question label.authoring.basic.add.survey.open.question=Add open text label.authoring.basic.add.option =Add more options Index: lams_tool_survey/src/java/org/lamsfoundation/lams/tool/survey/web/action/AuthoringAction.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_survey/src/java/org/lamsfoundation/lams/tool/survey/web/action/AuthoringAction.java,v diff -u -r1.4 -r1.5 --- lams_tool_survey/src/java/org/lamsfoundation/lams/tool/survey/web/action/AuthoringAction.java 15 Sep 2006 07:18:30 -0000 1.4 +++ lams_tool_survey/src/java/org/lamsfoundation/lams/tool/survey/web/action/AuthoringAction.java 18 Sep 2006 02:14:04 -0000 1.5 @@ -276,6 +276,9 @@ if(!errors.isEmpty()){ this.addErrors(request,errors); + //add at least 2 instruction list + for(int idx=instructionList.size();idx < 2;idx++) + instructionList.add(""); request.setAttribute(SurveyConstants.ATTR_INSTRUCTION_LIST,instructionList); if(itemForm.getItemType() == SurveyConstants.QUESTION_TYPE_TEXT_ENTRY) return mapping.findForward(SurveyConstants.FORWARD_OPEN_QUESTION); @@ -736,6 +739,11 @@ */ private List getInstructionsFromRequest(HttpServletRequest request) { String list = request.getParameter("instructionList"); + List instructionList = new ArrayList(); + //for open text entry question + if(list == null) + return instructionList; + String[] params = list.split("&"); Map paramMap = new HashMap(); String[] pair; @@ -751,7 +759,6 @@ } int count = NumberUtils.stringToInt(paramMap.get(INSTRUCTION_ITEM_COUNT)); - List instructionList = new ArrayList(); for(int idx=0;idx -

 


Index: lams_tool_survey/web/includes/javascript/surveyitem.js =================================================================== RCS file: /usr/local/cvsroot/lams_tool_survey/web/includes/javascript/surveyitem.js,v diff -u -r1.1 -r1.2 --- lams_tool_survey/web/includes/javascript/surveyitem.js 14 Sep 2006 06:44:13 -0000 1.1 +++ lams_tool_survey/web/includes/javascript/surveyitem.js 18 Sep 2006 02:14:05 -0000 1.2 @@ -25,49 +25,6 @@ ); } - function changeMaxAnswerOptions(initVal){ - var tb = document.getElementById("questionTable"); - var num = tb.getElementsByTagName("tr"); - var numLen = num.length; - //remove button row - if(numLen > 0) - --numLen; - - var sel = document.getElementById("maxAnswerSelect"); - var newField = sel.options; - var len = sel.length; - - if(numLen == 0){ - sel.disabled = true; - return; - }else - sel.disabled = false; - - //when first enter, it should get value from Resource - var selIdx=initVal < 0?-1:initVal; - //there is bug in Opera8.5: if add alert before this loop, it will work,weird. - for (var idx=0;idx 0 && selIdx==i){ - opt.selected = true; - }else{ - opt.selected = false; - } - opt.appendChild(optT); - sel.appendChild(opt); - } - } function addInstruction(){ var url= addInstructionUrl; var reqIDVar = new Date(); @@ -109,7 +66,6 @@ function removeInstructionComplete(){ hideBusy(instructionTargetDiv); - changeMaxAnswerOptions(-1); } function addInstructionLoading(){ @@ -118,7 +74,6 @@ function addInstructionComplete(){ hideBusy(instructionTargetDiv); - changeMaxAnswerOptions(-1); } function showBusy(targetDiv){ if($(targetDiv+"_Busy") != null){ @@ -132,10 +87,9 @@ } function submitSurveyItem(){ - $("instructionList").value = Form.serialize("instructionForm"); + if($("instructionList") != null) + $("instructionList").value = Form.serialize("instructionForm"); $("surveyItemForm").submit(); - //after submit, it direct to itemlist.jsp, - // then refresh "basic tab" surveylist and close this window. } function cancelSurveyItem(){ window.top.hideMessage(); Index: lams_tool_survey/web/pages/authoring/basic.jsp =================================================================== RCS file: /usr/local/cvsroot/lams_tool_survey/web/pages/authoring/basic.jsp,v diff -u -r1.3 -r1.4 --- lams_tool_survey/web/pages/authoring/basic.jsp 15 Sep 2006 07:18:30 -0000 1.3 +++ lams_tool_survey/web/pages/authoring/basic.jsp 18 Sep 2006 02:14:02 -0000 1.4 @@ -25,9 +25,9 @@ } - function editItem(idx,sessionMapID){ + function editItem(idx,itemType,sessionMapID){ var reqIDVar = new Date(); - var url = "" + idx +"&reqID="+reqIDVar.getTime()+"&sessionMapID="+sessionMapID;; + var url = "" + idx +"&itemType="+itemType+"&reqID="+reqIDVar.getTime()+"&sessionMapID="+sessionMapID;; showMessage(url); } //The panel of survey list panel Index: lams_tool_survey/web/pages/authoring/parts/addchoicequestion.jsp =================================================================== RCS file: /usr/local/cvsroot/lams_tool_survey/web/pages/authoring/parts/addchoicequestion.jsp,v diff -u -r1.1 -r1.2 --- lams_tool_survey/web/pages/authoring/parts/addchoicequestion.jsp 15 Sep 2006 07:18:30 -0000 1.1 +++ lams_tool_survey/web/pages/authoring/parts/addchoicequestion.jsp 18 Sep 2006 02:14:04 -0000 1.2 @@ -39,6 +39,8 @@ + <%-- This value should be 1 or 2 --%> +
Index: lams_tool_survey/web/pages/authoring/parts/addopenquestion.jsp =================================================================== RCS file: /usr/local/cvsroot/lams_tool_survey/web/pages/authoring/parts/addopenquestion.jsp,v diff -u -r1.1 -r1.2 --- lams_tool_survey/web/pages/authoring/parts/addopenquestion.jsp 15 Sep 2006 07:18:30 -0000 1.1 +++ lams_tool_survey/web/pages/authoring/parts/addopenquestion.jsp 18 Sep 2006 02:14:04 -0000 1.2 @@ -35,10 +35,9 @@ <%@ include file="/common/messages.jsp"%> - <%-- This field is not belong STRUTS form --%> - + +
Index: lams_tool_survey/web/pages/authoring/parts/itemlist.jsp =================================================================== RCS file: /usr/local/cvsroot/lams_tool_survey/web/pages/authoring/parts/itemlist.jsp,v diff -u -r1.3 -r1.4 --- lams_tool_survey/web/pages/authoring/parts/itemlist.jsp 14 Sep 2006 06:59:15 -0000 1.3 +++ lams_tool_survey/web/pages/authoring/parts/itemlist.jsp 18 Sep 2006 02:14:04 -0000 1.4 @@ -24,7 +24,12 @@ ${survey.shortTitle} - + + + + +