Index: lams_tool_survey/build.xml
===================================================================
diff -u -r5fa6d8af9d03be39b6f5f4c33b75a853af5f6064 -r0b9b61d67c2dcf6f83c513325afca117cb1967f2
--- lams_tool_survey/build.xml (.../build.xml) (revision 5fa6d8af9d03be39b6f5f4c33b75a853af5f6064)
+++ lams_tool_survey/build.xml (.../build.xml) (revision 0b9b61d67c2dcf6f83c513325afca117cb1967f2)
@@ -146,7 +146,7 @@
-
+
- Deploying the Share Surveys tool
+ Deploying the Survey tool
-
-
-
-
+
-
-
-
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
Fisheye: Tag 0b9b61d67c2dcf6f83c513325afca117cb1967f2 refers to a dead (removed) revision in file `lams_tool_survey/conf/xdoclet/struts-message-surveys.xml'.
Fisheye: No comparison available. Pass `N' to diff?
Index: lams_tool_survey/db/sql/activity_insert.sql
===================================================================
diff -u -r0020cbe23ed34775811ceab0779d065243444dcb -r0b9b61d67c2dcf6f83c513325afca117cb1967f2
--- lams_tool_survey/db/sql/activity_insert.sql (.../activity_insert.sql) (revision 0020cbe23ed34775811ceab0779d065243444dcb)
+++ lams_tool_survey/db/sql/activity_insert.sql (.../activity_insert.sql) (revision 0b9b61d67c2dcf6f83c513325afca117cb1967f2)
@@ -44,8 +44,8 @@
VALUES
(
NULL
-, 'Share Surveys'
-, 'Share Surveys'
+, 'Survey'
+, 'Survey'
, 'Put some help text here.'
, NULL
, NULL
@@ -78,5 +78,5 @@
, NULL
, NULL
, NULL
-, 'org.lamsfoundation.lams.tool.survey.ApplicationSurveys'
+, 'org.lamsfoundation.lams.tool.survey.ApplicationResources'
)
Index: lams_tool_survey/db/sql/create_lams_tool_survey.sql
===================================================================
diff -u -r5fa6d8af9d03be39b6f5f4c33b75a853af5f6064 -r0b9b61d67c2dcf6f83c513325afca117cb1967f2
--- lams_tool_survey/db/sql/create_lams_tool_survey.sql (.../create_lams_tool_survey.sql) (revision 5fa6d8af9d03be39b6f5f4c33b75a853af5f6064)
+++ lams_tool_survey/db/sql/create_lams_tool_survey.sql (.../create_lams_tool_survey.sql) (revision 0b9b61d67c2dcf6f83c513325afca117cb1967f2)
@@ -7,6 +7,28 @@
drop table if exists tl_lasurv11_survey;
drop table if exists tl_lasurv11_user;
+
+create table tl_lasurv11_survey (
+uid bigint not null auto_increment,
+title varchar(255),
+run_offline smallint,
+lock_on_finished smallint,
+instructions text,
+online_instructions text,
+offline_instructions text,
+content_in_use smallint,
+define_later smallint,
+content_id bigint unique,
+reflect_instructions varchar(255),
+reflect_on_activity smallint,
+show_questions_on_one_page smallint,
+create_date datetime,
+update_date datetime,
+create_by bigint,
+primary key (uid)
+);
+
+
create table tl_lasurv11_answer (
uid bigint not null auto_increment,
survey_item_uid bigint,
@@ -31,15 +53,15 @@
create table tl_lasurv11_option (
uid bigint not null auto_increment,
-description varchar(255),
+description text,
sequence_id integer,
answer_uid bigint,
primary key (uid)
);
create table tl_lasurv11_question (
uid bigint not null auto_increment,
-description varchar(255),
+description text,
create_by bigint,
create_date datetime,
question_type smallint,
@@ -60,26 +82,6 @@
primary key (uid)
);
-create table tl_lasurv11_survey (
-uid bigint not null auto_increment,
-title varchar(255),
-run_offline smallint,
-lock_on_finished smallint,
-instructions text,
-online_instructions text,
-offline_instructions text,
-content_in_use smallint,
-define_later smallint,
-content_id bigint unique,
-reflect_instructions varchar(255),
-reflect_on_activity smallint,
-show_questions_on_one_page smallint,
-create_date datetime,
-update_date datetime,
-create_by bigint,
-primary key (uid)
-);
-
create table tl_lasurv11_user (
uid bigint not null auto_increment,
user_id bigint,
Index: lams_tool_survey/db/sql/table-schema.sql
===================================================================
diff -u -r5fa6d8af9d03be39b6f5f4c33b75a853af5f6064 -r0b9b61d67c2dcf6f83c513325afca117cb1967f2
--- lams_tool_survey/db/sql/table-schema.sql (.../table-schema.sql) (revision 5fa6d8af9d03be39b6f5f4c33b75a853af5f6064)
+++ lams_tool_survey/db/sql/table-schema.sql (.../table-schema.sql) (revision 0b9b61d67c2dcf6f83c513325afca117cb1967f2)
@@ -1,7 +1,7 @@
alter table tl_lasurv11_answer drop foreign key FK6DAAFE3BB1423DC1;
alter table tl_lasurv11_answer drop foreign key FK6DAAFE3BAE4CB69;
alter table tl_lasurv11_attachment drop foreign key FKD92A9120D14146E5;
-alter table tl_lasurv11_option drop foreign key FK85AB46F282152886;
+alter table tl_lasurv11_option drop foreign key FK85AB46F26966134F;
alter table tl_lasurv11_question drop foreign key FK872D4F23D14146E5;
alter table tl_lasurv11_question drop foreign key FK872D4F23E4C99A5F;
alter table tl_lasurv11_session drop foreign key FKF08793B9D14146E5;
@@ -17,15 +17,15 @@
drop table if exists tl_lasurv11_user;
create table tl_lasurv11_answer (uid bigint not null auto_increment, survey_item_uid bigint, user_uid bigint, session_id bigint, answer_choices varchar(255), udpate_date datetime, answer_text varchar(255), primary key (uid));
create table tl_lasurv11_attachment (uid bigint not null auto_increment, file_version_id bigint, file_type varchar(255), file_name varchar(255), file_uuid bigint, create_date datetime, survey_uid bigint, primary key (uid));
-create table tl_lasurv11_option (uid bigint not null auto_increment, description varchar(255), sequence_id integer, option_uid bigint, primary key (uid));
+create table tl_lasurv11_option (uid bigint not null auto_increment, description varchar(255), sequence_id integer, answer_uid bigint, primary key (uid));
create table tl_lasurv11_question (uid bigint not null auto_increment, description varchar(255), create_by bigint, create_date datetime, question_type smallint, append_text bit, compulsory bit, max_answers integer, survey_uid bigint, primary key (uid));
create table tl_lasurv11_session (uid bigint not null auto_increment, session_end_date datetime, session_start_date datetime, survey_uid bigint, session_id bigint, session_name varchar(250), primary key (uid));
create table tl_lasurv11_survey (uid bigint not null auto_increment, create_date datetime, update_date datetime, create_by bigint, title varchar(255), run_offline bit, lock_on_finished bit, instructions text, online_instructions text, offline_instructions text, content_in_use bit, define_later bit, content_id bigint unique, reflect_instructions varchar(255), reflect_on_activity bit, show_questions_on_one_page bit, primary key (uid));
create table tl_lasurv11_user (uid bigint not null auto_increment, user_id bigint, last_name varchar(255), first_name varchar(255), login_name varchar(255), session_uid bigint, survey_uid bigint, session_finished bit, primary key (uid));
alter table tl_lasurv11_answer add index FK6DAAFE3BB1423DC1 (user_uid), add constraint FK6DAAFE3BB1423DC1 foreign key (user_uid) references tl_lasurv11_user (uid);
alter table tl_lasurv11_answer add index FK6DAAFE3BAE4CB69 (survey_item_uid), add constraint FK6DAAFE3BAE4CB69 foreign key (survey_item_uid) references tl_lasurv11_question (uid);
alter table tl_lasurv11_attachment add index FKD92A9120D14146E5 (survey_uid), add constraint FKD92A9120D14146E5 foreign key (survey_uid) references tl_lasurv11_survey (uid);
-alter table tl_lasurv11_option add index FK85AB46F282152886 (option_uid), add constraint FK85AB46F282152886 foreign key (option_uid) references tl_lasurv11_question (uid);
+alter table tl_lasurv11_option add index FK85AB46F26966134F (answer_uid), add constraint FK85AB46F26966134F foreign key (answer_uid) references tl_lasurv11_question (uid);
alter table tl_lasurv11_question add index FK872D4F23D14146E5 (survey_uid), add constraint FK872D4F23D14146E5 foreign key (survey_uid) references tl_lasurv11_survey (uid);
alter table tl_lasurv11_question add index FK872D4F23E4C99A5F (create_by), add constraint FK872D4F23E4C99A5F foreign key (create_by) references tl_lasurv11_user (uid);
alter table tl_lasurv11_session add index FKF08793B9D14146E5 (survey_uid), add constraint FKF08793B9D14146E5 foreign key (survey_uid) references tl_lasurv11_survey (uid);
Index: lams_tool_survey/src/java/org/lamsfoundation/lams/tool/survey/SurveyConstants.java
===================================================================
diff -u -r5fa6d8af9d03be39b6f5f4c33b75a853af5f6064 -r0b9b61d67c2dcf6f83c513325afca117cb1967f2
--- lams_tool_survey/src/java/org/lamsfoundation/lams/tool/survey/SurveyConstants.java (.../SurveyConstants.java) (revision 5fa6d8af9d03be39b6f5f4c33b75a853af5f6064)
+++ lams_tool_survey/src/java/org/lamsfoundation/lams/tool/survey/SurveyConstants.java (.../SurveyConstants.java) (revision 0b9b61d67c2dcf6f83c513325afca117cb1967f2)
@@ -77,5 +77,8 @@
public static final String ATTR_FINISH_LOCK = "finishedLock";
public static final String ATTR_SURVEY = "survey";
public static final String ATTR_NEXT_ACTIVITY_URL = "nextActivityUrl";
+ public static final short SURVEY_TYPE_TEXT_ENTRY = 3;
+ public static final short SURVEY_TYPE_MULTIPLE_CHOICES = 2;
+ public static final short SURVEY_TYPE_SINGLE_CHOICE = 1;
}
Index: lams_tool_survey/src/java/org/lamsfoundation/lams/tool/survey/model/SurveyOption.hbm.xml
===================================================================
diff -u -r5fa6d8af9d03be39b6f5f4c33b75a853af5f6064 -r0b9b61d67c2dcf6f83c513325afca117cb1967f2
--- lams_tool_survey/src/java/org/lamsfoundation/lams/tool/survey/model/SurveyOption.hbm.xml (.../SurveyOption.hbm.xml) (revision 5fa6d8af9d03be39b6f5f4c33b75a853af5f6064)
+++ lams_tool_survey/src/java/org/lamsfoundation/lams/tool/survey/model/SurveyOption.hbm.xml (.../SurveyOption.hbm.xml) (revision 0b9b61d67c2dcf6f83c513325afca117cb1967f2)
@@ -27,7 +27,7 @@
options;
@@ -59,7 +59,7 @@
//***********************************************
//DTO fields:
- private boolean complete;
+ private String shortTitle;
public Object clone(){
SurveyQuestion obj = null;
@@ -105,7 +105,7 @@
}
/**
- * @hibernate.property column="description"
+ * @hibernate.property column="description" type="text"
* @return
*/
public String getDescription() {
@@ -192,10 +192,16 @@
* @hibernate.property column="max_answers"
* @return
*/
- public int getMaxAnswsers() {
- return maxAnswsers;
+ public int getMaxAnswers() {
+ return maxAnswers;
}
- public void setMaxAnswsers(int maxAnswsers) {
- this.maxAnswsers = maxAnswsers;
+ public void setMaxAnswers(int maxAnswers) {
+ this.maxAnswers = maxAnswers;
}
+ public String getShortTitle() {
+ return shortTitle;
+ }
+ public void setShortTitle(String shortTitle) {
+ this.shortTitle = shortTitle;
+ }
}
Index: lams_tool_survey/src/java/org/lamsfoundation/lams/tool/survey/service/SurveyServiceImpl.java
===================================================================
diff -u -r5fa6d8af9d03be39b6f5f4c33b75a853af5f6064 -r0b9b61d67c2dcf6f83c513325afca117cb1967f2
--- lams_tool_survey/src/java/org/lamsfoundation/lams/tool/survey/service/SurveyServiceImpl.java (.../SurveyServiceImpl.java) (revision 5fa6d8af9d03be39b6f5f4c33b75a853af5f6064)
+++ lams_tool_survey/src/java/org/lamsfoundation/lams/tool/survey/service/SurveyServiceImpl.java (.../SurveyServiceImpl.java) (revision 0b9b61d67c2dcf6f83c513325afca117cb1967f2)
@@ -637,7 +637,6 @@
+" as the tool content does not exist.");
}
- // TODO Share Surveys doesn't support reflection yet!
// toolContentObj.setReflectOnActivity(Boolean.TRUE);
// toolContentObj.setReflectInstructions(description);
}
Index: lams_tool_survey/src/java/org/lamsfoundation/lams/tool/survey/web/action/AuthoringAction.java
===================================================================
diff -u -r5fa6d8af9d03be39b6f5f4c33b75a853af5f6064 -r0b9b61d67c2dcf6f83c513325afca117cb1967f2
--- lams_tool_survey/src/java/org/lamsfoundation/lams/tool/survey/web/action/AuthoringAction.java (.../AuthoringAction.java) (revision 5fa6d8af9d03be39b6f5f4c33b75a853af5f6064)
+++ lams_tool_survey/src/java/org/lamsfoundation/lams/tool/survey/web/action/AuthoringAction.java (.../AuthoringAction.java) (revision 0b9b61d67c2dcf6f83c513325afca117cb1967f2)
@@ -61,16 +61,16 @@
import org.lamsfoundation.lams.tool.survey.SurveyConstants;
import org.lamsfoundation.lams.tool.survey.model.Survey;
import org.lamsfoundation.lams.tool.survey.model.SurveyAttachment;
-import org.lamsfoundation.lams.tool.survey.model.SurveyQuestion;
import org.lamsfoundation.lams.tool.survey.model.SurveyOption;
+import org.lamsfoundation.lams.tool.survey.model.SurveyQuestion;
import org.lamsfoundation.lams.tool.survey.model.SurveyUser;
import org.lamsfoundation.lams.tool.survey.service.ISurveyService;
import org.lamsfoundation.lams.tool.survey.service.SurveyApplicationException;
import org.lamsfoundation.lams.tool.survey.service.UploadSurveyFileException;
import org.lamsfoundation.lams.tool.survey.util.QuestionsComparator;
import org.lamsfoundation.lams.tool.survey.util.SurveyWebUtils;
-import org.lamsfoundation.lams.tool.survey.web.form.SurveyForm;
import org.lamsfoundation.lams.tool.survey.web.form.QuestionForm;
+import org.lamsfoundation.lams.tool.survey.web.form.SurveyForm;
import org.lamsfoundation.lams.usermanagement.dto.UserDTO;
import org.lamsfoundation.lams.util.WebUtil;
import org.lamsfoundation.lams.web.session.SessionManager;
@@ -88,7 +88,7 @@
private static final int INIT_INSTRUCTION_COUNT = 2;
private static final String INSTRUCTION_ITEM_DESC_PREFIX = "instructionItemDesc";
private static final String INSTRUCTION_ITEM_COUNT = "instructionCount";
- private static final String ITEM_TYPE = "itemType";
+ private static final int SHORT_TITLE_LENGTH = 60;
private static Logger log = Logger.getLogger(AuthoringAction.class);
@@ -238,7 +238,6 @@
String sessionMapID = WebUtil.readStrParam(request, SurveyConstants.ATTR_SESSION_MAP_ID);
((QuestionForm)form).setSessionMapID(sessionMapID);
- short type = (short) NumberUtils.stringToInt(request.getParameter(ITEM_TYPE));
List instructionList = new ArrayList(INIT_INSTRUCTION_COUNT);
for(int idx=0;idx instructionList.size()){
+ itemForm.getQuestion().setMaxAnswers(instructionList.size());
+ }
+ }
if(!errors.isEmpty()){
this.addErrors(request,errors);
-// request.setAttribute(SurveyConstants.ATTR_INSTRUCTION_LIST,instructionList);
- return mapping.findForward(SurveyConstants.SUCCESS);
+ request.setAttribute(SurveyConstants.ATTR_INSTRUCTION_LIST,instructionList);
+ return mapping.getInputForward();
}
try {
@@ -340,6 +346,7 @@
//init survey item list
SortedSet surveyItemList = getSurveyItemList(sessionMap);
surveyItemList.clear();
+ retriveQuestionListForDisplay(questions);
surveyItemList.addAll(questions);
sessionMap.put(SurveyConstants.ATTR_SURVEY_FORM, surveyForm);
@@ -759,19 +766,18 @@
* @param request
*/
private void populateItemToForm(int itemIdx, SurveyQuestion item, QuestionForm form, HttpServletRequest request) {
- form.setDescription(item.getDescription());
if(itemIdx >=0)
form.setItemIndex(new Integer(itemIdx).toString());
+ //set questions
+ form.setQuestion(item);
+
+ //set options
Set instructionList = item.getOptions();
List instructions = new ArrayList();
for(SurveyOption in : instructionList){
instructions.add(in.getDescription());
}
- //add extra blank line for instructions
- for(int idx=0;idx surveyList = getSurveyItemList(sessionMap);
int itemIdx = NumberUtils.stringToInt(itemForm.getItemIndex(),-1);
- SurveyQuestion item = null;
+ SurveyQuestion item = itemForm.getQuestion();
if(itemIdx == -1){ //add
- item = new SurveyQuestion();
item.setCreateDate(new Timestamp(new Date().getTime()));
surveyList.add(item);
}else{ //edit
List rList = new ArrayList(surveyList);
item = rList.get(itemIdx);
+ item.setDescription(itemForm.getQuestion().getDescription());
+ item.setCompulsory(itemForm.getQuestion().isCompulsory());
+ item.setAppendText(itemForm.getQuestion().isAppendText());
+ item.setMaxAnswers(itemForm.getQuestion().getMaxAnswers());
+
}
- short type = itemForm.getItemType();
- item.setType(itemForm.getItemType());
+ retriveQuestionForDisplay(item);
+ //set question type
+ int max = item.getMaxAnswers();
+ short type = SurveyConstants.SURVEY_TYPE_SINGLE_CHOICE;
+ if(instructionList == null || instructionList.size() == 0)
+ type = SurveyConstants.SURVEY_TYPE_TEXT_ENTRY;
+ else if( max > 1)
+ type = SurveyConstants.SURVEY_TYPE_MULTIPLE_CHOICES;
+ else if(max <= 1)
+ type = SurveyConstants.SURVEY_TYPE_SINGLE_CHOICE;
+ else
+ log.error("Unexpected survey question type for index : " + itemIdx);
+ item.setType(type);
//set instrcutions
Set instructions = new LinkedHashSet();
@@ -818,9 +839,20 @@
}
item.setOptions(instructions);
- item.setDescription(itemForm.getDescription());
+
}
+
+ private void retriveQuestionListForDisplay(List list) {
+ for(SurveyQuestion item: list){
+ retriveQuestionForDisplay(item);
+ }
+ }
+ private void retriveQuestionForDisplay(SurveyQuestion item) {
+ String desc = item.getDescription();
+ desc = desc.replaceAll("<(.|\n)*?>", "");
+ item.setShortTitle(StringUtils.abbreviate(desc,SHORT_TITLE_LENGTH));
+ }
/**
* Vaidate survey item regards to their type (url/file/learning object/website zip file)
@@ -829,7 +861,7 @@
*/
private ActionErrors validateSurveyItem(QuestionForm itemForm) {
ActionErrors errors = new ActionErrors();
- if(StringUtils.isBlank(itemForm.getDescription()))
+ if(StringUtils.isBlank(itemForm.getQuestion().getDescription()))
errors.add(ActionMessages.GLOBAL_MESSAGE,new ActionMessage(SurveyConstants.ERROR_MSG_DESC_BLANK));
return errors;
}
Index: lams_tool_survey/src/java/org/lamsfoundation/lams/tool/survey/web/form/QuestionForm.java
===================================================================
diff -u -r5fa6d8af9d03be39b6f5f4c33b75a853af5f6064 -r0b9b61d67c2dcf6f83c513325afca117cb1967f2
--- lams_tool_survey/src/java/org/lamsfoundation/lams/tool/survey/web/form/QuestionForm.java (.../QuestionForm.java) (revision 5fa6d8af9d03be39b6f5f4c33b75a853af5f6064)
+++ lams_tool_survey/src/java/org/lamsfoundation/lams/tool/survey/web/form/QuestionForm.java (.../QuestionForm.java) (revision 0b9b61d67c2dcf6f83c513325afca117cb1967f2)
@@ -23,7 +23,12 @@
/* $$Id$$ */
package org.lamsfoundation.lams.tool.survey.web.form;
+import javax.servlet.http.HttpServletRequest;
+
import org.apache.struts.action.ActionForm;
+import org.apache.struts.action.ActionMapping;
+import org.lamsfoundation.lams.tool.survey.model.Survey;
+import org.lamsfoundation.lams.tool.survey.model.SurveyQuestion;
/**
* Survey Item Form.
* @struts.form name="surveyItemForm"
@@ -38,27 +43,24 @@
//tool access mode;
private String mode;
- private short itemType;
- private String description;
+ private SurveyQuestion question;
- public String getDescription() {
- return description;
+ public QuestionForm(){
+ question = new SurveyQuestion();
}
- public void setDescription(String description) {
- this.description = description;
+ public void reset(ActionMapping mapping, HttpServletRequest request){
+ if(question != null){
+ question.setAppendText(false);
+ question.setCompulsory(false);
+ }
}
public String getItemIndex() {
return itemIndex;
}
public void setItemIndex(String itemIndex) {
this.itemIndex = itemIndex;
}
- public short getItemType() {
- return itemType;
- }
- public void setItemType(short type) {
- this.itemType = type;
- }
+
public String getSessionMapID() {
return sessionMapID;
}
@@ -71,4 +73,10 @@
public void setMode(String mode) {
this.mode = mode;
}
+ public SurveyQuestion getQuestion() {
+ return question;
+ }
+ public void setQuestion(SurveyQuestion question) {
+ this.question = question;
+ }
}
Index: lams_tool_survey/web/WEB-INF/web.xml
===================================================================
diff -u -rbb1c4dae67b80f4ed1f5a0d29acc29f0a2461eb1 -r0b9b61d67c2dcf6f83c513325afca117cb1967f2
--- lams_tool_survey/web/WEB-INF/web.xml (.../web.xml) (revision bb1c4dae67b80f4ed1f5a0d29acc29f0a2461eb1)
+++ lams_tool_survey/web/WEB-INF/web.xml (.../web.xml) (revision 0b9b61d67c2dcf6f83c513325afca117cb1967f2)
@@ -123,7 +123,7 @@
org.lamsfoundation.lams.contentrepository.client.ToolDownloadtoolContentHandlerBeanName
- surveyToolContentHandler
+ lasurvSurveyToolContentHandler3
Index: lams_tool_survey/web/includes/javascript/surveyitem.js
===================================================================
diff -u
--- lams_tool_survey/web/includes/javascript/surveyitem.js (revision 0)
+++ lams_tool_survey/web/includes/javascript/surveyitem.js (revision 0b9b61d67c2dcf6f83c513325afca117cb1967f2)
@@ -0,0 +1,142 @@
+ /*
+ This is Survey Item instrcution area.
+ */
+ var instructionTargetDiv = "instructionArea";
+ var itemAttachmentTargetDiv = "itemAttachmentArea";
+// Please set these 2 variables in JSP file for using tag reason:
+// var removeInstructionUrl = "";
+// var addInstructionUrl = "";
+ function removeInstruction(idx){
+ //var id = "instructionItem" + idx;
+ //Element.remove(id);
+ var url= removeInstructionUrl;
+ var reqIDVar = new Date();
+ var param = Form.serialize("instructionForm")+"&removeIdx="+idx+"&reqID="+reqIDVar.getTime();
+ removeInstructionLoading();
+ var myAjax = new Ajax.Updater(
+ instructionTargetDiv,
+ url,
+ {
+ method:'get',
+ parameters:param,
+ onComplete:removeInstructionComplete,
+ evalScripts:true
+ }
+ );
+ }
+
+ 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();
+ var param = Form.serialize("instructionForm")+"&reqID="+reqIDVar.getTime();
+ addInstructionLoading();
+ var myAjax = new Ajax.Updater(
+ instructionTargetDiv,
+ url,
+ {
+ method:'get',
+ parameters:param,
+ onComplete:addInstructionComplete,
+ evalScripts:true
+ }
+ );
+ }
+ function upItem(itemIdx){
+ if(itemIdx == 0)
+ return;
+ var currId = "instructionItemDesc" + itemIdx;
+ var repId = "instructionItemDesc" + (--itemIdx);
+ switchValue(currId,repId);
+ }
+ function downItem(itemIdx,maxSize){
+ if(itemIdx == (maxSize -1))
+ return;
+ var currId = "instructionItemDesc" + itemIdx;
+ var repId = "instructionItemDesc" + (++itemIdx);
+ switchValue(currId,repId);
+ }
+ function switchValue(currId,repId){
+ var temp = $(repId).value;
+ $(repId).value = $(currId).value;
+ $(currId).value= temp;
+ }
+ function removeInstructionLoading(){
+ showBusy(instructionTargetDiv);
+ }
+ function removeInstructionComplete(){
+ hideBusy(instructionTargetDiv);
+
+ changeMaxAnswerOptions(-1);
+ }
+
+ function addInstructionLoading(){
+ showBusy(instructionTargetDiv);
+ }
+ function addInstructionComplete(){
+ hideBusy(instructionTargetDiv);
+
+ changeMaxAnswerOptions(-1);
+ }
+ function showBusy(targetDiv){
+ if($(targetDiv+"_Busy") != null){
+ Element.show(targetDiv+"_Busy");
+ }
+ }
+ function hideBusy(targetDiv){
+ if($(targetDiv+"_Busy") != null){
+ Element.hide(targetDiv+"_Busy");
+ }
+ }
+
+ function submitSurveyItem(){
+ $("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();
+ }
Fisheye: Tag 0b9b61d67c2dcf6f83c513325afca117cb1967f2 refers to a dead (removed) revision in file `lams_tool_survey/web/includes/javascript/surveyresourceitem.js'.
Fisheye: No comparison available. Pass `N' to diff?
Index: lams_tool_survey/web/pages/authoring/advance.jsp
===================================================================
diff -u -r0020cbe23ed34775811ceab0779d065243444dcb -r0b9b61d67c2dcf6f83c513325afca117cb1967f2
--- lams_tool_survey/web/pages/authoring/advance.jsp (.../advance.jsp) (revision 0020cbe23ed34775811ceab0779d065243444dcb)
+++ lams_tool_survey/web/pages/authoring/advance.jsp (.../advance.jsp) (revision 0b9b61d67c2dcf6f83c513325afca117cb1967f2)
@@ -13,45 +13,12 @@
-
-
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
Index: lams_tool_survey/web/pages/authoring/authoring.jsp
===================================================================
diff -u -r0020cbe23ed34775811ceab0779d065243444dcb -r0b9b61d67c2dcf6f83c513325afca117cb1967f2
--- lams_tool_survey/web/pages/authoring/authoring.jsp (.../authoring.jsp) (revision 0020cbe23ed34775811ceab0779d065243444dcb)
+++ lams_tool_survey/web/pages/authoring/authoring.jsp (.../authoring.jsp) (revision 0b9b61d67c2dcf6f83c513325afca117cb1967f2)
@@ -43,10 +43,6 @@
tag.value = tabId;
// end optional tab controller stuff
selectTab(tabId);
-
- //for advanceTab
- if(tabId == 2)
- changeViewNum(-1);
}
function doUploadOnline() {
@@ -60,38 +56,6 @@
myForm.submit();
}
- function changeViewNum(initVal){
- var tb = document.getElementById("itemTable");
- var num = tb.getElementsByTagName("tr");
- var sel = document.getElementById("viewNumList");
- var newField = sel.options;
- var len = sel.length;
-
- //when first enter, it should get value from Survey
- 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);
- }
- }
@@ -152,9 +116,5 @@
-
-
Index: lams_tool_survey/web/pages/authoring/basic.jsp
===================================================================
diff -u -r0020cbe23ed34775811ceab0779d065243444dcb -r0b9b61d67c2dcf6f83c513325afca117cb1967f2
--- lams_tool_survey/web/pages/authoring/basic.jsp (.../basic.jsp) (revision 0020cbe23ed34775811ceab0779d065243444dcb)
+++ lams_tool_survey/web/pages/authoring/basic.jsp (.../basic.jsp) (revision 0b9b61d67c2dcf6f83c513325afca117cb1967f2)
@@ -7,7 +7,7 @@
* Launches the popup window for the instruction files
*/
function showMessage(url) {
- var area=document.getElementById("reourceInputArea");
+ var area=document.getElementById("questionInputArea");
if(area != null){
area.style.width="670px";
area.style.height="100%";
@@ -16,20 +16,14 @@
}
}
function hideMessage(){
- var area=document.getElementById("reourceInputArea");
+ var area=document.getElementById("questionInputArea");
if(area != null){
area.style.width="0px";
area.style.height="0px";
area.style.display="none";
}
}
- function previewItem(type,idx,sessionMapID){
- //1:url, 2:file, 3:website,4:learning object
- //This mode is special for unsaved author page. It is different with the author mode in preview
- var myUrl = ""+idx+"&sessionMapID="+sessionMapID;
- launchPopup(myUrl,"Review");
- }
function editItem(idx,sessionMapID){
var reqIDVar = new Date();
@@ -95,33 +89,18 @@