Index: lams_tool_scratchie/src/java/org/lamsfoundation/lams/tool/scratchie/web/action/AuthoringAction.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_scratchie/src/java/org/lamsfoundation/lams/tool/scratchie/web/action/AuthoringAction.java,v diff -u -r1.18 -r1.19 --- lams_tool_scratchie/src/java/org/lamsfoundation/lams/tool/scratchie/web/action/AuthoringAction.java 6 May 2014 13:26:33 -0000 1.18 +++ lams_tool_scratchie/src/java/org/lamsfoundation/lams/tool/scratchie/web/action/AuthoringAction.java 4 Jun 2014 10:25:29 -0000 1.19 @@ -289,16 +289,18 @@ // **********************************Get Scratchie PO********************* Scratchie scratchiePO = service.getScratchieByContentId(scratchieForm.getScratchie().getContentId()); - Set oldItems = (scratchiePO == null) ? new HashSet() : scratchiePO - .getScratchieItems(); - //initialize oldItems' answers - for (ScratchieItem oldItem: oldItems) { - for (ScratchieAnswer answer : (Set)oldItem.getAnswers()) { - } - } + Set oldItems = null; //allow using old and modified questions and references altogether if (mode.isTeacher()) { + oldItems = (scratchiePO == null) ? new HashSet() : scratchiePO.getScratchieItems(); + + // initialize oldItems' answers + for (ScratchieItem oldItem : oldItems) { + for (ScratchieAnswer answer : (Set) oldItem.getAnswers()) { + } + } + service.releaseItemsFromCache(scratchiePO); } @@ -337,7 +339,7 @@ //recalculate results in case content is edited from monitoring List deletedItems = getDeletedItemList(sessionMap); - if (mode.isTeacher()) { + if (mode.isTeacher()) { service.recalculateUserAnswers(scratchiePO, oldItems, newItems, deletedItems); }