Index: lams_central/conf/language/lams/ApplicationResources.properties =================================================================== diff -u -rf0ff6bc30e8fa7e5d4201b7b9571194845ad3a83 -r6027dca0125bccd15dcdae16bc108177f85e7f73 --- lams_central/conf/language/lams/ApplicationResources.properties (.../ApplicationResources.properties) (revision f0ff6bc30e8fa7e5d4201b7b9571194845ad3a83) +++ lams_central/conf/language/lams/ApplicationResources.properties (.../ApplicationResources.properties) (revision 6027dca0125bccd15dcdae16bc108177f85e7f73) @@ -1084,10 +1084,8 @@ authoring.label.application.exercise.doku.gallery.walk.enabled = Gallery Walk authoring.label.application.exercise.doku.gallery.walk.enabled.tooltip = Use Gallery Walk to promote inter- and intra-teams discussion, higher order thinking, cooperative learning and team building. If enabled, after you start Gallery Walk in Monitoring, the document created for each team is shared to all other teams. Students in their teams then can give each others feedback and rate on their work. label.qb.advanced.search = Advanced search -label.qb.advanced.search.same.ld = Present in this learning design -label.qb.advanced.search.same.ld.tip = Show only questions which were already used in this sequence's activities. authoring.create.doku.question.tooltip = Present a case to the students and as team they will collaboratively create a document in response. -authoring.label.application.exercise.doku.gallery.walk.read.only.tooltip = Students will not be able to neither comment on nor rate other teams' work. +authoring.label.application.exercise.doku.gallery.walk.read.only.tooltip = Students will not be able to comment or rate other teams' work. authoring.label.application.exercise.doku.description = Description/Case authoring.label.application.exercise.doku.instructions = Document Base authoring.label.application.exercise.doku.instructions.tooltip = If you want the students to have a template document to guide them on their collaborative response, add your template here. @@ -1129,3 +1127,5 @@ label.vsa.deallocate.confirm = Are you sure you want to mark this answer as not correct? Students' scores will be recalculated. authoring.fla.remove.button.confirm = Are you sure you want to remove this item? authoring.fla.remove.button.tip = Remove this item +label.qb.advanced.search.same.ld = Present in this learning design +label.qb.advanced.search.same.ld.tip = Show only questions which were already used in this sequence's activities. Index: lams_central/src/java/org/lamsfoundation/lams/web/qb/EditQbQuestionController.java =================================================================== diff -u -rf0ff6bc30e8fa7e5d4201b7b9571194845ad3a83 -r6027dca0125bccd15dcdae16bc108177f85e7f73 --- lams_central/src/java/org/lamsfoundation/lams/web/qb/EditQbQuestionController.java (.../EditQbQuestionController.java) (revision f0ff6bc30e8fa7e5d4201b7b9571194845ad3a83) +++ lams_central/src/java/org/lamsfoundation/lams/web/qb/EditQbQuestionController.java (.../EditQbQuestionController.java) (revision 6027dca0125bccd15dcdae16bc108177f85e7f73) @@ -302,6 +302,27 @@ return "qb/authoring/unitlist"; } + /** + * Ajax call, will remove the given unit + */ + @RequestMapping("/removeUnit") + public String removeUnit(HttpServletRequest request, @RequestParam int unitToRemoveIndex) + throws ServletException, IOException { + Set unitList = qbService.getUnitsFromRequest(request, false); + Set newUnitList = new TreeSet<>(); + int displayOrder = 0; + for (QbQuestionUnit unit : unitList) { + if (unitToRemoveIndex != unit.getDisplayOrder()) { + unit.setDisplayOrder(displayOrder); + displayOrder++; + newUnitList.add(unit); + } + } + + request.setAttribute(QbConstants.ATTR_UNIT_LIST, newUnitList); + return "qb/authoring/unitlist"; + } + @RequestMapping(path = "/checkQuestionExistsInToolActivities") @ResponseBody public String checkQuestionExistsInToolActivities(@RequestParam(name = "toolContentIds[]") Set toolContentIds, Index: lams_common/src/java/org/lamsfoundation/lams/qb/model/QbQuestion.java =================================================================== diff -u -rf0ff6bc30e8fa7e5d4201b7b9571194845ad3a83 -r6027dca0125bccd15dcdae16bc108177f85e7f73 --- lams_common/src/java/org/lamsfoundation/lams/qb/model/QbQuestion.java (.../QbQuestion.java) (revision f0ff6bc30e8fa7e5d4201b7b9571194845ad3a83) +++ lams_common/src/java/org/lamsfoundation/lams/qb/model/QbQuestion.java (.../QbQuestion.java) (revision 6027dca0125bccd15dcdae16bc108177f85e7f73) @@ -165,7 +165,7 @@ @Cache(usage = CacheConcurrencyStrategy.TRANSACTIONAL) private List qbOptions = new ArrayList<>(); - @OneToMany(mappedBy = "qbQuestion", cascade = CascadeType.ALL, fetch = FetchType.EAGER) + @OneToMany(mappedBy = "qbQuestion", cascade = CascadeType.ALL, orphanRemoval = true, fetch = FetchType.EAGER) @Fetch(FetchMode.SELECT) @Cache(usage = CacheConcurrencyStrategy.TRANSACTIONAL) private List units = new ArrayList<>(); Index: lams_common/src/java/org/lamsfoundation/lams/qb/service/QbService.java =================================================================== diff -u -rf0ff6bc30e8fa7e5d4201b7b9571194845ad3a83 -r6027dca0125bccd15dcdae16bc108177f85e7f73 --- lams_common/src/java/org/lamsfoundation/lams/qb/service/QbService.java (.../QbService.java) (revision f0ff6bc30e8fa7e5d4201b7b9571194845ad3a83) +++ lams_common/src/java/org/lamsfoundation/lams/qb/service/QbService.java (.../QbService.java) (revision 6027dca0125bccd15dcdae16bc108177f85e7f73) @@ -996,13 +996,13 @@ // set units if (type == QbQuestion.TYPE_NUMERICAL) { Set unitList = getUnitsFromRequest(request, true); - List units = new ArrayList<>(); + qbQuestion.getUnits().clear(); int displayOrder = 0; for (QbQuestionUnit unit : unitList) { + unit.setQbQuestion(qbQuestion); unit.setDisplayOrder(displayOrder++); - units.add(unit); + qbQuestion.getUnits().add(unit); } - qbQuestion.setUnits(units); } return qbQuestion.isQbQuestionModified(oldQuestion); Index: lams_tool_scratchie/conf/language/lams/ApplicationResources.properties =================================================================== diff -u -rf0ff6bc30e8fa7e5d4201b7b9571194845ad3a83 -r6027dca0125bccd15dcdae16bc108177f85e7f73 --- lams_tool_scratchie/conf/language/lams/ApplicationResources.properties (.../ApplicationResources.properties) (revision f0ff6bc30e8fa7e5d4201b7b9571194845ad3a83) +++ lams_tool_scratchie/conf/language/lams/ApplicationResources.properties (.../ApplicationResources.properties) (revision 6027dca0125bccd15dcdae16bc108177f85e7f73) @@ -316,4 +316,4 @@ label.authoring.advanced.discussion = Enable discussion sentiment voting label.authoring.advanced.discussion.tooltip = When enabled, in TBL monitoring, teachers are able to start instant polls for each burning question to assess the students' understanding. label.vsa.allocate.button = Allocate VSAs -label.prevent.learner.autosave.mutliple.tabs = You seem to have two LAMS learner tabs open. Please close one of them. Otherwise, answers will not be recorder properly and affect your score. +label.prevent.learner.autosave.mutliple.tabs = You seem to have two LAMS tabs open for this exam. Please close one of them. Otherwise, answers will not be recorder properly and affect your score.