Index: lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/controller/AuthoringController.java =================================================================== diff -u -rf7937adfea85b6a6976eaa98df8c68db93f9f060 -r8a10262db418fe16a5ac30cb2123feddea6f162e --- lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/controller/AuthoringController.java (.../AuthoringController.java) (revision f7937adfea85b6a6976eaa98df8c68db93f9f060) +++ lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/controller/AuthoringController.java (.../AuthoringController.java) (revision 8a10262db418fe16a5ac30cb2123feddea6f162e) @@ -107,14 +107,13 @@ ToolAccessMode mode = WebUtil.readToolAccessModeAuthorDefaulted(request); return readDatabaseData(form, request, mode); } - + /** * Set the defineLater flag so that learners cannot use content while we are editing. This flag is released when * updateContent is called. */ @RequestMapping(path = "/definelater", method = RequestMethod.POST) - public String definelater(@ModelAttribute("authoringForm") QaAuthoringForm form, - HttpServletRequest request) { + public String definelater(@ModelAttribute("authoringForm") QaAuthoringForm form, HttpServletRequest request) { Long toolContentID = WebUtil.readLongParam(request, AttributeNames.PARAM_TOOL_CONTENT_ID); qaService.setDefineLater(toolContentID, true); @@ -317,7 +316,7 @@ @RequestParam String sessionMapID, @RequestParam Long qbQuestionUid) { SessionMap sessionMap = getSessionMap(form, request); SortedSet qaQuestions = getQuestions(sessionMap); - + //check whether this QB question is a duplicate for (QaQueContent qaQuestion : qaQuestions) { if (qbQuestionUid.equals(qaQuestion.getQbQuestion().getUid())) { @@ -342,7 +341,7 @@ return "authoring/itemlist"; } - + /** * Shows "This question has already been added" error message in a browser. */ @@ -439,11 +438,11 @@ //take care about question's collections. add to collection first Long oldCollectionUid = form.getOldCollectionUid(); Long newCollectionUid = form.getNewCollectionUid(); - if (isAddingQuestion || !newCollectionUid.equals(oldCollectionUid)) { + if (isAddingQuestion || (newCollectionUid != null && !newCollectionUid.equals(oldCollectionUid))) { qbService.addQuestionToCollection(newCollectionUid, updatedQuestion.getQuestionId(), false); } //remove from the old collection, if needed - if (!isAddingQuestion && !newCollectionUid.equals(oldCollectionUid)) { + if (!isAddingQuestion && newCollectionUid != null && !newCollectionUid.equals(oldCollectionUid)) { qbService.removeQuestionFromCollectionByQuestionId(oldCollectionUid, updatedQuestion.getQuestionId(), false); } Index: lams_tool_laqa/web/authoring/newQuestionBox.jsp =================================================================== diff -u -re6dc4db4137cfd6b07a4aa79711b9d12b39fb78e -r8a10262db418fe16a5ac30cb2123feddea6f162e --- lams_tool_laqa/web/authoring/newQuestionBox.jsp (.../newQuestionBox.jsp) (revision e6dc4db4137cfd6b07a4aa79711b9d12b39fb78e) +++ lams_tool_laqa/web/authoring/newQuestionBox.jsp (.../newQuestionBox.jsp) (revision 8a10262db418fe16a5ac30cb2123feddea6f162e) @@ -174,7 +174,8 @@