Index: lams_tool_lamc/build.properties
===================================================================
diff -u -r05db875c7974d705f89231416ff6dfe91a5e70f1 -r3e5b36454b17cee648f9d02e0656e8e99c46e00e
--- lams_tool_lamc/build.properties (.../build.properties) (revision 05db875c7974d705f89231416ff6dfe91a5e70f1)
+++ lams_tool_lamc/build.properties (.../build.properties) (revision 3e5b36454b17cee648f9d02e0656e8e99c46e00e)
@@ -4,7 +4,7 @@
signature=lamc11
#version of this project
-tool.version=20081127
+tool.version=20110416
# hide tool option
hideTool=false
Index: lams_tool_lamc/conf/hibernate/mappings/org/lamsfoundation/lams/tool/mc/McContent.hbm.xml
===================================================================
diff -u -r3ff06f3f26058ef66d171ad6673eab70e76cd662 -r3e5b36454b17cee648f9d02e0656e8e99c46e00e
--- lams_tool_lamc/conf/hibernate/mappings/org/lamsfoundation/lams/tool/mc/McContent.hbm.xml (.../McContent.hbm.xml) (revision 3ff06f3f26058ef66d171ad6673eab70e76cd662)
+++ lams_tool_lamc/conf/hibernate/mappings/org/lamsfoundation/lams/tool/mc/McContent.hbm.xml (.../McContent.hbm.xml) (revision 3e5b36454b17cee648f9d02e0656e8e99c46e00e)
@@ -86,6 +86,13 @@
length="20"
/>
+
The modification of the content is not allowed.
+error.content.inUse =modification of the content is not allowed since one or more learners has attempted the activity.
error.noLearnerActivity =Summary report is not available since no users attempted the activity yet.
-label.question =Question
label.answers =Answers:
+button.endLearning =Next Activity
label.learning.user =User
label.learning.attemptTime =Attempt Date/Time
label.learning.response =Response
label.user =User
label.attemptTime =Attempt Date/Time
label.response =Response
+label.learning.forceOfflineMessage =This activity is not being done on the computer. Please see your instructor for details.
+error.defineLater =Please wait for the teacher to complete the contents of this activity.
+error.noStudentActivity =Sorry, the report can not be generated.
No learner has attempted the activity yet.
group.label =Group
button.summary =Summary
button.editActivity =Edit Activity
@@ -155,112 +175,101 @@
label.stats.allGroups =All Groups:
label.stats.totalAllGroups =Total count of all learners:
error.system.mc =A system exception has occured. Please contact your system administrator. The error to report is\:
{0}
-label.attempt.count =Attempt Count:
-label.final.attempt =Final Attempt:
-label.total =Total
-label.report.title.col =Report Title:
-label.report.endLearningMessage.col =End of Activity Message:
-label.studentMarks =Learner Marks
-label.export.learner =Portfolio Export for Learner
-label.export.teacher =Portfolio Export for Teacher
-label.yourAnswers =Learner's Answers:
-label.candidateAnswer =Candidate Answer
-label.studentMark =Learner Mark
-label.authoring.title.col =Title:
-label.monitoring.downloadMarks.button =Download Marks
-message.no.reflection.available =No notebook available
-label.mcqSummary =MCQ Summary
+authoring.msg.cancel.save =Do you want to close this window without saving?
label.learning.forceFinishMessage =Responses are no more allowed. Please finish.
label.correct =Correct
label.passingMark =Passing Mark
+label.mcqSummary =MCQ Summary
+label.yourAnswers =Learner's Answers:
label.learner =Learner
-error.defineLater =Please wait for the teacher to complete the contents of this activity.
button.try.again =Try again
-label.view.reflection =View Notebook Entries
-answers.submitted.none =Submission is not allowed. Please select at least one answer for each of the questions.
-label.notebook.entries =Notebook Entries
-label.reflection =Notebook Entry
-label.learning.forceOfflineMessage =This activity is not being done on the computer. Please see your instructor for details.
-label.randomize =Present answers in randomized order
-candidates.groupSize.warning =Please fix this: There must be at least 2 candidate answers.
-candidates.unremovable.groupSize =The candidate answer can not be removed since there must be at least 2 candidate answers.
-candidates.setFirst =Please be informed that the first candidate answer has been selected for you.
-candidates.blank =Please fix this: Candidate answer text can not be blank.
-candidates.none.correct =Please fix this: There must be 1 correct candidate answer out of at least 2 candidate answers.
-candidates.duplicate.correct =Please fix this: There must be one and only one correct candidate answer.
-label.monitoring.yesDisplayAnswers =Learners are able to see the answers for all questions.
-label.monitoring.noDisplayAnswers1 =Learners are not able to see the answers for the questions
-authoring.msg.cancel.save =Do you want to close this window without saving?
label.feedback =Question Feedback:
-label.save.question =Create Question
label.notEnoughMarks =You don't have enough marks to finish. Please redo.
-radiobox.onepq =One question per page
-label.feedback.simple =Feedback:
-error.questions.submitted.none =Please correct this: No questions have been submitted.
-label.edit.question =Edit Question
-label.tip.editQuestion =Enables editing of question
+label.tip.moveQuestionDown =Moves question down
+label.tip.moveQuestionUp =Moves question up
+label.tip.editOptions =Enables editing of candidate answers
+label.tip.removeQuestion =Removes question
+label.tip.removeCandidate =Removes candidate answer
+label.studentMarks =Learner Marks
+label.export.learner =Portfolio Export for Learner
+label.export.teacher =Portfolio Export for Teacher
+label.studentMark =Learner Mark
+label.authoring.title.col =Title:
+label.authoring.instructions.col =Instructions:
+label.candidateAnswer =Candidate Answer
+label.total =Total
+label.report.title.col =Report Title:
+label.report.endLearningMessage.col =End of Activity Message:
+label.continue =Continue
+label.reflect =Add Notebook at end of MCQ with the following instructions:
+label.notebook.entries =Notebook Entries
+label.reflection =Notebook Entry
+label.view.reflection =View Notebook Entries
+label.close =Close
label.question.marks =Marks
label.update.list =Update List
+label.tip.editQuestion =Enables editing of question
+candidates.none.correct =Please fix this: There must be 1 correct candidate answer out of at least 2 candidate answers.
+count.finished.session =Finished Session Count:
+label.add.candidates =Answers
+label.add.new.question =Add
+label.marks =mark(s)
label.new.question =New Question
label.questions =Questions
label.questions.worth =This question is worth
-label.upload =Upload
-question.blank =Please fix this: Question text can not be blank.
-question.duplicate =Please fix this: There are duplicate question entries.
-questions.none.submitted =No questions submitted. Please add at least one question.
-count.finished.session =Finished Session Count:
-label.marks =mark(s)
+label.save.question =Create Question
label.tip.deleteQuestion =Deletes question
label.tip.editCandidate =Enables editing of candidate answers
label.tip.moveCandidateDown =Moves candidate answer down
label.tip.moveCandidateUp =Moves candidate answer up
-label.monitoring.downloadMarks.username =Username
-label.showMarks =Show top and average mark
+label.upload =Upload
+question.blank =Please fix this: Question text can not be blank.
+question.duplicate =Please fix this: There are duplicate question entries.
+questions.none.submitted =No questions submitted. Please add at least one question.
+label.edit.question =Edit Question
+label.feedback.simple =Feedback:
+candidates.duplicate.correct =Please fix this: There must be one and only one correct candidate answer.
label.group.results =Group's top and average marks
-label.tip.moveQuestionDown =Moves question down
-label.tip.moveQuestionUp =Moves question up
-label.tip.editOptions =Enables editing of candidate answers
-label.tip.removeQuestion =Removes question
-label.tip.removeCandidate =Removes candidate answer
-label.monitoring.downloadMarks.question.mark =Question {0} (Mark: {1})
-label.continue =Continue
-label.close =Close
+candidates.groupSize.warning =Please fix this: There must be at least 2 candidate answers.
+candidates.unremovable.groupSize =The candidate answer can not be removed since there must be at least 2 candidate answers.
+candidates.setFirst =Please be informed that the first candidate answer has been selected for you.
+candidates.blank =Please fix this: Candidate answer text can not be blank.
+label.showMarks =Show top and average mark
+label.randomize =Present answers in randomized order
+answers.submitted.none =Submission is not allowed. Please select at least one answer for each of the questions.
+message.no.reflection.available =No notebook available
+label.attempt.count =Attempt Count:
+label.final.attempt =Final Attempt:
errors.maxfilesize =The uploaded file has exceeded the maximum file size limit of {0} bytes
-radiobox.defineLater =Define in Monitor
output.desc.learner.mark =Learner's total mark
+output.desc.learner.all.correct =Are learner's answers all correct?
+label.displayAnswers =Display correct answers and score after last question
+label.monitoring.yesDisplayAnswers =Learners are able to see the answers for all questions.
+label.monitoring.noDisplayAnswers1 =Learners are not able to see the answers for the questions
label.monitoring.noDisplayAnswers2 =Do you want to allow learners to see the answers now?
button.monitoring.noDisplayAnswers =Yes
-label.finished =Next Activity
-button.endLearning =Next Activity
-output.desc.learner.all.correct =Are learner's answers all correct?
output.desc.learner.all.correct.true =All Correct
output.desc.learner.all.correct.false =Not All Correct
-error.fileName.empty =Please correct this: Under "Instructions", the file(name) to upload can not be empty.
-label.reflect =Add Notebook at end of MCQ with the following instructions:
-label.onlineInstructions =Online Instructions
-label.offlineInstructions.col =Offline Instructions:
-label.offlineInstructions =Offline Instructions
-button.instructions =Instructions
-label.onlineInstructions.col =Online Instructions:
-label.authoring.instructions.col =Instructions:
-label.instructions =Instructions
-label.add.new.question =Add
-label.add.candidates =Answers
-label.displayAnswers =Display correct answers and score after last question
-label.individual.results.withRetries =Summary of Multiple Choice Responses with Retries
-label.individual.results.withoutRetries =Summary of Multiple Choice Responses
label.attachments =Attachments
-error.content.locked =The content has been locked since it is being used by one mor more learners.
The modification of the content is not allowed.
+label.monitoring.downloadMarks.button =Download Marks
+label.monitoring.downloadMarks.question.mark =Question {0} (Mark: {1})
+label.monitoring.downloadMarks.username =Username
error.monitoring.spreadsheet.download =An error occurred while preparing the marks spreadsheet for download.
-label.authoring.instructions =Instructions
-monitor.summary.td.notebookInstructions =Notebook Instructions
label.on =On
label.off =Off
monitor.summary.th.advancedSettings =Advanced Settings
monitor.summary.td.addNotebook =Add Notebook at the end of MCQ
-error.content.inUse =modification of the content is not allowed since one or more learners has attempted the activity.
-error.noStudentActivity =Sorry, the report can not be generated.
No learner has attempted the activity yet.
+monitor.summary.td.notebookInstructions =Notebook Instructions
error.pedagogical.planner.empty.answer.selected =In question {0} correct answer cannot be blank.
+monitor.summary.date.restriction =Date restriction
+monitor.summary.when.date.restriction.is.set =Learners will not be able to answer questions after the set date and time.
+monitor.summary.after.date =Date/time:
+monitor.summary.set.restriction =Set restriction
+monitor.summary.unset.restriction =Remove restriction
+authoring.info.teacher.set.restriction =The instructor has set a restriction to this activity from {0} onwards.
+monitor.summary.notification =Notification
+monitor.summary.date.restriction.set =Date restriction has been set
+monitor.summary.date.restriction.removed =Date restriction has been removed
-#======= End labels: Exported 255 labels for en AU =====
+#======= End labels: Exported 264 labels for en AU =====
Index: lams_tool_lamc/db/sql/create_lams_tool_mc.sql
===================================================================
diff -u -r1ea4325803995694fb93c9a59b73595607995b8a -r3e5b36454b17cee648f9d02e0656e8e99c46e00e
--- lams_tool_lamc/db/sql/create_lams_tool_mc.sql (.../create_lams_tool_mc.sql) (revision 1ea4325803995694fb93c9a59b73595607995b8a)
+++ lams_tool_lamc/db/sql/create_lams_tool_mc.sql (.../create_lams_tool_mc.sql) (revision 3e5b36454b17cee648f9d02e0656e8e99c46e00e)
@@ -20,6 +20,7 @@
, showMarks TINYINT(1) NOT NULL DEFAULT 0
, randomize TINYINT(1) NOT NULL DEFAULT 0
, displayAnswers TINYINT(1) NOT NULL DEFAULT 1
+ , submission_deadline datetime DEFAULT NULL
, UNIQUE UQ_tl_lamc11_content_1 (content_id)
, PRIMARY KEY (uid)
)TYPE=InnoDB;
Index: lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/McAppConstants.java
===================================================================
diff -u -r05db875c7974d705f89231416ff6dfe91a5e70f1 -r3e5b36454b17cee648f9d02e0656e8e99c46e00e
--- lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/McAppConstants.java (.../McAppConstants.java) (revision 05db875c7974d705f89231416ff6dfe91a5e70f1)
+++ lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/McAppConstants.java (.../McAppConstants.java) (revision 3e5b36454b17cee648f9d02e0656e8e99c46e00e)
@@ -224,6 +224,10 @@
public static final String TOP_MARK = "topMark";
public static final String LOWEST_MARK = "lowestMark";
public static final String AVERAGE_MARK = "averageMark";
+
+ /* Date time restriction LDEV-2657 */
+ public static final String ATTR_SUBMISSION_DEADLINE = "submissionDeadline";
+ public static final String ATTR_IS_SUBMISSION_DEADLINE_PASSED = "isSubmissionDeadlinePassed";
/*
* the learner or monitoring environment provides toolSessionId
Index: lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/McGeneralMonitoringDTO.java
===================================================================
diff -u -r189a3f0c09213d7a68f462bf6a4eb9ee7ae9ba05 -r3e5b36454b17cee648f9d02e0656e8e99c46e00e
--- lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/McGeneralMonitoringDTO.java (.../McGeneralMonitoringDTO.java) (revision 189a3f0c09213d7a68f462bf6a4eb9ee7ae9ba05)
+++ lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/McGeneralMonitoringDTO.java (.../McGeneralMonitoringDTO.java) (revision 3e5b36454b17cee648f9d02e0656e8e99c46e00e)
@@ -23,6 +23,7 @@
package org.lamsfoundation.lams.tool.mc;
+import java.util.Date;
import java.util.List;
import java.util.Map;
@@ -100,6 +101,7 @@
protected List deletedAttachmentList;
protected String contentFolderID;
+ protected Long submissionDeadline;
@@ -655,6 +657,15 @@
this.sessionUserCount = sessionUserCount;
}
+
+ public Long getSubmissionDeadline() {
+ return submissionDeadline;
+ }
+ public void setSubmissionDeadline(Long submissionDeadline) {
+ this.submissionDeadline = submissionDeadline;
+ }
+
+
public String toString() {
return new ToStringBuilder(this)
.append("toolContentID: ", toolContentID)
@@ -700,6 +711,7 @@
.append("sessionUserCount: ", sessionUserCount)
.append("completedSessionUserCount: ", completedSessionUserCount)
.append("completedSessionUserPercent: ", completedSessionUserPercent)
+ .append("submissionDeadline", submissionDeadline)
.toString();
}
Index: lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/McLearnerStarterDTO.java
===================================================================
diff -u -r08950e1090443c3423a3d1c587416a2fccd8bbdf -r3e5b36454b17cee648f9d02e0656e8e99c46e00e
--- lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/McLearnerStarterDTO.java (.../McLearnerStarterDTO.java) (revision 08950e1090443c3423a3d1c587416a2fccd8bbdf)
+++ lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/McLearnerStarterDTO.java (.../McLearnerStarterDTO.java) (revision 3e5b36454b17cee648f9d02e0656e8e99c46e00e)
@@ -22,6 +22,7 @@
/* $$Id$$ */
package org.lamsfoundation.lams.tool.mc;
+import java.util.Date;
/**
@@ -39,6 +40,8 @@
protected String toolActivityOffline;
+ protected Date submissionDeadline;
+
/**
* @return Returns the toolActivityOffline.
*/
@@ -75,6 +78,19 @@
public void setQuestionListingMode(String questionListingMode) {
this.questionListingMode = questionListingMode;
}
+ /**
+ * @return the submissionDeadline
+ */
+ public Date getSubmissionDeadline() {
+ return submissionDeadline;
+ }
+
+ /**
+ * @param submissionDeadline the submissionDeadline to set
+ */
+ public void setSubmissionDeadline(Date submissionDeadline) {
+ this.submissionDeadline = submissionDeadline;
+ }
public int compareTo(Object o)
{
McLearnerStarterDTO mcLearnerStarterDTO = (McLearnerStarterDTO) o;
Index: lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/dbupdates/patch20110416_updateFrom235.sql
===================================================================
diff -u
--- lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/dbupdates/patch20110416_updateFrom235.sql (revision 0)
+++ lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/dbupdates/patch20110416_updateFrom235.sql (revision 3e5b36454b17cee648f9d02e0656e8e99c46e00e)
@@ -0,0 +1,15 @@
+-- SQL statements to update from LAMS 2.3.5
+
+-- Turn off autocommit, so nothing is committed if there is an error
+SET AUTOCOMMIT = 0;
+
+----------------------Put all sql statements below here-------------------------
+
+alter table tl_lamc11_content add column submission_deadline datetime default null;
+UPDATE lams_tool SET tool_version = "20110416" WHERE tool_signature = "lamc11";
+
+----------------------Put all sql statements above here-------------------------
+
+-- If there were no errors, commit and restore autocommit to on
+COMMIT;
+SET AUTOCOMMIT = 1;
\ No newline at end of file
Index: lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/pojos/McContent.java
===================================================================
diff -u -r3ff06f3f26058ef66d171ad6673eab70e76cd662 -r3e5b36454b17cee648f9d02e0656e8e99c46e00e
--- lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/pojos/McContent.java (.../McContent.java) (revision 3ff06f3f26058ef66d171ad6673eab70e76cd662)
+++ lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/pojos/McContent.java (.../McContent.java) (revision 3e5b36454b17cee648f9d02e0656e8e99c46e00e)
@@ -103,6 +103,9 @@
private boolean showMarks;
+ /* LDEV-2657 */
+ private Date submissionDeadline;
+
/** nullable persistent field */
private Integer passMark;
@@ -522,6 +525,19 @@
this.displayAnswers = displayAnswers;
}
+
+ /**
+ * @return date submissionDeadline
+ */
+ public Date getSubmissionDeadline() {
+ return submissionDeadline;
+ }
+
+ public void setSubmissionDeadline(Date submissionDeadline) {
+ this.submissionDeadline = submissionDeadline;
+ }
+
+
/**
* Get total possible marks for this content. Iterates over the McQueContents set
*/
Index: lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/McLearningStarterAction.java
===================================================================
diff -u -r0c60cb489cc847e68d85b76322e0790130ae1dc2 -r3e5b36454b17cee648f9d02e0656e8e99c46e00e
--- lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/McLearningStarterAction.java (.../McLearningStarterAction.java) (revision 0c60cb489cc847e68d85b76322e0790130ae1dc2)
+++ lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/McLearningStarterAction.java (.../McLearningStarterAction.java) (revision 3e5b36454b17cee648f9d02e0656e8e99c46e00e)
@@ -23,9 +23,11 @@
package org.lamsfoundation.lams.tool.mc.web;
import java.io.IOException;
+import java.util.Date;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
+import java.util.TimeZone;
import java.util.TreeMap;
import javax.servlet.ServletException;
@@ -56,6 +58,7 @@
import org.lamsfoundation.lams.tool.mc.service.IMcService;
import org.lamsfoundation.lams.tool.mc.service.McServiceProxy;
import org.lamsfoundation.lams.usermanagement.dto.UserDTO;
+import org.lamsfoundation.lams.util.DateUtil;
import org.lamsfoundation.lams.web.session.SessionManager;
import org.lamsfoundation.lams.web.util.AttributeNames;
import org.lamsfoundation.lams.web.util.SessionMap;
@@ -258,7 +261,28 @@
mcLearningForm.setQuestionListingMode(QUESTION_LISTING_MODE_COMBINED);
}
+ /*
+ * Is there a deadline set?
+ */
+ Date submissionDeadline = mcContent.getSubmissionDeadline();
+
+ if (submissionDeadline != null) {
+
+ HttpSession ss = SessionManager.getSession();
+ UserDTO learnerDto = (UserDTO) ss.getAttribute(AttributeNames.USER);
+ TimeZone learnerTimeZone = learnerDto.getTimeZone();
+ Date tzSubmissionDeadline = DateUtil.convertToTimeZoneFromDefault(learnerTimeZone, submissionDeadline);
+ Date currentLearnerDate = DateUtil.convertToTimeZoneFromDefault(learnerTimeZone, new Date());
+ mcLearnerStarterDTO.setSubmissionDeadline(submissionDeadline);
+
+ //calculate whether submission deadline has passed, and if so forward to "runOffline"
+ if (currentLearnerDate.after(tzSubmissionDeadline)) {
+ request.setAttribute(MC_LEARNER_STARTER_DTO, mcLearnerStarterDTO);
+ return mapping.findForward(RUN_OFFLINE);
+ }
+ }
+
/*
* Is the tool activity been checked as Run Offline in the property inspector?
*/
Index: lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/McMonitoringAction.java
===================================================================
diff -u -rf0450cb2776a8eba5e274ec3e72f83a333f5d229 -r3e5b36454b17cee648f9d02e0656e8e99c46e00e
--- lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/McMonitoringAction.java (.../McMonitoringAction.java) (revision f0450cb2776a8eba5e274ec3e72f83a333f5d229)
+++ lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/McMonitoringAction.java (.../McMonitoringAction.java) (revision 3e5b36454b17cee648f9d02e0656e8e99c46e00e)
@@ -26,15 +26,18 @@
import java.io.IOException;
import java.io.OutputStream;
import java.util.ArrayList;
+import java.util.Date;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
+import java.util.TimeZone;
import java.util.TreeMap;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
+import javax.servlet.http.HttpSession;
import org.apache.log4j.Logger;
import org.apache.poi.hssf.usermodel.HSSFCell;
@@ -71,9 +74,11 @@
import org.lamsfoundation.lams.tool.mc.pojos.McUploadedFile;
import org.lamsfoundation.lams.tool.mc.service.IMcService;
import org.lamsfoundation.lams.tool.mc.service.McServiceProxy;
+import org.lamsfoundation.lams.util.DateUtil;
import org.lamsfoundation.lams.util.MessageService;
import org.lamsfoundation.lams.util.WebUtil;
import org.lamsfoundation.lams.web.action.LamsDispatchAction;
+import org.lamsfoundation.lams.web.session.SessionManager;
import org.lamsfoundation.lams.web.util.AttributeNames;
import org.lamsfoundation.lams.web.util.SessionMap;
@@ -4832,7 +4837,39 @@
return data;
}
+
+ /**
+ * Set Submission Deadline
+ *
+ * @param mapping
+ * @param form
+ * @param request
+ * @param response
+ * @return
+ */
+ public ActionForward setSubmissionDeadline(ActionMapping mapping, ActionForm form, HttpServletRequest request,
+ HttpServletResponse response) {
+
+ IMcService mcService = McServiceProxy.getMcService(getServlet().getServletContext());
+
+ Long contentID = WebUtil.readLongParam(request, AttributeNames.PARAM_TOOL_CONTENT_ID);
+ McContent mcContent = mcService.retrieveMc(contentID);
+
+ Long dateParameter = WebUtil.readLongParam(request, McAppConstants.ATTR_SUBMISSION_DEADLINE, true);
+ Date tzSubmissionDeadline = null;
+ if (dateParameter != null) {
+ Date submissionDeadline = new Date(dateParameter);
+ HttpSession ss = SessionManager.getSession();
+ org.lamsfoundation.lams.usermanagement.dto.UserDTO teacher = (org.lamsfoundation.lams.usermanagement.dto.UserDTO) ss.getAttribute(AttributeNames.USER);
+ TimeZone teacherTimeZone = teacher.getTimeZone();
+ tzSubmissionDeadline = DateUtil.convertFromTimeZoneToDefault(teacherTimeZone, submissionDeadline);
+ }
+ mcContent.setSubmissionDeadline(tzSubmissionDeadline);
+ mcService.updateMc(mcContent);
+ return null;
+ }
+
/**
* Return ResourceService bean.
*/
Index: lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/McMonitoringStarterAction.java
===================================================================
diff -u -rf0450cb2776a8eba5e274ec3e72f83a333f5d229 -r3e5b36454b17cee648f9d02e0656e8e99c46e00e
--- lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/McMonitoringStarterAction.java (.../McMonitoringStarterAction.java) (revision f0450cb2776a8eba5e274ec3e72f83a333f5d229)
+++ lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/McMonitoringStarterAction.java (.../McMonitoringStarterAction.java) (revision 3e5b36454b17cee648f9d02e0656e8e99c46e00e)
@@ -23,13 +23,17 @@
package org.lamsfoundation.lams.tool.mc.web;
import java.io.IOException;
+import java.util.ArrayList;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.TreeMap;
+import java.util.Date;
+import java.util.TimeZone;
import javax.servlet.ServletException;
+import javax.servlet.http.HttpSession;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
@@ -52,9 +56,12 @@
import org.lamsfoundation.lams.tool.mc.pojos.McQueContent;
import org.lamsfoundation.lams.tool.mc.service.IMcService;
import org.lamsfoundation.lams.tool.mc.service.McServiceProxy;
+import org.lamsfoundation.lams.usermanagement.dto.UserDTO;
import org.lamsfoundation.lams.util.WebUtil;
+import org.lamsfoundation.lams.util.DateUtil;
import org.lamsfoundation.lams.web.util.AttributeNames;
import org.lamsfoundation.lams.web.util.SessionMap;
+import org.lamsfoundation.lams.web.session.SessionManager;
/**
@@ -186,6 +193,20 @@
McContent mcContent=mcService.retrieveMc(new Long(toolContentID));
mcGeneralMonitoringDTO.setActivityTitle(mcContent.getTitle());
mcGeneralMonitoringDTO.setActivityInstructions(mcContent.getInstructions());
+
+ // get session from shared session.
+ HttpSession ss = SessionManager.getSession();
+
+ Date submissionDeadline = mcContent.getSubmissionDeadline();
+
+ if (submissionDeadline != null) {
+
+ UserDTO learnerDto = (UserDTO) ss.getAttribute(AttributeNames.USER);
+ TimeZone learnerTimeZone = learnerDto.getTimeZone();
+ Date tzSubmissionDeadline = DateUtil.convertToTimeZoneFromDefault(learnerTimeZone, submissionDeadline);
+ mcGeneralMonitoringDTO.setSubmissionDeadline(tzSubmissionDeadline.getTime());
+
+ }
mcGeneralMonitoringDTO.setCurrentMonitoringTab("summary");
mcGeneralMonitoringDTO.setSbmtSuccess(new Boolean(false).toString());
Index: lams_tool_lamc/web/common/header.jsp
===================================================================
diff -u -r00ae80d4791f903bcb3661537fc7e129c72ad195 -r3e5b36454b17cee648f9d02e0656e8e99c46e00e
--- lams_tool_lamc/web/common/header.jsp (.../header.jsp) (revision 00ae80d4791f903bcb3661537fc7e129c72ad195)
+++ lams_tool_lamc/web/common/header.jsp (.../header.jsp) (revision 3e5b36454b17cee648f9d02e0656e8e99c46e00e)
@@ -19,7 +19,6 @@
-
Index: lams_tool_lamc/web/learning/CombinedAnswersContent.jsp
===================================================================
diff -u -rf04e5eaf5a3b6bd01c39426e993609857686d936 -r3e5b36454b17cee648f9d02e0656e8e99c46e00e
--- lams_tool_lamc/web/learning/CombinedAnswersContent.jsp (.../CombinedAnswersContent.jsp) (revision f04e5eaf5a3b6bd01c39426e993609857686d936)
+++ lams_tool_lamc/web/learning/CombinedAnswersContent.jsp (.../CombinedAnswersContent.jsp) (revision 3e5b36454b17cee648f9d02e0656e8e99c46e00e)
@@ -33,7 +33,15 @@
-
+