Index: lams_central/conf/language/lams/ApplicationResources.properties =================================================================== diff -u -rc82d171dbdd8918839e396f2851d6e11b68bb9e8 -r24940cc694b5cab706055244b91904017b74ad54 --- lams_central/conf/language/lams/ApplicationResources.properties (.../ApplicationResources.properties) (revision c82d171dbdd8918839e396f2851d6e11b68bb9e8) +++ lams_central/conf/language/lams/ApplicationResources.properties (.../ApplicationResources.properties) (revision 24940cc694b5cab706055244b91904017b74ad54) @@ -321,7 +321,7 @@ label.tab.conditions.timelimit.individual = Is this time limit for each individual? label.tab.conditions.enable = Enable label.questions.file.title = Choose IMS QTI file -label.questions.file.missing = Please select a ZIP or XML file with questions in IMS QTIformat. +label.questions.file.missing = Please select an MS Word (.docx), ZIP or XML file with the questions to import. label.questions.choice.title = Choose questions label.questions.choice.select.all = Select all label.questions.choice.missing = Please check at least one question. @@ -978,7 +978,7 @@ label.qb.collection.private = Private collection label.qb.collection.remove = Remove collection label.qb.collection.xml = XML -label.qb.collection.qti = QTI +label.qb.collection.qti = IMS QTI label.qb.collection.questions.none = There are no questions in this collection label.qb.collection.share.title = Share collection with courses label.qb.collection.shared = Shared @@ -1054,9 +1054,10 @@ label.authoring.basic.none = None error.positive.grade.required = One of the answers should have a positive grade label.do.you.want.to.delete.answer = Do you want to delete this answer? -label.choose.word.document = Choose Word file -label.import.word = Import questions from Word document -label.qb.collection.word = Word +label.choose.word.document = Choose Microsoft Word file +label.import.word = Import questions from Microsoft Word document +# Microsoft Word +label.qb.collection.word = MS Word authoring.fla.page.prop.gate.type.password = Password authoring.fla.page.prop.password = Password label.question.bank = Question Bank @@ -1075,3 +1076,7 @@ label.authoring.feeback.partially.correct = Feedback on any partially correct response label.authoring.feeback.incorrect = Feedback on any incorrect response error.ld.zip.file = Only zip files allowed +# MS Word file template for importing questions into LAMS +label.download.word.template = Download Microsoft Word template +authoring.tbl.import.questions.from = Import questions from +button.save.new.version = Save as new version Index: lams_central/src/java/org/lamsfoundation/lams/web/qb/EditQbQuestionController.java =================================================================== diff -u -rc82d171dbdd8918839e396f2851d6e11b68bb9e8 -r24940cc694b5cab706055244b91904017b74ad54 --- lams_central/src/java/org/lamsfoundation/lams/web/qb/EditQbQuestionController.java (.../EditQbQuestionController.java) (revision c82d171dbdd8918839e396f2851d6e11b68bb9e8) +++ lams_central/src/java/org/lamsfoundation/lams/web/qb/EditQbQuestionController.java (.../EditQbQuestionController.java) (revision 24940cc694b5cab706055244b91904017b74ad54) @@ -172,7 +172,8 @@ */ @RequestMapping(path = "/saveOrUpdateQuestion", method = RequestMethod.POST) public String saveOrUpdateQuestion(@ModelAttribute("assessmentQuestionForm") QbQuestionForm form, - HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { + @RequestParam(name = "newVersion", required = false) boolean enforceNewVersion, HttpServletRequest request, + HttpServletResponse response) throws IOException, ServletException { //find according question QbQuestion qbQuestion = null; Long oldQuestionUid = null; @@ -192,6 +193,9 @@ } int questionModificationStatus = extractFormToQbQuestion(qbQuestion, form, request); + if (questionModificationStatus < IQbService.QUESTION_MODIFIED_VERSION_BUMP && enforceNewVersion) { + questionModificationStatus = IQbService.QUESTION_MODIFIED_VERSION_BUMP; + } switch (questionModificationStatus) { case IQbService.QUESTION_MODIFIED_VERSION_BUMP: { // new version of the old question gets created Index: lams_tool_assessment/conf/language/lams/ApplicationResources.properties =================================================================== diff -u -r864f2b803a021db179bce114a069ca7aadc54ce2 -r24940cc694b5cab706055244b91904017b74ad54 --- lams_tool_assessment/conf/language/lams/ApplicationResources.properties (.../ApplicationResources.properties) (revision 864f2b803a021db179bce114a069ca7aadc54ce2) +++ lams_tool_assessment/conf/language/lams/ApplicationResources.properties (.../ApplicationResources.properties) (revision 24940cc694b5cab706055244b91904017b74ad54) @@ -238,7 +238,7 @@ 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 +label.authoring.basic.import.qti = 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 @@ -413,12 +413,13 @@ message.disclose.groups.answers = Please confirm that you want to disclose the groups' answers for this question. Note that after you confirm this, this action cannot be reversed. Are you sure you want to do this? message.disclose.all.correct.answers = Please confirm that you want to disclose ALL the correct answers for ALL questions. Note that after you confirm this, this action cannot be reversed. Are you sure you want to do this? message.disclose.all.groups.answers = Please confirm that you want to disclose the answers of ALL groups for ALL the questions. Note that after you confirm this, this action cannot be reversed. Are you sure you want to do this? -# Button to show a teacher's view on Assessment results -label.monitoring.summary.results.view = Show results view label.monitoring.summary.completion = Completion label.monitoring.summary.completion.possible = Not started label.monitoring.summary.completion.started = In progress label.monitoring.summary.completion.completed = Completed label.monitoring.summary.answered.questions = Students Progress label.monitoring.summary.answered.questions.x.axis = Number of answered questions -label.monitoring.summary.answered.questions.y.axis = Students +label.monitoring.summary.answered.questions.y.axis.students = Students +label.authoring.basic.import.word = MS Word +label.monitoring.summary.answered.questions.y.axis.groups = Groups +label.monitoring.summary.answered.questions.groups = Groups Progress Index: lams_tool_assessment/src/java/org/lamsfoundation/lams/tool/assessment/service/AssessmentServiceImpl.java =================================================================== diff -u -rc82d171dbdd8918839e396f2851d6e11b68bb9e8 -r24940cc694b5cab706055244b91904017b74ad54 --- lams_tool_assessment/src/java/org/lamsfoundation/lams/tool/assessment/service/AssessmentServiceImpl.java (.../AssessmentServiceImpl.java) (revision c82d171dbdd8918839e396f2851d6e11b68bb9e8) +++ lams_tool_assessment/src/java/org/lamsfoundation/lams/tool/assessment/service/AssessmentServiceImpl.java (.../AssessmentServiceImpl.java) (revision 24940cc694b5cab706055244b91904017b74ad54) @@ -69,6 +69,9 @@ import org.lamsfoundation.lams.notebook.model.NotebookEntry; import org.lamsfoundation.lams.notebook.service.CoreNotebookConstants; import org.lamsfoundation.lams.notebook.service.ICoreNotebookService; +import org.lamsfoundation.lams.outcome.Outcome; +import org.lamsfoundation.lams.outcome.OutcomeMapping; +import org.lamsfoundation.lams.outcome.service.IOutcomeService; import org.lamsfoundation.lams.qb.model.QbCollection; import org.lamsfoundation.lams.qb.model.QbOption; import org.lamsfoundation.lams.qb.model.QbQuestion; @@ -183,6 +186,8 @@ private IQbService qbService; + private IOutcomeService outcomeService; + // ******************************************************************************* // Service method // ******************************************************************************* @@ -3372,6 +3377,10 @@ this.qbService = qbService; } + public void setOutcomeService(IOutcomeService outcomeService) { + this.outcomeService = outcomeService; + } + public AssessmentOutputFactory getAssessmentOutputFactory() { return assessmentOutputFactory; } @@ -3436,6 +3445,7 @@ * * @throws IOException */ + @SuppressWarnings("unchecked") @Override public void createRestToolContent(Integer userID, Long toolContentID, ObjectNode toolContentJSON) throws IOException { @@ -3634,6 +3644,28 @@ throw new IllegalArgumentException( "Implement other Question Bank modification levels in Assessment tool"); } + } else { + // only process learning outcomes when this is not a modification, i.e. it is a new question + ArrayNode learningOutcomesJSON = JsonUtil.optArray(questionJSONData, RestTags.LEARNING_OUTCOMES); + if (learningOutcomesJSON != null && learningOutcomesJSON.size() > 0) { + for (JsonNode learningOutcomeJSON : learningOutcomesJSON) { + String learningOutcomeText = learningOutcomeJSON.asText(); + learningOutcomeText = learningOutcomeText.strip(); + List learningOutcomes = userManagementService.findByProperty(Outcome.class, "name", + learningOutcomeText); + Outcome learningOutcome = null; + if (learningOutcomes.isEmpty()) { + learningOutcome = outcomeService.createOutcome(learningOutcomeText, userID); + } else { + learningOutcome = learningOutcomes.get(0); + } + + OutcomeMapping outcomeMapping = new OutcomeMapping(); + outcomeMapping.setOutcome(learningOutcome); + outcomeMapping.setQbQuestionId(qbQuestion.getQuestionId()); + userManagementService.save(outcomeMapping); + } + } } // Store it back into JSON so Scratchie can read it @@ -3649,7 +3681,7 @@ // all questions need to end up in user's private collection if (addToCollection) { - // qbService.addQuestionToCollection(collection.getUid(), qbQuestion.getQuestionId(), false); + qbService.addQuestionToCollection(collection.getUid(), qbQuestion.getQuestionId(), false); collectionUUIDs.add(uuid); } } Index: lams_tool_assessment/web/pages/authoring/basic.jsp =================================================================== diff -u -raee194cea3eb314bc67b143955bec5d730f0faa6 -r24940cc694b5cab706055244b91904017b74ad54 --- lams_tool_assessment/web/pages/authoring/basic.jsp (.../basic.jsp) (revision aee194cea3eb314bc67b143955bec5d730f0faa6) +++ lams_tool_assessment/web/pages/authoring/basic.jsp (.../basic.jsp) (revision 24940cc694b5cab706055244b91904017b74ad54) @@ -22,6 +22,31 @@ #add-question-div { margin-top: -5px; } + + .question-type-alert { + white-space: nowrap; + display: inline-block; + margin-top: 3px; + } + .newer-version-prompt { + text-align: left; + color: orange; + font-size: 1.3em; + } + .question-version-dropdown { + margin-top: -3px; + } + + .question-version-dropdown .dropdown-menu { + min-width: 160px; + } + + .question-version-dropdown li a { + display: inline-block; + } + .question-version-dropdown li.disabled a:first-child { + text-decoration: underline; + }