Index: lams_tool_scratchie/src/java/org/lamsfoundation/lams/tool/scratchie/dbupdates/patch20190510.sql =================================================================== diff -u --- lams_tool_scratchie/src/java/org/lamsfoundation/lams/tool/scratchie/dbupdates/patch20190510.sql (revision 0) +++ lams_tool_scratchie/src/java/org/lamsfoundation/lams/tool/scratchie/dbupdates/patch20190510.sql (revision 07be5ed62c56a16247f3d934413770f7774e5920) @@ -0,0 +1,17 @@ +-- Turn off autocommit, so nothing is committed if there is an error +SET AUTOCOMMIT = 0; +SET FOREIGN_KEY_CHECKS=0; +----------------------Put all sql statements below here------------------------- + +-- LDEV-4817 Delete existing blank burning questions +DELETE FROM tl_lascrt11_burning_question WHERE question IS NULL OR TRIM(question) = ''; + +----------------------Put all sql statements above here------------------------- + +-- If there were no errors, commit and restore autocommit to on +COMMIT; +SET AUTOCOMMIT = 1; +SET FOREIGN_KEY_CHECKS=1; + + + Index: lams_tool_scratchie/src/java/org/lamsfoundation/lams/tool/scratchie/web/controller/LearningController.java =================================================================== diff -u -rfba7287887f6dd83d3098100af6320cccf1f3e36 -r07be5ed62c56a16247f3d934413770f7774e5920 --- lams_tool_scratchie/src/java/org/lamsfoundation/lams/tool/scratchie/web/controller/LearningController.java (.../LearningController.java) (revision fba7287887f6dd83d3098100af6320cccf1f3e36) +++ lams_tool_scratchie/src/java/org/lamsfoundation/lams/tool/scratchie/web/controller/LearningController.java (.../LearningController.java) (revision 07be5ed62c56a16247f3d934413770f7774e5920) @@ -628,16 +628,20 @@ final String burningQuestion = request .getParameter(ScratchieConstants.ATTR_BURNING_QUESTION_PREFIX + itemUid); - // update question in sessionMap - item.setBurningQuestion(burningQuestion); + if (StringUtils.isNotBlank(burningQuestion)) { + // update question in sessionMap + item.setBurningQuestion(burningQuestion); - // update new entry - scratchieService.saveBurningQuestion(sessionId, itemUid, burningQuestion); + // update new entry + scratchieService.saveBurningQuestion(sessionId, itemUid, burningQuestion); + } } // handle general burning question final String generalQuestion = request.getParameter(ScratchieConstants.ATTR_GENERAL_BURNING_QUESTION); - scratchieService.saveBurningQuestion(sessionId, null, generalQuestion); + if (StringUtils.isNotBlank(generalQuestion)) { + scratchieService.saveBurningQuestion(sessionId, null, generalQuestion); + } // update general question in sessionMap sessionMap.put(ScratchieConstants.ATTR_GENERAL_BURNING_QUESTION, generalQuestion); }