Index: lams_central/conf/language/lams/ApplicationResources_en_AU.properties =================================================================== diff -u -r394f403c289f0fd7808c228840bead5c4e7d5d32 -r5129d828c41c0731ee7889271cffde6421e2146c --- lams_central/conf/language/lams/ApplicationResources_en_AU.properties (.../ApplicationResources_en_AU.properties) (revision 394f403c289f0fd7808c228840bead5c4e7d5d32) +++ lams_central/conf/language/lams/ApplicationResources_en_AU.properties (.../ApplicationResources_en_AU.properties) (revision 5129d828c41c0731ee7889271cffde6421e2146c) @@ -910,4 +910,71 @@ msg.import.file.format =The import file must be .xml file exported from assessment tool and not exceed size of {0} error.import.file.format =The import file is not an .xml file. +error.form.validation.error =You have 1 error in a form. It has been highlighted +error.form.validation.errors =You have {0} errors in a form. They have been highlighted +label.authoring.choice.add.multiple.choice =Add multiple choice +label.authoring.choice.field.required =This field is required. +label.authoring.choice.enter.integer =Please enter an integer. +label.authoring.choice.enter.float =Please enter a floating point number. +label.authoring.choice.one.multiple.answers =One or multiple answers? +label.authoring.choice.one.answer =One answer only +label.authoring.choice.multiple.answers =Multiple answers allowed +label.authoring.choice.overall.feedback =Overall feedback +label.authoring.choice.feedback.on.correct =Feedback shown on any correct response +label.authoring.choice.feedback.on.partially.correct =Feedback shown on any partially correct response +label.authoring.choice.feedback.on.incorrect =Feedback shown on any incorrect response +label.authoring.choice.add.option =Add another answer +label.authoring.matching.pairs.matching.pairs =Matching pairs +label.authoring.matching.pairs.error.one.matching.pair =You should provide at least 1 matching pair. +label.authoring.matching.pairs.add.matching.pair =Add another +label.authoring.short.answer.no.case.unimportant =No, case is unimportant +label.authoring.short.answer.yes.case.must.match =Yes, case must match +label.authoring.short.answer.case.sensitivity =Case sensitivity +label.authoring.short.answer.add.answer =Add another answer +label.authoring.true.false.question =True/False question +label.authoring.true.false.correct.answer =Correct answer +label.authoring.true.false.feedback.on.true =Feedback for the response 'True'. +label.authoring.true.false.feedback.on.false =Feedback for the response 'False'. +label.authoring.numerical.question =Numerical question +label.authoring.numerical.units =Units +label.authoring.numerical.error.answer =You should provide at least one possible answer. +label.authoring.numerical.add.answer =Add another answer +label.authoring.numerical.add.unit =Add another unit +label.settings =Settings +label.enter.question.title =Question's title +label.enter.question.description =Question's description +label.authoring.answer.required =Answer required? +label.authoring.basic.default.question.grade =Default question grade +label.required.field =Required field +label.authoring.basic.allow.learners.rich.editor =Allow learners to use rich text editor +label.maximum.number.words =Maximum number of words +label.minimum.number.words =Minimum number of words +label.authoring.basic.general.feedback =General feedback +label.authoring.basic.shuffle.the.choices =Shuffle answers? +label.ask.for.hedging.justification =Ask for hedging justification? +label.authoring.basic.penalty.factor =Penalty factor +error.form.validation.hundred.score =One of the answers should have a grade of 100% so it is possible to get full marks for this question. +error.form.validation.positive.accepted.errors =All the accepted errors should be positive. +label.prefix.sequential.letters.for.each.answer =Prefix sequential letters for each answer +label.authoring.basic.option.question =Question +label.authoring.basic.option.grade =Grade +label.authoring.basic.option.feedback =Feedback +label.authoring.basic.option.accepted.error =Accepted error +label.authoring.basic.unit.unit =Unit +label.authoring.basic.unit.multiplier =Multiplier +label.authoring.true.false.false =False +label.authoring.true.false.true =True +label.authoring.basic.type.multiple.choice =Multiple choice +label.authoring.basic.type.matching.pairs =Matching pairs +label.authoring.basic.type.short.answer =Short answer +label.authoring.basic.type.numerical =Numerical +label.authoring.basic.type.true.false =True/False +label.authoring.basic.type.essay =Essay +label.authoring.basic.type.ordering =Ordering +label.authoring.basic.type.mark.hedging =Mark hedging +label.incorrect.answer.nullifies.mark =Assigns full mark only when the correct answers are selected. +label.authoring.basic.option.answer =Answer +label.authoring.basic.delete =Delete +label.authoring.basic.none =None + #======= End labels: Exported 872 labels for en AU ===== Index: lams_central/src/java/org/lamsfoundation/lams/web/qb/QbCollectionController.java =================================================================== diff -u -rce08b5834386d861110869e90237174b8969f3a0 -r5129d828c41c0731ee7889271cffde6421e2146c --- lams_central/src/java/org/lamsfoundation/lams/web/qb/QbCollectionController.java (.../QbCollectionController.java) (revision ce08b5834386d861110869e90237174b8969f3a0) +++ lams_central/src/java/org/lamsfoundation/lams/web/qb/QbCollectionController.java (.../QbCollectionController.java) (revision 5129d828c41c0731ee7889271cffde6421e2146c) @@ -185,7 +185,7 @@ @RequestMapping("/removeCollectionQuestion") @ResponseBody public void removeCollectionQuestion(@RequestParam long collectionUid, @RequestParam int qbQuestionId) { - qbService.removeQuestionFromCollectionByQuestionId(collectionUid, qbQuestionId); + qbService.removeQuestionFromCollectionByQuestionId(collectionUid, qbQuestionId, true); } @RequestMapping("/addCollectionQuestion") Index: lams_central/web/qb/collection.jsp =================================================================== diff -u -rce08b5834386d861110869e90237174b8969f3a0 -r5129d828c41c0731ee7889271cffde6421e2146c --- lams_central/web/qb/collection.jsp (.../collection.jsp) (revision ce08b5834386d861110869e90237174b8969f3a0) +++ lams_central/web/qb/collection.jsp (.../collection.jsp) (revision 5129d828c41c0731ee7889271cffde6421e2146c) @@ -256,7 +256,7 @@ + "\", \"_blank\")' title='Show stats'>"; cellhtml += "' href='?qbQuestionUid=" - + cellvalue + "&collectionUid=${collection.uid}&KeepThis=true&TB_iframe=true' class='thickbox'>"; + + cellvalue + "&collectionUid=${collection.uid}&KeepThis=true&TB_iframe=true&modal=true' class='thickbox'>"; cellhtml += ""; cellhtml += ""; @@ -394,7 +394,7 @@ function initLinkHref() { var questionType = document.getElementById("question-type").selectedIndex + 1; $("#create-question-href").attr("href", - "?questionType=" + questionType + "?questionType=" + questionType + "&collectionUid=${collection.uid}" + "&KeepThis=true&TB_iframe=true&modal=true"); }; Index: lams_central/web/qb/stats.jsp =================================================================== diff -u -r0f2b554d8e5dca78a8e936730490d03ecd0357ba -r5129d828c41c0731ee7889271cffde6421e2146c --- lams_central/web/qb/stats.jsp (.../stats.jsp) (revision 0f2b554d8e5dca78a8e936730490d03ecd0357ba) +++ lams_central/web/qb/stats.jsp (.../stats.jsp) (revision 5129d828c41c0731ee7889271cffde6421e2146c) @@ -136,7 +136,7 @@ Question
- + "> Index: lams_common/src/java/org/lamsfoundation/lams/qb/model/QbQuestion.java =================================================================== diff -u -rce08b5834386d861110869e90237174b8969f3a0 -r5129d828c41c0731ee7889271cffde6421e2146c --- lams_common/src/java/org/lamsfoundation/lams/qb/model/QbQuestion.java (.../QbQuestion.java) (revision ce08b5834386d861110869e90237174b8969f3a0) +++ lams_common/src/java/org/lamsfoundation/lams/qb/model/QbQuestion.java (.../QbQuestion.java) (revision 5129d828c41c0731ee7889271cffde6421e2146c) @@ -23,6 +23,7 @@ import org.apache.commons.lang.builder.HashCodeBuilder; import org.hibernate.annotations.Fetch; import org.hibernate.annotations.FetchMode; +import org.lamsfoundation.lams.qb.service.IQbService; import org.lamsfoundation.lams.outcome.Outcome; /** @@ -68,6 +69,9 @@ @Column(name = "create_date") private Date createDate = new Date(); + + @Column(name = "content_folder_id") + private String contentFolderId; // text of the question @Column @@ -145,13 +149,57 @@ @JoinTable(name = "lams_outcome_mapping", joinColumns = @JoinColumn(name = "qb_question_id", referencedColumnName = "question_id", updatable = false, insertable = false), inverseJoinColumns = @JoinColumn(name = "outcome_id")) private List outcomes = new ArrayList<>(); - // compares if current question data and the other one (probably modified with new data) are the same - // it detects if question is the same or should another question/version be created - public boolean isModified(QbQuestion modifiedQuestion) { - return !equals(modifiedQuestion); + // checks if important parts of another question are the same as current question's. + // And if not, determines whether another question/version be created. + public int isQbQuestionModified(QbQuestion oldQuestion) { + if (oldQuestion.getUid() == null) { + return IQbService.QUESTION_MODIFIED_ID_BUMP; + } + if (QbQuestion.TYPE_ESSAY == oldQuestion.getType() || QbQuestion.TYPE_MATCHING_PAIRS == oldQuestion.getType()) { + return IQbService.QUESTION_MODIFIED_NONE; + } + + boolean isModificationRequiresNewVersion = false; + // title or question is different - do nothing. Also question grade can't be changed + + //QbQuestion.TYPE_TRUE_FALSE + if (oldQuestion.getCorrectAnswer() != getCorrectAnswer()) { + isModificationRequiresNewVersion = true; + } + + // options are different + List oldOptions = oldQuestion.getQbOptions(); + List newOptions = getQbOptions(); + for (QbOption oldOption : oldOptions) { + for (QbOption newOption : newOptions) { + if (oldOption.getDisplayOrder() == newOption.getDisplayOrder()) { + + //ordering + if (((oldQuestion.getType() == QbQuestion.TYPE_ORDERING) + && (oldOption.getDisplayOrder() != newOption.getDisplayOrder())) + //short answer + || ((oldQuestion.getType() == QbQuestion.TYPE_SHORT_ANSWER) + && !StringUtils.equals(oldOption.getName(), newOption.getName())) + //numbering + || (oldOption.getNumericalOption() != newOption.getNumericalOption()) + || (oldOption.getAcceptedError() != newOption.getAcceptedError()) + //option grade + || (oldOption.getMaxMark() != newOption.getMaxMark()) + //changed correct option + || (oldOption.isCorrect() != newOption.isCorrect())) { + isModificationRequiresNewVersion = true; + } + } + } + } + if (oldOptions.size() != newOptions.size()) { + isModificationRequiresNewVersion = true; + } + + return isModificationRequiresNewVersion ? IQbService.QUESTION_MODIFIED_VERSION_BUMP + : IQbService.QUESTION_MODIFIED_NONE; } - // checks if important parts of another question are the same as current question's @Override public boolean equals(Object o) { QbQuestion other = (QbQuestion) o; @@ -240,7 +288,15 @@ public void setCreateDate(Date createDate) { this.createDate = createDate; } + + public String getContentFolderId() { + return contentFolderId; + } + public void setContentFolderId(String contentFolderId) { + this.contentFolderId = contentFolderId; + } + public String getName() { return name; } Index: lams_common/src/java/org/lamsfoundation/lams/qb/service/IQbService.java =================================================================== diff -u -r0f2b554d8e5dca78a8e936730490d03ecd0357ba -r5129d828c41c0731ee7889271cffde6421e2146c --- lams_common/src/java/org/lamsfoundation/lams/qb/service/IQbService.java (.../IQbService.java) (revision 0f2b554d8e5dca78a8e936730490d03ecd0357ba) +++ lams_common/src/java/org/lamsfoundation/lams/qb/service/IQbService.java (.../IQbService.java) (revision 5129d828c41c0731ee7889271cffde6421e2146c) @@ -107,7 +107,7 @@ boolean removeQuestionFromCollectionByUid(long collectionUid, long qbQuestionUid); - boolean removeQuestionFromCollectionByQuestionId(long collectionUid, int qbQuestionId); + boolean removeQuestionFromCollectionByQuestionId(long collectionUid, int qbQuestionId, boolean tryRemovingQuestion); Collection removeQuestionFromCollection(long collectionUid, Collection excludedQbQuestionIds); Index: lams_common/src/java/org/lamsfoundation/lams/qb/service/QbService.java =================================================================== diff -u -r0f2b554d8e5dca78a8e936730490d03ecd0357ba -r5129d828c41c0731ee7889271cffde6421e2146c --- lams_common/src/java/org/lamsfoundation/lams/qb/service/QbService.java (.../QbService.java) (revision 0f2b554d8e5dca78a8e936730490d03ecd0357ba) +++ lams_common/src/java/org/lamsfoundation/lams/qb/service/QbService.java (.../QbService.java) (revision 5129d828c41c0731ee7889271cffde6421e2146c) @@ -452,11 +452,12 @@ @Override public boolean removeQuestionFromCollectionByUid(long collectionUid, long qbQuestionUid) { QbQuestion question = getQuestionByUid(qbQuestionUid); - return removeQuestionFromCollectionByQuestionId(collectionUid, question.getQuestionId()); + return removeQuestionFromCollectionByQuestionId(collectionUid, question.getQuestionId(), true); } @Override - public boolean removeQuestionFromCollectionByQuestionId(long collectionUid, int qbQuestionId) { + public boolean removeQuestionFromCollectionByQuestionId(long collectionUid, int qbQuestionId, + boolean tryRemovingQuestion) { Collection collections = getQuestionCollectionsByQuestionId(qbQuestionId); int size = collections.size(); if (size <= 1) { @@ -473,7 +474,7 @@ Collection includedIds = qbDAO.getCollectionQuestionIdsExcluded(collectionUid, excludedQbQuestionIds); Collection retainedQuestionIds = new HashSet<>(); for (Integer questionId : includedIds) { - boolean deleted = removeQuestionFromCollectionByQuestionId(collectionUid, questionId); + boolean deleted = removeQuestionFromCollectionByQuestionId(collectionUid, questionId, true); if (!deleted) { retainedQuestionIds.add(questionId); } Index: lams_tool_assessment/conf/language/lams/ApplicationResources_en_AU.properties =================================================================== diff -u -r394f403c289f0fd7808c228840bead5c4e7d5d32 -r5129d828c41c0731ee7889271cffde6421e2146c --- lams_tool_assessment/conf/language/lams/ApplicationResources_en_AU.properties (.../ApplicationResources_en_AU.properties) (revision 394f403c289f0fd7808c228840bead5c4e7d5d32) +++ lams_tool_assessment/conf/language/lams/ApplicationResources_en_AU.properties (.../ApplicationResources_en_AU.properties) (revision 5129d828c41c0731ee7889271cffde6421e2146c) @@ -19,12 +19,7 @@ label.authoring.basic.title =Title label.authoring.basic.question.name =Question name label.authoring.basic.question.text =Question text -label.authoring.basic.default.question.grade =Default question grade -label.authoring.basic.penalty.factor =Penalty factor -label.authoring.basic.general.feedback =General feedback -label.authoring.basic.shuffle.the.choices =Shuffle answers? label.authoring.basic.add.question =Add question -label.authoring.basic.question.list.title =Question list label.authoring.basic.list.header.type =Type label.authoring.basic.list.header.question =Question label.authoring.basic.type.multiple.choice =Multiple choice @@ -39,51 +34,8 @@ label.authoring.basic.down =Move down label.authoring.basic.up =Move Up label.authoring.basic.option.answer =Answer -label.authoring.basic.option.question =Question -label.authoring.basic.option.grade =Grade -label.authoring.basic.option.feedback =Feedback -label.authoring.basic.option.accepted.error =Accepted error -label.authoring.basic.unit.unit =Unit -label.authoring.basic.unit.multiplier =Multiplier -label.authoring.basic.none =None -label.authoring.choice.add.multiple.choice =Add multiple choice -label.authoring.choice.field.required =This field is required. -label.authoring.choice.enter.integer =Please enter an integer. -label.authoring.choice.enter.float =Please enter a floating point number. -label.authoring.choice.one.multiple.answers =One or multiple answers? -label.authoring.choice.one.answer =One answer only -label.authoring.choice.multiple.answers =Multiple answers allowed -label.authoring.choice.overall.feedback =Overall feedback -label.authoring.choice.feedback.on.correct =For any correct response -label.authoring.choice.feedback.on.partially.correct =For any partially correct response -label.authoring.choice.feedback.on.incorrect =For any incorrect response -label.authoring.choice.add.option =Add another answer -label.authoring.matching.pairs.add.matching.pairs =Add question -label.authoring.matching.pairs.matching.pairs =Matching pairs -label.authoring.matching.pairs.error.one.matching.pair =You should provide at least 1 matching pair. -label.authoring.matching.pairs.add.matching.pair =Add another -label.authoring.short.answer.no.case.unimportant =No, case is unimportant -label.authoring.short.answer.yes.case.must.match =Yes, case must match -label.authoring.short.answer.case.sensitivity =Case sensitivity -label.authoring.short.answer.answers =Answers -label.authoring.short.answer.add.answer =Add another answer -label.authoring.short.answer.add.short.answer =Add question -label.authoring.true.false.question =True/False question -label.authoring.true.false.correct.answer =Correct answer label.authoring.true.false.false =False label.authoring.true.false.true =True -label.authoring.true.false.feedback.on.true =Feedback for the response 'True'. -label.authoring.true.false.feedback.on.false =Feedback for the response 'False'. -label.authoring.true.false.add.true.false =Add question -label.authoring.numerical.question =Numerical question -label.authoring.numerical.answers =Answers -label.authoring.numerical.units =Units -label.authoring.numerical.error.answer =You should provide at least one possible answer. -label.authoring.numerical.add.answer =Add another answer -label.authoring.numerical.add.numerical =Add question -label.authoring.numerical.add.unit =Add another unit -label.authoring.essay.add.essay =Add question -label.authoring.ordering.add.ordering =Add question label.authoring.advance.allow.students.overall.feedback =Display overall feedback at the end of each attempt label.authoring.advance.time.limit =Time limit (minutes) label.authoring.advance.questions.per.page =Questions per page @@ -179,10 +131,6 @@ output.desc.learner.time.taken =Time taken output.desc.learner.number.of.attempts =Number of attempts output.user.score.for.question =Score for the question: -error.form.validation.error =You have 1 error in a form. It has been highlighted -error.form.validation.errors =You have {0} errors in a form. They have been highlighted -error.form.validation.hundred.score =One of the answers should have a grade of 100% so it is possible to get full marks for this question. -error.form.validation.positive.accepted.errors =All the accepted errors should be positive. message.monitoring.summary.no.session =No learners yet label.cancel =Cancel define.later.message =Please wait for the instructor to complete the contents of this activity. @@ -211,7 +159,6 @@ label.export.summary.by.user =Summary by learner lable.export.summary.by.question =Summary by question label.export.user.id =Username -label.authoring.basic.allow.learners.rich.editor =Allow learners to use rich text editor label.authoring.advance.allow.students.right.answers =Indicate choice(s) that have been answered correctly. label.authoring.advance.allow.students.wrong.answers =Indicate choice(s) that have been answered incorrectly. monitor.summary.date.restriction =Deadline @@ -232,9 +179,7 @@ label.authoring.basic.question.bank.title =Question bank label.authoring.basic.list.header.mark =Mark label.authoring.basic.type.random.question =Random question -label.authoring.basic.select.random.question =Random question from pool label.authoring.basic.random.question =Question -label.authoring.basic.warning.too.many.questions =Too many questions in a list. Please, remove some of them. authoring.import.result =Import tool content result authoring.title.import =Import questions authoring.import.instruction =Please choose questions to import. @@ -245,7 +190,6 @@ label.authoring.basic.import.questions =Import label.authoring.basic.export.questions =Export label.authoring.advance.display.summary =Display all questions and answers once the learner finishes. -label.authoring.basic.import.qti =Import IMS QTI advanced.reflectOnActivity =Add a notebook at end of Assessment with the following instructions: monitor.summary.td.addNotebook =Add a notebook at end of Assessment monitor.summary.td.notebookInstructions =Notebook instructions @@ -261,12 +205,8 @@ label.group.leader =Group leader: {0} label.refresh =Refresh label.display.name.column =Display name column -label.authoring.answer.required =Answer required? warn.answers.required =Please, answer highlighted questions in order to continue. -label.authoring.basic.export.qti =Export IMS QTI label.monitoring.heading =Assessment Monitoring -label.maximum.number.words =Maximum number of words -label.minimum.number.words =Minimum number of words label.info.maximum.number.words =This answer must have a maximum of {0} words. label.info.minimum.number.words =This answer must have a minimum of {0} words. label.info.max.and.min.number.words =This answer must have a minimal of {0} and maximum of {1} words. @@ -285,7 +225,6 @@ label.question.options =Question options label.activity.completion =End of activity label.notifications =Notifications -label.ask.for.hedging.justification =Ask for hedging justification? label.number.learners.per.session =Number of learners per session label.tool.output =Tool Output output.desc.best.score =Best score @@ -337,12 +276,12 @@ label.disclose.groups.answers =Disclose groups' answers label.disclose.all.correct.answers =Disclose all correct answers label.disclose.all.groups.answers =Disclose all groups' answers -label.prefix.sequential.letters.for.each.answer =Prefix sequential letters for each answer label.edit.in.monitor.warning =Attention: while you edit this assessment students don't have access to it. You must save your changes so students can re-attempt this assessment again. outcome.authoring.title =Learning outcomes outcome.authoring.input =Search and select by outcome name or code outcome.authoring.existing =Added outcomes outcome.authoring.existing.none =none +label.do.you.want.to.delete.answer =Are you sure you want to delete? authoring.fla.branch.mapping.ordered.asc =Start with branches mapped to highest ordered answers warn.tool.output.change.none =This will delete all existing marks for this activity. Are you sure? output.desc.none =No score @@ -355,4 +294,9 @@ label.qb.discrimination.index =Discrimination index label.qb.point.biserial =Point biserial +message.qb.modified.update =The question in Question Bank will be updated +message.qb.modified.version =A new version of the question will be created in Question Bank +message.qb.modified.new =A new question will be created in Question Bank +label.import.from.question.bank =Import from question bank + #======= End labels: Exported 337 labels for en AU ===== Index: lams_tool_assessment/src/java/org/lamsfoundation/lams/tool/assessment/AssessmentConstants.java =================================================================== diff -u -r394f403c289f0fd7808c228840bead5c4e7d5d32 -r5129d828c41c0731ee7889271cffde6421e2146c --- lams_tool_assessment/src/java/org/lamsfoundation/lams/tool/assessment/AssessmentConstants.java (.../AssessmentConstants.java) (revision 394f403c289f0fd7808c228840bead5c4e7d5d32) +++ lams_tool_assessment/src/java/org/lamsfoundation/lams/tool/assessment/AssessmentConstants.java (.../AssessmentConstants.java) (revision 5129d828c41c0731ee7889271cffde6421e2146c) @@ -89,16 +89,14 @@ public static final String ATTR_CONFIDENCE_LEVEL_PREFIX = "confidenceLevel"; - public static final String ATTR_QUESTION_TYPE = "questionType"; - public static final String ATTR_QUESTION_LIST = "questionList"; + + public static final String ATTR_RANDOM_POOL_QUESTIONS = "randomPoolQuestions"; + + public static final String ATTR_DELETED_RANDOM_POOL_QUESTIONS = "deletedRandomPoolQuestions"; public static final String ATTR_QUESTION_REFERENCES = "questionReferences"; - public static final String ATTR_AVAILABLE_QUESTIONS = "availableQuestions"; - - public static final String ATTR_DELETED_QUESTION_LIST = "deleteAssessmentList"; - public static final String ATTR_DELETED_QUESTION_REFERENCES = "deleteQuestionReferences"; public static final String ATTR_UNIT_LIST = "unitList"; Index: lams_tool_assessment/src/java/org/lamsfoundation/lams/tool/assessment/service/AssessmentServiceImpl.java =================================================================== diff -u -r394f403c289f0fd7808c228840bead5c4e7d5d32 -r5129d828c41c0731ee7889271cffde6421e2146c --- lams_tool_assessment/src/java/org/lamsfoundation/lams/tool/assessment/service/AssessmentServiceImpl.java (.../AssessmentServiceImpl.java) (revision 394f403c289f0fd7808c228840bead5c4e7d5d32) +++ lams_tool_assessment/src/java/org/lamsfoundation/lams/tool/assessment/service/AssessmentServiceImpl.java (.../AssessmentServiceImpl.java) (revision 5129d828c41c0731ee7889271cffde6421e2146c) @@ -416,11 +416,14 @@ @Override public void saveOrUpdateAssessment(Assessment assessment) { - for (AssessmentQuestion question : assessment.getQuestions()) { - //update only in case QbQuestion was modified, to prevent updating the same QbQuestions received from SesssionMap - if (question.getQbQuestionModified() != IQbService.QUESTION_MODIFIED_NONE) { - assessmentQuestionDao.saveObject(question.getQbQuestion()); + for (QuestionReference reference : assessment.getQuestionReferences()) { + if (!reference.isRandomQuestion()) { + assessmentQuestionDao.saveObject(reference.getQuestion()); } + assessmentQuestionDao.saveObject(reference); + } + + for (AssessmentQuestion question : assessment.getQuestions()) { assessmentQuestionDao.saveObject(question); } @@ -3152,10 +3155,9 @@ ArrayNode references = JsonUtil.optArray(toolContentJSON, "references"); Set newReferenceSet = assessment.getQuestionReferences(); // the Assessment constructor will set up the - ;// collection + // collection for (JsonNode referenceJSONData : references) { QuestionReference reference = new QuestionReference(); - reference.setType((short) 0); reference.setMaxMark(JsonUtil.optInt(referenceJSONData, "maxMark", 1)); reference.setSequenceId(JsonUtil.optInt(referenceJSONData, RestTags.DISPLAY_ORDER)); AssessmentQuestion matchingQuestion = matchQuestion(newQuestionSet, @@ -3166,7 +3168,6 @@ } reference.setQuestion(matchingQuestion); reference.setRandomQuestion(JsonUtil.optBoolean(referenceJSONData, "randomQuestion", Boolean.FALSE)); - reference.setTitle(null); newReferenceSet.add(reference); } Index: lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/service/McService.java =================================================================== diff -u -r394f403c289f0fd7808c228840bead5c4e7d5d32 -r5129d828c41c0731ee7889271cffde6421e2146c --- lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/service/McService.java (.../McService.java) (revision 394f403c289f0fd7808c228840bead5c4e7d5d32) +++ lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/service/McService.java (.../McService.java) (revision 5129d828c41c0731ee7889271cffde6421e2146c) @@ -2068,7 +2068,7 @@ modifiedQuestion.setFeedback(questionDTO.getFeedback()); List optionDTOs = questionDTO.getOptionDtos(); - boolean isModified = baseLine.isModified(modifiedQuestion) + boolean isModified = !baseLine.equals(modifiedQuestion) || optionDTOs.size() != modifiedQuestion.getQbOptions().size(); if (isModified) { return IQbService.QUESTION_MODIFIED_VERSION_BUMP; @@ -2090,7 +2090,7 @@ } } // run check again, this time with modified options - return baseLine.isModified(modifiedQuestion) ? IQbService.QUESTION_MODIFIED_VERSION_BUMP + return !baseLine.equals(modifiedQuestion) ? IQbService.QUESTION_MODIFIED_VERSION_BUMP : IQbService.QUESTION_MODIFIED_NONE; }