Index: lams_tool_survey/conf/xdoclet/struts-actions.xml
===================================================================
RCS file: /usr/local/cvsroot/lams_tool_survey/conf/xdoclet/struts-actions.xml,v
diff -u -r1.7 -r1.8
--- lams_tool_survey/conf/xdoclet/struts-actions.xml 26 Sep 2006 07:12:41 -0000 1.7
+++ lams_tool_survey/conf/xdoclet/struts-actions.xml 6 Oct 2006 01:10:08 -0000 1.8
@@ -106,6 +106,17 @@
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
surveyList = getSurveyItemList(sessionMap);
+ List rList = new ArrayList(surveyList);
+ //get current and the target item, and switch their sequnece
+ SurveyQuestion item = rList.get(itemIdx);
+ SurveyQuestion repItem;
+ if(up)
+ repItem = rList.get(--itemIdx);
+ else
+ repItem = rList.get(++itemIdx);
+ int upSeqId = repItem.getSequenceId();
+ repItem.setSequenceId(item.getSequenceId());
+ item.setSequenceId(upSeqId);
+
+ //put back list, it will be sorted again
+ surveyList.clear();
+ surveyList.addAll(rList);
+ }
+
+ request.setAttribute(SurveyConstants.ATTR_SESSION_MAP_ID, sessionMapID);
+ return mapping.findForward(SurveyConstants.SUCCESS);
+ }
/**
* Display edit page for existed survey item.
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.5 -r1.6
--- lams_tool_survey/web/pages/authoring/basic.jsp 28 Sep 2006 07:04:25 -0000 1.5
+++ lams_tool_survey/web/pages/authoring/basic.jsp 6 Oct 2006 01:10:06 -0000 1.6
@@ -48,13 +48,56 @@
}
);
}
+ function upQuestion(idx,sessionMapID){
+ var url = "";
+ var reqIDVar = new Date();
+ var param = "itemIndex=" + idx +"&reqID="+reqIDVar.getTime()+"&sessionMapID="+sessionMapID;;
+ deleteItemLoading();
+ var myAjax = new Ajax.Updater(
+ surveyListTargetDiv,
+ url,
+ {
+ method:'get',
+ parameters:param,
+ onComplete:deleteItemComplete,
+ evalScripts:true
+ }
+ );
+ }
+ function downQuestion(idx,sessionMapID){
+ var url = "";
+ var reqIDVar = new Date();
+ var param = "itemIndex=" + idx +"&reqID="+reqIDVar.getTime()+"&sessionMapID="+sessionMapID;;
+ deleteItemLoading();
+ var myAjax = new Ajax.Updater(
+ surveyListTargetDiv,
+ url,
+ {
+ method:'get',
+ parameters:param,
+ onComplete:deleteItemComplete,
+ evalScripts:true
+ }
+ );
+ }
function deleteItemLoading(){
showBusy(surveyListTargetDiv);
}
function deleteItemComplete(){
hideBusy(surveyListTargetDiv);
}
+ function showBusy(targetDiv){
+ if($(targetDiv+"_Busy") != null){
+ Element.show(targetDiv+"_Busy");
+ }
+ }
+ function hideBusy(targetDiv){
+ if($(targetDiv+"_Busy") != null){
+ Element.hide(targetDiv+"_Busy");
+ }
+ }
+
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.6 -r1.7
--- lams_tool_survey/web/pages/authoring/parts/itemlist.jsp 28 Sep 2006 07:04:25 -0000 1.6
+++ lams_tool_survey/web/pages/authoring/parts/itemlist.jsp 6 Oct 2006 01:10:08 -0000 1.7
@@ -28,13 +28,33 @@
+
+
+
+ ">
+
+ |
+
+ |
+
+
+
+
+ |
+
+
+
+ ">
+
+ |
+
-
+
|
-
+
|