Index: lams_tool_survey/src/java/org/lamsfoundation/lams/tool/survey/web/action/LearningAction.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_survey/src/java/org/lamsfoundation/lams/tool/survey/web/action/LearningAction.java,v diff -u -r1.29.2.3 -r1.29.2.4 --- lams_tool_survey/src/java/org/lamsfoundation/lams/tool/survey/web/action/LearningAction.java 11 May 2016 07:37:31 -0000 1.29.2.3 +++ lams_tool_survey/src/java/org/lamsfoundation/lams/tool/survey/web/action/LearningAction.java 17 Feb 2017 12:49:10 -0000 1.29.2.4 @@ -358,12 +358,26 @@ HttpServletResponse response) { AnswerForm answerForm = (AnswerForm) form; Integer questionSeqID = answerForm.getQuestionSeqID(); - answerForm.setPosition(SurveyConstants.POSITION_ONLY_ONE); + String sessionMapID = answerForm.getSessionMapID(); SessionMap sessionMap = (SessionMap) request.getSession() .getAttribute(sessionMapID); SortedMap surveyItemMap = getQuestionList(sessionMap); + Collection surveyItemList = surveyItemMap.values(); + + if ( surveyItemList.size() < 2 || ( questionSeqID != null && questionSeqID > 0 ) ) { + answerForm.setPosition(SurveyConstants.POSITION_ONLY_ONE); + } else { + answerForm.setPosition(SurveyConstants.POSITION_FIRST); + } + if ( questionSeqID == null || questionSeqID <= 0 ) { + Boolean onePage = (Boolean) sessionMap.get(SurveyConstants.ATTR_SHOW_ON_ONE_PAGE); + if ( ! onePage && surveyItemList.size() > 0) { + answerForm.setQuestionSeqID(surveyItemMap.firstKey()); + } + } + // get current question index of total questions int currIdx = new ArrayList(surveyItemMap.keySet()).indexOf(questionSeqID) + 1; answerForm.setCurrentIdx(currIdx);