+
+
+
-
-
-
+
\ No newline at end of file
Index: lams_common/db/sql/create_lams_11_tables.sql
===================================================================
diff -u -r2b7ffc7c6e661a7f78d74a80a367b87d1f71e2fe -rcf258bae4dd72eab7a6f5bc895b96966caafaf06
--- lams_common/db/sql/create_lams_11_tables.sql (.../create_lams_11_tables.sql) (revision 2b7ffc7c6e661a7f78d74a80a367b87d1f71e2fe)
+++ lams_common/db/sql/create_lams_11_tables.sql (.../create_lams_11_tables.sql) (revision cf258bae4dd72eab7a6f5bc895b96966caafaf06)
@@ -974,7 +974,7 @@
`options_instructions` mediumtext COLLATE utf8mb4_unicode_ci,
`tool_id` bigint(20) DEFAULT NULL,
`tool_content_id` bigint(20) DEFAULT NULL,
- `activity_category_id` int(3) NOT NULL,
+ `activity_category_id` int(3),
`gate_activity_level_id` int(11) DEFAULT NULL,
`gate_open_flag` tinyint(1) DEFAULT NULL,
`gate_open_user` bigint(20) DEFAULT NULL,
Index: lams_common/src/java/org/lamsfoundation/lams/dbupdates/patch20200219_updateTo40.sql
===================================================================
diff -u -r2b7ffc7c6e661a7f78d74a80a367b87d1f71e2fe -rcf258bae4dd72eab7a6f5bc895b96966caafaf06
--- lams_common/src/java/org/lamsfoundation/lams/dbupdates/patch20200219_updateTo40.sql (.../patch20200219_updateTo40.sql) (revision 2b7ffc7c6e661a7f78d74a80a367b87d1f71e2fe)
+++ lams_common/src/java/org/lamsfoundation/lams/dbupdates/patch20200219_updateTo40.sql (.../patch20200219_updateTo40.sql) (revision cf258bae4dd72eab7a6f5bc895b96966caafaf06)
@@ -63,7 +63,7 @@
`type` TINYINT NOT NULL,
`question_id` INT NOT NULL,
`version` SMALLINT NOT NULL DEFAULT 1,
- `create_date` DATETIME NOT NULL DEFAULT NOW(),
+ `create_date` DATETIME,
`content_folder_id` char(36),
`name` TEXT,
`description` MEDIUMTEXT,
@@ -85,6 +85,7 @@
`min_words_limit` int(11) DEFAULT 0,
`hedging_justification_enabled` TINYINT(1) DEFAULT 0,
`tmp_question_id` BIGINT,
+ `owner_id` BIGINT,
PRIMARY KEY (uid),
INDEX (tmp_question_id),
CONSTRAINT UQ_question_version UNIQUE INDEX (question_id, version));
@@ -99,10 +100,11 @@
CREATE TABLE lams_qb_tool_question (`tool_question_uid` BIGINT AUTO_INCREMENT,
`qb_question_uid` BIGINT NOT NULL,
`tool_content_id` BIGINT NOT NULL,
- `display_order` TINYINT NOT NULL DEFAULT 1,
+ `display_order` TINYINT UNSIGNED NOT NULL DEFAULT 1,
PRIMARY KEY (tool_question_uid),
INDEX (tool_content_id),
CONSTRAINT FK_lams_qb_tool_question_1 FOREIGN KEY (qb_question_uid) REFERENCES lams_qb_question (uid) ON UPDATE CASCADE);
+
-- create Question Bank option
CREATE TABLE lams_qb_option (`uid` BIGINT AUTO_INCREMENT,
`qb_question_uid` BIGINT NOT NULL,
@@ -206,12 +208,22 @@
ON q.question_uid = mcq.uid
JOIN tl_lamc11_content AS c
ON mcq.mc_content_id = c.uid;
-
+
-- remove columns from MCQ which are duplicated in Question Bank
ALTER TABLE tl_lamc11_que_content DROP COLUMN question,
DROP COLUMN mark,
DROP COLUMN display_order,
DROP COLUMN feedback;
+
+-- add missing display order in options, if any
+UPDATE tl_lamc11_options_content AS c
+ JOIN (SELECT MIN(uid)-1 AS uid_shift, mc_que_content_id
+ FROM tl_lamc11_options_content
+ WHERE displayOrder IS NULL
+ GROUP BY mc_que_content_id) AS s
+ USING (mc_que_content_id)
+ SET c.displayOrder = c.uid - s.uid_shift
+ WHERE c.displayOrder IS NULL;
-- fill table with options matching unique QB questions inserted above
INSERT INTO lams_qb_option (qb_question_uid, display_order, name, max_mark)
@@ -583,7 +595,7 @@
TRIM(aq.description), IFNULL(aq.max_mark, 1), aq.feedback, aq.penalty_factor, aq.answer_required,
aq.multiple_answers_allowed, aq.incorrect_answer_nullifies_mark, aq.feedback_on_correct, aq.feedback_on_partially_correct,
aq.feedback_on_incorrect, aq.shuffle, aq.prefix_answers_with_letters, aq.case_sensitive, aq.correct_answer,
- aq.allow_rich_editor, aq.max_words_limit, aq.min_words_limit, aq.hedging_justification_enabled, q.target_uid
+ aq.allow_rich_editor, aq.max_words_limit, aq.min_words_limit, aq.hedging_justification_enabled, q.target_uid, NULL
FROM (SELECT uid,
title AS question,
question AS description,
@@ -612,7 +624,7 @@
ON aq.uid = q.target_uid
JOIN tl_laasse10_assessment AS assessment
ON aq.assessment_uid = assessment.uid;
-
+
-- set up references to QB question UIDs created above
INSERT INTO lams_qb_tool_question
SELECT q.question_uid, qb.uid, assess.content_id, aq.sequence_id
@@ -793,7 +805,7 @@
INSERT INTO lams_qb_question (uid, `type`, question_id, version, create_date,
name,
description, max_mark, feedback, answer_required, min_words_limit, tmp_question_id)
- SELECT NULL, 6, @question_id:=@question_id + 1, 1, IFNULL(c.creation_date, NOW()),
+ SELECT NULL, 6, @question_id:=@question_id + 1, 1, c.creation_date,
SUBSTRING(TRIM(REPLACE(REPLACE(strip_tags(qa.question, false) COLLATE utf8mb4_0900_ai_ci, ' ', ' '), '\t', '')), 1, 200),
qa.question, 1, qa.feedback, qa.answer_required, qa.min_words_limit, q.target_uid
FROM (SELECT uid,
@@ -852,8 +864,8 @@
-- clean up
ALTER TABLE tl_laqa11_usr_resp DROP COLUMN qa_que_content_id,
DROP COLUMN answer;
-
+
ALTER TABLE lams_qb_question DROP COLUMN tmp_question_id;
DROP TABLE tmp_question,
tmp_question_match,
@@ -867,7 +879,24 @@
INSERT INTO lams_sequence_generator(lams_qb_question_question_id) VALUES ((SELECT MAX(question_id) FROM lams_qb_question));
+-- find earlierst occurence of questions and fill create date and owner
+UPDATE lams_qb_question AS qb,
+ (SELECT qt.qb_question_uid,
+ d.user_id AS owner_id,
+ MIN(a.create_date_time) AS create_date
+ FROM lams_qb_tool_question AS qt JOIN
+ lams_learning_activity AS a USING (tool_content_id) JOIN
+ lams_learning_design AS d USING (learning_design_id)
+ GROUP BY qb_question_uid
+ ) AS s
+SET qb.create_date = s.create_date,
+ qb.owner_id = s.owner_id
+WHERE qb.uid = s.qb_question_uid;
+-- fill missing gaps
+UPDATE lams_qb_question
+ SET create_date = NOW()
+ WHERE create_date IS NULL;
-- LDEV-4827 Add configuration settings for Question Bank
INSERT INTO lams_configuration VALUES
@@ -904,12 +933,26 @@
CONSTRAINT FK_lams_qb_collection_share_2 FOREIGN KEY (organisation_id) REFERENCES lams_organisation (organisation_id)
ON DELETE CASCADE ON UPDATE CASCADE
);
-
+
+-- add questions to public collection
INSERT INTO lams_qb_collection VALUES (1, 'Public questions', NULL, false);
INSERT INTO lams_qb_collection_question
- SELECT 1, question_id FROM lams_qb_question;
+ SELECT 1, question_id FROM lams_qb_question
+ WHERE owner_id IS NULL;
+-- add questions to private collections
+INSERT INTO lams_qb_collection
+ SELECT NULL, 'My questions', owner_id, true
+ FROM (SELECT DISTINCT owner_id FROM lams_qb_question WHERE owner_id IS NOT NULL) AS qb;
+
+INSERT INTO lams_qb_collection_question
+ SELECT c.uid, qb.question_id
+ FROM lams_qb_question AS qb
+ JOIN lams_qb_collection AS c ON qb.owner_id = c.user_id
+ WHERE qb.owner_id IS NOT NULL;
+ALTER TABLE lams_qb_question DROP COLUMN owner_id;
+
INSERT INTO lams_configuration VALUES
('QbCollectionsTransferEnable', 'true', 'config.qb.collections.transfer.enable', 'config.header.qb', 'BOOLEAN', 1);
Index: lams_common/src/java/org/lamsfoundation/lams/learningdesign/service/ExportToolContentService.java
===================================================================
diff -u -r8bc318f44b193b1d926fcc62211ca1b4b18d9b30 -rcf258bae4dd72eab7a6f5bc895b96966caafaf06
--- lams_common/src/java/org/lamsfoundation/lams/learningdesign/service/ExportToolContentService.java (.../ExportToolContentService.java) (revision 8bc318f44b193b1d926fcc62211ca1b4b18d9b30)
+++ lams_common/src/java/org/lamsfoundation/lams/learningdesign/service/ExportToolContentService.java (.../ExportToolContentService.java) (revision cf258bae4dd72eab7a6f5bc895b96966caafaf06)
@@ -2005,7 +2005,6 @@
act.setGroupingSupportType(actDto.getGroupingSupportType());
act.setActivityUIID(actDto.getActivityUIID());
- act.setActivityCategoryID(actDto.getActivityCategoryID());
act.setActivityId(actDto.getActivityID());
act.setActivityTypeId(actDto.getActivityTypeID());
act.setApplyGrouping(actDto.getApplyGrouping());
Index: lams_common/src/java/org/lamsfoundation/lams/qb/dao/hibernate/QbDAO.java
===================================================================
diff -u -r8bc318f44b193b1d926fcc62211ca1b4b18d9b30 -rcf258bae4dd72eab7a6f5bc895b96966caafaf06
--- lams_common/src/java/org/lamsfoundation/lams/qb/dao/hibernate/QbDAO.java (.../QbDAO.java) (revision 8bc318f44b193b1d926fcc62211ca1b4b18d9b30)
+++ lams_common/src/java/org/lamsfoundation/lams/qb/dao/hibernate/QbDAO.java (.../QbDAO.java) (revision cf258bae4dd72eab7a6f5bc895b96966caafaf06)
@@ -22,8 +22,10 @@
public class QbDAO extends LAMSBaseDAO implements IQbDAO {
- private static final String FIND_MAX_QUESTION_ID = "SELECT MAX(lams_qb_question_question_id) FROM lams_sequence_generator";
+ private static final String FIND_MAX_QUESTION_ID = "SELECT IFNULL(MAX(question_id), 0) FROM lams_qb_question";
+ private static final String FIND_MAX_QUESTION_ID_FROM_GENERATOR = "SELECT IFNULL(MAX(lams_qb_question_question_id), 0) FROM lams_sequence_generator";
+
private static final String FIND_MAX_VERSION = "SELECT MAX(version) FROM QbQuestion AS q WHERE q.questionId = :questionId";
private static final String FIND_QUESTION_ACTIVITIES = "SELECT a FROM QbToolQuestion AS q, ToolActivity AS a JOIN a.learningDesign.lessons AS l "
@@ -142,13 +144,26 @@
@Override
public int generateNextQuestionId() {
- Integer max = (Integer) this.getSession().createNativeQuery(FIND_MAX_QUESTION_ID).uniqueResult();
+ int max = ((BigInteger) this.getSession().createNativeQuery(FIND_MAX_QUESTION_ID_FROM_GENERATOR).uniqueResult())
+ .intValue();
max++;
this.getSession().createNativeQuery(GENERATE_QUESTION_ID).setParameter("qbQuestionId", max).executeUpdate();
return max;
}
@Override
+ public void updateMaxQuestionId() {
+ int maxGenerator = ((BigInteger) this.getSession().createNativeQuery(FIND_MAX_QUESTION_ID_FROM_GENERATOR)
+ .uniqueResult()).intValue();
+ int maxTable = ((BigInteger) this.getSession().createNativeQuery(FIND_MAX_QUESTION_ID).uniqueResult())
+ .intValue();
+ if (maxGenerator < maxTable) {
+ this.getSession().createNativeQuery(GENERATE_QUESTION_ID).setParameter("qbQuestionId", maxTable)
+ .executeUpdate();
+ }
+ }
+
+ @Override
public int getMaxQuestionVersion(Integer qbQuestionId) {
Object result = this.getSession().createQuery(FIND_MAX_VERSION).setParameter("questionId", qbQuestionId)
.uniqueResult();
Index: lams_gradebook/src/java/org/lamsfoundation/lams/gradebook/service/GradebookService.java
===================================================================
diff -u -r8df2f2fd1327e415d338658a64cb110cfdd21872 -rcf258bae4dd72eab7a6f5bc895b96966caafaf06
--- lams_gradebook/src/java/org/lamsfoundation/lams/gradebook/service/GradebookService.java (.../GradebookService.java) (revision 8df2f2fd1327e415d338658a64cb110cfdd21872)
+++ lams_gradebook/src/java/org/lamsfoundation/lams/gradebook/service/GradebookService.java (.../GradebookService.java) (revision cf258bae4dd72eab7a6f5bc895b96966caafaf06)
@@ -770,39 +770,39 @@
/*
* TODO Method is not in use. Remove it?
- *
+ *
* private void updateUserActivityGradebookMark(Lesson lesson, Activity activity, User learner) {
* ToolSession toolSession = toolService.getToolSessionByLearner(learner, activity);
- *
+ *
* if ((toolSession == null) || (toolSession == null) || (learner == null) || (lesson == null)
* || (activity == null) || !(activity instanceof ToolActivity)
* || (((ToolActivity) activity).getEvaluation() == null)) {
* return;
* }
* ToolActivity toolActivity = (ToolActivity) activity;
- *
+ *
* // Getting the first activity evaluation
* ActivityEvaluation eval = toolActivity.getEvaluation();
- *
+ *
* try {
* ToolOutput toolOutput = toolService.getOutputFromTool(eval.getToolOutputDefinition(), toolSession,
* learner.getUserId());
- *
+ *
* if (toolOutput != null) {
* ToolOutputValue outputVal = toolOutput.getValue();
* if (outputVal != null) {
* Double outputDouble = outputVal.getDouble();
- *
+ *
* GradebookUserActivity gradebookUserActivity = getGradebookUserActivity(toolActivity.getActivityId(),
* learner.getUserId());
- *
+ *
* // Only set the mark if it hasnt previously been set by a teacher
* if ((gradebookUserActivity == null) || !gradebookUserActivity.getMarkedInGradebook()) {
* updateGradebookUserActivityMark(lesson, learner, toolActivity, outputDouble, false, false);
* }
* }
* }
- *
+ *
* } catch (ToolException e) {
* logger.debug(
* "Runtime exception when attempted to get outputs for activity: " + toolActivity.getActivityId(), e);
@@ -1160,7 +1160,12 @@
GBActivityGridRowDTO activityRow = (GBActivityGridRowDTO) it.next();
// Add the activity average data
ExcelRow activityDataRow = summarySheet.initRow();
- activityDataRow.addCell(activityRow.getRowName()); // this is the problem entry
+ String activityName = activityRow.getRowName();
+ if (isWeighted) {
+ activityName += " " + getMessage("gradebook.export.weight",
+ new Object[] { activityRow.getWeight() == null ? 0 : activityRow.getWeight() });
+ }
+ activityDataRow.addCell(activityName);
activityDataRow.addCell(activityRow.getCompetences());
activityDataRow.addCell(activityRow.getMedianTimeTakenSeconds());
activityDataRow.addCell(activityRow.getAverageMark());
@@ -1223,14 +1228,21 @@
headerRow = summarySheet.initRow();
headerRow.addEmptyCells(3);
for (Activity activity : filteredActivityToUserDTOMap.keySet()) {
- headerRow.addCell(activity.getTitle(), true); // this one works
+ String activityName = activity.getTitle();
+ if (isWeighted && activity.isToolActivity()) {
+ ActivityEvaluation eval = ((ToolActivity) activity).getEvaluation();
+ activityName += " " + getMessage("gradebook.export.weight",
+ new Object[] { eval == null || eval.getWeight() == null ? 0 : eval.getWeight() });
+ }
+
+ headerRow.addCell(activityName, true);
}
headerRow = summarySheet.initRow();
headerRow.addCell(getMessage("gradebook.export.last.name"), true);
headerRow.addCell(getMessage("gradebook.export.first.name"), true);
headerRow.addCell(getMessage("gradebook.export.login"), true);
- for (Activity activity : filteredActivityToUserDTOMap.keySet()) {
+ for (int columnCount = 0; columnCount < filteredActivityToUserDTOMap.keySet().size(); columnCount++) {
headerRow.addCell(getMessage("gradebook.columntitle.mark"), true);
}
headerRow.addCell(getMessage("gradebook.export.total.mark"), true);
@@ -1270,8 +1282,16 @@
for (Activity activity : activityToUserDTOMap.keySet()) {
ExcelRow activityTitleRow = activitySheet.initRow();
- activityTitleRow.addCell(activity.getTitle(), true);
+ String activityName = activity.getTitle();
+ if (isWeighted && activity.isToolActivity()) {
+ ActivityEvaluation eval = ((ToolActivity) activity).getEvaluation();
+ activityName += " " + getMessage("gradebook.export.weight",
+ new Object[] { eval == null || eval.getWeight() == null ? 0 : eval.getWeight() });
+ }
+
+ activityTitleRow.addCell(activityName, true);
+
ExcelRow titleRow = activitySheet.initRow();
titleRow.addCell(getMessage("gradebook.export.last.name"), true);
titleRow.addCell(getMessage("gradebook.export.first.name"), true);
@@ -1353,6 +1373,13 @@
String activityRowName = (groupName != null && groupId != null)
? activity.getTitle() + " (" + groupName + ")"
: activity.getTitle();
+
+ if (isWeighted && activity.isToolActivity()) {
+ ActivityEvaluation eval = activity.getEvaluation();
+ activityRowName += " " + getMessage("gradebook.export.weight",
+ new Object[] { eval == null || eval.getWeight() == null ? 0 : eval.getWeight() });
+ }
+
activityIdToName.put(activity.getActivityId(), activityRowName);
String startDate = (userDto.getStartDate() == null) ? ""
@@ -1643,9 +1670,6 @@
activityTouserToGradebookUserActivityMap.put(activity.getActivityId(), userToGradebookUserActivityMap);
}
- int numberCellsPerRow = simplified ? 3 + selectedLessons.size() + 3
- : (selectedLessons.size() * 9) + (allActivities.size() * 2) + 5;
-
String weightedMessage = messageService.getMessage("label.activity.marks.weighted");
// Lesson names row----------------------
ExcelRow lessonsNames = sheet.initRow();
@@ -1670,7 +1694,7 @@
lessonsNames.addCell(lessonName, true);
lessonsNames.addEmptyCells(9 + (numberActivities * 2));
}
-// i -= 2;
+
lessonsNames.addCell("", ExcelCell.BORDER_STYLE_LEFT_THIN);
lessonsNames.addCell(getMessage("label.overall.totals"), true);
lessonsNames.addCell("", ExcelCell.BORDER_STYLE_RIGHT_THICK);
@@ -1696,6 +1720,8 @@
} else {
//create Selected Lessons Header Full
for (Lesson lesson : selectedLessons) {
+ boolean isWeighted = isWeightedLessonMap.get(lesson.getLessonId());
+
headerRow.addCell(getMessage("gradebook.export.last.name"));
headerRow.addCell(getMessage("gradebook.export.first.name"));
headerRow.addCell(getMessage("gradebook.export.login"));
@@ -1705,7 +1731,14 @@
List
activities = lessonActivitiesMap.get(lesson.getLessonId());
for (Activity activity : activities) {
- headerRow.addCell(activity.getTitle(), true);
+ String activityName = activity.getTitle();
+ if (isWeighted && activity.isToolActivity()) {
+ ActivityEvaluation eval = ((ToolActivity) activity).getEvaluation();
+ activityName += " " + getMessage("gradebook.export.weight",
+ new Object[] { eval == null || eval.getWeight() == null ? 0 : eval.getWeight() });
+ }
+
+ headerRow.addCell(activityName, true);
headerRow.addCell(getMessage("label.max.possible"));
}
@@ -1788,9 +1821,12 @@
if (activityToTotalMarkMap.get(activity.getActivityId()) != null) {
rawActivityTotalMarks = activityToTotalMarkMap.get(activity.getActivityId());
}
- Integer weight = weighted && activity.getEvaluation() != null
- && activity.getEvaluation().getWeight() != null ? activity.getEvaluation().getWeight()
- : null;
+ Integer weight = weighted ? 0 : null;
+
+ if (activity.getEvaluation() != null && activity.getEvaluation().getWeight() != null) {
+ weight = activity.getEvaluation().getWeight();
+ }
+
Long weightedActivityTotalMarks = weight != null ? weight : rawActivityTotalMarks;
Double mark = 0d;
@@ -1883,15 +1919,15 @@
/*
* TODO Method is not in use. Remove it?
- *
+ *
* public void updateActivityMark(Double mark, String feedback, Integer userID, Long toolSessionID,
* Boolean markedInGradebook) {
* ToolSession toolSession = toolService.getToolSessionById(toolSessionID);
* User learner = (User) userService.findById(User.class, userID);
* if ((learner != null) && (toolSession != null)) {
* ToolActivity activity = toolSession.getToolActivity();
* GradebookUserActivity gradebookUserActivity = getGradebookUserActivity(activity.getActivityId(), userID);
- *
+ *
* // If gradebook user activity is null or the mark is set by teacher or was set previously by user - save the
* // mark and feedback
* if ((gradebookUserActivity == null) || markedInGradebook || !gradebookUserActivity.getMarkedInGradebook()) {
Index: lams_learning/src/java/org/lamsfoundation/lams/learning/service/LearnerService.java
===================================================================
diff -u -r8bc318f44b193b1d926fcc62211ca1b4b18d9b30 -rcf258bae4dd72eab7a6f5bc895b96966caafaf06
--- lams_learning/src/java/org/lamsfoundation/lams/learning/service/LearnerService.java (.../LearnerService.java) (revision 8bc318f44b193b1d926fcc62211ca1b4b18d9b30)
+++ lams_learning/src/java/org/lamsfoundation/lams/learning/service/LearnerService.java (.../LearnerService.java) (revision cf258bae4dd72eab7a6f5bc895b96966caafaf06)
@@ -628,7 +628,7 @@
new Object[] { progress.getUser().getLogin(), progress.getUser().getUserId(),
activity.getTitle(), activity.getActivityId() }));
}
-
+
/**
* "Complete" an activity from the web layer's perspective. Used for CompleteActivityAction and the Gate and
* Grouping actions. Calls the learningService to actually complete the activity and progress.
@@ -646,13 +646,13 @@
if (currentActivity == null) {
progress = joinLesson(learnerId, lesson.getLessonId());
-
+
} else if (progress.getCompletedActivities().containsKey(currentActivity)) {
// recalculate activity mark and pass it to gradebook
updateGradebookMark(currentActivity, progress);
return activityMapping.getCloseForward(currentActivity, lesson.getLessonId());
-
+
} else {
completeActivity(learnerId, currentActivity, progress.getLearnerProgressId());
}
@@ -1434,14 +1434,11 @@
@Override
public void createCommandForLearners(Long toolContentId, Collection userIds, String jsonCommand) {
// find lesson for given tool content ID
- ToolActivity activity = activityDAO.getToolActivityByToolContentId(toolContentId);
- LearningDesign learningDesign = activity.getLearningDesign();
- Lesson lesson = learningDesign.getLessons().iterator().next();
- Long lessonId = lesson.getLessonId();
+ Long lessonId = lessonService.getLessonByToolContentId(toolContentId).getLessonId();
// go through each user, find his user name and add a command for him
for (Integer userId : userIds) {
- User user = (User) activityDAO.find(User.class, userId);
+ User user = activityDAO.find(User.class, userId);
Command command = new Command(lessonId, user.getLogin(), jsonCommand);
commandDAO.insert(command);
}
Index: lams_monitoring/src/java/org/lamsfoundation/lams/monitoring/web/MonitoringController.java
===================================================================
diff -u -rb5d2a6851ee4797e641081bd5e6a1f28f78c30a6 -rcf258bae4dd72eab7a6f5bc895b96966caafaf06
--- lams_monitoring/src/java/org/lamsfoundation/lams/monitoring/web/MonitoringController.java (.../MonitoringController.java) (revision b5d2a6851ee4797e641081bd5e6a1f28f78c30a6)
+++ lams_monitoring/src/java/org/lamsfoundation/lams/monitoring/web/MonitoringController.java (.../MonitoringController.java) (revision cf258bae4dd72eab7a6f5bc895b96966caafaf06)
@@ -285,13 +285,12 @@
}
@RequestMapping(path = "/addLesson", method = RequestMethod.POST)
- public String addLesson(HttpServletRequest request, HttpServletResponse response,
- @RequestParam String lessonName, @RequestParam long learningDesignID)
- throws IOException, ServletException, ParseException {
+ public String addLesson(HttpServletRequest request, HttpServletResponse response, @RequestParam String lessonName,
+ @RequestParam long learningDesignID) throws IOException, ServletException, ParseException {
if (!ValidationUtil.isOrgNameValid(lessonName)) {
throw new IOException("Lesson name contains invalid characters");
}
-
+
String[] organisationIdsStr = request.getParameterValues(AttributeNames.PARAM_ORGANISATION_ID);
boolean introEnable = WebUtil.readBooleanParam(request, "introEnable", false);
String introDescription = introEnable ? request.getParameter("introDescription") : null;
@@ -461,8 +460,7 @@
* The Struts dispatch method to archive a lesson.
*/
@RequestMapping(path = "/archiveLesson", method = RequestMethod.POST)
- public void archiveLesson(HttpServletRequest request, HttpServletResponse response)
- throws IOException {
+ public void archiveLesson(HttpServletRequest request, HttpServletResponse response) throws IOException {
long lessonId = WebUtil.readLongParam(request, AttributeNames.PARAM_LESSON_ID);
try {
monitoringService.archiveLesson(lessonId, getUserId());
@@ -475,8 +473,7 @@
* The Struts dispatch method to "unarchive" a lesson. Returns it back to its previous state.
*/
@RequestMapping(path = "/unarchiveLesson", method = RequestMethod.POST)
- public void unarchiveLesson(HttpServletRequest request, HttpServletResponse response)
- throws IOException {
+ public void unarchiveLesson(HttpServletRequest request, HttpServletResponse response) throws IOException {
long lessonId = WebUtil.readLongParam(request, AttributeNames.PARAM_LESSON_ID);
try {
monitoringService.unarchiveLesson(lessonId, getUserId());
@@ -628,8 +625,8 @@
}
if (log.isDebugEnabled()) {
- log.debug("Force complete for learners " + learnerIdNameBuf.toString() + " lesson "
- + lessonId + ". " + message);
+ log.debug("Force complete for learners " + learnerIdNameBuf.toString() + " lesson " + lessonId + ". "
+ + message);
}
// audit log force completion attempt
@@ -782,7 +779,7 @@
MonitoringController.USER_PAGE_SIZE, (pageNumber - 1) * MonitoringController.USER_PAGE_SIZE,
orderAscending);
for (User learner : learners) {
- learnersJSON.add(WebUtil.userToJSON(learner));
+ learnersJSON.add(WebUtil.userToJSON(learner, activity));
}
learnerCount = monitoringService.getCountLearnersCurrentActivities(new Long[] { activityId })
.get(activityId);
@@ -1133,7 +1130,7 @@
indfm.format(tzFinishDate) + " " + user.getTimeZone().getDisplayName(userLocale));
}
- List contributeActivities = getContributeActivities(lessonId, false);
+ List contributeActivities = getContributeActivities(lessonId, false, false);
if (contributeActivities != null) {
responseJSON.set("contributeActivities", JsonUtil.readArray(contributeActivities));
}
@@ -1203,7 +1200,7 @@
}
ObjectNode responseJSON = JsonNodeFactory.instance.objectNode();
- List contributeActivities = getContributeActivities(lessonId, true);
+ List contributeActivities = getContributeActivities(lessonId, true, true);
if (contributeActivities != null) {
responseJSON.set("contributeActivities", JsonUtil.readArray(contributeActivities));
}
@@ -1301,7 +1298,7 @@
if (!latestLearners.isEmpty()) {
ArrayNode learnersJSON = JsonNodeFactory.instance.arrayNode();
for (User learner : latestLearners) {
- ObjectNode userJSON = WebUtil.userToJSON(learner);
+ ObjectNode userJSON = WebUtil.userToJSON(learner, activity);
if (leaders.contains(learner.getUserId().longValue())) {
userJSON.put("leader", true);
}
@@ -1630,7 +1627,8 @@
}
@SuppressWarnings("unchecked")
- private List getContributeActivities(Long lessonId, boolean skipCompletedBranching) {
+ private List getContributeActivities(Long lessonId, boolean skipCompletedBranching,
+ boolean skipOpenedGates) {
List contributeActivities = monitoringService.getAllContributeActivityDTO(lessonId);
Lesson lesson = lessonService.getLesson(lessonId);
@@ -1658,7 +1656,7 @@
contributeEntry.setIsComplete(learners.isEmpty());
}
- if (!contributeEntry.getIsRequired() || contributeEntry.getIsComplete()) {
+ if (!contributeEntry.getIsRequired() || (skipOpenedGates && contributeEntry.getIsComplete())) {
entryIterator.remove();
}
}
Index: lams_monitoring/web/tblmonitor/tblmonitor.jsp
===================================================================
diff -u -rb5d2a6851ee4797e641081bd5e6a1f28f78c30a6 -rcf258bae4dd72eab7a6f5bc895b96966caafaf06
--- lams_monitoring/web/tblmonitor/tblmonitor.jsp (.../tblmonitor.jsp) (revision b5d2a6851ee4797e641081bd5e6a1f28f78c30a6)
+++ lams_monitoring/web/tblmonitor/tblmonitor.jsp (.../tblmonitor.jsp) (revision cf258bae4dd72eab7a6f5bc895b96966caafaf06)
@@ -14,7 +14,10 @@
@@ -457,4 +793,6 @@
<%@ include file="parts/advanceoptions.jsp"%>
+<%@ include file="parts/timeLimit.jsp"%>
+
<%@ include file="parts/dateRestriction.jsp"%>
Index: lams_tool_scratchie/src/java/org/lamsfoundation/lams/tool/scratchie/web/controller/AuthoringController.java
===================================================================
diff -u -r8bc318f44b193b1d926fcc62211ca1b4b18d9b30 -rcf258bae4dd72eab7a6f5bc895b96966caafaf06
--- lams_tool_scratchie/src/java/org/lamsfoundation/lams/tool/scratchie/web/controller/AuthoringController.java (.../AuthoringController.java) (revision 8bc318f44b193b1d926fcc62211ca1b4b18d9b30)
+++ lams_tool_scratchie/src/java/org/lamsfoundation/lams/tool/scratchie/web/controller/AuthoringController.java (.../AuthoringController.java) (revision cf258bae4dd72eab7a6f5bc895b96966caafaf06)
@@ -365,7 +365,6 @@
boolean isMcqQuestionType = qbQuestion.getType() == QbQuestion.TYPE_MULTIPLE_CHOICE;
if (!isMcqQuestionType) {
form.setFeedback(qbQuestion.getFeedback());
- form.setAnswerRequired(qbQuestion.isAnswerRequired());
form.setCaseSensitive(qbQuestion.isCaseSensitive());
form.setAutocompleteEnabled(qbQuestion.isAutocompleteEnabled());
}
@@ -512,7 +511,6 @@
//handle VSA question type
if (!isMcqQuestionType) {
qbQuestion.setFeedback(form.getFeedback());
- qbQuestion.setAnswerRequired(form.isAnswerRequired());
qbQuestion.setCaseSensitive(form.isCaseSensitive());
qbQuestion.setAutocompleteEnabled(form.isAutocompleteEnabled());
}
Index: lams_tool_scratchie/web/pages/authoring/basic.jsp
===================================================================
diff -u -r8bc318f44b193b1d926fcc62211ca1b4b18d9b30 -rcf258bae4dd72eab7a6f5bc895b96966caafaf06
--- lams_tool_scratchie/web/pages/authoring/basic.jsp (.../basic.jsp) (revision 8bc318f44b193b1d926fcc62211ca1b4b18d9b30)
+++ lams_tool_scratchie/web/pages/authoring/basic.jsp (.../basic.jsp) (revision cf258bae4dd72eab7a6f5bc895b96966caafaf06)
@@ -59,7 +59,7 @@
function importQTI(){
window.open('
questions/questionFile.jsp?limitType=mc&collectionChoice=true',
- 'QuestionFile','width=500,height=240,scrollbars=yes');
+ 'QuestionFile','width=500,height=370,scrollbars=yes');
}
// this method is called by QTI questionChoice.jsp
Index: lams_tool_scratchie/web/pages/authoring/parts/itemlist.jsp
===================================================================
diff -u -r2f91c77f2441c84fd78199bd4e51f1028186bf8f -rcf258bae4dd72eab7a6f5bc895b96966caafaf06
--- lams_tool_scratchie/web/pages/authoring/parts/itemlist.jsp (.../itemlist.jsp) (revision 2f91c77f2441c84fd78199bd4e51f1028186bf8f)
+++ lams_tool_scratchie/web/pages/authoring/parts/itemlist.jsp (.../itemlist.jsp) (revision cf258bae4dd72eab7a6f5bc895b96966caafaf06)
@@ -74,7 +74,7 @@