Index: lams_tool_survey/src/java/org/lamsfoundation/lams/tool/survey/web/action/LearningAction.java =================================================================== diff -u -r2f725f8ef2aa09a2663b2335bf67213074426d11 -r3a19040b0f3858baa666d23d70057b314a95c4a7 --- lams_tool_survey/src/java/org/lamsfoundation/lams/tool/survey/web/action/LearningAction.java (.../LearningAction.java) (revision 2f725f8ef2aa09a2663b2335bf67213074426d11) +++ lams_tool_survey/src/java/org/lamsfoundation/lams/tool/survey/web/action/LearningAction.java (.../LearningAction.java) (revision 3a19040b0f3858baa666d23d70057b314a95c4a7) @@ -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);