Index: lams_central/conf/language/lams/ApplicationResources.properties =================================================================== diff -u -r3545f552a808e2338350fee3467ed6a53a1fc67f -rd0031eadc1ee66ed82eade3ffa5c039016d999eb --- lams_central/conf/language/lams/ApplicationResources.properties (.../ApplicationResources.properties) (revision 3545f552a808e2338350fee3467ed6a53a1fc67f) +++ lams_central/conf/language/lams/ApplicationResources.properties (.../ApplicationResources.properties) (revision d0031eadc1ee66ed82eade3ffa5c039016d999eb) @@ -838,10 +838,11 @@ authoring.learning.design.templates =Learning Design Templates authoring.template.successful =Your design has been saved as {0}. authoring.label.sequence.title =Name -authoring.error.question.num =Question {0} may not be blank -authoring.error.question.correct.num =One of the answers for Question {0} needs to be correct. +authoring.error.question.num =RAT Questions: Question {0} may not be blank +authoring.error.question.correct.num =RAT Questions: One of the answers for Question {0} needs to be correct. authoring.description.application.exercise =Application Exercise (These question(s) will be shown during the analysis phase in the sequence.) authoring.label.grouping =Teams +authoring.label.group.name =Team_{0} authoring.label.grouping.learners.choice =Learner's Choice authoring.label.grouping.teachers.choice =Teacher's Choice authoring.label.grouping.random.allocation =Random Allocation @@ -858,7 +859,7 @@ authoring.create.essay.question =Add Essay Question authoring.create.mc.question =Add Multiple Choice Question authoring.label.application.exercise.num =Application Exercise {0} -authoring.error.application.exercise.num =Application Exercise {0} may not be blank. +authoring.error.application.exercise.num =Application Exercises: Application Exercise {0} may not be blank. authoring.label.question.num =Question {0} authoring.label.option.num =Option {0} authoring.error.option =Option may not be blank @@ -868,13 +869,13 @@ button.previous =Previous button.return.to.template.list =Back to Templates authoring.error.content.id =Content ID is missing -authoring.error.question.must.have.answer.num =Question {0} must have at least one answer. -authoring.error.application.exercise.question.must.not.be.blank.num =Application Exercise {0} Question {1} may not be blank. -authoring.error.application.exercise.must.have.answer.num =Application Exercise {0} Question {1} must have at least one answer. -authoring.error.application.exercise.must.have.100.percent =Application Exercise {0} Question {1} must have at least one answer worth 100%. -authoring.error.application.exercise.not.blank.and.grade =Application Exercise {0} Question {1} may not be blank and must have a grade. -authoring.error.application.exercise.needs.noticeboard.text =Application Exercise {0} is missing the text for the noticeboard. -authoring.error.rat.not.blank=RAT Questions must have at least one question. +authoring.error.question.must.have.answer.num =RAT Questions: Question {0} must have at least one answer. +authoring.error.application.exercise.question.must.not.be.blank.num =Application Exercises: {0} Question {1} may not be blank. +authoring.error.application.exercise.must.have.answer.num =Application Exercises: {0} Question {1} must have at least one answer. +authoring.error.application.exercise.must.have.100.percent =Application Exercises: {0} Question {1} must have at least one answer worth 100%. +authoring.error.application.exercise.not.blank.and.grade =Application Exercises: {0} Question {1} may not be blank and must have a grade. +authoring.error.application.exercise.needs.noticeboard.text =Application Exercises: {0} is missing the text for the noticeboard. +authoring.error.rat.not.blank=RAT Questions: There must be at least one question. authoring.label.grade =Grade authoring.label.none =None authoring.tbl.template.title =Team Based Learning @@ -883,7 +884,8 @@ authoring.tbl.enable.confidence.tooltip =Asks students in the iRAT how confident they are with their choosen answer. Then the confidence level for each student is displayed in the tRAT to all members of their team. authoring.tbl.desc.ae =Adding Application Exercises (AEs). You can create multiple AEs if needed. authoring.template.basic.import.qti =Import IMS QTI -authoring.tbl.use.noticeboard=Add additional content after AE +authoring.tbl.use.noticeboard=Add Noticeboard after AE authoring.tbl.use.noticeboard.tooltip=After the AE, displays content to students as additional information or as a reflection on the AE topic -authoring.create.application.exercise=Add Application Exercise +authoring.create.application.exercise=Add New Application Exercise +label.marks=Marks #======= End labels: Exported 872 labels for en AU ===== Index: lams_central/conf/language/lams/ApplicationResources_en_AU.properties =================================================================== diff -u -r3545f552a808e2338350fee3467ed6a53a1fc67f -rd0031eadc1ee66ed82eade3ffa5c039016d999eb --- lams_central/conf/language/lams/ApplicationResources_en_AU.properties (.../ApplicationResources_en_AU.properties) (revision 3545f552a808e2338350fee3467ed6a53a1fc67f) +++ lams_central/conf/language/lams/ApplicationResources_en_AU.properties (.../ApplicationResources_en_AU.properties) (revision d0031eadc1ee66ed82eade3ffa5c039016d999eb) @@ -838,10 +838,11 @@ authoring.learning.design.templates =Learning Design Templates authoring.template.successful =Your design has been saved as {0}. authoring.label.sequence.title =Name -authoring.error.question.num =Question {0} may not be blank -authoring.error.question.correct.num =One of the answers for Question {0} needs to be correct. +authoring.error.question.num =RAT Questions: Question {0} may not be blank +authoring.error.question.correct.num =RAT Questions: One of the answers for Question {0} needs to be correct. authoring.description.application.exercise =Application Exercise (These question(s) will be shown during the analysis phase in the sequence.) authoring.label.grouping =Teams +authoring.label.group.name =Team_{0} authoring.label.grouping.learners.choice =Learner's Choice authoring.label.grouping.teachers.choice =Teacher's Choice authoring.label.grouping.random.allocation =Random Allocation @@ -858,7 +859,7 @@ authoring.create.essay.question =Add Essay Question authoring.create.mc.question =Add Multiple Choice Question authoring.label.application.exercise.num =Application Exercise {0} -authoring.error.application.exercise.num =Application Exercise {0} may not be blank. +authoring.error.application.exercise.num =Application Exercises: Application Exercise {0} may not be blank. authoring.label.question.num =Question {0} authoring.label.option.num =Option {0} authoring.error.option =Option may not be blank @@ -868,13 +869,14 @@ button.previous =Previous button.return.to.template.list =Back to Templates authoring.error.content.id =Content ID is missing -authoring.error.question.must.have.answer.num =Question {0} must have at least one answer. -authoring.error.application.exercise.question.must.not.be.blank.num =Application Exercise {0} Question {1} may not be blank. -authoring.error.application.exercise.must.have.answer.num =Application Exercise {0} Question {1} must have at least one answer. -authoring.error.application.exercise.must.have.100.percent =Application Exercise {0} Question {1} must have at least one answer worth 100%. -authoring.error.application.exercise.not.blank.and.grade =Application Exercise {0} Question {1} may not be blank and must have a grade. -authoring.error.application.exercise.needs.noticeboard.text =Application Exercise {0} is missing the text for the noticeboard. -authoring.error.rat.not.blank=RAT Questions must have at least one question. +authoring.error.question.must.have.answer.num =RAT Questions: Question {0} must have at least one answer. +authoring.error.application.exercise.question.must.not.be.blank.num =Application Exercises: {0} Question {1} may not be blank. +authoring.error.application.exercise.must.have.answer.num =Application Exercises: {0} Question {1} must have at least one answer. +authoring.error.application.exercise.must.have.100.percent =Application Exercises: {0} Question {1} must have at least one answer worth 100%. +authoring.error.application.exercise.not.blank.and.grade =Application Exercises: {0} Question {1} may not be blank and must have a grade. +authoring.error.application.exercise.needs.noticeboard.text =Application Exercises: {0} is missing the text for the noticeboard. +authoring.error.application.exercise.mark.one.or.more =Application Exercises: {0} Question {1} must have an integer mark worth 1 or more. +authoring.error.rat.not.blank=RAT Questions: There must be at least one question. authoring.label.grade =Grade authoring.label.none =None authoring.tbl.template.title =Team Based Learning @@ -883,7 +885,8 @@ authoring.tbl.enable.confidence.tooltip =Asks students in the iRAT how confident they are with their choosen answer. Then the confidence level for each student is displayed in the tRAT to all members of their team. authoring.tbl.desc.ae =Adding Application Exercises (AEs). You can create multiple AEs if needed. authoring.template.basic.import.qti =Import IMS QTI -authoring.tbl.use.noticeboard=Add additional content after AE +authoring.tbl.use.noticeboard=Add Noticeboard after AE authoring.tbl.use.noticeboard.tooltip=After the AE, displays content to students as additional information or as a reflection on the AE topic -authoring.create.application.exercise=Add Application Exercise +authoring.create.application.exercise=Add New Application Exercise +label.marks=Marks #======= End labels: Exported 872 labels for en AU ===== Index: lams_central/conf/language/lams/TBLResources.properties =================================================================== diff -u -r08a2133f0cddf6ef58bdd8bd6ea21c6d73cc354f -rd0031eadc1ee66ed82eade3ffa5c039016d999eb --- lams_central/conf/language/lams/TBLResources.properties (.../TBLResources.properties) (revision 08a2133f0cddf6ef58bdd8bd6ea21c6d73cc354f) +++ lams_central/conf/language/lams/TBLResources.properties (.../TBLResources.properties) (revision d0031eadc1ee66ed82eade3ffa5c039016d999eb) @@ -6,8 +6,8 @@ boilerplate.ira.title=IRA boilerplate.ira.instructions= boilerplate.leader.title=Leader Selection -boilerplate.leader.instructions=Instructions -boilerplate.tra.title=Scratchie / TRA +boilerplate.leader.instructions=Leader Selection +boilerplate.tra.title=TRA boilerplate.tra.instructions= boilerplate.ae.instructions= boilerplate.grouped.ae.noticeboard.num=Noticeboard {0} @@ -20,4 +20,5 @@ boilerplate.before.app.ex=AEGate {0} boilerplate.before.app.ex.noticeboard=AEGate Noticeboard {0} boilerplate.before.peer.review=Peer Review Gate -boilerplate.grouping.title=Group Setup +boilerplate.grouping.title=Team Setup +boilerplate.grouping.group.name=Team {0} Index: lams_central/src/java/org/lamsfoundation/lams/authoring/template/Assessment.java =================================================================== diff -u -r08a2133f0cddf6ef58bdd8bd6ea21c6d73cc354f -rd0031eadc1ee66ed82eade3ffa5c039016d999eb --- lams_central/src/java/org/lamsfoundation/lams/authoring/template/Assessment.java (.../Assessment.java) (revision 08a2133f0cddf6ef58bdd8bd6ea21c6d73cc354f) +++ lams_central/src/java/org/lamsfoundation/lams/authoring/template/Assessment.java (.../Assessment.java) (revision d0031eadc1ee66ed82eade3ffa5c039016d999eb) @@ -24,7 +24,6 @@ package org.lamsfoundation.lams.authoring.template; import java.text.MessageFormat; -import java.util.ArrayList; import java.util.LinkedList; import java.util.List; import java.util.ResourceBundle; @@ -52,6 +51,7 @@ String title = null; String questionText = null; Boolean required = false; + int defaultGrade = 1; List answers = null; // only used if type == 1 public void setType(short type) { @@ -97,6 +97,14 @@ this.title = title; } + public int getDefaultGrade() { + return defaultGrade; + } + + public void setDefaultGrade(int defaultGrade) { + this.defaultGrade = defaultGrade; + } + public List getAnswers() { return answers; } @@ -107,6 +115,7 @@ json.put(RestTags.QUESTION_TEXT, questionText != null ? questionText : ""); json.put(RestTags.DISPLAY_ORDER, displayOrder); json.put("answerRequired", required); + json.put("defaultGrade", defaultGrade); if (type == ASSESSMENT_QUESTION_TYPE_MULTIPLE_CHOICE) { json.put("type", ASSESSMENT_QUESTION_TYPE_MULTIPLE_CHOICE); ArrayNode answersJSON = JsonNodeFactory.instance.arrayNode(); @@ -120,25 +129,22 @@ return json; } - private List addError(List errorMessages, String errorMessage) { - if (errorMessages == null) { - errorMessages = new ArrayList(); - } - errorMessages.add(errorMessage); - return errorMessages; - } - - /** If no errors exist, returns null */ - public List validate(ResourceBundle appBundle, MessageFormat formatter, Integer applicationExerciseNumber, String applicationExerciseTitle, Integer questionNumber) { - List errorMessages = null; + + public boolean validate(List errorMessages, ResourceBundle appBundle, MessageFormat formatter, + Integer applicationExerciseNumber, String applicationExerciseTitle, Integer questionNumber) { + boolean errorsExist = false; if (questionText == null || questionText.length() == 0) { - errorMessages = addError(errorMessages, TextUtil.getText(appBundle, formatter, - "authoring.error.application.exercise.question.must.not.be.blank.num", new Object[] { applicationExerciseTitle, title })); + errorMessages.add(TextUtil.getText(appBundle, formatter, + "authoring.error.application.exercise.question.must.not.be.blank.num", + new Object[] { applicationExerciseTitle, title })); + errorsExist = true; } if (type == ASSESSMENT_QUESTION_TYPE_MULTIPLE_CHOICE) { if (answers.size() == 0) { - errorMessages = addError(errorMessages, TextUtil.getText(appBundle, formatter, - "authoring.error.application.exercise.must.have.answer.num", new Object[] { applicationExerciseTitle, title })); + errorMessages.add(TextUtil.getText(appBundle, formatter, + "authoring.error.application.exercise.must.have.answer.num", + new Object[] { applicationExerciseTitle, "\""+ title +"\"" })); + errorsExist = true; } else { boolean found100percent = false; for (AssessMCAnswer answer : answers) { @@ -148,13 +154,13 @@ } } if (!found100percent) { - errorMessages = addError(errorMessages, - TextUtil.getText(appBundle, formatter, - "authoring.error.application.exercise.must.have.100.percent", - new Object[] { applicationExerciseTitle, title })); + errorMessages.add(TextUtil.getText(appBundle, formatter, + "authoring.error.application.exercise.must.have.100.percent", + new Object[] { applicationExerciseTitle, "\""+ title +"\""})); + errorsExist = true; } } } - return errorMessages; + return errorsExist; } } Index: lams_central/src/java/org/lamsfoundation/lams/authoring/template/SurveyQuestion.java =================================================================== diff -u -r7475d08afc280b5e2e5ddf04e8bf35e3166aaf80 -rd0031eadc1ee66ed82eade3ffa5c039016d999eb --- lams_central/src/java/org/lamsfoundation/lams/authoring/template/SurveyQuestion.java (.../SurveyQuestion.java) (revision 7475d08afc280b5e2e5ddf04e8bf35e3166aaf80) +++ lams_central/src/java/org/lamsfoundation/lams/authoring/template/SurveyQuestion.java (.../SurveyQuestion.java) (revision d0031eadc1ee66ed82eade3ffa5c039016d999eb) @@ -25,7 +25,6 @@ import java.io.IOException; import java.text.MessageFormat; -import java.util.ArrayList; import java.util.List; import java.util.Map; import java.util.ResourceBundle; @@ -83,21 +82,17 @@ .put("required", required).set(RestTags.ANSWERS, JsonUtil.readArray(answers.values())); } - /** If no errors exist, returns null */ - public List validate(ResourceBundle appBundle, MessageFormat formatter, Integer questionNumber) { - List errorMessages = null; + public boolean validate(List errorMessages, ResourceBundle appBundle, MessageFormat formatter, Integer questionNumber) { + boolean errorsExist = false; if (questionText == null || questionText.length() == 0) { - errorMessages = new ArrayList(); - errorMessages - .add(TextUtil.getText(appBundle, formatter, "error.question.num", new Object[] { questionNumber })); + errorMessages.add(TextUtil.getText(appBundle, formatter, "error.question.num", new Object[] { questionNumber })); + errorsExist = true; } if (answers.size() == 0) { - if (errorMessages == null) { - errorMessages = new ArrayList(); - } errorMessages.add(TextUtil.getText(appBundle, formatter, "error.question.must.have.answer.num", new Object[] { questionNumber })); + errorsExist = true; } - return errorMessages; + return errorsExist; } } Index: lams_central/src/java/org/lamsfoundation/lams/authoring/template/TemplateData.java =================================================================== diff -u -r7475d08afc280b5e2e5ddf04e8bf35e3166aaf80 -rd0031eadc1ee66ed82eade3ffa5c039016d999eb --- lams_central/src/java/org/lamsfoundation/lams/authoring/template/TemplateData.java (.../TemplateData.java) (revision 7475d08afc280b5e2e5ddf04e8bf35e3166aaf80) +++ lams_central/src/java/org/lamsfoundation/lams/authoring/template/TemplateData.java (.../TemplateData.java) (revision d0031eadc1ee66ed82eade3ffa5c039016d999eb) @@ -47,7 +47,7 @@ protected ResourceBundle msgBundle; protected ResourceBundle appBundle; protected MessageFormat formatter; - protected List errorMessages; + protected List errorMessages; // Errors to be returned. Other error lists may be used temporarily for sorting purposes public TemplateData(HttpServletRequest request, String templateCode) { // get a new message source & formatter each time we process a template so @@ -103,10 +103,24 @@ return null; } + /** Create an error message from the ApplicationResources file into a particular set of errors */ + protected void addValidationErrorMessage(String key, Object[] params, List errorList) { + errorList.add(params != null ? TextUtil.getText(appBundle, formatter, key, params) + : TextUtil.getText(appBundle, key)); + } + + /** + * Add all the errors in newErrors to the errorList + */ + protected void addValidationErrorMessages(List newErrors, List errorList) { + if (newErrors != null) { + errorList.addAll(newErrors); + } + } + /** Create an error message from the ApplicationResources file */ protected void addValidationErrorMessage(String key, Object[] params) { - errorMessages.add(params != null ? TextUtil.getText(appBundle, formatter, key, params) - : TextUtil.getText(appBundle, key)); + addValidationErrorMessage(key, params, errorMessages); } /** @@ -116,13 +130,7 @@ * may be null if there are no errors */ protected void addValidationErrorMessages(List newErrors) { - if (newErrors != null) { - if (errorMessages == null) { - errorMessages = newErrors; - } else { - errorMessages.addAll(newErrors); - } - } + addValidationErrorMessages(newErrors, errorMessages); } protected ArrayNode getForumTopics(HttpServletRequest request, Integer numTopics) { Index: lams_central/src/java/org/lamsfoundation/lams/authoring/template/web/LdTemplateController.java =================================================================== diff -u -r4ba498bb61566c7a8972ad1dcff80a76894114ef -rd0031eadc1ee66ed82eade3ffa5c039016d999eb --- lams_central/src/java/org/lamsfoundation/lams/authoring/template/web/LdTemplateController.java (.../LdTemplateController.java) (revision 4ba498bb61566c7a8972ad1dcff80a76894114ef) +++ lams_central/src/java/org/lamsfoundation/lams/authoring/template/web/LdTemplateController.java (.../LdTemplateController.java) (revision d0031eadc1ee66ed82eade3ffa5c039016d999eb) @@ -25,7 +25,9 @@ import java.io.File; import java.io.IOException; import java.io.UnsupportedEncodingException; +import java.text.DecimalFormat; import java.text.MessageFormat; +import java.text.NumberFormat; import java.util.LinkedList; import java.util.ResourceBundle; import java.util.Set; @@ -91,6 +93,9 @@ @Autowired WebApplicationContext applictionContext; + // Used to append the number to the group label - format as 2 digits so it sorts better. + NumberFormat groupNumberFormatter = new DecimalFormat("00"); + private static Logger log = Logger.getLogger(LdTemplateController.class); public static final int MAX_OPTION_COUNT = 6; public static final int MAX_FLOATING_ACTIVITY_OPTIONS = 6; // Hardcoded in the Flash client @@ -378,7 +383,7 @@ } /* ************************************** Non-Tool Activity methods ******************************************** */ - protected ObjectNode createGateActivity(AtomicInteger uiid, int order, Integer[] layoutCoords, String activityTitle) { + protected ObjectNode createGateActivity(AtomicInteger uiid, int order, Integer[] layoutCoords, String activityTitle, String activityDescription) { ObjectNode activityJSON = JsonNodeFactory.instance.objectNode(); Integer[] pos = layoutCoords; @@ -395,6 +400,8 @@ activityJSON.put(AuthoringJsonTags.XCOORD, pos[0]); activityJSON.put(AuthoringJsonTags.YCOORD, pos[1]); activityJSON.put(AuthoringJsonTags.ACTIVITY_TITLE, activityTitle != null ? activityTitle : "Gate"); + if ( activityDescription != null ) + activityJSON.put(AuthoringJsonTags.DESCRIPTION, activityDescription); activityJSON.put(AuthoringJsonTags.ACTIVITY_CATEGORY_ID, Activity.CATEGORY_SYSTEM); activityJSON.put(AuthoringJsonTags.ACTIVITY_TYPE_ID, Activity.PERMISSION_GATE_ACTIVITY_TYPE); activityJSON.put(AuthoringJsonTags.GATE_ACTIVITY_LEVEL_ID, GateActivity.LEARNER_GATE_LEVEL); @@ -403,9 +410,9 @@ } protected ObjectNode createScheduledGateActivity(AtomicInteger uiid, int order, Integer[] layoutCoords, - String activityTitle, Long startOffset) { + String activityTitle, String activityDescription, Long startOffset) { - ObjectNode activityJSON = createGateActivity(uiid, order, layoutCoords, activityTitle); + ObjectNode activityJSON = createGateActivity(uiid, order, layoutCoords, activityTitle, activityDescription); activityJSON.put(AuthoringJsonTags.ACTIVITY_TYPE_ID, Activity.SCHEDULE_GATE_ACTIVITY_TYPE); activityJSON.put(AuthoringJsonTags.GATE_START_OFFSET, startOffset); @@ -446,8 +453,8 @@ Integer useNumGroups = (numGroups != null && numGroups > 0) ? numGroups : 2; for (int orderId = 0, groupNum = 1; orderId < useNumGroups; orderId++, groupNum++) { ObjectNode group = JsonNodeFactory.instance.objectNode(); - group.put(AuthoringJsonTags.GROUP_NAME, - TextUtil.getText(appBundle, formatter, "label.course.groups.prefix", null) + groupNum); + group.put(AuthoringJsonTags.GROUP_NAME, TextUtil.getText(appBundle, formatter, + "authoring.label.group.name", new String[] { groupNumberFormatter.format(groupNum) })); group.put(AuthoringJsonTags.ORDER_ID, orderId); group.put(AuthoringJsonTags.GROUP_UIID, uiid.incrementAndGet()); groups.add(group); @@ -759,13 +766,17 @@ user); toolContentJSON.put(RestTags.USE_SELECT_LEADER_TOOL_OUTPUT, selectLeaderToolOutput); toolContentJSON.put("numbered", enableNumbering); + toolContentJSON.put("displaySummary", Boolean.TRUE); + toolContentJSON.put("allowDiscloseAnswers", Boolean.TRUE); toolContentJSON.set(RestTags.QUESTIONS, questions); ArrayNode references = JsonNodeFactory.instance.arrayNode(); for (int i = 0; i < questions.size(); i++) { - Integer questionDisplayOrder = ((ObjectNode) questions.get(i)).get(RestTags.DISPLAY_ORDER).asInt(); + ObjectNode question = (ObjectNode) questions.get(i); + Integer questionDisplayOrder = question.get(RestTags.DISPLAY_ORDER).asInt(); + Integer defaultGrade = question.get("defaultGrade").asInt(); references.add(JsonNodeFactory.instance.objectNode().put(RestTags.DISPLAY_ORDER, questionDisplayOrder) - .put("questionDisplayOrder", questionDisplayOrder)); + .put("questionDisplayOrder", questionDisplayOrder).put("defaultGrade", defaultGrade)); } toolContentJSON.set("references", references); Index: lams_central/src/java/org/lamsfoundation/lams/authoring/template/web/TBLTemplateController.java =================================================================== diff -u -r08a2133f0cddf6ef58bdd8bd6ea21c6d73cc354f -rd0031eadc1ee66ed82eade3ffa5c039016d999eb --- lams_central/src/java/org/lamsfoundation/lams/authoring/template/web/TBLTemplateController.java (.../TBLTemplateController.java) (revision 08a2133f0cddf6ef58bdd8bd6ea21c6d73cc354f) +++ lams_central/src/java/org/lamsfoundation/lams/authoring/template/web/TBLTemplateController.java (.../TBLTemplateController.java) (revision d0031eadc1ee66ed82eade3ffa5c039016d999eb) @@ -25,6 +25,7 @@ import java.text.DateFormat; import java.text.ParseException; import java.text.SimpleDateFormat; +import java.util.ArrayList; import java.util.Date; import java.util.Enumeration; import java.util.List; @@ -42,6 +43,7 @@ import org.lamsfoundation.lams.authoring.template.Assessment; import org.lamsfoundation.lams.authoring.template.PeerReviewCriteria; import org.lamsfoundation.lams.authoring.template.TemplateData; +import org.lamsfoundation.lams.authoring.template.TextUtil; import org.lamsfoundation.lams.rest.RestTags; import org.lamsfoundation.lams.usermanagement.dto.UserDTO; import org.lamsfoundation.lams.util.AuthoringJsonTags; @@ -139,10 +141,10 @@ activityTitle = data.getText("boilerplate.before.ira.gate"); if (data.useScheduledGates && data.iraStartOffset != null) { activities.add(createScheduledGateActivity(maxUIID, order++, calcGateOffset(currentActivityPosition), - activityTitle, data.iraStartOffset)); + activityTitle, null, data.iraStartOffset)); } else { activities.add( - createGateActivity(maxUIID, order++, calcGateOffset(currentActivityPosition), activityTitle)); + createGateActivity(maxUIID, order++, calcGateOffset(currentActivityPosition), activityTitle, activityTitle)); } // iRA Test - MCQ @@ -169,10 +171,10 @@ activityTitle = data.getText("boilerplate.before.tra.gate"); if (data.useScheduledGates && data.traStartOffset != null) { activities.add(createScheduledGateActivity(maxUIID, order++, calcGateOffset(currentActivityPosition), - activityTitle, data.traStartOffset)); + activityTitle, null, data.traStartOffset)); } else { activities.add(createGateActivity(maxUIID, order++, calcGateOffset(currentActivityPosition), - activityTitle)); + activityTitle, activityTitle)); } // tRA Test @@ -206,10 +208,10 @@ String gateTitleBeforeAppEx = data.getText("boilerplate.before.app.ex", new String[] {applicationExercise.title}); if (data.useScheduledGates && data.aeStartOffset != null) { activities.add(createScheduledGateActivity(maxUIID, order++, - calcGateOffset(currentActivityPosition), gateTitleBeforeAppEx, data.aeStartOffset)); + calcGateOffset(currentActivityPosition), gateTitleBeforeAppEx, null, data.aeStartOffset)); } else { activities.add(createGateActivity(maxUIID, order++, calcGateOffset(currentActivityPosition), - gateTitleBeforeAppEx)); + gateTitleBeforeAppEx, gateTitleBeforeAppEx)); } // Application Exercise @@ -222,7 +224,7 @@ assessmentNumber++; } Long aetoolContentId = createAssessmentToolContent(userDTO, applicationExerciseTitle, - data.getText("boilerplate.ae.instructions"), null, true, false, questionsJSONArray); + data.getText("boilerplate.ae.instructions"), null, true, true, questionsJSONArray); activities.add(createAssessmentActivity(maxUIID, order++, currentActivityPosition, aetoolContentId, data.contentFolderID, groupingUIID, null, null, applicationExerciseTitle)); @@ -233,8 +235,9 @@ if (!data.useScheduledGates) { currentActivityPosition = calcPositionNextRight(currentActivityPosition); + String gateTitle = data.getText("boilerplate.before.app.ex.noticeboard", new String[] {noticeboardCountAsString} ); activities.add(createGateActivity(maxUIID, order++, calcGateOffset(currentActivityPosition), - data.getText("boilerplate.before.app.ex.noticeboard", new String[] {noticeboardCountAsString} ))); + gateTitle, gateTitle)); } currentActivityPosition = calcPositionNextRight(currentActivityPosition); String notebookTitle = data.getText("boilerplate.grouped.ae.noticeboard.num", @@ -263,8 +266,9 @@ } if (criterias.size() > 0) { // Stop! - activities.add(createGateActivity(maxUIID, order++, calcGateOffset(currentActivityPosition), - data.getText("boilerplate.before.peer.review"))); + String gateTitle =data.getText("boilerplate.before.peer.review"); + activities.add(createGateActivity(maxUIID, order++, calcGateOffset(currentActivityPosition), gateTitle, + gateTitle)); currentActivityPosition = calcPositionNextRight(currentActivityPosition); String peerReviewTitle = data.getText("boilerplate.peerreview"); @@ -279,7 +283,7 @@ if (data.useReflection) { // Stop! - activities.add(createGateActivity(maxUIID, order++, calcGateOffset(currentActivityPosition), null)); + activities.add(createGateActivity(maxUIID, order++, calcGateOffset(currentActivityPosition), null, null)); // Individual Reflection currentActivityPosition = calcPositionNextRight(currentActivityPosition); @@ -319,6 +323,13 @@ * "correctOption" (Boolean). */ class TBLData extends TemplateData { + + /* The error messages are to be sorted by tab, so store them separately and join together */ + List lessonDetailsErrors = new ArrayList(); + List ratErrors = new ArrayList(); + List applicationExerciseErrors = new ArrayList(); + List peerReviewErrors = new ArrayList(); + /* Fields from form */ String contentFolderID; String sequenceTitle; @@ -355,14 +366,14 @@ TBLData(HttpServletRequest request) { super(request, templateCode); - // Debugging .....String name = (String) parameterNames.nextElement(); - for ( Map.Entry paramEntry : request.getParameterMap().entrySet() ) { - StringBuffer debugStr = new StringBuffer("Parameter name ").append(paramEntry.getKey()).append(" values "); - for ( String value : paramEntry.getValue() ) { - debugStr.append(value).append(", "); - } - log.debug(debugStr.toString()); - } +// // Debugging .....String name = (String) parameterNames.nextElement(); +// for ( Map.Entry paramEntry : request.getParameterMap().entrySet() ) { +// StringBuffer debugStr = new StringBuffer("Parameter name ").append(paramEntry.getKey()).append(" values "); +// for ( String value : paramEntry.getValue() ) { +// debugStr.append(value).append(", "); +// } +// log.debug(debugStr.toString()); +// } contentFolderID = getTrimmedString(request, "contentFolderID", false); @@ -442,7 +453,7 @@ confidenceLevelEnable = WebUtil.readBooleanParam(request, "confidenceLevelEnable", false); if (useIRATRA) { if ( testQuestions.size() == 0 ) { - addValidationErrorMessage("authoring.error.rat.not.blank", null); + addValidationErrorMessage("authoring.error.rat.not.blank", null, ratErrors); } updateCorrectAnswers(correctAnswers); } @@ -453,6 +464,10 @@ validate(); + errorMessages.addAll(lessonDetailsErrors); + errorMessages.addAll(ratErrors); + errorMessages.addAll(applicationExerciseErrors); + errorMessages.addAll(peerReviewErrors); } private Long getOffsetFromRequest(HttpServletRequest request, String radioButtonField, @@ -487,7 +502,7 @@ newAppex.noticeboardInstructions = getTrimmedString(request, appexDiv+"NBEntry", true); if ( newAppex.noticeboardInstructions == null ) addValidationErrorMessage( - "authoring.error.application.exercise.needs.noticeboard.text", new Object[] {"\"" + newAppex.title + "\""}); + "authoring.error.application.exercise.needs.noticeboard.text", new Object[] {"\"" + newAppex.title + "\""}, applicationExerciseErrors); } applicationExercises.put(i, newAppex); } @@ -502,12 +517,27 @@ .append(i).toString(); String questionText = getTrimmedString(request, assessmentPrefix, true); String questionTitle = getTrimmedString(request, assessmentPrefix + "title", true); + String markAsString = getTrimmedString(request, assessmentPrefix + "mark", false); Assessment assessment = new Assessment(); if (questionText != null) { assessment.setTitle(questionTitle); assessment.setQuestionText(questionText); assessment.setType(WebUtil.readStrParam(request, assessmentPrefix + "type")); assessment.setRequired(true); + + Integer mark = -1; + if ( markAsString != null ) { + try { + mark = Integer.parseInt(markAsString); + } catch (Exception e) { + } + } + if ( mark < 1 ) { + addValidationErrorMessage("authoring.error.application.exercise.mark.one.or.more", new String[] {"\"" + appexTitle + "\"", "\"" + questionTitle + "\""}, applicationExerciseErrors); + } else { + assessment.setDefaultGrade(mark); + } + if (assessment.getType() == Assessment.ASSESSMENT_QUESTION_TYPE_MULTIPLE_CHOICE) { String optionPrefix = new StringBuilder("divass").append(appexNumber).append("assmcq") .append(i).append("option").toString(); @@ -521,7 +551,7 @@ } catch (Exception e) { log.error("Error parsing " + grade + " for float", e); addValidationErrorMessage( - "authoring.error.application.exercise.not.blank.and.grade", new Object[] {"\"" + appexTitle + "\"", i}); + "authoring.error.application.exercise.not.blank.and.grade", new Object[] {"\"" + appexTitle + "\"", i}, applicationExerciseErrors); } } } @@ -533,7 +563,6 @@ } void processInputPeerReviewRequestField(String name, HttpServletRequest request) { - log.debug("process peer review " + name + " order " + name.substring(10)); int fieldIndex = name.indexOf("EnableComments"); if (fieldIndex > 0) { // peerreview1EnableComments Integer criteriaNumber = Integer.valueOf(name.substring(10, fieldIndex)); @@ -599,20 +628,20 @@ ObjectNode question = entry.getValue(); if (!question.has(RestTags.QUESTION_TEXT)) { Object param = question.has(RestTags.QUESTION_TITLE) ? question.get(RestTags.QUESTION_TITLE) : questionNumber; - addValidationErrorMessage("authoring.error.question.num", new Object[] { param }); + addValidationErrorMessage("authoring.error.question.num", new Object[] { param }, ratErrors); } Integer correctAnswerDisplay = correctAnswers.get(entry.getKey()); if (correctAnswerDisplay == null) { Object param = question.has(RestTags.QUESTION_TITLE) ? question.get(RestTags.QUESTION_TITLE): questionNumber; - addValidationErrorMessage("authoring.error.question.correct.num", new Object[] { param }); + addValidationErrorMessage("authoring.error.question.correct.num", new Object[] { param }, ratErrors); } else { ArrayNode answers = (ArrayNode) question.get(RestTags.ANSWERS); if (answers == null || answers.size() == 0) { Object param = question.has(RestTags.QUESTION_TITLE) ? question.get(RestTags.QUESTION_TITLE): questionNumber; addValidationErrorMessage("authoring.error.question.must.have.answer.num", - new Object[] { param }); + new Object[] { param }, ratErrors); } else { boolean correctAnswerFound = false; // may not exist as the user didn't put any text in! for (int i = 0; i < answers.size(); i++) { @@ -626,7 +655,7 @@ if (!correctAnswerFound) { Object param = question.has(RestTags.QUESTION_TITLE) ? question.get(RestTags.QUESTION_TITLE): questionNumber; addValidationErrorMessage("authoring.error.question.correct.num", - new Object[] { param }); + new Object[] { param }, ratErrors); } } } @@ -636,10 +665,12 @@ // do any additional validation not included in other checking void validate() { if (contentFolderID == null) { - addValidationErrorMessage("authoring.error.content.id", null); + addValidationErrorMessage("authoring.error.content.id", null, lessonDetailsErrors); } if (sequenceTitle == null || !ValidationUtil.isOrgNameValid(sequenceTitle)) { - addValidationErrorMessage("authoring.fla.title.validation.error", null); + lessonDetailsErrors.add(new StringBuilder(TextUtil.getText(appBundle, "authoring.section.lessondetails")) + .append(": ").append(TextUtil.getText(appBundle, "authoring.fla.title.validation.error")) + .toString()); } if (useApplicationExercises) { @@ -651,19 +682,17 @@ private void validateApplicationExercises() { if (applicationExercises.size() == 0) { - addValidationErrorMessage("authoring.error.application.exercise.num", new Integer[] { 1 }); + addValidationErrorMessage("authoring.error.application.exercise.num", new Integer[] { 1 }, applicationExerciseErrors); } else { for (Map.Entry appExEntry : applicationExercises.entrySet()) { AppExData appEx = appExEntry.getValue(); if (appEx.assessments == null || appEx.assessments.size() == 0) { addValidationErrorMessage("authoring.error.application.exercise.num", - new String[] { "\""+appEx.title +"\""}); + new String[] { "\""+appEx.title +"\""}, applicationExerciseErrors); } else { for (Map.Entry assessmentEntry : appEx.assessments.entrySet()) { - List errors = assessmentEntry.getValue().validate(appBundle, formatter, + assessmentEntry.getValue().validate(applicationExerciseErrors, appBundle, formatter, appExEntry.getKey(), "\""+appEx.title +"\"", assessmentEntry.getKey()); - if (errors != null) - errorMessages.addAll(errors); } } } Index: lams_central/web/authoring/template/groupingerrors.jsp =================================================================== diff -u -r7475d08afc280b5e2e5ddf04e8bf35e3166aaf80 -rd0031eadc1ee66ed82eade3ffa5c039016d999eb --- lams_central/web/authoring/template/groupingerrors.jsp (.../groupingerrors.jsp) (revision 7475d08afc280b5e2e5ddf04e8bf35e3166aaf80) +++ lams_central/web/authoring/template/groupingerrors.jsp (.../groupingerrors.jsp) (revision d0031eadc1ee66ed82eade3ffa5c039016d999eb) @@ -1,2 +1,2 @@ - numGroups:'', - numLearners:'' + numGroups:': ', + numLearners:': ' Index: lams_central/web/authoring/template/tbl/tbl.jsp =================================================================== diff -u -r3545f552a808e2338350fee3467ed6a53a1fc67f -rd0031eadc1ee66ed82eade3ffa5c039016d999eb --- lams_central/web/authoring/template/tbl/tbl.jsp (.../tbl.jsp) (revision 3545f552a808e2338350fee3467ed6a53a1fc67f) +++ lams_central/web/authoring/template/tbl/tbl.jsp (.../tbl.jsp) (revision d0031eadc1ee66ed82eade3ffa5c039016d999eb) @@ -42,8 +42,8 @@ }, messages: { sequenceTitle: { - required: '', - validateNoSpecialCharacters: '' + required: ': ', + validateNoSpecialCharacters: ': ' }, <%@ include file="../groupingerrors.jsp" %> }, @@ -56,7 +56,7 @@ }, }); - jQuery.validator.addMethod("validateNoSpecialCharacters", validateNoSpecialCharacters, ''); + jQuery.validator.addMethod("validateNoSpecialCharacters", validateNoSpecialCharacters, ': '); initializeWizard(validator); }); Index: lams_central/web/authoring/template/tool/assessmcq.jsp =================================================================== diff -u -r1c3d21d9fdee96b507a158f84564fafbef9a6ecb -rd0031eadc1ee66ed82eade3ffa5c039016d999eb --- lams_central/web/authoring/template/tool/assessmcq.jsp (.../assessmcq.jsp) (revision 1c3d21d9fdee96b507a158f84564fafbef9a6ecb) +++ lams_central/web/authoring/template/tool/assessmcq.jsp (.../assessmcq.jsp) (revision d0031eadc1ee66ed82eade3ffa5c039016d999eb) @@ -34,6 +34,9 @@ + + +
Index: lams_central/web/authoring/template/tool/assessment.jsp =================================================================== diff -u -r1c3d21d9fdee96b507a158f84564fafbef9a6ecb -rd0031eadc1ee66ed82eade3ffa5c039016d999eb --- lams_central/web/authoring/template/tool/assessment.jsp (.../assessment.jsp) (revision 1c3d21d9fdee96b507a158f84564fafbef9a6ecb) +++ lams_central/web/authoring/template/tool/assessment.jsp (.../assessment.jsp) (revision d0031eadc1ee66ed82eade3ffa5c039016d999eb) @@ -26,7 +26,11 @@
+ + + +
Index: lams_central/web/authoring/template/tool/mcquestion.jsp =================================================================== diff -u -r1c3d21d9fdee96b507a158f84564fafbef9a6ecb -rd0031eadc1ee66ed82eade3ffa5c039016d999eb --- lams_central/web/authoring/template/tool/mcquestion.jsp (.../mcquestion.jsp) (revision 1c3d21d9fdee96b507a158f84564fafbef9a6ecb) +++ lams_central/web/authoring/template/tool/mcquestion.jsp (.../mcquestion.jsp) (revision d0031eadc1ee66ed82eade3ffa5c039016d999eb) @@ -4,7 +4,7 @@ <%@ taglib uri="tags-function" prefix="fn" %> <%@ page import="org.lamsfoundation.lams.authoring.template.web.LdTemplateController"%> -<%-- Generic Q&A question page. Expects an input of questionNumber, contentFolderID, and creates a text field field question${questionNumber} and three options / as many as are need for a QTI import --%> +<%-- Generic MC question page. Expects an input of questionNumber, contentFolderID, and creates a text field field question${questionNumber} and three options / as many as are need for a QTI import --%> <%-- The title needs to look like an ordinary panel title, but be editable via the X-editable javascript. But that won't be returned to the server in the form data, so copy what appears in the displayed span to a hidden input field. --%> Index: lams_tool_assessment/src/java/org/lamsfoundation/lams/tool/assessment/service/AssessmentServiceImpl.java =================================================================== diff -u -r18ffef3eac77674c112b895ca5bb1963a399c340 -rd0031eadc1ee66ed82eade3ffa5c039016d999eb --- lams_tool_assessment/src/java/org/lamsfoundation/lams/tool/assessment/service/AssessmentServiceImpl.java (.../AssessmentServiceImpl.java) (revision 18ffef3eac77674c112b895ca5bb1963a399c340) +++ lams_tool_assessment/src/java/org/lamsfoundation/lams/tool/assessment/service/AssessmentServiceImpl.java (.../AssessmentServiceImpl.java) (revision d0031eadc1ee66ed82eade3ffa5c039016d999eb) @@ -60,8 +60,6 @@ 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.questions.Answer; -import org.lamsfoundation.lams.questions.Question; import org.lamsfoundation.lams.rest.RestTags; import org.lamsfoundation.lams.rest.ToolRestManager; import org.lamsfoundation.lams.tool.ToolCompletionStatus; @@ -3050,6 +3048,7 @@ JsonUtil.optBoolean(toolContentJSON, "allowOverallFeedbackAfterQuestion", Boolean.FALSE)); assessment .setAllowQuestionFeedback(JsonUtil.optBoolean(toolContentJSON, "allowQuestionFeedback", Boolean.FALSE)); + assessment.setAllowDiscloseAnswers(JsonUtil.optBoolean(toolContentJSON, "allowDiscloseAnswers", Boolean.FALSE)); assessment.setAllowRightAnswersAfterQuestion( JsonUtil.optBoolean(toolContentJSON, "allowRightAnswersAfterQuestion", Boolean.FALSE)); assessment.setAllowWrongAnswersAfterQuestion(