Index: lams_common/src/java/org/lamsfoundation/lams/tool/ToolContentManager.java =================================================================== diff -u -r9f98b5e2b822f824d857d3d677f21b1149f794c8 -rd7bfc30e7d7a056b984f35c292a7abed4635c754 --- lams_common/src/java/org/lamsfoundation/lams/tool/ToolContentManager.java (.../ToolContentManager.java) (revision 9f98b5e2b822f824d857d3d677f21b1149f794c8) +++ lams_common/src/java/org/lamsfoundation/lams/tool/ToolContentManager.java (.../ToolContentManager.java) (revision d7bfc30e7d7a056b984f35c292a7abed4635c754) @@ -23,17 +23,16 @@ package org.lamsfoundation.lams.tool; -import java.util.SortedMap; - import org.lamsfoundation.lams.tool.exception.DataMissingException; import org.lamsfoundation.lams.tool.exception.ToolException; +import java.util.SortedMap; + /** * Tool interface that defines the contract regarding tool content manipulation. * * @author Jacky Fang 2004-12-7 * @author Fiona Malikoff May 2005 - * */ public interface ToolContentManager { @@ -43,11 +42,11 @@ * the default content id. * * @param fromContentId - * the original tool content id. + * the original tool content id. * @param toContentId - * the destination tool content id. + * the destination tool content id. * @throws ToolException - * if an error occurs e.g. defaultContent is missing + * if an error occurs e.g. defaultContent is missing */ public void copyToolContent(Long fromContentId, Long toContentId) throws ToolException; @@ -57,11 +56,11 @@ * Monitor. * * @param toolContentId - * the tool content id of the tool content to be changed. + * the tool content id of the tool content to be changed. * @throws DataMissingException - * if no tool content matches the toolContentId + * if no tool content matches the toolContentId * @throws ToolException - * if any other error occurs + * if any other error occurs */ public void resetDefineLater(Long toolContentId) throws DataMissingException, ToolException; @@ -72,32 +71,33 @@ * repository. If no matching data exists, the tool should return without throwing an exception. * * @param toolContentId - * the requested tool content id. + * the requested tool content id. * @throws ToolException - * if any other error occurs + * if any other error occurs */ public void removeToolContent(Long toolContentId) throws ToolException; /** * Removes content previously added by the given user. */ - public void removeLearnerContent(Long toolContentId, Integer userId) throws ToolException; + public void removeLearnerContent(Long toolContentId, Integer userId, boolean resetActivityCompletionOnly) + throws ToolException; /** * Export the XML fragment for the tool's content, along with any files needed for the content. * * @throws DataMissingException - * if no tool content matches the toolSessionId + * if no tool content matches the toolSessionId * @throws ToolException - * if any other error occurs + * if any other error occurs */ public void exportToolContent(Long toolContentId, String toPath) throws DataMissingException, ToolException; /** * Import the XML fragment for the tool's content, along with any files needed for the content. * * @throws ToolException - * if any other error occurs + * if any other error occurs */ public void importToolContent(Long toolContentId, Integer newUserUid, String toolContentPath, String fromVersion, String toVersion) throws ToolException; @@ -110,7 +110,7 @@ * * @return SortedMap of ToolOutputDefinitions with the key being the name of each definition. * - * Added in LAMS 2.1 + * Added in LAMS 2.1 */ public SortedMap getToolOutputDefinitions(Long toolContentId, int definitionType) throws ToolException; Index: lams_common/src/java/org/lamsfoundation/lams/tool/service/ILamsCoreToolService.java =================================================================== diff -u -rbfa7dfb5557d54767b137652b34dd89c13fb1227 -rd7bfc30e7d7a056b984f35c292a7abed4635c754 --- lams_common/src/java/org/lamsfoundation/lams/tool/service/ILamsCoreToolService.java (.../ILamsCoreToolService.java) (revision bfa7dfb5557d54767b137652b34dd89c13fb1227) +++ lams_common/src/java/org/lamsfoundation/lams/tool/service/ILamsCoreToolService.java (.../ILamsCoreToolService.java) (revision d7bfc30e7d7a056b984f35c292a7abed4635c754) @@ -23,10 +23,6 @@ package org.lamsfoundation.lams.tool.service; -import java.util.Collection; -import java.util.List; -import java.util.SortedMap; - import org.lamsfoundation.lams.confidencelevel.ConfidenceLevelDTO; import org.lamsfoundation.lams.confidencelevel.VsaAnswerDTO; import org.lamsfoundation.lams.learningdesign.Activity; @@ -47,6 +43,10 @@ import org.springframework.beans.factory.NoSuchBeanDefinitionException; import org.springframework.dao.DataIntegrityViolationException; +import java.util.Collection; +import java.util.List; +import java.util.SortedMap; + /** *

* This interface defines the service that lams tool package offers to other lams core modules, such as, lams_learning, @@ -169,9 +169,9 @@ /** * Ask an activity to delete content entered by the given user, if exists. * - * @return whether the activity should be persisted afterwards + * @return whether the activity should be persisted afterward */ - boolean removeLearnerContent(Activity activity, User learner) throws ToolException; + boolean removeLearnerContent(Activity activity, User learner, boolean resetActivityCompletionOnly) throws ToolException; /** * Checks whether the activity's read-only flag can be reset. @@ -453,4 +453,4 @@ Object findToolService(Tool tool) throws NoSuchBeanDefinitionException; ToolCompletionStatus getCompletionStatusFromTool(User learner, Activity activity) throws LamsToolServiceException; -} +} \ No newline at end of file Index: lams_common/src/java/org/lamsfoundation/lams/tool/service/LamsCoreToolService.java =================================================================== diff -u -r9bdc7922225fb1533d0a511eaa3d631222326428 -rd7bfc30e7d7a056b984f35c292a7abed4635c754 --- lams_common/src/java/org/lamsfoundation/lams/tool/service/LamsCoreToolService.java (.../LamsCoreToolService.java) (revision 9bdc7922225fb1533d0a511eaa3d631222326428) +++ lams_common/src/java/org/lamsfoundation/lams/tool/service/LamsCoreToolService.java (.../LamsCoreToolService.java) (revision d7bfc30e7d7a056b984f35c292a7abed4635c754) @@ -23,13 +23,6 @@ package org.lamsfoundation.lams.tool.service; -import java.util.Collection; -import java.util.Iterator; -import java.util.List; -import java.util.Set; -import java.util.SortedMap; -import java.util.TreeSet; - import org.apache.log4j.Logger; import org.lamsfoundation.lams.confidencelevel.ConfidenceLevelDTO; import org.lamsfoundation.lams.confidencelevel.VsaAnswerDTO; @@ -74,8 +67,14 @@ import org.springframework.context.ApplicationContextAware; import org.springframework.dao.DataIntegrityViolationException; +import java.util.Collection; +import java.util.Iterator; +import java.util.List; +import java.util.Set; +import java.util.SortedMap; +import java.util.TreeSet; + /** - * * @author Jacky Fang * @version 1.1 * @since 2005-2-23 @@ -108,7 +107,7 @@ /** * @param toolSessionDAO - * The toolSessionDAO to set. + * The toolSessionDAO to set. */ public void setToolSessionDAO(IToolSessionDAO toolSessionDAO) { this.toolSessionDAO = toolSessionDAO; @@ -124,7 +123,7 @@ /** * @param contentIDGenerator - * The contentIDGenerator to set. + * The contentIDGenerator to set. */ public void setContentIDGenerator(ToolContentIDGenerator contentIDGenerator) { this.contentIDGenerator = contentIDGenerator; @@ -201,8 +200,9 @@ sessionManager.createToolSession(toolSession.getToolSessionId(), toolSession.getToolSessionName(), activity.getToolContentId()); } catch (NoSuchBeanDefinitionException e) { - String message = "A tool which is defined in the database appears to missing from the classpath. Unable to create tool session. ToolActivity " - + activity; + String message = + "A tool which is defined in the database appears to missing from the classpath. Unable to create tool session. ToolActivity " + + activity; log.error(message, e); throw new ToolException(message, e); } @@ -226,8 +226,9 @@ } } catch (NoSuchBeanDefinitionException e) { - String message = "A tool which is defined in the database appears to missing from the classpath. Unable to copy/update the tool content. ToolActivity " - + toolActivity; + String message = + "A tool which is defined in the database appears to missing from the classpath. Unable to copy/update the tool content. ToolActivity " + + toolActivity; log.error(message, e); throw new ToolException(message, e); } @@ -240,8 +241,8 @@ throws DataMissingException, ToolException { ToolContent toolContent = toolContentDAO.find(ToolContent.class, toolContentId); if (toolContent == null) { - String error = "The toolContentID " + toolContentId - + " is not valid. No such record exists on the database."; + String error = + "The toolContentID " + toolContentId + " is not valid. No such record exists on the database."; log.error(error); throw new DataMissingException(error); } @@ -263,8 +264,9 @@ contentManager.copyToolContent(toolContentId, newToolcontentID); } } catch (NoSuchBeanDefinitionException e) { - String message = "A tool which is defined in the database appears to missing from the classpath. Unable to copy the tool content. ToolContentId " - + toolContentId; + String message = + "A tool which is defined in the database appears to missing from the classpath. Unable to copy the tool content. ToolContentId " + + toolContentId; log.error(message, e); throw new ToolException(message, e); } @@ -278,23 +280,27 @@ ToolContentManager contentManager = (ToolContentManager) findToolService(toolActivity.getTool()); contentManager.removeToolContent(toolActivity.getToolContentId()); } catch (NoSuchBeanDefinitionException e) { - String message = "A tool which is defined in the database appears to missing from the classpath. Unable to delete the tool content. ToolActivity " - + toolActivity; + String message = + "A tool which is defined in the database appears to missing from the classpath. Unable to delete the tool content. ToolActivity " + + toolActivity; log.error(message, e); throw new ToolException(message, e); } } @Override - public boolean removeLearnerContent(Activity activity, User learner) throws ToolException { + public boolean removeLearnerContent(Activity activity, User learner, boolean resetActivityCompletionOnly) + throws ToolException { if (activity.isToolActivity()) { ToolActivity toolActivity = (ToolActivity) activity; try { ToolContentManager contentManager = (ToolContentManager) findToolService(toolActivity.getTool()); - contentManager.removeLearnerContent(toolActivity.getToolContentId(), learner.getUserId()); + contentManager.removeLearnerContent(toolActivity.getToolContentId(), learner.getUserId(), + resetActivityCompletionOnly); } catch (NoSuchBeanDefinitionException e) { - String message = "A tool which is defined in the database appears to missing from the classpath. Unable to delete learner content. ToolActivity " - + toolActivity; + String message = + "A tool which is defined in the database appears to missing from the classpath. Unable to delete learner content. ToolActivity " + + toolActivity; log.error(message, e); throw new ToolException(message, e); } @@ -367,8 +373,8 @@ ToolContent toolContent = toolContentDAO.find(ToolContent.class, toolContentId); if (toolContent == null) { - String error = "The toolContentID " + toolContentId - + " is not valid. No such record exists on the database."; + String error = + "The toolContentID " + toolContentId + " is not valid. No such record exists on the database."; log.error(error); throw new DataMissingException(error); } @@ -384,8 +390,9 @@ ToolContentManager contentManager = (ToolContentManager) findToolService(tool); return contentManager.getToolOutputDefinitions(toolContentId, definitionType); } catch (NoSuchBeanDefinitionException e) { - String message = "A tool which is defined in the database appears to missing from the classpath. Unable to get the tool output definitions. ToolContentId " - + toolContentId; + String message = + "A tool which is defined in the database appears to missing from the classpath. Unable to get the tool output definitions. ToolContentId " + + toolContentId; log.error(message, e); throw new ToolException(message, e); } catch (java.lang.AbstractMethodError e) { @@ -404,8 +411,8 @@ definitionType); ToolContent toolContent = toolContentDAO.find(ToolContent.class, inputToolContentId); if (toolContent == null) { - String error = "The toolContentID " + inputToolContentId - + " is not valid. No such record exists on the database."; + String error = + "The toolContentID " + inputToolContentId + " is not valid. No such record exists on the database."; log.error(error); throw new DataMissingException(error); } @@ -447,8 +454,9 @@ } return definitions; } catch (NoSuchBeanDefinitionException e) { - String message = "A tool which is defined in the database appears to missing from the classpath. Unable to get the tool output definitions. ToolContentId " - + inputToolContentId; + String message = + "A tool which is defined in the database appears to missing from the classpath. Unable to get the tool output definitions. ToolContentId " + + inputToolContentId; log.error(message, e); throw new ToolException(message, e); } catch (java.lang.AbstractMethodError e) { @@ -491,8 +499,9 @@ Long longLearnerId = learnerId != null ? learnerId.longValue() : null; return sessionManager.getToolOutput(conditionName, toolSession.getToolSessionId(), longLearnerId); } catch (NoSuchBeanDefinitionException e) { - String message = "A tool which is defined in the database appears to missing from the classpath. Unable to gt the tol output. toolSession " - + toolSession.getToolSessionId(); + String message = + "A tool which is defined in the database appears to missing from the classpath. Unable to gt the tol output. toolSession " + + toolSession.getToolSessionId(); log.error(message, e); throw new ToolException(message, e); } catch (java.lang.AbstractMethodError e) { @@ -523,8 +532,9 @@ ToolSessionManager sessionManager = (ToolSessionManager) findToolService(tool); return sessionManager.getToolOutputs(conditionName, toolActivity.getToolContentId()); } catch (NoSuchBeanDefinitionException e) { - String message = "A tool which is defined in the database appears to missing from the classpath. Unable to grt the tol output. toolActivity " - + toolActivity.getActivityId(); + String message = + "A tool which is defined in the database appears to missing from the classpath. Unable to grt the tol output. toolActivity " + + toolActivity.getActivityId(); log.error(message, e); throw new ToolException(message, e); } catch (java.lang.AbstractMethodError e) { @@ -562,8 +572,9 @@ ICommonAssessmentService sessionManager = (ICommonAssessmentService) findToolService(tool); return sessionManager.getVSAnswers(toolSession.getToolSessionId()); } catch (NoSuchBeanDefinitionException e) { - String message = "A tool which is defined in the database appears to missing from the classpath. Unable to get the tool output. toolActivity " - + toolSession.getToolActivity().getActivityId(); + String message = + "A tool which is defined in the database appears to missing from the classpath. Unable to get the tool output. toolActivity " + + toolSession.getToolActivity().getActivityId(); LamsCoreToolService.log.error(message, e); throw new ToolException(message, e); } catch (java.lang.AbstractMethodError e) { @@ -594,8 +605,9 @@ ToolSessionManager sessionManager = (ToolSessionManager) findToolService(tool); return sessionManager.getConfidenceLevels(toolSession.getToolSessionId()); } catch (NoSuchBeanDefinitionException e) { - String message = "A tool which is defined in the database appears to missing from the classpath. Unable to get the tool output. toolActivity " - + toolSession.getToolActivity().getActivityId(); + String message = + "A tool which is defined in the database appears to missing from the classpath. Unable to get the tool output. toolActivity " + + toolSession.getToolActivity().getActivityId(); log.error(message, e); throw new ToolException(message, e); } catch (java.lang.AbstractMethodError e) { @@ -625,8 +637,9 @@ //we get leader from the current tool rather than LeaderSelection tool in order to avoid making redundant calls to DB return sessionManager.isUserGroupLeader(learner.getUserId().longValue(), toolSession.getToolSessionId()); } catch (NoSuchBeanDefinitionException e) { - String message = "A tool which is defined in the database appears to missing from the classpath. Unable to check whether user is a leader. toolSession " - + toolSession.getToolSessionId(); + String message = + "A tool which is defined in the database appears to missing from the classpath. Unable to check whether user is a leader. toolSession " + + toolSession.getToolSessionId(); log.error(message, e); throw new ToolException(message, e); } catch (AbstractMethodError e) { @@ -657,8 +670,9 @@ ToolSessionManager sessionManager = (ToolSessionManager) findToolService(tool); sessionManager.forceCompleteUser(toolSession.getToolSessionId(), learner); } catch (NoSuchBeanDefinitionException e) { - String message = "A tool which is defined in the database appears to missing from the classpath. Unable to force complete activity. toolSession " - + toolSession.getToolSessionId(); + String message = + "A tool which is defined in the database appears to missing from the classpath. Unable to force complete activity. toolSession " + + toolSession.getToolSessionId(); log.error(message, e); throw new ToolException(message, e); } catch (java.lang.AbstractMethodError e) { @@ -698,8 +712,9 @@ Long longLearnerId = learnerId != null ? new Long(learnerId.longValue()) : null; return sessionManager.getToolOutput(names, toolSession.getToolSessionId(), longLearnerId); } catch (NoSuchBeanDefinitionException e) { - String message = "A tool which is defined in the database appears to missing from the classpath. Unable to gt the tol output. toolSession " - + toolSession.getToolSessionId(); + String message = + "A tool which is defined in the database appears to missing from the classpath. Unable to gt the tol output. toolSession " + + toolSession.getToolSessionId(); log.error(message, e); throw new ToolException(message, e); } catch (java.lang.AbstractMethodError e) { @@ -811,7 +826,8 @@ if (!(activity instanceof ToolActivity)) { } - ToolActivity toolActivity = (ToolActivity) (activity instanceof ToolActivity ? activity + ToolActivity toolActivity = (ToolActivity) (activity instanceof ToolActivity + ? activity : activityDAO.getActivityByActivityId(activity.getActivityId())); toolActivities.add(toolActivity); } @@ -965,9 +981,9 @@ ToolSession toolSession = this.getToolSessionByActivity(learner, activity); if (toolSession == null) { - String error = "Unable to set up url as session does not exist. Activity " - + (activity != null ? activity.getActivityId() + ":" + activity.getTitle() : "null") + " learner " - + (learner != null ? learner.getUserId() + ":" + learner.getLogin() : "null"); + String error = "Unable to set up url as session does not exist. Activity " + (activity != null ? + activity.getActivityId() + ":" + activity.getTitle() : "null") + " learner " + (learner != null ? + learner.getUserId() + ":" + learner.getLogin() : "null"); log.error(error); throw new LamsToolServiceException(error); } @@ -1028,4 +1044,4 @@ return null; } -} +} \ No newline at end of file Index: lams_monitoring/conf/language/lams/ApplicationResources.properties =================================================================== diff -u -rec05d1ee8615ffb69e594e5551e5f93d692bccb4 -rd7bfc30e7d7a056b984f35c292a7abed4635c754 --- lams_monitoring/conf/language/lams/ApplicationResources.properties (.../ApplicationResources.properties) (revision ec05d1ee8615ffb69e594e5551e5f93d692bccb4) +++ lams_monitoring/conf/language/lams/ApplicationResources.properties (.../ApplicationResources.properties) (revision d7bfc30e7d7a056b984f35c292a7abed4635c754) @@ -1,545 +1,545 @@ -button.finished = Finished -error.title = Error occured -label.synch.gate.title = Synch gate -label.permission.gate.title = Permission gate -label.schedule.gate.title = Schedule gate -label.schedule.gate.open.message = Schedule gate will be opened at: -label.schedule.gate.close.message = Schedule gate will be closed at: -label.gate.you.open.message = You may open the gate for the whole class -label.gate.gate.open = Gate was opened -label.gate.open = Open -label.gate.closed = Closed -label.gate.waiting.learners = {0} out of {1} are waiting in front of the gate. -label.grouping.max.num.in.group.heading = Maximum number of groups: -label.grouping.general.instructions.heading = General instructions: -label.grouping.general.instructions.line1 = Choose a course grouping to use in this lesson or create a new one. You are working with copies, so any changes made here have no influence on the original course groupings. Grouping with zero groups are not listed here. Once a grouping is chosen, the only way to come back to the grouping list is to manually remove all groups. -label.grouping.general.instructions.line2 = Place the lesson participants in their groups. Initially you can add and remove learners, but once a groups is used (that is, a participant starts an activity that uses the grouping) you will not be able to remove learners from it. Even if a group is in use you can still add learners. The changes are saved immediately. -label.grouping.group.heading = Groups -label.grouping.non.grouped.users.heading = Learners without a group -label.grouping.grouped.users.heading = Members of selected group -label.grouping.no.groups.created = No groups have been created. -label.grouping.loading = Loading... -error.grouping.data = Required information not received from server. Error code: -error.grouping.add.group = Please enter a new group name to add. -error.grouping.remove.group = Please select a group to remove. -button.grouping.remove.selected.group = Remove selected group -button.grouping.add.group = Add group -button.grouping.add.user.to.group = Add selected to group -button.grouping.remove.user.from.group = Remove selected members -monitor.title = Monitor :: LAMS -preview.deleted.title = Preview data deleted -preview.deleted.message = Preview data for {0} lesson(s) has been deleted. -not.supported = This option is not supported for this activity. -NO.SUCH.LESSON = No such lesson with a lessonID of : {0} exists. -INVALID.ACTIVITYID = Invalid activityID :{0}. -INVALID.ACTIVITYID.TYPE = Invalid Activity type: {0}. Only ToolActivity allowed. -INVALID.ACTIVITYID.LESSONID = Invalid activityID/lessonID : {0} : {1}. -error.system.error = An error has occurred. Please start again. Reason for error: {0} -error.user.noprivilege = Sorry, you do not have the privilege to perform this action. -force.complete.stop.message.activity.done = Nothing changed as activity "{0}" is already complete. -force.complete.stop.message.grouping.error = Move to activity stopped at a grouping activity "{0}" due to system error. -force.complete.stop.message.grouping = Move to activity stopped at a grouping activity "{0}" that cannot be completed. -force.complete.stop.message.gate = Move to activity stopped at a gate "{0}" that cannot be opened. -force.complete.stop.message.completed.to.activity = Move to activity successful. -force.complete.stop.message.completed.to.end = Move to activity successful to end of the lesson. -force.complete.stop.message.stopped.unexpectedly = Move to activity has finished processing. Please check the learner's progress bar for their current activity. -audit.lesson.created = Lesson "{0}" created with learning design "{1}" ({2}) -label.branching.general.instructions = Place the lesson participants in their branches. Initially you can add and remove learners, but once a participant starts one of the branches then you will not be able to remove learners from any branches. If you try to remove someone from a branch and they will not remove then check their progress - if they start using the branch while you are on this screen you will not get any errors but you will not be able to remove them from the branch. You will still be able to add learners to branches. -label.branching.branch.heading = Branch -label.branching.non.allocated.users.heading = Learners without a branch -label.branching.allocated.users.heading = Members of selected branch -button.branching.add.user.to.branch = Add selected to branch -button.branching.remove.user.from.branch = Remove selected from branch -label.branching.general.group.instructions = Place the groups in their branches. Initially you can add and remove groups, but once a participant starts one of the branches then you will not be able to remove groups from any branches. You will still be able to add groups to branches. -label.branching.non.allocated.groups.heading = Groups without a branch -label.branching.allocated.groups.heading = Groups of the selected branch -label.started = Started -label.not.started = Not started -label.completed = Completed -label.condition.gate.title = Condition gate -label.gate.allow = Allow to pass -label.gate.open.single.learner = You may allow a single learner to pass the gate -label.gate.list.all.learners = Forbidden to pass -label.gate.list.waiting.learners = Waiting at the gate -label.gate.list.allowed.learners = Allowed to pass -label.grouping.status = Status: -label.grouping.functions = Group functions: -label.grouping.popup.change.group.name = Change group name -label.grouping.learners = Learners -label.grouping.popup.change.group.name.field = Enter new name: -label.grouping.popup.delete.group = Delete group -label.grouping.popup.delete.group.message = Are you sure you want to delete this group? -button.ok = OK -button.cancel = Cancel -button.yes = Yes -button.no = No -label.grouping.popup.drag.selection.message = Because some learners have already entered this grouping activity, it will only be possible to add new learners to groups. Learners can not be removed from groups. Once a learner is added to a group, the action can not be undone. -label.branching.popup.drag.selection.message = Because some learners have already entered this branching activity, it will only be possible to add new learners to branches. Learners can not be removed from branches, therefore, once a learner is added to a branch, the action can not be undone. -label.grouping.general.instructions.branching = This grouping activity is used for branching. Groups can therefore not be added or deleted. -label.grouping.popup.viewmode.message = You are presently in group view mode. Groups can not be modified. -label.gate.list.have.not.met.conditions.learners = Have not met conditions -message.gate.condition.force.pass = Note: This will allow all learners to pass regardless of the specified conditions. -show.average.checkbox = Show average -search.learner.textbox = Search -label.learner = Learner -title.lbl = Title -learner.lbl = Learners {0} -wizardTitle.x.lbl = Lesson: {0} -al.alert = Alert -al.validation.msg2 = Title is a required field. -summery.desc.lbl = Description: -summery.learners.lbl = Learners: -al.validation.msg1 = A valid design must be selected. -finish.btn = Start in Monitor -al.validation.schtime = Please select a future date and time for scheduling. -learners.group.name = {0} learners -al.validation.msg3.2 = There must be at least 1 monitor member and learner selected. -staff.group.name = {0} monitors -confirmMsg.4.txt = {0} instances of {1} have been started. -wizard.splitLearners.splitSum = {0} instances of this lesson will be created and approximately {1} learners will be allocated to each lesson. -wizard.splitLearners.LearnersPerLesson.lbl = No. learners per lesson: -wizard.splitLearners.cb.lbl = Split learners into separate copies of this lesson? -wizard.learner.enLiveEdit.cb.lbl = Enable Live Edit -wizard.learner.enpres.cb.lbl = Allow Learners to see who is online -wizard.wkspc.date.modified.lbl = Last modified: {0} -staff.lbl = Monitors {0} -add.lesson.panel.title = Add Lesson to {0} -lesson.tab.label = Lesson -class.tab.label = Class -advanced.tab.label = Advanced -lesson.tab.heading.label = Select the design to add a lesson, and click on Add now -advanced.tab.form.advanced.options.label = Advanced options -advanced.tab.form.enable.im.label = Enable Instant Messaging -advanced.tab.form.scheduling.label = Scheduling -advanced.tab.form.enable.label = Enable -advanced.tab.form.validation.no.learners.error = No learners loaded, please go to the Learners tab. -advanced.tab.form.details.label = Details -class.tab.available.label = unselected -class.tab.selected.label = selected -class.tab.heading.label = Please use drag 'n drop to select or unselect monitors and learners -class.tab.print.name.label = {0} {1} ({2}) -alert.no.learner.data = No learner data. -advanced.tab.form.time.limits.label = Time limitations -advanced.tab.form.enter.number.days.label = Number days: -advanced.tab.form.individual.not.entire.group.label = Is this time limit for each individual? -email.notifications.notify.sudents.that = Notify learners that: -email.notifications.lesson.notifications = Lesson notifications: {0} -email.notifications.course.notifications = Course notifications: {0} -email.notifications.user.name = User name [login] -email.notifications.lesson.name = Lesson name -email.notifications.send = Send -email.notifications.user.search.property.0 = Are assigned to this lesson -email.notifications.user.search.property.1 = Haven't finished this lesson -email.notifications.user.search.property.2 = Have finished this lesson -email.notifications.user.search.property.3 = Haven't started this lesson -email.notifications.user.search.property.4 = Have started this lesson -email.notifications.user.search.property.5 = Haven't reached particular activity -email.notifications.user.search.property.6 = Have X days to deadline -email.notifications.user.search.property.7 = Have finished a particular lesson -email.notifications.user.search.property.8 = Haven't started a particular lesson -email.notifications.user.search.property.9 = Haven't started any lessons -email.notifications.user.search.property.10 = Have finished these lessons -email.notifications.activity = Choose activity -email.notifications.days.to.deadline = Choose number of days to deadline -event.emailnotifications.email.subject = LAMS notification -email.notifications.lesson = Choose lesson -email.notifications.lessons = Choose lessons -error.emailnotifications.email.subject = LAMS notification -email.notifications.emails.successfully.sent = Emails have been successfully sent to selected learners. -advanced.tab.enable.lesson.notifications = Enable lesson notifications -email.notifications.by.this.date = By this date: -email.notifications.emails.successfully.scheduled = Emails have been successfully scheduled to be sent on specified date. -email.notifications.scheduled.messages.list = List of scheduled emails -email.notifications.scheduled.messages.list.scheduled.date = Scheduled date -email.notifications.scheduled.messages.list.email.body = Email body -email.notifications.scheduled.messages.list.notify.sudents.that = Notify learners that -email.notifications.scheduled.messages.list.back = Back to notifications -email.notifications.table.now = Now -email.notifications.table.schedule = Schedule -email.notifications.button.schedule = Schedule -email.notifications.schedule.description = Choose a date when you want the message to be delivered. Note that the message will be sent to the learners that fulfil the criteria at the scheduled date. -email.notifications.user.search.property.11 = Haven't finished these lessons -conditions.tab.label = Conditions -conditions.tab.form.preceding.label = Prerequisites -conditions.tab.form.preceding.info.label = Select a lesson that learners will need to complete before they can see the lesson you are about to create. -advanced.tab.form.time.limits.info.label = Set the number of days the lesson will be available to learners. After this period the lesson will not longer be shown. If the time should count from the moment the learner starts the lesson, select the option for individual time limit. -email.notifications.lesson.email.body.header = Hello, -email.notifications.lesson.email.body.msg = [put message here] -email.notifications.lesson.email.body.footer = Lesson: {0} ({1}) -email.notifications.course.email.body.header = Hello, -email.notifications.course.email.body.msg = [put message here] -advanced.tab.enable.lesson.intro = Enable lesson intro -advanced.tab.display.design.image = Display design image -email.notifications = Notifications -button.email = Email -lesson.name = Name: -lesson.state = Status: -lesson.learners = Learners -lesson.class = Class: -lesson.manage = Manage Lesson -button.view.learners = View/Email Learners -button.view.learners.tooltip = Shows all learners assigned to this lesson and allows to email them -button.edit.class = Edit class -button.edit.class.tooltip = Edit the list of learners and monitors assigned to this lesson -button.open.im = Open IM -lesson.change.state = Change status: -lesson.select.state = Select status -button.apply = Apply -lesson.change.state.tooltip = Change the status of this lesson based on the drop down selection -lesson.start = Start: -button.schedule = Schedule -button.schedule.tooltip = Schedule lesson to start in a future time -button.start.now = Start now -button.start.now.tooltip = Start the lesson immediately -lesson.enable.presence = Allow learners to see who is online -lesson.enable.presence.alert = Now learners can see who is online -lesson.disable.presence.alert = Now learners can not see who is online -lesson.enable.im = Enable Instant Messaging -lesson.enable.im.alert = Instant Messaging is now enabled -lesson.disable.im.alert = Instant Messaging is now disabled -lesson.required.tasks = Required tasks -lesson.task.gate = Permission gate -lesson.task.grouping = Choose grouping -lesson.task.branching = Instructor chosen branching -button.task.go = Go -button.task.go.tooltip = Complete this task now -lesson.monitors = Monitors -lesson.remove.alert = You have selected to remove this lesson. Removed lessons can not be retrieved again. Continue? -lesson.remove.doublecheck.alert = WARNING: This lesson is about to be removed! -lesson.state.created = Created but not started -lesson.state.scheduled = Scheduled -lesson.state.started = Started -lesson.state.suspended = Suspended -lesson.state.finished = Finished -lesson.state.archived = Archived -lesson.state.removed = Removed -lesson.state.action.disable = Disable -lesson.state.action.activate = Activate -lesson.state.action.remove = Remove -lesson.state.action.archive = Archive -error.lesson.schedule.date = No date was selected. Please select a date and time. -lesson.group.dialog.class = Class -label.learner.progress.activity.current.tooltip = This is the current activity -label.learner.progress.activity.completed.tooltip = Double click to review this completed activity -label.learner.progress.activity.attempted.tooltip = The learner has attempted but not yet finished this activity -label.learner.progress.activity.tostart.tooltip = The learner has to complete the activities before this activity to access it -label.learner.progress.activity.support.tooltip = Double click to open this support activity -button.timechart = Time chart -button.timechart.tooltip = View a chart of the selected learner progress against time for each activity -learners.page = Page -learners.order = Order by completion -learners.search.phrase.clear.tooltip = Clear search results -button.live.edit = Live Edit -button.live.edit.tooltip = Edit the current design for this lesson -button.live.edit.confirm = Live Edit allows you to modify the design of your lesson while the learners are attempting it. If you continue, your design will appear in Authoring for you to modify. Once you have done your changes you MUST "Apply changes" to the design so learners can progress. If these changes are not applied, the learners will NOT be able to continue with the lesson. Do you want to continue? -button.journal.entries = Journal entries -button.journal.entries.tooltip = View all Journal Entries saved by Learners -tab.lesson = Lesson -tab.sequence = Design -tab.learners = Learners -force.complete.click = Click on an activity to move learners [0] or click outside any activity to cancel. -force.complete.end.lesson.confirm = Are you sure you want to move learners [0] to the end of lesson? -force.complete.activity.confirm = Are you sure you want to move learners [0] to activity "[1]"? Please note that moving one learner takes several seconds. -force.complete.drop.fail = You have dropped learners [0] on either their current or on their completed activity "[1]". -force.complete.end.lesson.tooltip = To move learner to the end of lesson, drag them over to this bar. -learner.group.count = learners in total. -learner.group.show = Double-click for full list -learner.finished.dialog.title = End of lesson -learner.group.sort.button = Sort -button.force.complete = Move selected learners to... -button.view.learner = View learner -button.close = Close -button.help = Help -button.help.tooltip = Open help page -button.refresh = Refresh -button.refresh.tooltip = Reload the latest progress data -lesson.presence = Presence -sequence.help.info = Double click on an activity for more details -lesson.learner.url = Direct lesson link: -button.select = Select -learner.group.select.all = Select/Unselect all -email.notifications.problems.sending.emails = Some problems occurred while sending emails. Please, contact your system administrator. -learner.group.remove.progress = You are about to remove student(s) from a lesson. The student(s) will not have access to this lesson any longer. Do you also want to remove the student(s) progress? -force.complete.remove.content = You are moving learners [0] to activity "[1]". You can opt to delete the content of activities that have been previously done, so the learners have to enter the content/answers again. -force.complete.remove.content.yes = Delete content -force.complete.remove.content.no = Keep content -label.schedule.gate.activity.completion.based = This gate is based on each learner's previous activity completion time -audit.force.complete = Attempted to force complete learner {0} to {1}. LessonId:{2}. -audit.force.complete.end.lesson = Attempted to force complete learner {0} to the end of the lesson. LessonId:{2}. -lesson.task.content.edited = Content being edited -lesson.task.attention = This activity requires attention -lesson.task.define.later = Define later -label.learner.progress.not.started = The learner has not started the lesson yet -button.save = Save -learner.group.forward.1 = Next page -learner.group.forward.10 = 10 pages forward -learner.group.backward.1 = Previous page -learner.group.backward.10 = 10 pages back -lesson.presence.count = users -email.notify.students.that = Notify students that -email.notifications.delete = Delete notification -email.notification.delete.alert1 = About to delete the scheduled notification: {0} -email.notification.delete.alert2 = This cannot be undone. Do you want to delete? -learner.group.multi.select = (ctrl+click or ⌘+click to select multiple learners) -lesson.im = Instant messaging -label.lesson.introduction = Lesson introduction -lesson.chart.title = Lesson completion -lesson.chart.started = In progress -lesson.chart.not.started = Not started -lesson.chart.completed = Completed -class.add.all.confirm = Do you want to add all learners to the class? -class.add.all.success = All learners were added to the class -button.edit.class.add.all = Add all -force.complete.learner.command.message = The instructor has moved you to another activity. -index.emailnotifications = Notifications -label.email = Email -lesson.chart.not.completed = Not completed -tour.intro.title = Monitor Tour -tour.intro.content = This short tour will show you the features of the LAMS Monitoring screen. You can stop the tour at any time by clicking End Tour, and restart it again by clicking on the Tour button. -tour.end.title = End Of Tour -tour.end.content.1 = Thank you for taking the tour. To restart the tour, click the Tour button again. -tour.end.content.2 = For further help, click on the More button below. -tour.tab.selection.title = Tab Selection -tour.tab.selection.content.1 = Monitoring is broken into three areas, accessed by these titles at the top of the page. -tour.tab.selection.content.2 = Lesson gives the overall lesson details. -tour.tab.selection.content.3 = Design gives an overview of the lesson design and is used to access the activities. -tour.tab.selection.content.4 = Learners shows the details about each learner. -tour.tab.refresh.content = Updates the screen. -tour.lesson.state.content.1 = Click on the current status to change the status. The lesson can be Started, Suspended, Archived or Removed. -tour.lesson.state.content.2 = Started or Activated lessons are available for learners to participate in. -tour.lesson.state.content.3 = Suspended or Disabled lessons are lessons that have been disabled by a monitor. Learners cannot see but not access disabled lessons. Learners currently in the lesson (with a learner window open) can progress through the lesson. -tour.lesson.state.content.4 = Archived lessons do not appear on learner's main screen, but are available for Monitors to view. -tour.lesson.state.content.5 = Removed lessons are removed altogether and cannot be retrieved. -tour.lesson.count.learners.content.1 = This area shows the number of learners who have started the lesson so far, and the total number of learners who are able to access it. -tour.lesson.count.learners.content.2 = Note that this does NOT indicate the number of learners online at this moment, but rather how many learners have joined the lesson since it was started. -tour.learner.in.class.content = Display the learners in the class. From the resulting learner list you can email a particular learner. -tour.edit.class.content = Add or Remove learners from the lesson. -tour.email.notifications.content = Send an email notification to one or more learners. Notifications can be scheduled for later sending. -tour.lesson.im.content.1 = Click on Presence to allow learners to see who is currently online. -tour.lesson.im.content.2 = Once Presence is on, the number of learners online is shown on the Presence button. Click Instant Messaging to allow learners to message each other. -tour.lesson.im.content.3 = Click on Presence and Instant Messaging again to disable. -tour.lesson.im.content.4 = View the learners' messages using Open IM. -tour.completion.chart.content = Graph showing the proportion of learners who have not started the lesson, are in progress or have completed the lesson. Hover over the graph sections to see the percentages. -tour.tab.sequence.content = The design tab allows you to manage where learners are in the lesson or make changes to the lesson design. -tour.activity.content = Double click on any activity to see the details for that activity. -tour.move.learners.title = View and Move Learners -tour.move.learners.small.content = If you have a small number of learners in an activity, hover over each person icon in an activity to find the right learner, then click on the learner to open a view of their current activity or click and drag the icon to move them to another activity. -tour.move.learners.affect.content = Moving a learner forward to a new activity marks them as completed in the earlier activity or activities, without the learner completing the activity themselves. -tour.move.learners.large.content = If you have a large number of learners in an activity, click on the group/people icon on the top right of the activity. This will bring up a box allowing you to select one or more learners to move, or to see the current activity view for a particular learner. -tour.completed.learners.title = Completed Learners -tour.completed.learners.content = The completed learners appear at the bottom of the screen. To make a learner complete the lesson, click and drag the learner's icon from their current activity to this area at the bottom of the screen. -tour.learner.search.title = Learner Search -tour.learner.search.content = Enter a first name, last name or login to search for a learner. -tour.live.edit.title = Live Edit -tour.live.edit.content = Change the lesson design. You can only change the parts not yet accessed by learners, such as adding new activities later in the lesson. -tour.tab.learners.content = Learners gives a learner by learner view of lesson progression. More learners are available via paging. -tour.learners.progress.content.1 = Blue circles indicate activities which have been completed by the learner. -tour.learners.progress.content.2 = Red squares indicate the current position of the learner in the lesson. -tour.learners.progress.content.3 = Green triangles represent activities not yet reached. -tour.completion.sorting.title = Sorting -tour.completion.sorting.content = Turn on to sort the completed learners first or turn off to sort alphabetically. -tour.journal.entries.content = View the entries in the learner's journal. These are entries are made in Learner, using the Save to Journal option in the Notebook. -tour.email.content = Send an email to a particular learner. -tour.this.is.disabled = This function is disabled while the tour is running. -tour.prev = Prev -tour.next = Next -tour.more.help = More -tour.end.tour = End Tour -label.tour = Tour -lesson.ratio.learners.tooltip = Started learners / total learners -tab.gradebook = Gradebook -tour.tab.selection.content.5 = Gradebook shows the marks for each learner. -tour.gradebook.learner.grades = Grades by learner -tour.gradebook.learner.grades.content = View each learner in the lesson and their overall mark. Click on the + to see the details for individual activities. -tour.gradebook.activity.grades = Grades by activity -tour.gradebook.activity.grades.content = View the average marks for each activity. Click on the + to see the details for learners. -tour.gradebook.export.grades = Export -tour.gradebook.export.grades.content = Download the marks in an Excel (.xlsx) spreadsheet. -tour.gradebook.release.marks = Release marks -tour.gradebook.release.marks.content = Enable/Disable the marks being shown to learners -tour.gradebook.show.marks.chart = Show chart -tour.gradebook.show.marks.chart.content = Show/hide a graph of the marks. -tour.gradebook.show.dates = Show dates -tour.gradebook.show.dates.content = Show/hide some of the date columns in the grids to make it easier to read. -tour.gradebook.marks.chart = Chart -tour.histogram.help.content = Click on a bar in the graph and then use your mouse wheel to zoom in and out of the graph. Once you zoom in, the grey selection in the bottom graph can be dragged left or right to show a different set of marks. -lesson.progress.email = Email reports -progress.email.send = Send now -progress.email.configure = Schedule reports -progress.email.subject = LAMS lesson progress: {0} -progress.email.sent.success = [0] email(s) sent. -export.dateheader = Exported on: -progress.email.send.now.question = Send the current learners progress report by email to yourself only now? -progress.email.send.failed = Some problems occurred while sending emails. Please, contact your system administrator. -progress.email.select.date.first = Please select a date first. -progress.email.enter.two.dates.first = Please add your first two dates and then a list can be generated. -progress.email.would.you.like.to.generate = Would you like to generate a list of dates based on your first two dates? You can then select from the list. -progress.email.how.many.dates.to.generate = How many dates would you like generated? -progress.email.will.be.sent.on = Reports will be emailed on: -progress.email.add.date = Add date -progress.email.generate.date.list = Generate date list -progress.email.select.date = Date: -progress.email.title = Progress reports -progress.email.heading.number.learners = # of Learners -progress.email.heading.overall.progress = Overall learner's progress -label.gate.title = Gate -label.unknown = Unknown -progress.email.sent.automatically = Email sent by automatically by LAMS on scheduled request -label.activity = Activity -label.status = Status -tour.progress.email.send.title = Email learners progress reports -tour.progress.email.send.content = Email a summary of the learners progress to yourself immediately. -tour.progress.email.configure.title = Schedule progress reports -tour.progress.email.confure.content = Set up the dates to automatically send emails with a summary of learners progress to all monitors for this lesson. -error.date.in.past = Selected date is in the past. -audit.lesson.removed.permanently = Lesson "{0}" ({1}) removed permanently. -audit.lesson.status.changed = Lesson "{0}" ({1}) status changed from "{2}" to "{3}" -tour.gradebook.show.weight = Show Weights -tour.gradebook.show.weight.content = Show/hide the activity weights used for marking this lesson. -label.no.learners = No learners in group. -label.lesson.finishes = Lesson finishes {0} -label.lesson.starts = Lesson starts {0} -button.schedule.disable.tooltip = Schedule lesson to be disabled at a future time -button.disable.now = Disable now -button.disable.now.tooltip = Disable the lesson immediately -label.reschedule = Reschedule -label.display.activity.scores = Display activity scores on completion -lesson.display.activity.scores.alert = Now learners can see their activity scores on lesson completion. -lesson.hide.activity.scores.alert = Now learners can not see their activity scores on lesson completion. -tour.display.activity.scores.content = Click on Display activity scores on completion to allow learners to see their activity scores when they finish a lesson. Click again to disable. -tour.lesson.description = Lesson description shown to the learner when the lesson is launched. It may be changed with the Lesson Introduction button below. -tour.edit.lesson.introduction = Change the lesson description (shown above). This description is shown to the learner when the lesson is launched. -label.tbl.monitor = TBL Monitor -label.teams = Teams -label.students.teams = Students & Teams -label.student = Student -label.gates = Gates -label.ira = iRAT -label.tra = tRAT -label.burning.questions = Burning Qs -label.forum = Forum -label.aes = AEs -label.sequence = Design -label.sequence.diagram = Design -label.refresh = Refresh -label.attendance = Attendance -label.users.knocking.on.gate = {0} users knocking on the gate... -label.comparison = Comparison -label.change.leader = Change leader -label.bar.chart = Bar chart -label.score = Score -label.ira.responses.for = iRAT responses for -label.tra.responses.for = tRAT responses for -label.note.leader.change = Note that the leader change only will take place for the activities in which the existing leader has not been set or commenced. -label.current.leader = Current leader: -label.leader.successfully.changed = Leader has been successfully changed -label.view.forum = View forum -label.switch.to.regular.monitor = Switch to regular monitor -label.peer.review = Peer Evaluation -email.notifications.archived.export.button = Export -email.notifications.archived.export.sheet.name = Notification -email.notifications.message.header = Message: -email.notifications.scheduled.messages.button = Scheduled -email.notifications.archived.messages.button = Archived -email.notifications.archived.messages.list = List of archived emails -email.notifications.archived.messages.list.sent.date = Sent on -email.notifications.archived.messages.list.sent.count = Sent to -email.notifications.archived.messages.list.learners = learners -label.gate.gate.open.user = by {0} -lesson.end = End: -error.lesson.end.date.must.be.after.start.date = Scheduled end date must be after the start date. -label.countdown.timer = Countdown timer -label.enter.countdown.time = Enter countdown time: -label.start = Start -label.countdown.time.left = Time Left: -label.stop = Stop -label.resume = Resume -label.hours = Hours -label.minutes = Minutes -label.seconds = Seconds -label.reset = Reset -label.time.is.expired = Time has expired. -lesson.task.tool = Tool contribution -label.person.editing.lesson = {0} is currently editing this lesson. -outcome.authoring.title = Learning outcomes -outcome.authoring.input = Search and select by outcome name or code -outcome.authoring.existing = Added outcomes -outcome.authoring.existing.none = none -outcome.authoring.remove.confirm = Are you sure you want to remove this learning outcome? -button.task.gate.open.now = Open now -button.task.gate.open.now.tooltip = Opens gate immediately -button.task.gate.open = Open selectively... -button.task.gate.open.tooltip = Choose which learners can go through the gate -button.task.gate.opened = Opened +button.finished=Finished +error.title=Error occured +label.synch.gate.title=Synch gate +label.permission.gate.title=Permission gate +label.schedule.gate.title=Schedule gate +label.schedule.gate.open.message=Schedule gate will be opened at: +label.schedule.gate.close.message=Schedule gate will be closed at: +label.gate.you.open.message=You may open the gate for the whole class +label.gate.gate.open=Gate was opened +label.gate.open=Open +label.gate.closed=Closed +label.gate.waiting.learners={0} out of {1} are waiting in front of the gate. +label.grouping.max.num.in.group.heading=Maximum number of groups: +label.grouping.general.instructions.heading=General instructions: +label.grouping.general.instructions.line1=Choose a course grouping to use in this lesson or create a new one. You are working with copies, so any changes made here have no influence on the original course groupings. Grouping with zero groups are not listed here. Once a grouping is chosen, the only way to come back to the grouping list is to manually remove all groups. +label.grouping.general.instructions.line2=Place the lesson participants in their groups. Initially you can add and remove learners, but once a groups is used (that is, a participant starts an activity that uses the grouping) you will not be able to remove learners from it. Even if a group is in use you can still add learners. The changes are saved immediately. +label.grouping.group.heading=Groups +label.grouping.non.grouped.users.heading=Learners without a group +label.grouping.grouped.users.heading=Members of selected group +label.grouping.no.groups.created=No groups have been created. +label.grouping.loading=Loading... +error.grouping.data=Required information not received from server. Error code: +error.grouping.add.group=Please enter a new group name to add. +error.grouping.remove.group=Please select a group to remove. +button.grouping.remove.selected.group=Remove selected group +button.grouping.add.group=Add group +button.grouping.add.user.to.group=Add selected to group +button.grouping.remove.user.from.group=Remove selected members +monitor.title=Monitor :: LAMS +preview.deleted.title=Preview data deleted +preview.deleted.message=Preview data for {0} lesson(s) has been deleted. +not.supported=This option is not supported for this activity. +NO.SUCH.LESSON=No such lesson with a lessonID of : {0} exists. +INVALID.ACTIVITYID=Invalid activityID :{0}. +INVALID.ACTIVITYID.TYPE=Invalid Activity type: {0}. Only ToolActivity allowed. +INVALID.ACTIVITYID.LESSONID=Invalid activityID/lessonID : {0} : {1}. +error.system.error=An error has occurred. Please start again. Reason for error: {0} +error.user.noprivilege=Sorry, you do not have the privilege to perform this action. +force.complete.stop.message.activity.done=Nothing changed as activity "{0}" is already complete. +force.complete.stop.message.grouping.error=Move to activity stopped at a grouping activity "{0}" due to system error. +force.complete.stop.message.grouping=Move to activity stopped at a grouping activity "{0}" that cannot be completed. +force.complete.stop.message.gate=Move to activity stopped at a gate "{0}" that cannot be opened. +force.complete.stop.message.completed.to.activity=Move to activity successful. +force.complete.stop.message.completed.to.end=Move to activity successful to end of the lesson. +force.complete.stop.message.stopped.unexpectedly=Move to activity has finished processing. Please check the learner's progress bar for their current activity. +audit.lesson.created=Lesson "{0}" created with learning design "{1}" ({2}) +label.branching.general.instructions=Place the lesson participants in their branches. Initially you can add and remove learners, but once a participant starts one of the branches then you will not be able to remove learners from any branches. If you try to remove someone from a branch and they will not remove then check their progress - if they start using the branch while you are on this screen you will not get any errors but you will not be able to remove them from the branch. You will still be able to add learners to branches. +label.branching.branch.heading=Branch +label.branching.non.allocated.users.heading=Learners without a branch +label.branching.allocated.users.heading=Members of selected branch +button.branching.add.user.to.branch=Add selected to branch +button.branching.remove.user.from.branch=Remove selected from branch +label.branching.general.group.instructions=Place the groups in their branches. Initially you can add and remove groups, but once a participant starts one of the branches then you will not be able to remove groups from any branches. You will still be able to add groups to branches. +label.branching.non.allocated.groups.heading=Groups without a branch +label.branching.allocated.groups.heading=Groups of the selected branch +label.started=Started +label.not.started=Not started +label.completed=Completed +label.condition.gate.title=Condition gate +label.gate.allow=Allow to pass +label.gate.open.single.learner=You may allow a single learner to pass the gate +label.gate.list.all.learners=Forbidden to pass +label.gate.list.waiting.learners=Waiting at the gate +label.gate.list.allowed.learners=Allowed to pass +label.grouping.status=Status: +label.grouping.functions=Group functions: +label.grouping.popup.change.group.name=Change group name +label.grouping.learners=Learners +label.grouping.popup.change.group.name.field=Enter new name: +label.grouping.popup.delete.group=Delete group +label.grouping.popup.delete.group.message=Are you sure you want to delete this group? +button.ok=OK +button.cancel=Cancel +button.yes=Yes +button.no=No +label.grouping.popup.drag.selection.message=Because some learners have already entered this grouping activity, it will only be possible to add new learners to groups. Learners can not be removed from groups. Once a learner is added to a group, the action can not be undone. +label.branching.popup.drag.selection.message=Because some learners have already entered this branching activity, it will only be possible to add new learners to branches. Learners can not be removed from branches, therefore, once a learner is added to a branch, the action can not be undone. +label.grouping.general.instructions.branching=This grouping activity is used for branching. Groups can therefore not be added or deleted. +label.grouping.popup.viewmode.message=You are presently in group view mode. Groups can not be modified. +label.gate.list.have.not.met.conditions.learners=Have not met conditions +message.gate.condition.force.pass=Note: This will allow all learners to pass regardless of the specified conditions. +show.average.checkbox=Show average +search.learner.textbox=Search +label.learner=Learner +title.lbl=Title +learner.lbl=Learners {0} +wizardTitle.x.lbl=Lesson: {0} +al.alert=Alert +al.validation.msg2=Title is a required field. +summery.desc.lbl=Description: +summery.learners.lbl=Learners: +al.validation.msg1=A valid design must be selected. +finish.btn=Start in Monitor +al.validation.schtime=Please select a future date and time for scheduling. +learners.group.name={0} learners +al.validation.msg3.2=There must be at least 1 monitor member and learner selected. +staff.group.name={0} monitors +confirmMsg.4.txt={0} instances of {1} have been started. +wizard.splitLearners.splitSum={0} instances of this lesson will be created and approximately {1} learners will be allocated to each lesson. +wizard.splitLearners.LearnersPerLesson.lbl=No. learners per lesson: +wizard.splitLearners.cb.lbl=Split learners into separate copies of this lesson? +wizard.learner.enLiveEdit.cb.lbl=Enable Live Edit +wizard.learner.enpres.cb.lbl=Allow Learners to see who is online +wizard.wkspc.date.modified.lbl=Last modified: {0} +staff.lbl=Monitors {0} +add.lesson.panel.title=Add Lesson to {0} +lesson.tab.label=Lesson +class.tab.label=Class +advanced.tab.label=Advanced +lesson.tab.heading.label=Select the design to add a lesson, and click on Add now +advanced.tab.form.advanced.options.label=Advanced options +advanced.tab.form.enable.im.label=Enable Instant Messaging +advanced.tab.form.scheduling.label=Scheduling +advanced.tab.form.enable.label=Enable +advanced.tab.form.validation.no.learners.error=No learners loaded, please go to the Learners tab. +advanced.tab.form.details.label=Details +class.tab.available.label=unselected +class.tab.selected.label=selected +class.tab.heading.label=Please use drag 'n drop to select or unselect monitors and learners +class.tab.print.name.label={0} {1} ({2}) +alert.no.learner.data=No learner data. +advanced.tab.form.time.limits.label=Time limitations +advanced.tab.form.enter.number.days.label=Number days: +advanced.tab.form.individual.not.entire.group.label=Is this time limit for each individual? +email.notifications.notify.sudents.that=Notify learners that: +email.notifications.lesson.notifications=Lesson notifications: {0} +email.notifications.course.notifications=Course notifications: {0} +email.notifications.user.name=User name [login] +email.notifications.lesson.name=Lesson name +email.notifications.send=Send +email.notifications.user.search.property.0=Are assigned to this lesson +email.notifications.user.search.property.1=Haven't finished this lesson +email.notifications.user.search.property.2=Have finished this lesson +email.notifications.user.search.property.3=Haven't started this lesson +email.notifications.user.search.property.4=Have started this lesson +email.notifications.user.search.property.5=Haven't reached particular activity +email.notifications.user.search.property.6=Have X days to deadline +email.notifications.user.search.property.7=Have finished a particular lesson +email.notifications.user.search.property.8=Haven't started a particular lesson +email.notifications.user.search.property.9=Haven't started any lessons +email.notifications.user.search.property.10=Have finished these lessons +email.notifications.activity=Choose activity +email.notifications.days.to.deadline=Choose number of days to deadline +event.emailnotifications.email.subject=LAMS notification +email.notifications.lesson=Choose lesson +email.notifications.lessons=Choose lessons +error.emailnotifications.email.subject=LAMS notification +email.notifications.emails.successfully.sent=Emails have been successfully sent to selected learners. +advanced.tab.enable.lesson.notifications=Enable lesson notifications +email.notifications.by.this.date=By this date: +email.notifications.emails.successfully.scheduled=Emails have been successfully scheduled to be sent on specified date. +email.notifications.scheduled.messages.list=List of scheduled emails +email.notifications.scheduled.messages.list.scheduled.date=Scheduled date +email.notifications.scheduled.messages.list.email.body=Email body +email.notifications.scheduled.messages.list.notify.sudents.that=Notify learners that +email.notifications.scheduled.messages.list.back=Back to notifications +email.notifications.table.now=Now +email.notifications.table.schedule=Schedule +email.notifications.button.schedule=Schedule +email.notifications.schedule.description=Choose a date when you want the message to be delivered. Note that the message will be sent to the learners that fulfil the criteria at the scheduled date. +email.notifications.user.search.property.11=Haven't finished these lessons +conditions.tab.label=Conditions +conditions.tab.form.preceding.label=Prerequisites +conditions.tab.form.preceding.info.label=Select a lesson that learners will need to complete before they can see the lesson you are about to create. +advanced.tab.form.time.limits.info.label=Set the number of days the lesson will be available to learners. After this period the lesson will not longer be shown. If the time should count from the moment the learner starts the lesson, select the option for individual time limit. +email.notifications.lesson.email.body.header=Hello, +email.notifications.lesson.email.body.msg=[put message here] +email.notifications.lesson.email.body.footer=Lesson: {0} ({1}) +email.notifications.course.email.body.header=Hello, +email.notifications.course.email.body.msg=[put message here] +advanced.tab.enable.lesson.intro=Enable lesson intro +advanced.tab.display.design.image=Display design image +email.notifications=Notifications +button.email=Email +lesson.name=Name: +lesson.state=Status: +lesson.learners=Learners +lesson.class=Class: +lesson.manage=Manage Lesson +button.view.learners=View/Email Learners +button.view.learners.tooltip=Shows all learners assigned to this lesson and allows to email them +button.edit.class=Edit class +button.edit.class.tooltip=Edit the list of learners and monitors assigned to this lesson +button.open.im=Open IM +lesson.change.state=Change status: +lesson.select.state=Select status +button.apply=Apply +lesson.change.state.tooltip=Change the status of this lesson based on the drop down selection +lesson.start=Start: +button.schedule=Schedule +button.schedule.tooltip=Schedule lesson to start in a future time +button.start.now=Start now +button.start.now.tooltip=Start the lesson immediately +lesson.enable.presence=Allow learners to see who is online +lesson.enable.presence.alert=Now learners can see who is online +lesson.disable.presence.alert=Now learners can not see who is online +lesson.enable.im=Enable Instant Messaging +lesson.enable.im.alert=Instant Messaging is now enabled +lesson.disable.im.alert=Instant Messaging is now disabled +lesson.required.tasks=Required tasks +lesson.task.gate=Permission gate +lesson.task.grouping=Choose grouping +lesson.task.branching=Instructor chosen branching +button.task.go=Go +button.task.go.tooltip=Complete this task now +lesson.monitors=Monitors +lesson.remove.alert=You have selected to remove this lesson. Removed lessons can not be retrieved again. Continue? +lesson.remove.doublecheck.alert=WARNING: This lesson is about to be removed! +lesson.state.created=Created but not started +lesson.state.scheduled=Scheduled +lesson.state.started=Started +lesson.state.suspended=Suspended +lesson.state.finished=Finished +lesson.state.archived=Archived +lesson.state.removed=Removed +lesson.state.action.disable=Disable +lesson.state.action.activate=Activate +lesson.state.action.remove=Remove +lesson.state.action.archive=Archive +error.lesson.schedule.date=No date was selected. Please select a date and time. +lesson.group.dialog.class=Class +label.learner.progress.activity.current.tooltip=This is the current activity +label.learner.progress.activity.completed.tooltip=Double click to review this completed activity +label.learner.progress.activity.attempted.tooltip=The learner has attempted but not yet finished this activity +label.learner.progress.activity.tostart.tooltip=The learner has to complete the activities before this activity to access it +label.learner.progress.activity.support.tooltip=Double click to open this support activity +button.timechart=Time chart +button.timechart.tooltip=View a chart of the selected learner progress against time for each activity +learners.page=Page +learners.order=Order by completion +learners.search.phrase.clear.tooltip=Clear search results +button.live.edit=Live Edit +button.live.edit.tooltip=Edit the current design for this lesson +button.live.edit.confirm=Live Edit allows you to modify the design of your lesson while the learners are attempting it. If you continue, your design will appear in Authoring for you to modify. Once you have done your changes you MUST "Apply changes" to the design so learners can progress. If these changes are not applied, the learners will NOT be able to continue with the lesson. Do you want to continue? +button.journal.entries=Journal entries +button.journal.entries.tooltip=View all Journal Entries saved by Learners +tab.lesson=Lesson +tab.sequence=Design +tab.learners=Learners +force.complete.click=Click on an activity to move learners [0] or click outside any activity to cancel. +force.complete.end.lesson.confirm=Are you sure you want to move learners [0] to the end of lesson? +force.complete.activity.confirm=Are you sure you want to move learners [0] to activity "[1]"? Please note that moving one learner takes several seconds. +force.complete.drop.fail=You have dropped learners [0] on either their current or on their completed activity "[1]". +force.complete.end.lesson.tooltip=To move learner to the end of lesson, drag them over to this bar. +learner.group.count=learners in total. +learner.group.show=Double-click for full list +learner.finished.dialog.title=End of lesson +learner.group.sort.button=Sort +button.force.complete=Move selected learners to... +button.view.learner=View learner +button.close=Close +button.help=Help +button.help.tooltip=Open help page +button.refresh=Refresh +button.refresh.tooltip=Reload the latest progress data +lesson.presence=Presence +sequence.help.info=Double click on an activity for more details +lesson.learner.url=Direct lesson link: +button.select=Select +learner.group.select.all=Select/Unselect all +email.notifications.problems.sending.emails=Some problems occurred while sending emails. Please, contact your system administrator. +learner.group.remove.progress=You are about to remove student(s) from a lesson. The student(s) will not have access to this lesson any longer. Do you also want to remove the student(s) progress? +force.complete.remove.content=You are moving learners [0] to activity "[1]". You can opt to delete the content of activities that have been previously done, so the learners have to enter the content/answers again. Otherwise only activities' completed status will be reset. +force.complete.remove.content.yes=Delete content +force.complete.remove.content.no=Keep content +label.schedule.gate.activity.completion.based=This gate is based on each learner's previous activity completion time +audit.force.complete=Attempted to force complete learner {0} to {1}. LessonId:{2}. +audit.force.complete.end.lesson=Attempted to force complete learner {0} to the end of the lesson. LessonId:{2}. +lesson.task.content.edited=Content being edited +lesson.task.attention=This activity requires attention +lesson.task.define.later=Define later +label.learner.progress.not.started=The learner has not started the lesson yet +button.save=Save +learner.group.forward.1=Next page +learner.group.forward.10=10 pages forward +learner.group.backward.1=Previous page +learner.group.backward.10=10 pages back +lesson.presence.count=users +email.notify.students.that=Notify students that +email.notifications.delete=Delete notification +email.notification.delete.alert1=About to delete the scheduled notification: {0} +email.notification.delete.alert2=This cannot be undone. Do you want to delete? +learner.group.multi.select=(ctrl+click or ⌘+click to select multiple learners) +lesson.im=Instant messaging +label.lesson.introduction=Lesson introduction +lesson.chart.title=Lesson completion +lesson.chart.started=In progress +lesson.chart.not.started=Not started +lesson.chart.completed=Completed +class.add.all.confirm=Do you want to add all learners to the class? +class.add.all.success=All learners were added to the class +button.edit.class.add.all=Add all +force.complete.learner.command.message=The instructor has moved you to another activity. +index.emailnotifications=Notifications +label.email=Email +lesson.chart.not.completed=Not completed +tour.intro.title=Monitor Tour +tour.intro.content=This short tour will show you the features of the LAMS Monitoring screen. You can stop the tour at any time by clicking End Tour, and restart it again by clicking on the Tour button. +tour.end.title=End Of Tour +tour.end.content.1=Thank you for taking the tour. To restart the tour, click the Tour button again. +tour.end.content.2=For further help, click on the More button below. +tour.tab.selection.title=Tab Selection +tour.tab.selection.content.1=Monitoring is broken into three areas, accessed by these titles at the top of the page. +tour.tab.selection.content.2=Lesson gives the overall lesson details. +tour.tab.selection.content.3=Design gives an overview of the lesson design and is used to access the activities. +tour.tab.selection.content.4=Learners shows the details about each learner. +tour.tab.refresh.content=Updates the screen. +tour.lesson.state.content.1=Click on the current status to change the status. The lesson can be Started, Suspended, Archived or Removed. +tour.lesson.state.content.2=Started or Activated lessons are available for learners to participate in. +tour.lesson.state.content.3=Suspended or Disabled lessons are lessons that have been disabled by a monitor. Learners cannot see but not access disabled lessons. Learners currently in the lesson (with a learner window open) can progress through the lesson. +tour.lesson.state.content.4=Archived lessons do not appear on learner's main screen, but are available for Monitors to view. +tour.lesson.state.content.5=Removed lessons are removed altogether and cannot be retrieved. +tour.lesson.count.learners.content.1=This area shows the number of learners who have started the lesson so far, and the total number of learners who are able to access it. +tour.lesson.count.learners.content.2=Note that this does NOT indicate the number of learners online at this moment, but rather how many learners have joined the lesson since it was started. +tour.learner.in.class.content=Display the learners in the class. From the resulting learner list you can email a particular learner. +tour.edit.class.content=Add or Remove learners from the lesson. +tour.email.notifications.content=Send an email notification to one or more learners. Notifications can be scheduled for later sending. +tour.lesson.im.content.1=Click on Presence to allow learners to see who is currently online. +tour.lesson.im.content.2=Once Presence is on, the number of learners online is shown on the Presence button. Click Instant Messaging to allow learners to message each other. +tour.lesson.im.content.3=Click on Presence and Instant Messaging again to disable. +tour.lesson.im.content.4=View the learners' messages using Open IM. +tour.completion.chart.content=Graph showing the proportion of learners who have not started the lesson, are in progress or have completed the lesson. Hover over the graph sections to see the percentages. +tour.tab.sequence.content=The design tab allows you to manage where learners are in the lesson or make changes to the lesson design. +tour.activity.content=Double click on any activity to see the details for that activity. +tour.move.learners.title=View and Move Learners +tour.move.learners.small.content=If you have a small number of learners in an activity, hover over each person icon in an activity to find the right learner, then click on the learner to open a view of their current activity or click and drag the icon to move them to another activity. +tour.move.learners.affect.content=Moving a learner forward to a new activity marks them as completed in the earlier activity or activities, without the learner completing the activity themselves. +tour.move.learners.large.content=If you have a large number of learners in an activity, click on the group/people icon on the top right of the activity. This will bring up a box allowing you to select one or more learners to move, or to see the current activity view for a particular learner. +tour.completed.learners.title=Completed Learners +tour.completed.learners.content=The completed learners appear at the bottom of the screen. To make a learner complete the lesson, click and drag the learner's icon from their current activity to this area at the bottom of the screen. +tour.learner.search.title=Learner Search +tour.learner.search.content=Enter a first name, last name or login to search for a learner. +tour.live.edit.title=Live Edit +tour.live.edit.content=Change the lesson design. You can only change the parts not yet accessed by learners, such as adding new activities later in the lesson. +tour.tab.learners.content=Learners gives a learner by learner view of lesson progression. More learners are available via paging. +tour.learners.progress.content.1=Blue circles indicate activities which have been completed by the learner. +tour.learners.progress.content.2=Red squares indicate the current position of the learner in the lesson. +tour.learners.progress.content.3=Green triangles represent activities not yet reached. +tour.completion.sorting.title=Sorting +tour.completion.sorting.content=Turn on to sort the completed learners first or turn off to sort alphabetically. +tour.journal.entries.content=View the entries in the learner's journal. These are entries are made in Learner, using the Save to Journal option in the Notebook. +tour.email.content=Send an email to a particular learner. +tour.this.is.disabled=This function is disabled while the tour is running. +tour.prev=Prev +tour.next=Next +tour.more.help=More +tour.end.tour=End Tour +label.tour=Tour +lesson.ratio.learners.tooltip=Started learners / total learners +tab.gradebook=Gradebook +tour.tab.selection.content.5=Gradebook shows the marks for each learner. +tour.gradebook.learner.grades=Grades by learner +tour.gradebook.learner.grades.content=View each learner in the lesson and their overall mark. Click on the + to see the details for individual activities. +tour.gradebook.activity.grades=Grades by activity +tour.gradebook.activity.grades.content=View the average marks for each activity. Click on the + to see the details for learners. +tour.gradebook.export.grades=Export +tour.gradebook.export.grades.content=Download the marks in an Excel (.xlsx) spreadsheet. +tour.gradebook.release.marks=Release marks +tour.gradebook.release.marks.content=Enable/Disable the marks being shown to learners +tour.gradebook.show.marks.chart=Show chart +tour.gradebook.show.marks.chart.content=Show/hide a graph of the marks. +tour.gradebook.show.dates=Show dates +tour.gradebook.show.dates.content=Show/hide some of the date columns in the grids to make it easier to read. +tour.gradebook.marks.chart=Chart +tour.histogram.help.content=Click on a bar in the graph and then use your mouse wheel to zoom in and out of the graph. Once you zoom in, the grey selection in the bottom graph can be dragged left or right to show a different set of marks. +lesson.progress.email=Email reports +progress.email.send=Send now +progress.email.configure=Schedule reports +progress.email.subject=LAMS lesson progress: {0} +progress.email.sent.success=[0] email(s) sent. +export.dateheader=Exported on: +progress.email.send.now.question=Send the current learners progress report by email to yourself only now? +progress.email.send.failed=Some problems occurred while sending emails. Please, contact your system administrator. +progress.email.select.date.first=Please select a date first. +progress.email.enter.two.dates.first=Please add your first two dates and then a list can be generated. +progress.email.would.you.like.to.generate=Would you like to generate a list of dates based on your first two dates? You can then select from the list. +progress.email.how.many.dates.to.generate=How many dates would you like generated? +progress.email.will.be.sent.on=Reports will be emailed on: +progress.email.add.date=Add date +progress.email.generate.date.list=Generate date list +progress.email.select.date=Date: +progress.email.title=Progress reports +progress.email.heading.number.learners=# of Learners +progress.email.heading.overall.progress=Overall learner's progress +label.gate.title=Gate +label.unknown=Unknown +progress.email.sent.automatically=Email sent by automatically by LAMS on scheduled request +label.activity=Activity +label.status=Status +tour.progress.email.send.title=Email learners progress reports +tour.progress.email.send.content=Email a summary of the learners progress to yourself immediately. +tour.progress.email.configure.title=Schedule progress reports +tour.progress.email.confure.content=Set up the dates to automatically send emails with a summary of learners progress to all monitors for this lesson. +error.date.in.past=Selected date is in the past. +audit.lesson.removed.permanently=Lesson "{0}" ({1}) removed permanently. +audit.lesson.status.changed=Lesson "{0}" ({1}) status changed from "{2}" to "{3}" +tour.gradebook.show.weight=Show Weights +tour.gradebook.show.weight.content=Show/hide the activity weights used for marking this lesson. +label.no.learners=No learners in group. +label.lesson.finishes=Lesson finishes {0} +label.lesson.starts=Lesson starts {0} +button.schedule.disable.tooltip=Schedule lesson to be disabled at a future time +button.disable.now=Disable now +button.disable.now.tooltip=Disable the lesson immediately +label.reschedule=Reschedule +label.display.activity.scores=Display activity scores on completion +lesson.display.activity.scores.alert=Now learners can see their activity scores on lesson completion. +lesson.hide.activity.scores.alert=Now learners can not see their activity scores on lesson completion. +tour.display.activity.scores.content=Click on Display activity scores on completion to allow learners to see their activity scores when they finish a lesson. Click again to disable. +tour.lesson.description=Lesson description shown to the learner when the lesson is launched. It may be changed with the Lesson Introduction button below. +tour.edit.lesson.introduction=Change the lesson description (shown above). This description is shown to the learner when the lesson is launched. +label.tbl.monitor=TBL Monitor +label.teams=Teams +label.students.teams=Students & Teams +label.student=Student +label.gates=Gates +label.ira=iRAT +label.tra=tRAT +label.burning.questions=Burning Qs +label.forum=Forum +label.aes=AEs +label.sequence=Design +label.sequence.diagram=Design +label.refresh=Refresh +label.attendance=Attendance +label.users.knocking.on.gate={0} users knocking on the gate... +label.comparison=Comparison +label.change.leader=Change leader +label.bar.chart=Bar chart +label.score=Score +label.ira.responses.for=iRAT responses for +label.tra.responses.for=tRAT responses for +label.note.leader.change=Note that the leader change only will take place for the activities in which the existing leader has not been set or commenced. +label.current.leader=Current leader: +label.leader.successfully.changed=Leader has been successfully changed +label.view.forum=View forum +label.switch.to.regular.monitor=Switch to regular monitor +label.peer.review=Peer Evaluation +email.notifications.archived.export.button=Export +email.notifications.archived.export.sheet.name=Notification +email.notifications.message.header=Message: +email.notifications.scheduled.messages.button=Scheduled +email.notifications.archived.messages.button=Archived +email.notifications.archived.messages.list=List of archived emails +email.notifications.archived.messages.list.sent.date=Sent on +email.notifications.archived.messages.list.sent.count=Sent to +email.notifications.archived.messages.list.learners=learners +label.gate.gate.open.user=by {0} +lesson.end=End: +error.lesson.end.date.must.be.after.start.date=Scheduled end date must be after the start date. +label.countdown.timer=Countdown timer +label.enter.countdown.time=Enter countdown time: +label.start=Start +label.countdown.time.left=Time Left: +label.stop=Stop +label.resume=Resume +label.hours=Hours +label.minutes=Minutes +label.seconds=Seconds +label.reset=Reset +label.time.is.expired=Time has expired. +lesson.task.tool=Tool contribution +label.person.editing.lesson={0} is currently editing this lesson. +outcome.authoring.title=Learning outcomes +outcome.authoring.input=Search and select by outcome name or code +outcome.authoring.existing=Added outcomes +outcome.authoring.existing.none=none +outcome.authoring.remove.confirm=Are you sure you want to remove this learning outcome? +button.task.gate.open.now=Open now +button.task.gate.open.now.tooltip=Opens gate immediately +button.task.gate.open=Open selectively... +button.task.gate.open.tooltip=Choose which learners can go through the gate +button.task.gate.opened=Opened # Button for closing an opened permission gate. -button.task.gate.close = Close gate +button.task.gate.close=Close gate # Tooltip of a button for closing an opened permission gate -button.task.gate.close.tooltip = Immediately closes the gate again -label.password.gate.title = Password gate -label.gate.password = Change the gate password -button.gate.password = Change -lesson.task.gate.password = Password gate +button.task.gate.close.tooltip=Immediately closes the gate again +label.password.gate.title=Password gate +label.gate.password=Change the gate password +button.gate.password=Change +lesson.task.gate.password=Password gate # Tooltip for a button which leads to an open gate status page -button.task.gate.opened.tooltip = See gate status -button.force.complete.all = Move all learners to... -tab.instructions = Instructions -tab.instructions.title = Teaching Instructions -label.aes.questions.marks = AE Questions & Marks -label.ira.correct.count = iRAT correct answers -label.ira.correct.count.average = iRAT correct answers average -label.ira.tra.average = Average -label.tra.correct.count = tRAT correct answers -label.ira.tra.highest = Highest -label.ira.tra.lowest = Lowest -label.ira.tra.delta = Increase iRAT vs tRAT -label.ira.tra.correct.count = correct answers iRAT & tRAT -label.ira.tra.summary = Summary -label.teams.setup = Setup teams -button.canvas.fit.screen = Fit screen -button.canvas.fit.screen.tooltip = Enlarge / shrink design image to fit window -button.canvas.original.size = Original size -button.canvas.original.size.tooltip = Show design image with original size -label.gate.stop.at.preceding = Learners will be stopped at the preceding activity. -label.monitoring.time.limit = Timing limits -label.monitoring.time.limit.relative = Duration relative to from student start -label.monitoring.time.limit.relative.desc = Set the duration in minutes that the learners will have to have to complete the assessment. The duration will apply from the moment each learner begins the assessment. For example, if set to 5 minutes, all learners will have 5 minutes from the moment each of them start the assessment. -label.monitoring.time.limit.absolute = Duration for all learners -label.monitoring.time.limit.absolute.desc = Set the number of minutes to finish the assessment for all learners. This duration applies to all learners regardless when each of them starts the assessment. Set the minutes and click Start for the time to apply. -label.monitoring.time.limit.individual = Individual extensions -label.monitoring.time.limit.individual.desc = Apply duration extensions for individual learners. Search the learner and then apply extra time. -label.monitoring.time.limit.minutes = minutes -label.monitoring.time.limit.enabled = Enabled -label.monitoring.time.limit.disabled = Disabled -label.monitoring.time.limit.start = Start -label.monitoring.time.limit.cancel = Cancel -label.monitoring.time.limit.plus.minute.1 = + 1 minute -label.monitoring.time.limit.plus.minute.5 = + 5 minutes -label.monitoring.time.limit.minus.minute.1 = - 1 minute -label.monitoring.time.limit.minus.minute.5 = - 5 minutes -label.monitoring.time.limit.finish.now = Finish now -label.monitoring.time.limit.finish.now.confirm = Are you sure you want to make all learners finish their work right now? -label.monitoring.time.limit.individual.placeholder = Type name -label.monitoring.time.limit.expired = Expired -label.monitoring.time.limit.show.controls = Show controls -tab.dashboard = Dashboard -button.edit.lesson.name = Edit lesson name -lesson.ratio.learners.started = Started learners: -lesson.ratio.learners.total = Total learners: -label.monitoring.logo = LAMS logo -label.monitoring.return.to.index = Return to course -label.monitoring.edit.lesson.settings = Edit lesson settings -label.monitoring.edit = Edit -label.monitoring.burning.questions = Burning Questions -label.monitoring.teams.question.results.question = Question -label.monitoring.teams.question.results = Question results -label.monitoring.learners.no.progress = No progress yet -label.monitoring.learners.time.taken = Time taken -label.monitoring.learners.mark = Mark -button.copy.lesson.url.tooltip = Copy lesson link to clipboard -learner.completed.activity.count = Completed activities -learner.completed.lesson = Lesson finished -label.monitoring.search.learners = Search learners -label.monitoring.learning.design.path = Path to learning design -label.monitoring.learning.design.path.courses = Courses -label.monitoring.learning.design.path.run.sequences = Run sequences -label.monitoring.time.limit.absolute.await.trigger = starts when first learner enters +button.task.gate.opened.tooltip=See gate status +button.force.complete.all=Move all learners to... +tab.instructions=Instructions +tab.instructions.title=Teaching Instructions +label.aes.questions.marks=AE Questions & Marks +label.ira.correct.count=iRAT correct answers +label.ira.correct.count.average=iRAT correct answers average +label.ira.tra.average=Average +label.tra.correct.count=tRAT correct answers +label.ira.tra.highest=Highest +label.ira.tra.lowest=Lowest +label.ira.tra.delta=Increase iRAT vs tRAT +label.ira.tra.correct.count=correct answers iRAT & tRAT +label.ira.tra.summary=Summary +label.teams.setup=Setup teams +button.canvas.fit.screen=Fit screen +button.canvas.fit.screen.tooltip=Enlarge / shrink design image to fit window +button.canvas.original.size=Original size +button.canvas.original.size.tooltip=Show design image with original size +label.gate.stop.at.preceding=Learners will be stopped at the preceding activity. +label.monitoring.time.limit=Timing limits +label.monitoring.time.limit.relative=Duration relative to from student start +label.monitoring.time.limit.relative.desc=Set the duration in minutes that the learners will have to have to complete the assessment. The duration will apply from the moment each learner begins the assessment. For example, if set to 5 minutes, all learners will have 5 minutes from the moment each of them start the assessment. +label.monitoring.time.limit.absolute=Duration for all learners +label.monitoring.time.limit.absolute.desc=Set the number of minutes to finish the assessment for all learners. This duration applies to all learners regardless when each of them starts the assessment. Set the minutes and click Start for the time to apply. +label.monitoring.time.limit.individual=Individual extensions +label.monitoring.time.limit.individual.desc=Apply duration extensions for individual learners. Search the learner and then apply extra time. +label.monitoring.time.limit.minutes=minutes +label.monitoring.time.limit.enabled=Enabled +label.monitoring.time.limit.disabled=Disabled +label.monitoring.time.limit.start=Start +label.monitoring.time.limit.cancel=Cancel +label.monitoring.time.limit.plus.minute.1=+ 1 minute +label.monitoring.time.limit.plus.minute.5=+ 5 minutes +label.monitoring.time.limit.minus.minute.1=- 1 minute +label.monitoring.time.limit.minus.minute.5=- 5 minutes +label.monitoring.time.limit.finish.now=Finish now +label.monitoring.time.limit.finish.now.confirm=Are you sure you want to make all learners finish their work right now? +label.monitoring.time.limit.individual.placeholder=Type name +label.monitoring.time.limit.expired=Expired +label.monitoring.time.limit.show.controls=Show controls +tab.dashboard=Dashboard +button.edit.lesson.name=Edit lesson name +lesson.ratio.learners.started=Started learners: +lesson.ratio.learners.total=Total learners: +label.monitoring.logo=LAMS logo +label.monitoring.return.to.index=Return to course +label.monitoring.edit.lesson.settings=Edit lesson settings +label.monitoring.edit=Edit +label.monitoring.burning.questions=Burning Questions +label.monitoring.teams.question.results.question=Question +label.monitoring.teams.question.results=Question results +label.monitoring.learners.no.progress=No progress yet +label.monitoring.learners.time.taken=Time taken +label.monitoring.learners.mark=Mark +button.copy.lesson.url.tooltip=Copy lesson link to clipboard +learner.completed.activity.count=Completed activities +learner.completed.lesson=Lesson finished +label.monitoring.search.learners=Search learners +label.monitoring.learning.design.path=Path to learning design +label.monitoring.learning.design.path.courses=Courses +label.monitoring.learning.design.path.run.sequences=Run sequences +label.monitoring.time.limit.absolute.await.trigger=starts when first learner enters \ No newline at end of file Index: lams_monitoring/conf/language/lams/ApplicationResources_en_AU.properties =================================================================== diff -u -rec05d1ee8615ffb69e594e5551e5f93d692bccb4 -rd7bfc30e7d7a056b984f35c292a7abed4635c754 --- lams_monitoring/conf/language/lams/ApplicationResources_en_AU.properties (.../ApplicationResources_en_AU.properties) (revision ec05d1ee8615ffb69e594e5551e5f93d692bccb4) +++ lams_monitoring/conf/language/lams/ApplicationResources_en_AU.properties (.../ApplicationResources_en_AU.properties) (revision d7bfc30e7d7a056b984f35c292a7abed4635c754) @@ -260,7 +260,7 @@ learner.group.select.all = Select/Unselect all email.notifications.problems.sending.emails = Some problems occurred while sending emails. Please, contact your system administrator. learner.group.remove.progress = You are about to remove student(s) from a lesson. The student(s) will not have access to this lesson any longer. Do you also want to remove the student(s) progress? -force.complete.remove.content = You are moving learners [0] to activity "[1]". You can opt to delete the content of activities that have been previously done, so the learners have to enter the content/answers again. +force.complete.remove.content=You are moving learners [0] to activity "[1]". You can opt to delete the content of activities that have been previously done, so the learners have to enter the content/answers again. Otherwise only activities' completed status will be reset. force.complete.remove.content.yes = Delete content force.complete.remove.content.no = Keep content label.schedule.gate.activity.completion.based = This gate is based on each learner's previous activity completion time @@ -542,4 +542,4 @@ label.monitoring.learning.design.path = Path to learning design label.monitoring.learning.design.path.courses = Courses label.monitoring.learning.design.path.run.sequences = Run sequences -label.monitoring.time.limit.absolute.await.trigger = starts when first learner enters +label.monitoring.time.limit.absolute.await.trigger = starts when first learner enters \ No newline at end of file Index: lams_monitoring/src/java/org/lamsfoundation/lams/monitoring/service/MonitoringService.java =================================================================== diff -u -r9977d4544bd83f5f9a17c0013448b289fc077aa7 -rd7bfc30e7d7a056b984f35c292a7abed4635c754 --- lams_monitoring/src/java/org/lamsfoundation/lams/monitoring/service/MonitoringService.java (.../MonitoringService.java) (revision 9977d4544bd83f5f9a17c0013448b289fc077aa7) +++ lams_monitoring/src/java/org/lamsfoundation/lams/monitoring/service/MonitoringService.java (.../MonitoringService.java) (revision d7bfc30e7d7a056b984f35c292a7abed4635c754) @@ -1725,13 +1725,11 @@ for (Activity activity : uncompleteActivities) { learnerProgress.getAttemptedActivities().remove(activity); learnerProgress.getCompletedActivities().remove(activity); - if (removeLearnerContent) { - // the iteration goes from the end of the sequence to the beginning - // once an activity reports it will not reset its read-only flag, no other activities will reset it - // Also target activity does not have it reset - resetReadOnly = removeLearnerContent(activity, learner, - resetReadOnly && !activity.equals(targetActivity)); - } + // the iteration goes from the end of the sequence to the beginning + // once an activity reports it will not reset its read-only flag, no other activities will reset it + // Also target activity does not have it reset + resetReadOnly = removeLearnerContent(activity, learner, !removeLearnerContent, + resetReadOnly && !activity.equals(targetActivity)); } // set target activity as attempted @@ -2723,7 +2721,7 @@ activities.addAll(learnerProgress.getCompletedActivities().keySet()); boolean resetReadOnly = true; for (Activity activity : activities) { - resetReadOnly = removeLearnerContent(activity, learner, resetReadOnly); + resetReadOnly = removeLearnerContent(activity, learner, false, resetReadOnly); } } @@ -2948,10 +2946,11 @@ /** * Removes learner content from ToolActivities and resets read-only flag, if possible. */ - private boolean removeLearnerContent(Activity activity, User learner, boolean resetReadOnly) { + private boolean removeLearnerContent(Activity activity, User learner, boolean resetActivityCompletionOnly, + boolean resetReadOnly) { activity = getActivityById(activity.getActivityId()); // remove learner content from this activity - boolean update = lamsCoreToolService.removeLearnerContent(activity, learner); + boolean update = lamsCoreToolService.removeLearnerContent(activity, learner, resetActivityCompletionOnly); if (update) { activityDAO.update(activity); } Index: lams_tool_assessment/src/java/org/lamsfoundation/lams/tool/assessment/service/AssessmentServiceImpl.java =================================================================== diff -u -r7a06b75af5f08854848a931748f2d447d7977c04 -rd7bfc30e7d7a056b984f35c292a7abed4635c754 --- lams_tool_assessment/src/java/org/lamsfoundation/lams/tool/assessment/service/AssessmentServiceImpl.java (.../AssessmentServiceImpl.java) (revision 7a06b75af5f08854848a931748f2d447d7977c04) +++ lams_tool_assessment/src/java/org/lamsfoundation/lams/tool/assessment/service/AssessmentServiceImpl.java (.../AssessmentServiceImpl.java) (revision d7bfc30e7d7a056b984f35c292a7abed4635c754) @@ -353,9 +353,7 @@ } } - } - } } } @@ -3329,38 +3327,60 @@ } @Override - public void removeLearnerContent(Long toolContentId, Integer userId) throws ToolException { + public void removeLearnerContent(Long toolContentId, Integer userId, boolean resetActivityCompletionOnly) + throws ToolException { + if (log.isDebugEnabled()) { - log.debug("Removing Assessment results for user ID " + userId + " and toolContentId " + toolContentId); + if (resetActivityCompletionOnly) { + log.debug("Resetting Assessment completion for user ID " + userId + " and toolContentId " + + toolContentId); + } else { + log.debug("Removing Assessment results for user ID " + userId + " and toolContentId " + toolContentId); + } } List sessions = assessmentSessionDao.getByContentId(toolContentId); for (AssessmentSession session : sessions) { List results = assessmentResultDao.getAssessmentResultsBySession(session.getSessionId(), userId.longValue()); + for (AssessmentResult result : results) { - for (AssessmentQuestionResult questionResult : result.getQuestionResults()) { - assessmentQuestionResultDao.removeObject(AssessmentQuestionResult.class, questionResult.getUid()); + if (resetActivityCompletionOnly) { + if (result.isLatest() && result.getFinishDate() != null) { + result.setFinishDate(null); + assessmentResultDao.saveObject(result); + } + } else { + for (AssessmentQuestionResult questionResult : result.getQuestionResults()) { + assessmentQuestionResultDao.removeObject(AssessmentQuestionResult.class, + questionResult.getUid()); + } + assessmentResultDao.removeObject(AssessmentResult.class, result.getUid()); } - assessmentResultDao.removeObject(AssessmentResult.class, result.getUid()); } AssessmentUser user = assessmentUserDao.getUserByUserIDAndSessionID(userId.longValue(), session.getSessionId()); if (user != null) { - NotebookEntry entry = getEntry(session.getSessionId(), userId); - if (entry != null) { - assessmentDao.removeObject(NotebookEntry.class, entry.getUid()); - } - if ((session.getGroupLeader() != null) && session.getGroupLeader().getUid().equals(user.getUid())) { - session.setGroupLeader(null); - } + if (resetActivityCompletionOnly) { + user.setSessionFinished(false); + assessmentUserDao.saveObject(user); + } else { + NotebookEntry entry = getEntry(session.getSessionId(), userId); + if (entry != null) { + assessmentDao.removeObject(NotebookEntry.class, entry.getUid()); + } - // propagade changes to Gradebook - toolService.removeActivityMark(userId, session.getSessionId()); + if ((session.getGroupLeader() != null) && session.getGroupLeader().getUid().equals(user.getUid())) { + session.setGroupLeader(null); + } - assessmentUserDao.removeObject(AssessmentUser.class, user.getUid()); + // propagade changes to Gradebook + toolService.removeActivityMark(userId, session.getSessionId()); + + assessmentUserDao.removeObject(AssessmentUser.class, user.getUid()); + } } } } @@ -3807,7 +3827,7 @@ return new ToolCompletionStatus(ToolCompletionStatus.ACTIVITY_ATTEMPTED, startDate, null); } } - // ****************** REST methods ************************* +// ****************** REST methods ************************* /** * Rest call to create a new Assessment content. Required fields in toolContentJSON: "title", "instructions", Index: lams_tool_bbb/src/java/org/lamsfoundation/lams/tool/bbb/service/BbbService.java =================================================================== diff -u -r20aa6cbca9fc96d341080e6ad39f82593443f792 -rd7bfc30e7d7a056b984f35c292a7abed4635c754 --- lams_tool_bbb/src/java/org/lamsfoundation/lams/tool/bbb/service/BbbService.java (.../BbbService.java) (revision 20aa6cbca9fc96d341080e6ad39f82593443f792) +++ lams_tool_bbb/src/java/org/lamsfoundation/lams/tool/bbb/service/BbbService.java (.../BbbService.java) (revision d7bfc30e7d7a056b984f35c292a7abed4635c754) @@ -23,10 +23,6 @@ package org.lamsfoundation.lams.tool.bbb.service; -import java.util.ArrayList; -import java.util.List; -import java.util.SortedMap; - import org.lamsfoundation.lams.confidencelevel.ConfidenceLevelDTO; import org.lamsfoundation.lams.tool.ToolCompletionStatus; import org.lamsfoundation.lams.tool.ToolContentManager; @@ -38,6 +34,10 @@ import org.lamsfoundation.lams.tool.exception.ToolException; import org.lamsfoundation.lams.usermanagement.User; +import java.util.ArrayList; +import java.util.List; +import java.util.SortedMap; + /** * An implementation of the IBbbService interface. * @@ -90,7 +90,7 @@ public List getConfidenceLevels(Long toolSessionId) { return null; } - + @Override public boolean isUserGroupLeader(Long userId, Long toolSessionId) { return false; @@ -113,7 +113,8 @@ } @Override - public void removeLearnerContent(Long toolContentId, Integer userId) throws ToolException { + public void removeLearnerContent(Long toolContentId, Integer userId, boolean resetActivityCompletionOnly) + throws ToolException { } @Override @@ -155,4 +156,4 @@ public ToolCompletionStatus getCompletionStatus(Long learnerId, Long toolSessionId) { return null; } -} +} \ No newline at end of file Index: lams_tool_chat/src/java/org/lamsfoundation/lams/tool/chat/service/ChatService.java =================================================================== diff -u -r20aa6cbca9fc96d341080e6ad39f82593443f792 -rd7bfc30e7d7a056b984f35c292a7abed4635c754 --- lams_tool_chat/src/java/org/lamsfoundation/lams/tool/chat/service/ChatService.java (.../ChatService.java) (revision 20aa6cbca9fc96d341080e6ad39f82593443f792) +++ lams_tool_chat/src/java/org/lamsfoundation/lams/tool/chat/service/ChatService.java (.../ChatService.java) (revision d7bfc30e7d7a056b984f35c292a7abed4635c754) @@ -23,22 +23,10 @@ package org.lamsfoundation.lams.tool.chat.service; -import java.util.ArrayList; -import java.util.Collection; -import java.util.Date; -import java.util.List; -import java.util.Map; -import java.util.Random; -import java.util.Set; -import java.util.SortedMap; -import java.util.concurrent.ConcurrentHashMap; -import java.util.regex.Matcher; -import java.util.regex.Pattern; - +import com.fasterxml.jackson.databind.node.ObjectNode; import org.apache.log4j.Logger; import org.lamsfoundation.lams.confidencelevel.ConfidenceLevelDTO; import org.lamsfoundation.lams.contentrepository.client.IToolContentHandler; -import org.lamsfoundation.lams.learningdesign.dto.ActivityPositionDTO; import org.lamsfoundation.lams.learningdesign.service.ExportToolContentException; import org.lamsfoundation.lams.learningdesign.service.IExportToolContentService; import org.lamsfoundation.lams.learningdesign.service.ImportToolContentException; @@ -73,7 +61,17 @@ import org.lamsfoundation.lams.usermanagement.dto.UserDTO; import org.lamsfoundation.lams.util.JsonUtil; -import com.fasterxml.jackson.databind.node.ObjectNode; +import java.util.ArrayList; +import java.util.Collection; +import java.util.Date; +import java.util.List; +import java.util.Map; +import java.util.Random; +import java.util.Set; +import java.util.SortedMap; +import java.util.concurrent.ConcurrentHashMap; +import java.util.regex.Matcher; +import java.util.regex.Pattern; /** * An implementation of the IChatService interface. @@ -111,8 +109,9 @@ @Override public void createToolSession(Long toolSessionId, String toolSessionName, Long toolContentId) throws ToolException { if (ChatService.logger.isDebugEnabled()) { - ChatService.logger.debug("entering method createToolSession:" + " toolSessionId = " + toolSessionId - + " toolSessionName = " + toolSessionName + " toolContentId = " + toolContentId); + ChatService.logger.debug( + "entering method createToolSession:" + " toolSessionId = " + toolSessionId + " toolSessionName = " + + toolSessionName + " toolContentId = " + toolContentId); } ChatSession session = new ChatSession(); @@ -163,7 +162,7 @@ // } return toolService.completeToolSession(toolSessionId, learnerId); } - + @Override public String finishToolSession(Long userUid) { @@ -221,7 +220,7 @@ public List getConfidenceLevels(Long toolSessionId) { return null; } - + @Override public boolean isUserGroupLeader(Long userId, Long toolSessionId) { return false; @@ -238,8 +237,9 @@ public void copyToolContent(Long fromContentId, Long toContentId) throws ToolException { if (ChatService.logger.isDebugEnabled()) { - ChatService.logger.debug("entering method copyToolContent:" + " fromContentId=" + fromContentId - + " toContentId=" + toContentId); + ChatService.logger.debug( + "entering method copyToolContent:" + " fromContentId=" + fromContentId + " toContentId=" + + toContentId); } if (toContentId == null) { @@ -291,50 +291,57 @@ @Override @SuppressWarnings("unchecked") - public void removeLearnerContent(Long toolContentId, Integer userId) throws ToolException { - if (ChatService.logger.isDebugEnabled()) { - ChatService.logger - .debug("Removing Chat messages for user ID " + userId + " and toolContentId " + toolContentId); + public void removeLearnerContent(Long toolContentId, Integer userId, boolean resetActivityCompletionOnly) + throws ToolException { + if (logger.isDebugEnabled()) { + if (resetActivityCompletionOnly) { + logger.debug("Resetting Chat completion for user ID " + userId + " and toolContentId " + toolContentId); + } else { + ChatService.logger.debug( + "Removing Chat messages for user ID " + userId + " and toolContentId " + toolContentId); + } } + Chat chat = chatDAO.getByContentId(toolContentId); if (chat == null) { - ChatService.logger - .warn("Did not find activity with toolContentId: " + toolContentId + " to remove learner content"); + ChatService.logger.warn( + "Did not find activity with toolContentId: " + toolContentId + " to remove learner content"); return; } - for (ChatSession session : (Set) chat.getChatSessions()) { + for (ChatSession session : chat.getChatSessions()) { ChatUser user = chatUserDAO.getByUserIdAndSessionId(userId.longValue(), session.getSessionId()); if (user != null) { - List messages = chatMessageDAO.getSentByUser(user.getUid()); - if (!messages.isEmpty()) { - for (ChatMessage message : messages) { - chatMessageDAO.delete(message); - session.getChatMessages().remove(message); + if (!resetActivityCompletionOnly) { + List messages = chatMessageDAO.getSentByUser(user.getUid()); + if (!messages.isEmpty()) { + for (ChatMessage message : messages) { + chatMessageDAO.delete(message); + session.getChatMessages().remove(message); + } } - } - NotebookEntry entry = getEntry(session.getSessionId(), CoreNotebookConstants.NOTEBOOK_TOOL, - ChatConstants.TOOL_SIGNATURE, userId); - if (entry != null) { - chatDAO.delete(entry); + NotebookEntry entry = getEntry(session.getSessionId(), CoreNotebookConstants.NOTEBOOK_TOOL, + ChatConstants.TOOL_SIGNATURE, userId); + if (entry != null) { + chatDAO.delete(entry); + } } user.setFinishedActivity(false); user.setLastPresence(null); chatUserDAO.update(user); } - } } /** * Export the XML fragment for the tool's content, along with any files needed for the content. * * @throws DataMissingException - * if no tool content matches the toolSessionId + * if no tool content matches the toolSessionId * @throws ToolException - * if any other error occurs + * if any other error occurs */ @Override @@ -362,7 +369,7 @@ * Import the XML fragment for the tool's content, along with any files needed for the content. * * @throws ToolException - * if any other error occurs + * if any other error occurs */ @Override public void importToolContent(Long toolContentId, Integer newUserUid, String toolContentPath, String fromVersion, @@ -689,7 +696,7 @@ public void auditLogStartEditingActivityInMonitor(long toolContentID) { toolService.auditLogStartEditingActivityInMonitor(toolContentID); } - + @Override public boolean isLastActivity(Long toolSessionId) { return toolService.isLastActivity(toolSessionId); @@ -868,9 +875,9 @@ return new ToolCompletionStatus(ToolCompletionStatus.ACTIVITY_ATTEMPTED, startDate, null); } } - // ========================================================================================= +// ========================================================================================= - // ****************** REST methods ************************* +// ****************** REST methods ************************* /** * Used by the Rest calls to create content. Mandatory fields in toolContentJSON: title, instructions Optional @@ -902,4 +909,4 @@ saveOrUpdateChat(content); } -} +} \ No newline at end of file Index: lams_tool_daco/src/java/org/lamsfoundation/lams/tool/daco/service/DacoServiceImpl.java =================================================================== diff -u -r2de8f805211b6433aff4efd6fa9275a1b9933033 -rd7bfc30e7d7a056b984f35c292a7abed4635c754 --- lams_tool_daco/src/java/org/lamsfoundation/lams/tool/daco/service/DacoServiceImpl.java (.../DacoServiceImpl.java) (revision 2de8f805211b6433aff4efd6fa9275a1b9933033) +++ lams_tool_daco/src/java/org/lamsfoundation/lams/tool/daco/service/DacoServiceImpl.java (.../DacoServiceImpl.java) (revision d7bfc30e7d7a056b984f35c292a7abed4635c754) @@ -23,17 +23,6 @@ package org.lamsfoundation.lams.tool.daco.service; -import java.io.FileNotFoundException; -import java.io.IOException; -import java.io.InputStream; -import java.util.ArrayList; -import java.util.Collection; -import java.util.Date; -import java.util.LinkedList; -import java.util.List; -import java.util.Set; -import java.util.SortedMap; - import org.apache.commons.lang.StringUtils; import org.apache.log4j.Logger; import org.lamsfoundation.lams.confidencelevel.ConfidenceLevelDTO; @@ -78,6 +67,17 @@ import org.lamsfoundation.lams.util.MessageService; import org.springframework.web.multipart.MultipartFile; +import java.io.FileNotFoundException; +import java.io.IOException; +import java.io.InputStream; +import java.util.ArrayList; +import java.util.Collection; +import java.util.Date; +import java.util.LinkedList; +import java.util.List; +import java.util.Set; +import java.util.SortedMap; + /** * @author Dapeng.Ni */ @@ -323,8 +323,8 @@ String fileName = file.getOriginalFilename(); String fileType = file.getContentType(); // For file only upload one sigle file - if ((answer.getQuestion().getType() == DacoConstants.QUESTION_TYPE_FILE) - || (answer.getQuestion().getType() == DacoConstants.QUESTION_TYPE_IMAGE)) { + if ((answer.getQuestion().getType() == DacoConstants.QUESTION_TYPE_FILE) || (answer.getQuestion().getType() + == DacoConstants.QUESTION_TYPE_IMAGE)) { NodeKey nodeKey = processFile(file); answer.setFileUuid(nodeKey.getNodeId()); answer.setFileVersionId(nodeKey.getVersion()); @@ -495,7 +495,7 @@ summary.setQuestionUid(question.getUid()); result.add(summary); } - break; + break; case DacoConstants.QUESTION_TYPE_RADIO: case DacoConstants.QUESTION_TYPE_DROPDOWN: case DacoConstants.QUESTION_TYPE_CHECKBOX: { @@ -511,7 +511,7 @@ } result.add(summary); } - break; + break; default: result.add(null); break; @@ -690,10 +690,12 @@ session.setStatus(DacoConstants.SESSION_COMPLETED); dacoSessionDao.saveObject(session); } else { - DacoServiceImpl.log.error("Fail to leave tool Session.Could not find shared daco " - + "session by given session id: " + toolSessionId); - throw new DataMissingException("Fail to leave tool Session." - + "Could not find shared daco session by given session id: " + toolSessionId); + DacoServiceImpl.log.error( + "Fail to leave tool Session.Could not find shared daco " + "session by given session id: " + + toolSessionId); + throw new DataMissingException( + "Fail to leave tool Session." + "Could not find shared daco session by given session id: " + + toolSessionId); } return toolService.completeToolSession(toolSessionId, learnerId); } @@ -796,33 +798,45 @@ } @Override - public void removeLearnerContent(Long toolContentId, Integer userId) throws ToolException { - if (DacoServiceImpl.log.isDebugEnabled()) { - DacoServiceImpl.log - .debug("Removing Daco data for user ID " + userId + " and toolContentId " + toolContentId); + public void removeLearnerContent(Long toolContentId, Integer userId, boolean resetActivityCompletionOnly) + throws ToolException { + + if (log.isDebugEnabled()) { + if (resetActivityCompletionOnly) { + log.debug("Resetting Daco completion for user ID " + userId + " and toolContentId " + toolContentId); + } else { + DacoServiceImpl.log.debug( + "Removing Daco data for user ID " + userId + " and toolContentId " + toolContentId); + } } + List sessions = dacoSessionDao.getByContentId(toolContentId); for (DacoSession session : sessions) { DacoUser user = dacoUserDao.getUserByUserIdAndSessionId(userId.longValue(), session.getSessionId()); if (user != null) { - for (DacoAnswer answer : user.getAnswers()) { - if (answer.getFileUuid() != null) { - try { - dacoToolContentHandler.deleteFile(answer.getFileUuid()); - } catch (Exception e) { - throw new ToolException("Error while removing Daco file", e); + if (resetActivityCompletionOnly) { + user.setSessionFinished(false); + dacoUserDao.saveObject(user); + } else { + for (DacoAnswer answer : user.getAnswers()) { + if (answer.getFileUuid() != null) { + try { + dacoToolContentHandler.deleteFile(answer.getFileUuid()); + } catch (Exception e) { + throw new ToolException("Error while removing Daco file", e); + } } + dacoAnswerDao.removeObject(DacoAnswer.class, answer.getUid()); } - dacoAnswerDao.removeObject(DacoAnswer.class, answer.getUid()); - } - NotebookEntry entry = getEntry(session.getSessionId(), CoreNotebookConstants.NOTEBOOK_TOOL, - DacoConstants.TOOL_SIGNATURE, userId); - if (entry != null) { - dacoDao.removeObject(NotebookEntry.class, entry.getUid()); - } + NotebookEntry entry = getEntry(session.getSessionId(), CoreNotebookConstants.NOTEBOOK_TOOL, + DacoConstants.TOOL_SIGNATURE, userId); + if (entry != null) { + dacoDao.removeObject(NotebookEntry.class, entry.getUid()); + } - dacoUserDao.removeObject(DacoUser.class, user.getUid()); + dacoUserDao.removeObject(DacoUser.class, user.getUid()); + } } } } Index: lams_tool_dimdim/src/java/org/lamsfoundation/lams/tool/dimdim/service/DimdimService.java =================================================================== diff -u -r20aa6cbca9fc96d341080e6ad39f82593443f792 -rd7bfc30e7d7a056b984f35c292a7abed4635c754 --- lams_tool_dimdim/src/java/org/lamsfoundation/lams/tool/dimdim/service/DimdimService.java (.../DimdimService.java) (revision 20aa6cbca9fc96d341080e6ad39f82593443f792) +++ lams_tool_dimdim/src/java/org/lamsfoundation/lams/tool/dimdim/service/DimdimService.java (.../DimdimService.java) (revision d7bfc30e7d7a056b984f35c292a7abed4635c754) @@ -24,10 +24,6 @@ package org.lamsfoundation.lams.tool.dimdim.service; -import java.util.ArrayList; -import java.util.List; -import java.util.SortedMap; - import org.lamsfoundation.lams.confidencelevel.ConfidenceLevelDTO; import org.lamsfoundation.lams.tool.ToolCompletionStatus; import org.lamsfoundation.lams.tool.ToolContentManager; @@ -39,6 +35,10 @@ import org.lamsfoundation.lams.tool.exception.ToolException; import org.lamsfoundation.lams.usermanagement.User; +import java.util.ArrayList; +import java.util.List; +import java.util.SortedMap; + public class DimdimService implements ToolSessionManager, ToolContentManager { @Override @@ -80,12 +80,12 @@ public List getToolOutputs(String name, Long toolContentId) { return new ArrayList(); } - + @Override public List getConfidenceLevels(Long toolSessionId) { return null; } - + @Override public boolean isUserGroupLeader(Long userId, Long toolSessionId) { return false; @@ -108,7 +108,8 @@ } @Override - public void removeLearnerContent(Long toolContentId, Integer userId) throws ToolException { + public void removeLearnerContent(Long toolContentId, Integer userId, boolean resetActivityCompletionOnly) + throws ToolException { } @Override @@ -145,6 +146,7 @@ public boolean isReadOnly(Long toolContentId) { return false; } + @Override public ToolCompletionStatus getCompletionStatus(Long learnerId, Long toolSessionId) { return null; Index: lams_tool_doku/src/java/org/lamsfoundation/lams/tool/dokumaran/service/DokumaranService.java =================================================================== diff -u -r8c6ccd715c5bbd55bacc9a0f112d2ee9a870aa3d -rd7bfc30e7d7a056b984f35c292a7abed4635c754 --- lams_tool_doku/src/java/org/lamsfoundation/lams/tool/dokumaran/service/DokumaranService.java (.../DokumaranService.java) (revision 8c6ccd715c5bbd55bacc9a0f112d2ee9a870aa3d) +++ lams_tool_doku/src/java/org/lamsfoundation/lams/tool/dokumaran/service/DokumaranService.java (.../DokumaranService.java) (revision d7bfc30e7d7a056b984f35c292a7abed4635c754) @@ -984,10 +984,15 @@ @Override @SuppressWarnings("unchecked") - public void removeLearnerContent(Long toolContentId, Integer userId) throws ToolException { - if (DokumaranService.log.isDebugEnabled()) { - DokumaranService.log.debug( - "Removing Dokumaran content for user ID " + userId + " and toolContentId " + toolContentId); + public void removeLearnerContent(Long toolContentId, Integer userId, boolean resetActivityCompletionOnly) + throws ToolException { + if (log.isDebugEnabled()) { + if (resetActivityCompletionOnly) { + log.debug( + "Resetting Dokumaran completion for user ID " + userId + " and toolContentId " + toolContentId); + } else { + log.debug("Removing Dokumaran content for user ID " + userId + " and toolContentId " + toolContentId); + } } Dokumaran dokumaran = dokumaranDao.getByContentId(toolContentId); @@ -1002,13 +1007,18 @@ DokumaranUser user = dokumaranUserDao.getUserByUserIDAndSessionID(userId.longValue(), session.getSessionId()); if (user != null) { - NotebookEntry entry = getEntry(session.getSessionId(), CoreNotebookConstants.NOTEBOOK_TOOL, - DokumaranConstants.TOOL_SIGNATURE, userId); - if (entry != null) { - dokumaranDao.removeObject(NotebookEntry.class, entry.getUid()); - } + if (resetActivityCompletionOnly) { + user.setSessionFinished(false); + dokumaranUserDao.saveObject(user); + } else { + NotebookEntry entry = getEntry(session.getSessionId(), CoreNotebookConstants.NOTEBOOK_TOOL, + DokumaranConstants.TOOL_SIGNATURE, userId); + if (entry != null) { + dokumaranDao.removeObject(NotebookEntry.class, entry.getUid()); + } - dokumaranUserDao.removeObject(DokumaranUser.class, user.getUid()); + dokumaranUserDao.removeObject(DokumaranUser.class, user.getUid()); + } } } } Index: lams_tool_eadventure/src/java/org/eucm/lams/tool/eadventure/service/EadventureServiceImpl.java =================================================================== diff -u -r20aa6cbca9fc96d341080e6ad39f82593443f792 -rd7bfc30e7d7a056b984f35c292a7abed4635c754 --- lams_tool_eadventure/src/java/org/eucm/lams/tool/eadventure/service/EadventureServiceImpl.java (.../EadventureServiceImpl.java) (revision 20aa6cbca9fc96d341080e6ad39f82593443f792) +++ lams_tool_eadventure/src/java/org/eucm/lams/tool/eadventure/service/EadventureServiceImpl.java (.../EadventureServiceImpl.java) (revision d7bfc30e7d7a056b984f35c292a7abed4635c754) @@ -23,10 +23,6 @@ /* $$Id$$ */ package org.eucm.lams.tool.eadventure.service; -import java.util.ArrayList; -import java.util.List; -import java.util.SortedMap; - import org.lamsfoundation.lams.confidencelevel.ConfidenceLevelDTO; import org.lamsfoundation.lams.tool.ToolCompletionStatus; import org.lamsfoundation.lams.tool.ToolContentManager; @@ -38,6 +34,10 @@ import org.lamsfoundation.lams.tool.exception.ToolException; import org.lamsfoundation.lams.usermanagement.User; +import java.util.ArrayList; +import java.util.List; +import java.util.SortedMap; + public class EadventureServiceImpl implements ToolContentManager, ToolSessionManager { @Override @@ -74,17 +74,17 @@ public ToolOutput getToolOutput(String name, Long toolSessionId, Long learnerId) { return null; } - + @Override public List getToolOutputs(String name, Long toolContentId) { return new ArrayList(); } - + @Override public List getConfidenceLevels(Long toolSessionId) { return null; } - + @Override public boolean isUserGroupLeader(Long userId, Long toolSessionId) { return false; @@ -107,7 +107,8 @@ } @Override - public void removeLearnerContent(Long toolContentId, Integer userId) throws ToolException { + public void removeLearnerContent(Long toolContentId, Integer userId, boolean resetActivityCompletionOnly) + throws ToolException { } @Override @@ -144,7 +145,7 @@ public boolean isReadOnly(Long toolContentId) { return false; } - + @Override public ToolCompletionStatus getCompletionStatus(Long learnerId, Long toolSessionId) { return null; Index: lams_tool_forum/src/java/org/lamsfoundation/lams/tool/forum/service/ForumService.java =================================================================== diff -u -rd6cc136dd301517f59c05b2ba254a4538dae65aa -rd7bfc30e7d7a056b984f35c292a7abed4635c754 --- lams_tool_forum/src/java/org/lamsfoundation/lams/tool/forum/service/ForumService.java (.../ForumService.java) (revision d6cc136dd301517f59c05b2ba254a4538dae65aa) +++ lams_tool_forum/src/java/org/lamsfoundation/lams/tool/forum/service/ForumService.java (.../ForumService.java) (revision d7bfc30e7d7a056b984f35c292a7abed4635c754) @@ -23,23 +23,8 @@ package org.lamsfoundation.lams.tool.forum.service; -import java.io.File; -import java.io.FileInputStream; -import java.io.FileNotFoundException; -import java.util.ArrayList; -import java.util.Collection; -import java.util.Date; -import java.util.HashSet; -import java.util.Iterator; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Random; -import java.util.Set; -import java.util.SortedMap; -import java.util.TreeMap; -import java.util.TreeSet; - +import com.fasterxml.jackson.databind.node.ArrayNode; +import com.fasterxml.jackson.databind.node.ObjectNode; import org.apache.commons.lang.StringUtils; import org.apache.log4j.Logger; import org.lamsfoundation.lams.confidencelevel.ConfidenceLevelDTO; @@ -105,13 +90,25 @@ import org.lamsfoundation.lams.util.JsonUtil; import org.lamsfoundation.lams.util.MessageService; -import com.fasterxml.jackson.databind.node.ArrayNode; -import com.fasterxml.jackson.databind.node.ObjectNode; +import java.io.File; +import java.io.FileInputStream; +import java.io.FileNotFoundException; +import java.util.ArrayList; +import java.util.Collection; +import java.util.Date; +import java.util.HashSet; +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Random; +import java.util.Set; +import java.util.SortedMap; +import java.util.TreeMap; +import java.util.TreeSet; /** - * * @author Steve.Ni - * * @version $Revision$ */ public class ForumService implements IForumService, ToolContentManager, ToolSessionManager, ToolRestManager { @@ -372,8 +369,8 @@ // get root topic and create record in MessageSeq table MessageSeq parentSeq = messageSeqDao.getByTopicId(parent.getUid()); if (parentSeq == null) { - ForumService.log - .error("Message Sequence table is broken becuase topic " + parent + " can not get Sequence Record"); + ForumService.log.error( + "Message Sequence table is broken becuase topic " + parent + " can not get Sequence Record"); } Message root = parentSeq.getRootMessage(); MessageSeq msgSeq = new MessageSeq(); @@ -641,8 +638,8 @@ notificationMessageParameters[0] = message.getSubject(); notificationMessageParameters[1] = message.getUpdated(); notificationMessageParameters[2] = report.getMark(); - notificationMessage - .append(getLocalisedMessage("event.mark.release.mark", notificationMessageParameters)); + notificationMessage.append( + getLocalisedMessage("event.mark.release.mark", notificationMessageParameters)); notificationMessages.put(user.getUserId().intValue(), notificationMessage); } } @@ -659,8 +656,9 @@ //audit log event String sessionName = session.getSessionName() + " (toolSessionId=" + session.getSessionId() + ")"; - String message = messageService.getMessage("tool.display.name") + ". " - + messageService.getMessage("msg.mark.released", new String[] { sessionName }); + String message = + messageService.getMessage("tool.display.name") + ". " + messageService.getMessage("msg.mark.released", + new String[] { sessionName }); logEventService.logToolEvent(LogEvent.TYPE_TOOL_MARK_RELEASED, forum.getContentId(), null, message); } @@ -707,6 +705,7 @@ // *************************************************************************************************************** // Private methods // *************************************************************************************************************** + /** * @param map * @return @@ -905,53 +904,60 @@ } @Override - public void removeLearnerContent(Long toolContentId, Integer userId) throws ToolException { + public void removeLearnerContent(Long toolContentId, Integer userId, boolean resetActivityCompletionOnly) + throws ToolException { + // do not remove learner content if it was set up so in appadmin tool management ForumConfigItem keepLearnerContent = getConfigItem(ForumConfigItem.KEY_KEEP_LEARNER_CONTENT); if (Boolean.valueOf(keepLearnerContent.getConfigValue())) { return; } - - if (ForumService.log.isDebugEnabled()) { - ForumService.log.debug( - "Hiding or removing Forum messages for user ID " + userId + " and toolContentId " + toolContentId); + if (log.isDebugEnabled()) { + if (resetActivityCompletionOnly) { + log.debug("Resetting Forum completion for user ID " + userId + " and toolContentId " + toolContentId); + } else { + log.debug("Hiding or removing Forum messages for user ID " + userId + " and toolContentId " + + toolContentId); + } } List sessionList = forumToolSessionDao.getByContentId(toolContentId); for (ForumToolSession session : sessionList) { Long sessionId = session.getSessionId(); ForumUser user = forumUserDao.getByUserIdAndSessionId(userId.longValue(), sessionId); if (user != null) { - List messages = messageDao.getByUserAndSession(user.getUid(), sessionId); - Iterator messageIterator = messages.iterator(); - while (messageIterator.hasNext()) { - Message message = messageIterator.next(); + user.setSessionFinished(false); - if (userOwnMessageTree(message, user.getUid())) { - messageSeqDao.deleteByTopicId(message.getUid()); - Timestamp timestamp = timestampDao.getTimestamp(message.getUid(), user.getUid()); - if (timestamp != null) { - timestampDao.delete(timestamp); + if (!resetActivityCompletionOnly) { + List messages = messageDao.getByUserAndSession(user.getUid(), sessionId); + Iterator messageIterator = messages.iterator(); + while (messageIterator.hasNext()) { + Message message = messageIterator.next(); + + if (userOwnMessageTree(message, user.getUid())) { + messageSeqDao.deleteByTopicId(message.getUid()); + Timestamp timestamp = timestampDao.getTimestamp(message.getUid(), user.getUid()); + if (timestamp != null) { + timestampDao.delete(timestamp); + } + messageDao.delete(message.getUid()); + messageIterator.remove(); + } else { + message.setHideFlag(true); + messageDao.update(message); } - messageDao.delete(message.getUid()); - messageIterator.remove(); - } else { - message.setHideFlag(true); - messageDao.update(message); } - } - NotebookEntry entry = getEntry(session.getSessionId(), CoreNotebookConstants.NOTEBOOK_TOOL, - ForumConstants.TOOL_SIGNATURE, userId); - if (entry != null) { - // hopefully it understands NotebookEntries - activityDAO.delete(entry); + NotebookEntry entry = getEntry(session.getSessionId(), CoreNotebookConstants.NOTEBOOK_TOOL, + ForumConstants.TOOL_SIGNATURE, userId); + if (entry != null) { + // hopefully it understands NotebookEntries + activityDAO.delete(entry); + } + toolService.removeActivityMark(userId, session.getSessionId()); } - user.setSessionFinished(false); forumUserDao.save(user); - - toolService.removeActivityMark(userId, session.getSessionId()); } } } @@ -1108,8 +1114,9 @@ // also clone author created topic from this forum tool content!!! // this can avoid topic record information conflict when multiple sessions are against same tool content // for example, the reply number maybe various for different sessions. - ForumService.log.debug("Clone tool content [" + forum.getContentId() + "] topics for session [" - + session.getSessionId() + "]"); + ForumService.log.debug( + "Clone tool content [" + forum.getContentId() + "] topics for session [" + session.getSessionId() + + "]"); Set contentTopics = forum.getMessages(); if ((contentTopics != null) && (contentTopics.size() > 0)) { for (Message msg : contentTopics) { @@ -1143,10 +1150,12 @@ if (session != null) { forumToolSessionDao.saveOrUpdate(session); } else { - ForumService.log.error("Fail to leave tool Session.Could not find submit file " - + "session by given session id: " + toolSessionId); - throw new DataMissingException("Fail to leave tool Session." - + "Could not find submit file session by given session id: " + toolSessionId); + ForumService.log.error( + "Fail to leave tool Session.Could not find submit file " + "session by given session id: " + + toolSessionId); + throw new DataMissingException( + "Fail to leave tool Session." + "Could not find submit file session by given session id: " + + toolSessionId); } return toolService.completeToolSession(toolSessionId, learnerId); } @@ -1506,9 +1515,11 @@ forum.setInstructions(JsonUtil.optString(toolContentJSON, RestTags.INSTRUCTIONS)); forum.setAllowAnonym(JsonUtil.optBoolean(toolContentJSON, "allowAnonym", Boolean.FALSE)); - forum.setAllowEdit(JsonUtil.optBoolean(toolContentJSON, "allowEdit", Boolean.TRUE)); // defaults to true in the default + forum.setAllowEdit( + JsonUtil.optBoolean(toolContentJSON, "allowEdit", Boolean.TRUE)); // defaults to true in the default // entry in the db - forum.setAllowNewTopic(JsonUtil.optBoolean(toolContentJSON, "allowNewTopic", Boolean.TRUE)); // defaults to true in the + forum.setAllowNewTopic( + JsonUtil.optBoolean(toolContentJSON, "allowNewTopic", Boolean.TRUE)); // defaults to true in the // default entry in the db forum.setAllowRateMessages(JsonUtil.optBoolean(toolContentJSON, "allowRateMessages", Boolean.FALSE)); forum.setAllowRichEditor(JsonUtil.optBoolean(toolContentJSON, RestTags.ALLOW_RICH_TEXT_EDITOR, Boolean.FALSE)); @@ -1518,8 +1529,9 @@ forum.setLimitedMaxCharacters(JsonUtil.optBoolean(toolContentJSON, "limitedMaxCharacters", Boolean.TRUE)); forum.setLimitedMinCharacters(JsonUtil.optBoolean(toolContentJSON, "limitedMinCharacters", Boolean.FALSE)); forum.setLockWhenFinished(JsonUtil.optBoolean(toolContentJSON, "lockWhenFinished", Boolean.FALSE)); - forum.setMaxCharacters(JsonUtil.optInt(toolContentJSON, "maxCharacters", 5000)); // defaults to 5000 chars in the - // default entry in the db. + forum.setMaxCharacters( + JsonUtil.optInt(toolContentJSON, "maxCharacters", 5000)); // defaults to 5000 chars in the + // default entry in the db. forum.setMaximumRate(JsonUtil.optInt(toolContentJSON, "maximumRate", 0)); forum.setMaximumReply(JsonUtil.optInt(toolContentJSON, "maximumReply", 0)); forum.setMinCharacters(JsonUtil.optInt(toolContentJSON, "minCharacters", 0)); Index: lams_tool_gmap/src/java/org/lamsfoundation/lams/tool/gmap/service/GmapService.java =================================================================== diff -u -r20aa6cbca9fc96d341080e6ad39f82593443f792 -rd7bfc30e7d7a056b984f35c292a7abed4635c754 --- lams_tool_gmap/src/java/org/lamsfoundation/lams/tool/gmap/service/GmapService.java (.../GmapService.java) (revision 20aa6cbca9fc96d341080e6ad39f82593443f792) +++ lams_tool_gmap/src/java/org/lamsfoundation/lams/tool/gmap/service/GmapService.java (.../GmapService.java) (revision d7bfc30e7d7a056b984f35c292a7abed4635c754) @@ -23,10 +23,6 @@ package org.lamsfoundation.lams.tool.gmap.service; -import java.util.ArrayList; -import java.util.List; -import java.util.SortedMap; - import org.lamsfoundation.lams.confidencelevel.ConfidenceLevelDTO; import org.lamsfoundation.lams.tool.ToolCompletionStatus; import org.lamsfoundation.lams.tool.ToolContentManager; @@ -38,6 +34,10 @@ import org.lamsfoundation.lams.tool.exception.ToolException; import org.lamsfoundation.lams.usermanagement.User; +import java.util.ArrayList; +import java.util.List; +import java.util.SortedMap; + /** * As a requirement, all LAMS tool's service bean must implement ToolContentManager and ToolSessionManager. */ @@ -87,7 +87,7 @@ public List getConfidenceLevels(Long toolSessionId) { return null; } - + @Override public boolean isUserGroupLeader(Long userId, Long toolSessionId) { return false; @@ -110,7 +110,8 @@ } @Override - public void removeLearnerContent(Long toolContentId, Integer userId) throws ToolException { + public void removeLearnerContent(Long toolContentId, Integer userId, boolean resetActivityCompletionOnly) + throws ToolException { } @Override @@ -152,4 +153,4 @@ public ToolCompletionStatus getCompletionStatus(Long learnerId, Long toolSessionId) { return null; } -} +} \ No newline at end of file Index: lams_tool_images/src/java/org/lamsfoundation/lams/tool/imageGallery/service/ImageGalleryServiceImpl.java =================================================================== diff -u -r2de8f805211b6433aff4efd6fa9275a1b9933033 -rd7bfc30e7d7a056b984f35c292a7abed4635c754 --- lams_tool_images/src/java/org/lamsfoundation/lams/tool/imageGallery/service/ImageGalleryServiceImpl.java (.../ImageGalleryServiceImpl.java) (revision 2de8f805211b6433aff4efd6fa9275a1b9933033) +++ lams_tool_images/src/java/org/lamsfoundation/lams/tool/imageGallery/service/ImageGalleryServiceImpl.java (.../ImageGalleryServiceImpl.java) (revision d7bfc30e7d7a056b984f35c292a7abed4635c754) @@ -23,28 +23,6 @@ package org.lamsfoundation.lams.tool.imageGallery.service; -import java.awt.image.BufferedImage; -import java.io.File; -import java.io.FileInputStream; -import java.io.FileNotFoundException; -import java.io.IOException; -import java.io.InputStream; -import java.sql.Timestamp; -import java.util.ArrayList; -import java.util.Collection; -import java.util.Date; -import java.util.HashMap; -import java.util.Iterator; -import java.util.LinkedList; -import java.util.List; -import java.util.Map; -import java.util.Set; -import java.util.SortedMap; -import java.util.TreeSet; - -import javax.imageio.ImageIO; -import javax.servlet.http.HttpServletRequest; - import org.apache.commons.lang.StringUtils; import org.apache.log4j.Logger; import org.lamsfoundation.lams.confidencelevel.ConfidenceLevelDTO; @@ -100,6 +78,27 @@ import org.lamsfoundation.lams.util.MessageService; import org.lamsfoundation.lams.util.imgscalr.ResizePictureUtil; +import javax.imageio.ImageIO; +import javax.servlet.http.HttpServletRequest; +import java.awt.image.BufferedImage; +import java.io.File; +import java.io.FileInputStream; +import java.io.FileNotFoundException; +import java.io.IOException; +import java.io.InputStream; +import java.sql.Timestamp; +import java.util.ArrayList; +import java.util.Collection; +import java.util.Date; +import java.util.HashMap; +import java.util.Iterator; +import java.util.LinkedList; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.SortedMap; +import java.util.TreeSet; + /** * @author Andrey Balan */ @@ -582,8 +581,9 @@ if (mediumIS == null) { throw new UploadImageGalleryFileException("Impossible to resize image"); } - String mediumFileName = ImageGalleryServiceImpl.MEDIUM_FILENAME_PREFIX - + fileName.substring(0, fileName.indexOf('.')) + ".jpg"; + String mediumFileName = + ImageGalleryServiceImpl.MEDIUM_FILENAME_PREFIX + fileName.substring(0, fileName.indexOf('.')) + + ".jpg"; NodeKey mediumNodeKey = imageGalleryToolContentHandler.uploadFile(mediumIS, mediumFileName, "image/jpeg"); image.setMediumFileUuid(mediumNodeKey.getNodeId()); image.setMediumFileDisplayUuid(mediumNodeKey.getUuid()); @@ -597,8 +597,9 @@ // prepare thumbnail image InputStream originalIS2 = imageGalleryToolContentHandler.getFileInputStream(nodeKey.getNodeId()); InputStream thumbnailIS = ResizePictureUtil.resize(originalIS2, thumbnailImageDimensions); - String thumbnailFileName = ImageGalleryServiceImpl.THUMBNAIL_FILENAME_PREFIX - + fileName.substring(0, fileName.indexOf('.')) + ".jpg"; + String thumbnailFileName = + ImageGalleryServiceImpl.THUMBNAIL_FILENAME_PREFIX + fileName.substring(0, fileName.indexOf('.')) + + ".jpg"; NodeKey thumbnailNodeKey = imageGalleryToolContentHandler.uploadFile(thumbnailIS, thumbnailFileName, "image/jpeg"); image.setThumbnailFileUuid(thumbnailNodeKey.getNodeId()); @@ -932,8 +933,8 @@ public void removeToolContent(Long toolContentId) throws ToolException { ImageGallery imageGallery = imageGalleryDao.getByContentId(toolContentId); if (imageGallery == null) { - ImageGalleryServiceImpl.log - .warn("Can not remove the tool content as it does not exist, ID: " + toolContentId); + ImageGalleryServiceImpl.log.warn( + "Can not remove the tool content as it does not exist, ID: " + toolContentId); return; } @@ -949,61 +950,73 @@ } @Override - public void removeLearnerContent(Long toolContentId, Integer userId) throws ToolException { - if (ImageGalleryServiceImpl.log.isDebugEnabled()) { - ImageGalleryServiceImpl.log.debug( - "Removing Image Gallery content for user ID " + userId + " and toolContentId " + toolContentId); + public void removeLearnerContent(Long toolContentId, Integer userId, boolean resetActivityCompletionOnly) + throws ToolException { + + if (log.isDebugEnabled()) { + if (resetActivityCompletionOnly) { + log.debug("Resetting Image Gallery completion for user ID " + userId + " and toolContentId " + + toolContentId); + } else { + log.debug( + "Removing Image Gallery content for user ID " + userId + " and toolContentId " + toolContentId); + } } ImageGallery gallery = imageGalleryDao.getByContentId(toolContentId); if (gallery == null) { - ImageGalleryServiceImpl.log - .warn("Did not find activity with toolContentId: " + toolContentId + " to remove learner content"); + ImageGalleryServiceImpl.log.warn( + "Did not find activity with toolContentId: " + toolContentId + " to remove learner content"); return; } - Iterator itemIterator = gallery.getImageGalleryItems().iterator(); - while (itemIterator.hasNext()) { - ImageGalleryItem item = itemIterator.next(); + if (!resetActivityCompletionOnly) { + Iterator itemIterator = gallery.getImageGalleryItems().iterator(); + while (itemIterator.hasNext()) { + ImageGalleryItem item = itemIterator.next(); - ImageVote vote = imageVoteDao.getImageVoteByImageAndUser(item.getUid(), userId.longValue()); - if (vote != null) { - imageVoteDao.removeObject(ImageVote.class, vote.getUid()); - } + ImageVote vote = imageVoteDao.getImageVoteByImageAndUser(item.getUid(), userId.longValue()); + if (vote != null) { + imageVoteDao.removeObject(ImageVote.class, vote.getUid()); + } - if (!item.isCreateByAuthor() && item.getCreateBy().getUserId().equals(userId.longValue())) { - try { - if (item.getOriginalFileUuid() != null) { - imageGalleryToolContentHandler.deleteFile(item.getOriginalFileUuid()); + if (!item.isCreateByAuthor() && item.getCreateBy().getUserId().equals(userId.longValue())) { + try { + if (item.getOriginalFileUuid() != null) { + imageGalleryToolContentHandler.deleteFile(item.getOriginalFileUuid()); + } + if (item.getMediumFileUuid() != null) { + imageGalleryToolContentHandler.deleteFile(item.getMediumFileUuid()); + } + if (item.getThumbnailFileUuid() != null) { + imageGalleryToolContentHandler.deleteFile(item.getThumbnailFileUuid()); + } + } catch (Exception e) { + throw new ToolException("Error while removing a file in Image Gallery", e); } - if (item.getMediumFileUuid() != null) { - imageGalleryToolContentHandler.deleteFile(item.getMediumFileUuid()); - } - if (item.getThumbnailFileUuid() != null) { - imageGalleryToolContentHandler.deleteFile(item.getThumbnailFileUuid()); - } - } catch (Exception e) { - throw new ToolException("Error while removing a file in Image Gallery", e); - } - imageGalleryItemDao.removeObject(ImageGalleryItem.class, item.getUid()); - itemIterator.remove(); + imageGalleryItemDao.removeObject(ImageGalleryItem.class, item.getUid()); + itemIterator.remove(); + } } } - for (ImageGallerySession session : imageGallerySessionDao.getByContentId(toolContentId)) { ImageGalleryUser user = imageGalleryUserDao.getUserByUserIDAndSessionID(userId.longValue(), session.getSessionId()); if (user != null) { - NotebookEntry entry = getEntry(user.getSession().getSessionId(), CoreNotebookConstants.NOTEBOOK_TOOL, - ImageGalleryConstants.TOOL_SIGNATURE, userId); - if (entry != null) { - imageGalleryDao.removeObject(NotebookEntry.class, entry.getUid()); - } + if (resetActivityCompletionOnly) { + user.setSessionFinished(false); + imageGalleryUserDao.saveObject(user); + } else { + NotebookEntry entry = getEntry(user.getSession().getSessionId(), + CoreNotebookConstants.NOTEBOOK_TOOL, ImageGalleryConstants.TOOL_SIGNATURE, userId); + if (entry != null) { + imageGalleryDao.removeObject(NotebookEntry.class, entry.getUid()); + } - imageGalleryUserDao.removeObject(ImageGalleryUser.class, user.getUid()); + imageGalleryUserDao.removeObject(ImageGalleryUser.class, user.getUid()); + } } } - } @Override @@ -1032,10 +1045,12 @@ session.setStatus(ImageGalleryConstants.COMPLETED); imageGallerySessionDao.saveObject(session); } else { - ImageGalleryServiceImpl.log.error("Fail to leave tool Session.Could not find shared imageGallery " - + "session by given session id: " + toolSessionId); - throw new DataMissingException("Fail to leave tool Session." - + "Could not find shared imageGallery session by given session id: " + toolSessionId); + ImageGalleryServiceImpl.log.error( + "Fail to leave tool Session.Could not find shared imageGallery " + "session by given session id: " + + toolSessionId); + throw new DataMissingException( + "Fail to leave tool Session." + "Could not find shared imageGallery session by given session id: " + + toolSessionId); } return toolService.completeToolSession(toolSessionId, learnerId); } @@ -1238,4 +1253,4 @@ public Class[] getSupportedToolOutputDefinitionClasses(int definitionType) { return getImageGalleryOutputFactory().getSupportedDefinitionClasses(definitionType); } -} +} \ No newline at end of file Index: lams_tool_imscc/src/java/org/lamsfoundation/lams/tool/commonCartridge/service/CommonCartridgeServiceImpl.java =================================================================== diff -u -r2de8f805211b6433aff4efd6fa9275a1b9933033 -rd7bfc30e7d7a056b984f35c292a7abed4635c754 --- lams_tool_imscc/src/java/org/lamsfoundation/lams/tool/commonCartridge/service/CommonCartridgeServiceImpl.java (.../CommonCartridgeServiceImpl.java) (revision 2de8f805211b6433aff4efd6fa9275a1b9933033) +++ lams_tool_imscc/src/java/org/lamsfoundation/lams/tool/commonCartridge/service/CommonCartridgeServiceImpl.java (.../CommonCartridgeServiceImpl.java) (revision d7bfc30e7d7a056b984f35c292a7abed4635c754) @@ -23,22 +23,6 @@ package org.lamsfoundation.lams.tool.commonCartridge.service; -import java.io.FileNotFoundException; -import java.io.IOException; -import java.io.InputStream; -import java.sql.Timestamp; -import java.util.ArrayList; -import java.util.Date; -import java.util.HashMap; -import java.util.Iterator; -import java.util.List; -import java.util.Map; -import java.util.Set; -import java.util.SortedMap; -import java.util.SortedSet; -import java.util.TreeMap; -import java.util.TreeSet; - import org.apache.log4j.Logger; import org.lamsfoundation.lams.confidencelevel.ConfidenceLevelDTO; import org.lamsfoundation.lams.contentrepository.client.IToolContentHandler; @@ -87,10 +71,24 @@ import org.lamsfoundation.lams.util.zipfile.ZipFileUtilException; import org.springframework.web.multipart.MultipartFile; +import java.io.FileNotFoundException; +import java.io.IOException; +import java.io.InputStream; +import java.sql.Timestamp; +import java.util.ArrayList; +import java.util.Date; +import java.util.HashMap; +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.SortedMap; +import java.util.SortedSet; +import java.util.TreeMap; +import java.util.TreeSet; + /** - * * @author Andrey Balan - * */ public class CommonCartridgeServiceImpl implements ICommonCartridgeService, ToolContentManager, ToolSessionManager { static Logger log = Logger.getLogger(CommonCartridgeServiceImpl.class.getName()); @@ -376,8 +374,8 @@ @Override public List getUserListBySessionItem(Long sessionId, Long itemUid) { - List logList = commonCartridgeItemVisitDao - .getCommonCartridgeItemLogBySession(sessionId, itemUid); + List logList = commonCartridgeItemVisitDao.getCommonCartridgeItemLogBySession( + sessionId, itemUid); List userList = new ArrayList(logList.size()); for (CommonCartridgeItemVisitLog visit : logList) { CommonCartridgeUser user = visit.getUser(); @@ -613,8 +611,8 @@ // reset it to new toolContentId toolContentObj.setContentId(toolContentId); - CommonCartridgeUser user = commonCartridgeUserDao - .getUserByUserIDAndContentID(new Long(newUserUid.longValue()), toolContentId); + CommonCartridgeUser user = commonCartridgeUserDao.getUserByUserIDAndContentID( + new Long(newUserUid.longValue()), toolContentId); if (user == null) { user = new CommonCartridgeUser(); UserDTO sysUser = ((User) userManagementService.findById(User.class, newUserUid)).getUserDTO(); @@ -740,10 +738,17 @@ } @Override - public void removeLearnerContent(Long toolContentId, Integer userId) throws ToolException { + public void removeLearnerContent(Long toolContentId, Integer userId, boolean resetActivityCompletionOnly) + throws ToolException { + if (log.isDebugEnabled()) { - log.debug( - "Removing Common Cartridge content for user ID " + userId + " and toolContentId " + toolContentId); + if (resetActivityCompletionOnly) { + log.debug("Resetting Common Cartridge completion for user ID " + userId + " and toolContentId " + + toolContentId); + } else { + log.debug("Removing Common Cartridge content for user ID " + userId + " and toolContentId " + + toolContentId); + } } CommonCartridge cartridge = commonCartridgeDao.getByContentId(toolContentId); @@ -752,42 +757,48 @@ return; } - Iterator itemIterator = cartridge.getCommonCartridgeItems().iterator(); - while (itemIterator.hasNext()) { - CommonCartridgeItem item = itemIterator.next(); - CommonCartridgeItemVisitLog visitLog = commonCartridgeItemVisitDao.getCommonCartridgeItemLog(item.getUid(), - userId.longValue()); - if (visitLog != null) { - commonCartridgeItemVisitDao.removeObject(CommonCartridgeItemVisitLog.class, visitLog.getUid()); - } + if (!resetActivityCompletionOnly) { + Iterator itemIterator = cartridge.getCommonCartridgeItems().iterator(); + while (itemIterator.hasNext()) { + CommonCartridgeItem item = itemIterator.next(); + CommonCartridgeItemVisitLog visitLog = commonCartridgeItemVisitDao.getCommonCartridgeItemLog( + item.getUid(), userId.longValue()); + if (visitLog != null) { + commonCartridgeItemVisitDao.removeObject(CommonCartridgeItemVisitLog.class, visitLog.getUid()); + } - if (!item.isCreateByAuthor() && item.getCreateBy().getUserId().equals(userId.longValue())) { - if (item.getFileUuid() != null) { - try { - commonCartridgeToolContentHandler.deleteFile(item.getFileUuid()); - } catch (Exception e) { - throw new ToolException("Error while removing Common Cartridge file UUID " + item.getFileUuid(), - e); + if (!item.isCreateByAuthor() && item.getCreateBy().getUserId().equals(userId.longValue())) { + if (item.getFileUuid() != null) { + try { + commonCartridgeToolContentHandler.deleteFile(item.getFileUuid()); + } catch (Exception e) { + throw new ToolException( + "Error while removing Common Cartridge file UUID " + item.getFileUuid(), e); + } } + commonCartridgeItemDao.removeObject(CommonCartridgeItem.class, item.getUid()); + itemIterator.remove(); } - commonCartridgeItemDao.removeObject(CommonCartridgeItem.class, item.getUid()); - itemIterator.remove(); } } List sessions = commonCartridgeSessionDao.getByContentId(toolContentId); - for (CommonCartridgeSession session : sessions) { CommonCartridgeUser user = commonCartridgeUserDao.getUserByUserIDAndSessionID(userId.longValue(), session.getSessionId()); if (user != null) { - NotebookEntry entry = getEntry(session.getSessionId(), CoreNotebookConstants.NOTEBOOK_TOOL, - CommonCartridgeConstants.TOOL_SIGNATURE, userId); - if (entry != null) { - commonCartridgeDao.removeObject(NotebookEntry.class, entry.getUid()); - } + if (resetActivityCompletionOnly) { + user.setSessionFinished(false); + commonCartridgeUserDao.saveObject(user); + } else { + NotebookEntry entry = getEntry(session.getSessionId(), CoreNotebookConstants.NOTEBOOK_TOOL, + CommonCartridgeConstants.TOOL_SIGNATURE, userId); + if (entry != null) { + commonCartridgeDao.removeObject(NotebookEntry.class, entry.getUid()); + } - commonCartridgeUserDao.removeObject(CommonCartridgeUser.class, user.getUid()); + commonCartridgeUserDao.removeObject(CommonCartridgeUser.class, user.getUid()); + } } } } @@ -940,4 +951,4 @@ this.lessonService = lessonService; } -} +} \ No newline at end of file Index: lams_tool_kaltura/src/java/org/lamsfoundation/lams/tool/kaltura/service/KalturaService.java =================================================================== diff -u -r20aa6cbca9fc96d341080e6ad39f82593443f792 -rd7bfc30e7d7a056b984f35c292a7abed4635c754 --- lams_tool_kaltura/src/java/org/lamsfoundation/lams/tool/kaltura/service/KalturaService.java (.../KalturaService.java) (revision 20aa6cbca9fc96d341080e6ad39f82593443f792) +++ lams_tool_kaltura/src/java/org/lamsfoundation/lams/tool/kaltura/service/KalturaService.java (.../KalturaService.java) (revision d7bfc30e7d7a056b984f35c292a7abed4635c754) @@ -21,13 +21,8 @@ * **************************************************************** */ - package org.lamsfoundation.lams.tool.kaltura.service; -import java.util.ArrayList; -import java.util.List; -import java.util.SortedMap; - import org.lamsfoundation.lams.confidencelevel.ConfidenceLevelDTO; import org.lamsfoundation.lams.tool.ToolCompletionStatus; import org.lamsfoundation.lams.tool.ToolContentManager; @@ -39,6 +34,10 @@ import org.lamsfoundation.lams.tool.exception.ToolException; import org.lamsfoundation.lams.usermanagement.User; +import java.util.ArrayList; +import java.util.List; +import java.util.SortedMap; + /** * An implementation of the IKalturaService interface. * @@ -90,7 +89,7 @@ public List getConfidenceLevels(Long toolSessionId) { return null; } - + @Override public boolean isUserGroupLeader(Long userId, Long toolSessionId) { return false; @@ -113,7 +112,8 @@ } @Override - public void removeLearnerContent(Long toolContentId, Integer userId) throws ToolException { + public void removeLearnerContent(Long toolContentId, Integer userId, boolean resetActivityCompletionOnly) + throws ToolException { } @Override Index: lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/service/McService.java =================================================================== diff -u -r5fdff80f95053c4aae662e438c5d92022f994cb4 -rd7bfc30e7d7a056b984f35c292a7abed4635c754 --- lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/service/McService.java (.../McService.java) (revision 5fdff80f95053c4aae662e438c5d92022f994cb4) +++ lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/service/McService.java (.../McService.java) (revision d7bfc30e7d7a056b984f35c292a7abed4635c754) @@ -22,28 +22,9 @@ package org.lamsfoundation.lams.tool.mc.service; -import java.io.ByteArrayOutputStream; -import java.io.IOException; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collection; -import java.util.Collections; -import java.util.Date; -import java.util.HashSet; -import java.util.Iterator; -import java.util.LinkedList; -import java.util.List; -import java.util.Locale; -import java.util.Map; -import java.util.Set; -import java.util.SortedMap; -import java.util.TreeMap; -import java.util.TreeSet; -import java.util.UUID; -import java.util.stream.Collectors; - -import javax.servlet.http.HttpSession; - +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.node.ArrayNode; +import com.fasterxml.jackson.databind.node.ObjectNode; import org.apache.commons.lang.StringUtils; import org.apache.log4j.Logger; import org.apache.poi.hssf.usermodel.HSSFCell; @@ -121,19 +102,36 @@ import org.lamsfoundation.lams.web.util.AttributeNames; import org.springframework.dao.DataAccessException; -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.node.ArrayNode; -import com.fasterxml.jackson.databind.node.ObjectNode; +import javax.servlet.http.HttpSession; +import java.io.ByteArrayOutputStream; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import java.util.Collections; +import java.util.Date; +import java.util.HashSet; +import java.util.Iterator; +import java.util.LinkedList; +import java.util.List; +import java.util.Locale; +import java.util.Map; +import java.util.Set; +import java.util.SortedMap; +import java.util.TreeMap; +import java.util.TreeSet; +import java.util.UUID; +import java.util.stream.Collectors; /** - * * The POJO implementation of Mc service. All business logics of MCQ tool are implemented in this class. It translate * the request from presentation layer and perform appropriate database operation. * * @author Ozgur Demirtas */ -public class McService implements IMcService, ToolContentManager, ToolSessionManager, ToolRestManager, McAppConstants, - IQbToolService, ICommonAssessmentService { +public class McService + implements IMcService, ToolContentManager, ToolSessionManager, ToolRestManager, McAppConstants, IQbToolService, + ICommonAssessmentService { private static Logger logger = Logger.getLogger(McService.class.getName()); private IMcContentDAO mcContentDAO; @@ -284,7 +282,8 @@ McQueContent question = getQuestionByUid(questionDTO.getUid()); // get the QB questionDescription from DB - QbQuestion qbQuestion = questionDTO.getQbQuestionUid() == null ? null + QbQuestion qbQuestion = questionDTO.getQbQuestionUid() == null + ? null : (QbQuestion) mcQueContentDAO.find(QbQuestion.class, questionDTO.getQbQuestionUid()); if (qbQuestion == null) { // if it does not exist, create a new one @@ -828,10 +827,9 @@ userAttemptToUpdate.getMcQueContent().getUid()); } else { String error = new StringBuilder( - "Attempting to update the mark for a non-leader. Cannot update. Session ") - .append(mcSession.getSession_name()).append(":").append(mcSession.getMcSessionId()) - .append(" user ").append(selectedUser.getUsername()).append(":") - .append(selectedUser.getQueUsrId()).toString(); + "Attempting to update the mark for a non-leader. Cannot update. Session ").append( + mcSession.getSession_name()).append(":").append(mcSession.getMcSessionId()).append(" user ") + .append(selectedUser.getUsername()).append(":").append(selectedUser.getQueUsrId()).toString(); logger.warn(error); } } else { @@ -900,8 +898,8 @@ for (McOptionDTO optionDTO : optionDTOs) { if (oldOption.getUid().equals(optionDTO.getQbOptionUid())) { - if (!StringUtils.equals(oldOption.getName(), optionDTO.getCandidateAnswer()) - || (oldOption.isCorrect() != "Correct".equals(optionDTO.getCorrect()))) { + if (!StringUtils.equals(oldOption.getName(), optionDTO.getCandidateAnswer()) || ( + oldOption.isCorrect() != "Correct".equals(optionDTO.getCorrect()))) { isQuestionModified = true; break; } @@ -1165,9 +1163,8 @@ cell = row.createCell(count++); cell.setCellValue(new Long(userMark.getTotalMark())); - Double totalPercents = questions.size() != 0 - ? (double) numberOfCorrectlyAnsweredByUser / questions.size() - : 0d; + Double totalPercents = + questions.size() != 0 ? (double) numberOfCorrectlyAnsweredByUser / questions.size() : 0d; totalPercentList.add(totalPercents); cell = row.createCell(count++); cell.setCellValue(totalPercents); @@ -1184,8 +1181,8 @@ cell.setCellValue(messageService.getMessage("label.ave")); for (int numberOfCorrectAnswers : numberOfCorrectAnswersPerQuestion) { cell = row.createCell(count++); - Double average = totalPercentList.size() == 0 ? 0d - : (double) numberOfCorrectAnswers / totalPercentList.size(); + Double average = + totalPercentList.size() == 0 ? 0d : (double) numberOfCorrectAnswers / totalPercentList.size(); cell.setCellValue(average); CellUtil.setCellStyleProperty(cell, CellUtil.DATA_FORMAT, percentageFormat); } @@ -1372,31 +1369,44 @@ @Override @SuppressWarnings("unchecked") - public void removeLearnerContent(Long toolContentId, Integer userId) throws ToolException { + public void removeLearnerContent(Long toolContentId, Integer userId, boolean resetActivityCompletionOnly) + throws ToolException { + if (logger.isDebugEnabled()) { - logger.debug( - "Removing Multiple Choice attempts for user ID " + userId + " and toolContentId " + toolContentId); + if (resetActivityCompletionOnly) { + logger.debug("Resetting Multiple Choice completion for user ID " + userId + " and toolContentId " + + toolContentId); + } else { + logger.debug("Removing Multiple Choice content for user ID " + userId + " and toolContentId " + + toolContentId); + } } McContent content = mcContentDAO.findMcContentById(toolContentId); if (content != null) { for (McSession session : content.getMcSessions()) { McQueUsr user = mcUserDAO.getMcUserBySession(userId.longValue(), session.getUid()); if (user != null) { - mcUsrAttemptDAO.removeAllUserAttempts(user.getUid()); + if (resetActivityCompletionOnly) { + user.setResponseFinalised(false); + mcUserDAO.saveMcUser(user); + } else { + mcUsrAttemptDAO.removeAllUserAttempts(user.getUid()); - NotebookEntry entry = getEntry(session.getMcSessionId(), CoreNotebookConstants.NOTEBOOK_TOOL, - McAppConstants.TOOL_SIGNATURE, userId); - if (entry != null) { - mcContentDAO.delete(entry); - } + NotebookEntry entry = getEntry(session.getMcSessionId(), CoreNotebookConstants.NOTEBOOK_TOOL, + McAppConstants.TOOL_SIGNATURE, userId); + if (entry != null) { + mcContentDAO.delete(entry); + } - if ((session.getGroupLeader() != null) && session.getGroupLeader().getUid().equals(user.getUid())) { - session.setGroupLeader(null); - } + if ((session.getGroupLeader() != null) && session.getGroupLeader().getUid() + .equals(user.getUid())) { + session.setGroupLeader(null); + } - mcUserDAO.removeMcUser(user); - toolService.removeActivityMark(userId, session.getMcSessionId()); + mcUserDAO.removeMcUser(user); + toolService.removeActivityMark(userId, session.getMcSessionId()); + } } } } @@ -1770,47 +1780,47 @@ /** * @param mcContentDAO - * The mcContentDAO to set. + * The mcContentDAO to set. */ public void setMcContentDAO(IMcContentDAO mcContentDAO) { this.mcContentDAO = mcContentDAO; } /** * @param mcOptionsContentDAO - * The mcOptionsContentDAO to set. + * The mcOptionsContentDAO to set. */ public void setMcOptionsContentDAO(IMcOptionsContentDAO mcOptionsContentDAO) { this.mcOptionsContentDAO = mcOptionsContentDAO; } /** * @param mcQueContentDAO - * The mcQueContentDAO to set. + * The mcQueContentDAO to set. */ public void setMcQueContentDAO(IMcQueContentDAO mcQueContentDAO) { this.mcQueContentDAO = mcQueContentDAO; } /** * @param mcSessionDAO - * The mcSessionDAO to set. + * The mcSessionDAO to set. */ public void setMcSessionDAO(IMcSessionDAO mcSessionDAO) { this.mcSessionDAO = mcSessionDAO; } /** * @param mcUserDAO - * The mcUserDAO to set. + * The mcUserDAO to set. */ public void setMcUserDAO(IMcUserDAO mcUserDAO) { this.mcUserDAO = mcUserDAO; } /** * @param mcUsrAttemptDAO - * The mcUsrAttemptDAO to set. + * The mcUsrAttemptDAO to set. */ public void setMcUsrAttemptDAO(IMcUsrAttemptDAO mcUsrAttemptDAO) { this.mcUsrAttemptDAO = mcUsrAttemptDAO; @@ -1830,7 +1840,7 @@ /** * @param mcToolContentHandler - * The mcToolContentHandler to set. + * The mcToolContentHandler to set. */ public void setMcToolContentHandler(IToolContentHandler mcToolContentHandler) { this.mcToolContentHandler = mcToolContentHandler; @@ -1896,7 +1906,7 @@ /** * @param coreNotebookService - * The coreNotebookService to set. + * The coreNotebookService to set. */ public void setCoreNotebookService(ICoreNotebookService coreNotebookService) { this.coreNotebookService = coreNotebookService; @@ -1911,7 +1921,7 @@ /** * @param logEventService - * The logEventService to set. + * The logEventService to set. */ public void setLogEventService(ILogEventService logEventService) { this.logEventService = logEventService; @@ -1926,7 +1936,7 @@ /** * @param messageService - * The MessageService to set. + * The MessageService to set. */ public void setMessageService(MessageService messageService) { this.messageService = messageService; @@ -1976,15 +1986,15 @@ LeaderResultsDTO newDto = new LeaderResultsDTO(contentId); Object[] markStats = mcUserDAO.getStatsMarksForLeaders(contentId); if (markStats != null) { - newDto.setMinMark( - markStats[0] != null ? NumberUtil.formatLocalisedNumber((Float) markStats[0], (Locale) null, 2) - : "0.00"); - newDto.setAvgMark( - markStats[1] != null ? NumberUtil.formatLocalisedNumber((Float) markStats[1], (Locale) null, 2) - : "0.00"); - newDto.setMaxMark( - markStats[2] != null ? NumberUtil.formatLocalisedNumber((Float) markStats[2], (Locale) null, 2) - : "0.00"); + newDto.setMinMark(markStats[0] != null + ? NumberUtil.formatLocalisedNumber((Float) markStats[0], (Locale) null, 2) + : "0.00"); + newDto.setAvgMark(markStats[1] != null + ? NumberUtil.formatLocalisedNumber((Float) markStats[1], (Locale) null, 2) + : "0.00"); + newDto.setMaxMark(markStats[2] != null + ? NumberUtil.formatLocalisedNumber((Float) markStats[2], (Locale) null, 2) + : "0.00"); newDto.setNumberGroupsLeaderFinished((Integer) markStats[3]); } return newDto; @@ -2009,15 +2019,15 @@ sessionDto.setNumberLearners(countUsers); Object[] markStats = mcUserDAO.getStatsMarksBySession(session.getMcSessionId()); if (markStats != null) { - sessionDto.setMinMark(markStats[0] != null - ? NumberUtil.formatLocalisedNumber((Float) markStats[0], (Locale) null, 2) - : "0.00"); - sessionDto.setAvgMark(markStats[1] != null - ? NumberUtil.formatLocalisedNumber((Float) markStats[1], (Locale) null, 2) - : "0.00"); - sessionDto.setMaxMark(markStats[2] != null - ? NumberUtil.formatLocalisedNumber((Float) markStats[2], (Locale) null, 2) - : "0.00"); + sessionDto.setMinMark( + markStats[0] != null ? NumberUtil.formatLocalisedNumber((Float) markStats[0], + (Locale) null, 2) : "0.00"); + sessionDto.setAvgMark( + markStats[1] != null ? NumberUtil.formatLocalisedNumber((Float) markStats[1], + (Locale) null, 2) : "0.00"); + sessionDto.setMaxMark( + markStats[2] != null ? NumberUtil.formatLocalisedNumber((Float) markStats[2], + (Locale) null, 2) : "0.00"); } } @@ -2061,19 +2071,19 @@ public Integer countCorrectAnswers(long toolContentId, int userId) { McQueUsr user = getMcUserByContentId(Long.valueOf(userId), toolContentId); - return Long.valueOf(mcUsrAttemptDAO.getFinalizedUserAttempts(user.getUid()).stream() - .filter(McUsrAttempt::isAttemptCorrect).count()).intValue(); + return Long.valueOf( + mcUsrAttemptDAO.getFinalizedUserAttempts(user.getUid()).stream().filter(McUsrAttempt::isAttemptCorrect) + .count()).intValue(); } @Override public Map countCorrectAnswers(long toolContentId) { List attempts = mcUsrAttemptDAO.findByProperty(McUsrAttempt.class, "qbToolQuestion.toolContentId", toolContentId); - return attempts.stream() - .collect(Collectors.groupingBy(a -> a.getMcQueUsr().getQueUsrId().intValue(), - Collectors.collectingAndThen(Collectors.toList(), - l -> (int) l.stream().filter(McUsrAttempt::isAttemptCorrect).count()))); + return attempts.stream().collect(Collectors.groupingBy(a -> a.getMcQueUsr().getQueUsrId().intValue(), + Collectors.collectingAndThen(Collectors.toList(), + l -> (int) l.stream().filter(McUsrAttempt::isAttemptCorrect).count()))); } // ****************** REST methods ************************* @@ -2121,7 +2131,8 @@ createMc(mcq); QbCollection collection = qbService.getUserPrivateCollection(userID); - Set collectionUUIDs = collection == null ? new HashSet<>() + Set collectionUUIDs = collection == null + ? new HashSet<>() : qbService.getCollectionQuestions(collection.getUid()).stream().filter(q -> q.getUuid() != null) .collect(Collectors.mapping(q -> q.getUuid().toString(), Collectors.toSet())); // Questions @@ -2193,7 +2204,8 @@ if (name.isEmpty()) { return IQbService.QUESTION_MODIFIED_NONE; } - QbQuestion baseLine = questionDTO.getQbQuestionUid() == null ? null + QbQuestion baseLine = questionDTO.getQbQuestionUid() == null + ? null : (QbQuestion) mcQueContentDAO.find(QbQuestion.class, questionDTO.getQbQuestionUid()); if (baseLine == null) { return IQbService.QUESTION_MODIFIED_ID_BUMP; @@ -2217,8 +2229,8 @@ modifiedQuestion.setFeedback(questionDTO.getFeedback()); List optionDTOs = questionDTO.getOptionDtos(); - boolean isModified = !baseLine.equals(modifiedQuestion) - || optionDTOs.size() != modifiedQuestion.getQbOptions().size(); + boolean isModified = + !baseLine.equals(modifiedQuestion) || optionDTOs.size() != modifiedQuestion.getQbOptions().size(); if (isModified) { return IQbService.QUESTION_MODIFIED_VERSION_BUMP; } @@ -2239,7 +2251,8 @@ } } // run check again, this time with modified options - return !baseLine.equals(modifiedQuestion) ? IQbService.QUESTION_MODIFIED_VERSION_BUMP + return !baseLine.equals(modifiedQuestion) + ? IQbService.QUESTION_MODIFIED_VERSION_BUMP : IQbService.QUESTION_MODIFIED_NONE; } Index: lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/service/QaService.java =================================================================== diff -u -r536190f16e09f9b9e916ef3cf70cceda1c5ac810 -rd7bfc30e7d7a056b984f35c292a7abed4635c754 --- lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/service/QaService.java (.../QaService.java) (revision 536190f16e09f9b9e916ef3cf70cceda1c5ac810) +++ lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/service/QaService.java (.../QaService.java) (revision d7bfc30e7d7a056b984f35c292a7abed4635c754) @@ -23,20 +23,10 @@ package org.lamsfoundation.lams.tool.qa.service; -import java.security.InvalidParameterException; -import java.util.ArrayList; -import java.util.Collection; -import java.util.Date; -import java.util.List; -import java.util.Random; -import java.util.Set; -import java.util.SortedMap; -import java.util.TreeSet; -import java.util.stream.Collectors; - -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpSession; - +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.node.ArrayNode; +import com.fasterxml.jackson.databind.node.JsonNodeFactory; +import com.fasterxml.jackson.databind.node.ObjectNode; import org.apache.log4j.Logger; import org.lamsfoundation.lams.confidencelevel.ConfidenceLevelDTO; import org.lamsfoundation.lams.contentrepository.client.IToolContentHandler; @@ -89,10 +79,18 @@ import org.lamsfoundation.lams.web.util.AttributeNames; import org.springframework.dao.DataAccessException; -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.node.ArrayNode; -import com.fasterxml.jackson.databind.node.JsonNodeFactory; -import com.fasterxml.jackson.databind.node.ObjectNode; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpSession; +import java.security.InvalidParameterException; +import java.util.ArrayList; +import java.util.Collection; +import java.util.Date; +import java.util.List; +import java.util.Random; +import java.util.Set; +import java.util.SortedMap; +import java.util.TreeSet; +import java.util.stream.Collectors; /** * The POJO implementation of Qa service. All business logics of Qa tool are implemented in this class. It translate the @@ -480,30 +478,42 @@ } @Override - public void removeLearnerContent(Long toolContentId, Integer userId) throws ToolException { + public void removeLearnerContent(Long toolContentId, Integer userId, boolean resetActivityCompletionOnly) + throws ToolException { if (logger.isDebugEnabled()) { - logger.debug("Removing Q&A answers for user ID " + userId + " and toolContentId " + toolContentId); + if (resetActivityCompletionOnly) { + logger.debug("Resetting Q&A completion for user ID " + userId + " and toolContentId " + toolContentId); + } else { + logger.debug("Removing Q&A answers for user ID " + userId + " and toolContentId " + toolContentId); + } } QaContent content = qaDAO.getQaByContentId(toolContentId); if (content != null) { for (QaSession session : content.getQaSessions()) { QaQueUsr user = qaQueUsrDAO.getQaUserBySession(userId.longValue(), session.getQaSessionId()); if (user != null) { - for (QaUsrResp response : user.getQaUsrResps()) { - qaUsrRespDAO.removeUserResponse(response); - } + if (resetActivityCompletionOnly) { + user.setResponseFinalized(false); + user.setLearnerFinished(false); + updateUser(user); + } else { + for (QaUsrResp response : user.getQaUsrResps()) { + qaUsrRespDAO.removeUserResponse(response); + } - if ((session.getGroupLeader() != null) && session.getGroupLeader().getUid().equals(user.getUid())) { - session.setGroupLeader(null); - } + if ((session.getGroupLeader() != null) && session.getGroupLeader().getUid() + .equals(user.getUid())) { + session.setGroupLeader(null); + } - qaQueUsrDAO.deleteQaQueUsr(user); + qaQueUsrDAO.deleteQaQueUsr(user); - NotebookEntry entry = getEntry(session.getQaSessionId(), CoreNotebookConstants.NOTEBOOK_TOOL, - QaAppConstants.MY_SIGNATURE, userId); - if (entry != null) { - qaDAO.delete(entry); + NotebookEntry entry = getEntry(session.getQaSessionId(), CoreNotebookConstants.NOTEBOOK_TOOL, + QaAppConstants.MY_SIGNATURE, userId); + if (entry != null) { + qaDAO.delete(entry); + } } } } @@ -544,9 +554,9 @@ attemptTime = response.getAttemptTime(); } - message = NEW_LINE_CHARACTER + NEW_LINE_CHARACTER - + messageService.getMessage("label.user.has.answered.questions", new Object[] { fullName, attemptTime }) - + message + NEW_LINE_CHARACTER + NEW_LINE_CHARACTER; + message = + NEW_LINE_CHARACTER + NEW_LINE_CHARACTER + messageService.getMessage("label.user.has.answered.questions", + new Object[] { fullName, attemptTime }) + message + NEW_LINE_CHARACTER + NEW_LINE_CHARACTER; eventNotificationService.notifyLessonMonitors(sessionId, message, true); } @@ -555,8 +565,9 @@ public void changeLeaderForGroup(long toolSessionId, long leaderUserId) { QaSession session = getSessionById(toolSessionId); if (QaAppConstants.COMPLETED.equals(session.getSession_status())) { - throw new InvalidParameterException("Attempting to assing a new leader with user ID " + leaderUserId - + " to a finished session wtih ID " + toolSessionId); + throw new InvalidParameterException( + "Attempting to assing a new leader with user ID " + leaderUserId + " to a finished session wtih ID " + + toolSessionId); } QaQueUsr existingLeader = session.getGroupLeader(); @@ -1038,7 +1049,7 @@ /** * @param qaToolContentHandler - * The qaToolContentHandler to set. + * The qaToolContentHandler to set. */ public void setQaToolContentHandler(IToolContentHandler qaToolContentHandler) { this.qaToolContentHandler = qaToolContentHandler; @@ -1066,6 +1077,7 @@ } // ========================================================================================= + /** * @return Returns the coreNotebookService. */ @@ -1075,7 +1087,7 @@ /** * @param coreNotebookService - * The coreNotebookService to set. + * The coreNotebookService to set. */ public void setCoreNotebookService(ICoreNotebookService coreNotebookService) { this.coreNotebookService = coreNotebookService; @@ -1203,7 +1215,7 @@ }); } } - + //return nextActivityUrl return leaveToolSession(toolSessionID, userID); } @@ -1274,4 +1286,4 @@ // qa.setConditions(conditions); } -} +} \ No newline at end of file Index: lams_tool_larsrc/src/java/org/lamsfoundation/lams/tool/rsrc/service/ResourceServiceImpl.java =================================================================== diff -u -r2de8f805211b6433aff4efd6fa9275a1b9933033 -rd7bfc30e7d7a056b984f35c292a7abed4635c754 --- lams_tool_larsrc/src/java/org/lamsfoundation/lams/tool/rsrc/service/ResourceServiceImpl.java (.../ResourceServiceImpl.java) (revision 2de8f805211b6433aff4efd6fa9275a1b9933033) +++ lams_tool_larsrc/src/java/org/lamsfoundation/lams/tool/rsrc/service/ResourceServiceImpl.java (.../ResourceServiceImpl.java) (revision d7bfc30e7d7a056b984f35c292a7abed4635c754) @@ -23,26 +23,9 @@ package org.lamsfoundation.lams.tool.rsrc.service; -import java.io.File; -import java.io.FileFilter; -import java.io.FileInputStream; -import java.io.FileNotFoundException; -import java.io.IOException; -import java.io.InputStream; -import java.sql.Timestamp; -import java.util.ArrayList; -import java.util.Collection; -import java.util.Date; -import java.util.Iterator; -import java.util.LinkedHashSet; -import java.util.LinkedList; -import java.util.List; -import java.util.Map; -import java.util.Set; -import java.util.SortedMap; -import java.util.SortedSet; -import java.util.TreeSet; - +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.node.ArrayNode; +import com.fasterxml.jackson.databind.node.ObjectNode; import org.apache.commons.lang.StringUtils; import org.apache.log4j.Logger; import org.lamsfoundation.lams.confidencelevel.ConfidenceLevelDTO; @@ -101,9 +84,25 @@ import org.lamsfoundation.lams.util.zipfile.ZipFileUtilException; import org.lamsfoundation.lams.web.util.AttributeNames; -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.node.ArrayNode; -import com.fasterxml.jackson.databind.node.ObjectNode; +import java.io.File; +import java.io.FileFilter; +import java.io.FileInputStream; +import java.io.FileNotFoundException; +import java.io.IOException; +import java.io.InputStream; +import java.sql.Timestamp; +import java.util.ArrayList; +import java.util.Collection; +import java.util.Date; +import java.util.Iterator; +import java.util.LinkedHashSet; +import java.util.LinkedList; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.SortedMap; +import java.util.SortedSet; +import java.util.TreeSet; /** * @author Dapeng.Ni @@ -453,7 +452,8 @@ if (entry != null) { ReflectDTO ref = new ReflectDTO(user); ref.setReflect(entry.getEntry()); - Date postedDate = (entry.getLastModified() != null) ? entry.getLastModified() + Date postedDate = (entry.getLastModified() != null) + ? entry.getLastModified() : entry.getCreateDate(); ref.setDate(postedDate); reflections.add(ref); @@ -474,9 +474,8 @@ ResourceUser user = visit.getUser(); user.setAccessDate(visit.getAccessDate()); user.setCompleteDate(visit.getCompleteDate()); - Date timeTaken = ((visit.getCompleteDate() != null) && (visit.getAccessDate() != null)) - ? new Date(visit.getCompleteDate().getTime() - visit.getAccessDate().getTime()) - : null; + Date timeTaken = ((visit.getCompleteDate() != null) && (visit.getAccessDate() != null)) ? new Date( + visit.getCompleteDate().getTime() - visit.getAccessDate().getTime()) : null; user.setTimeTaken(timeTaken); userList.add(user); } @@ -559,14 +558,13 @@ ResourceUser resourceUser = item.getCreateBy(); ResourceSession session = resourceUser.getSession(); - String userName = new StringBuilder() - .append(StringUtils.isBlank(resourceUser.getFirstName()) ? "" : resourceUser.getFirstName() + " ") + String userName = new StringBuilder().append( + StringUtils.isBlank(resourceUser.getFirstName()) ? "" : resourceUser.getFirstName() + " ") .append(StringUtils.isBlank(resourceUser.getLastName()) ? "" : resourceUser.getLastName() + " ") .append("(").append(resourceUser.getLoginName()).append(")").toString(); - String resourceType = getLocalisedMessage( - item.getType() == ResourceConstants.RESOURCE_TYPE_URL ? "label.authoring.basic.resource.url" - : "label.authoring.basic.resource.file", - new Object[] {}); + String resourceType = getLocalisedMessage(item.getType() == ResourceConstants.RESOURCE_TYPE_URL + ? "label.authoring.basic.resource.url" + : "label.authoring.basic.resource.file", new Object[] {}); String url = null; StringBuilder link = new StringBuilder(" sessions = peerreviewSessionDao.getByContentId(toolContentId); for (PeerreviewSession session : sessions) { PeerreviewUser user = peerreviewUserDao.getUserByUserIDAndSessionID(userId.longValue(), session.getSessionId()); if (user != null) { - NotebookEntry entry = getEntry(session.getSessionId(), CoreNotebookConstants.NOTEBOOK_TOOL, - PeerreviewConstants.TOOL_SIGNATURE, userId); - if (entry != null) { - peerreviewDao.deleteById(NotebookEntry.class, entry.getUid()); - } + if (resetActivityCompletionOnly) { + user.setSessionFinished(false); + peerreviewUserDao.update(user); + } else { + NotebookEntry entry = getEntry(session.getSessionId(), CoreNotebookConstants.NOTEBOOK_TOOL, + PeerreviewConstants.TOOL_SIGNATURE, userId); + if (entry != null) { + peerreviewDao.deleteById(NotebookEntry.class, entry.getUid()); + } - peerreviewUserDao.delete(user); + peerreviewUserDao.delete(user); + } } } } Index: lams_tool_sbmt/src/java/org/lamsfoundation/lams/tool/sbmt/service/SubmitFilesService.java =================================================================== diff -u -r2de8f805211b6433aff4efd6fa9275a1b9933033 -rd7bfc30e7d7a056b984f35c292a7abed4635c754 --- lams_tool_sbmt/src/java/org/lamsfoundation/lams/tool/sbmt/service/SubmitFilesService.java (.../SubmitFilesService.java) (revision 2de8f805211b6433aff4efd6fa9275a1b9933033) +++ lams_tool_sbmt/src/java/org/lamsfoundation/lams/tool/sbmt/service/SubmitFilesService.java (.../SubmitFilesService.java) (revision d7bfc30e7d7a056b984f35c292a7abed4635c754) @@ -23,25 +23,8 @@ package org.lamsfoundation.lams.tool.sbmt.service; -import java.io.File; -import java.io.FileInputStream; -import java.io.FileNotFoundException; -import java.io.IOException; -import java.text.NumberFormat; -import java.util.ArrayList; -import java.util.Comparator; -import java.util.Date; -import java.util.Iterator; -import java.util.List; -import java.util.Locale; -import java.util.Map; -import java.util.Set; -import java.util.SortedMap; -import java.util.SortedSet; -import java.util.TreeMap; -import java.util.TreeSet; -import java.util.stream.Collectors; - +import com.fasterxml.jackson.databind.node.JsonNodeFactory; +import com.fasterxml.jackson.databind.node.ObjectNode; import org.apache.commons.lang.StringUtils; import org.apache.log4j.Logger; import org.lamsfoundation.lams.confidencelevel.ConfidenceLevelDTO; @@ -94,8 +77,24 @@ import org.springframework.dao.DataAccessException; import org.springframework.web.multipart.MultipartFile; -import com.fasterxml.jackson.databind.node.JsonNodeFactory; -import com.fasterxml.jackson.databind.node.ObjectNode; +import java.io.File; +import java.io.FileInputStream; +import java.io.FileNotFoundException; +import java.io.IOException; +import java.text.NumberFormat; +import java.util.ArrayList; +import java.util.Comparator; +import java.util.Date; +import java.util.Iterator; +import java.util.List; +import java.util.Locale; +import java.util.Map; +import java.util.Set; +import java.util.SortedMap; +import java.util.SortedSet; +import java.util.TreeMap; +import java.util.TreeSet; +import java.util.stream.Collectors; /** * @author Manpreet Minhas @@ -139,8 +138,8 @@ @Override public int compare(FileDetailsDTO o1, FileDetailsDTO o2) { - if ((o1 != null) && (o2 != null) && (o1.getDateOfSubmission() != null) - && (o2.getDateOfSubmission() != null)) { + if ((o1 != null) && (o2 != null) && (o1.getDateOfSubmission() != null) && (o2.getDateOfSubmission() + != null)) { // don't use Date.comparaTo() directly, because the date could be Timestamp or Date (depeneds the object // is persist or not) return (o1.getDateOfSubmission().getTime() - o2.getDateOfSubmission().getTime()) > 0 ? 1 : -1; @@ -223,33 +222,47 @@ } @Override - public void removeLearnerContent(Long toolContentId, Integer userId) throws ToolException { + public void removeLearnerContent(Long toolContentId, Integer userId, boolean resetActivityCompletionOnly) + throws ToolException { if (log.isDebugEnabled()) { - log.debug("Removing Submit Files content for user ID " + userId + " and toolContentId " + toolContentId); + if (resetActivityCompletionOnly) { + log.debug("Resetting Submit Files completion for user ID " + userId + " and toolContentId " + + toolContentId); + } else { + log.debug( + "Removing Submit Files content for user ID " + userId + " and toolContentId " + toolContentId); + } } List sessions = submitFilesSessionDAO.getSubmitFilesSessionByContentID(toolContentId); for (SubmitFilesSession session : sessions) { - List submissions = submissionDetailsDAO.getBySessionAndLearner(session.getSessionID(), - userId); - submissionDetailsDAO.deleteAll(submissions); + if (!resetActivityCompletionOnly) { + List submissions = submissionDetailsDAO.getBySessionAndLearner( + session.getSessionID(), userId); + submissionDetailsDAO.deleteAll(submissions); + } SubmitUser user = submitUserDAO.getLearner(session.getSessionID(), userId); if (user != null) { - NotebookEntry entry = getEntry(session.getSessionID(), CoreNotebookConstants.NOTEBOOK_TOOL, - SbmtConstants.TOOL_SIGNATURE, userId); - if (entry != null) { - submitFilesContentDAO.delete(entry); - } + if (resetActivityCompletionOnly) { + user.setFinished(false); + submitUserDAO.update(user); + } else { + NotebookEntry entry = getEntry(session.getSessionID(), CoreNotebookConstants.NOTEBOOK_TOOL, + SbmtConstants.TOOL_SIGNATURE, userId); + if (entry != null) { + submitFilesContentDAO.delete(entry); + } - toolService.removeActivityMark(user.getUserID(), session.getSessionID()); + toolService.removeActivityMark(user.getUserID(), session.getSessionID()); - if (session.getGroupLeader() != null && session.getGroupLeader().getUid() == user.getUid()) { - session.setGroupLeader(null); - submitFilesSessionDAO.update(session); - } + if (session.getGroupLeader() != null && session.getGroupLeader().getUid() == user.getUid()) { + session.setGroupLeader(null); + submitFilesSessionDAO.update(session); + } - submitUserDAO.delete(user); + submitUserDAO.delete(user); + } } } } @@ -480,8 +493,9 @@ } else { log.error("Fail to leave tool Session.Could not find submit file " + "session by given session id: " + toolSessionId); - throw new DataMissingException("Fail to leave tool Session." - + "Could not find submit file session by given session id: " + toolSessionId); + throw new DataMissingException( + "Fail to leave tool Session." + "Could not find submit file session by given session id: " + + toolSessionId); } return toolService.completeToolSession(toolSessionId, learnerId); } @@ -798,10 +812,10 @@ * Calculate user's total mark and push it to gradebook. * * @param updateMarksForAllSessionUsers - * whether we should update marks for all users in a session + * whether we should update marks for all users in a session * @param session * @param reportID - * applicable only in case of updateMarksForAllSessionUsers is false + * applicable only in case of updateMarksForAllSessionUsers is false */ private void recalculateUserTotalMarks(boolean updateMarksForAllSessionUsers, SubmitFilesSession session, Long reportID) { @@ -853,8 +867,8 @@ // push outputs to gradebook for (Integer userId : userIdToTotalMarkMap.keySet()) { - Double userTotalMark = userIdToTotalMarkMap.get(userId) == null ? null - : userIdToTotalMarkMap.get(userId).doubleValue(); + Double userTotalMark = + userIdToTotalMarkMap.get(userId) == null ? null : userIdToTotalMarkMap.get(userId).doubleValue(); toolService.updateActivityMark(userTotalMark, null, userId, sessionID, false); } } @@ -970,8 +984,9 @@ //audit log event String sessionName = session.getSessionName() + " (toolSessionId=" + session.getSessionID() + ")"; - String message = messageService.getMessage("tool.display.name") + ". " - + messageService.getMessage("msg.mark.released", new String[] { sessionName }); + String message = + messageService.getMessage("tool.display.name") + ". " + messageService.getMessage("msg.mark.released", + new String[] { sessionName }); logEventService.logToolEvent(LogEvent.TYPE_TOOL_MARK_RELEASED, content.getContentID(), null, message); } @@ -995,8 +1010,8 @@ notificationMessageParameters[0] = details.getFilePath(); notificationMessageParameters[1] = details.getDateOfSubmission(); notificationMessageParameters[2] = report.getMarks(); - notificationMessage - .append(getLocalisedMessage("event.mark.release.mark", notificationMessageParameters)); + notificationMessage.append( + getLocalisedMessage("event.mark.release.mark", notificationMessageParameters)); notificationMessages.put(userId, notificationMessage); } } @@ -1194,47 +1209,47 @@ /** * @param submitFilesContentDAO - * The submitFilesContentDAO to set. + * The submitFilesContentDAO to set. */ public void setSubmitFilesContentDAO(ISubmitFilesContentDAO submitFilesContentDAO) { this.submitFilesContentDAO = submitFilesContentDAO; } /** * @param submitFilesReportDAO - * The submitFilesReportDAO to set. + * The submitFilesReportDAO to set. */ public void setSubmitFilesReportDAO(ISubmitFilesReportDAO submitFilesReportDAO) { this.submitFilesReportDAO = submitFilesReportDAO; } /** * @param submitFilesSessionDAO - * The submitFilesSessionDAO to set. + * The submitFilesSessionDAO to set. */ public void setSubmitFilesSessionDAO(ISubmitFilesSessionDAO submitFilesSessionDAO) { this.submitFilesSessionDAO = submitFilesSessionDAO; } /** * @param submissionDetailsDAO - * The submissionDetailsDAO to set. + * The submissionDetailsDAO to set. */ public void setSubmissionDetailsDAO(ISubmissionDetailsDAO submissionDetailsDAO) { this.submissionDetailsDAO = submissionDetailsDAO; } /** * @param sbmtToolContentHandler - * The sbmtToolContentHandler to set. + * The sbmtToolContentHandler to set. */ public void setSbmtToolContentHandler(IToolContentHandler sbmtToolContentHandler) { this.sbmtToolContentHandler = sbmtToolContentHandler; } /** * @param learnerDAO - * The learnerDAO to set. + * The learnerDAO to set. */ public void setSubmitUserDAO(ISubmitUserDAO learnerDAO) { submitUserDAO = learnerDAO; @@ -1408,8 +1423,9 @@ public void changeLeaderForGroup(long toolSessionId, int leaderUserId) { SubmitFilesSession session = getSessionById(toolSessionId); if (session.getStatus() != null && session.getStatus().equals(SubmitFilesSession.COMPLETED)) { - throw new java.security.InvalidParameterException("Attempting to assing a new leader with user ID " - + leaderUserId + " to a finished session wtih ID " + toolSessionId); + throw new java.security.InvalidParameterException( + "Attempting to assing a new leader with user ID " + leaderUserId + " to a finished session wtih ID " + + toolSessionId); } SubmitUser existingLeader = session.getGroupLeader(); Index: lams_tool_scratchie/src/java/org/lamsfoundation/lams/tool/scratchie/service/ScratchieServiceImpl.java =================================================================== diff -u -r113c5a32c6fa73227ff541d4d197b1d6fe43a5b9 -rd7bfc30e7d7a056b984f35c292a7abed4635c754 --- lams_tool_scratchie/src/java/org/lamsfoundation/lams/tool/scratchie/service/ScratchieServiceImpl.java (.../ScratchieServiceImpl.java) (revision 113c5a32c6fa73227ff541d4d197b1d6fe43a5b9) +++ lams_tool_scratchie/src/java/org/lamsfoundation/lams/tool/scratchie/service/ScratchieServiceImpl.java (.../ScratchieServiceImpl.java) (revision d7bfc30e7d7a056b984f35c292a7abed4635c754) @@ -23,30 +23,10 @@ package org.lamsfoundation.lams.tool.scratchie.service; -import java.io.IOException; -import java.security.InvalidParameterException; -import java.sql.Timestamp; -import java.text.SimpleDateFormat; -import java.time.LocalDateTime; -import java.time.ZoneId; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collection; -import java.util.Date; -import java.util.HashMap; -import java.util.HashSet; -import java.util.Iterator; -import java.util.LinkedHashMap; -import java.util.LinkedList; -import java.util.List; -import java.util.Map; -import java.util.Set; -import java.util.SortedMap; -import java.util.TreeSet; -import java.util.UUID; -import java.util.function.Function; -import java.util.stream.Collectors; - +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.node.ArrayNode; +import com.fasterxml.jackson.databind.node.JsonNodeFactory; +import com.fasterxml.jackson.databind.node.ObjectNode; import org.apache.commons.lang.StringEscapeUtils; import org.apache.commons.lang.StringUtils; import org.apache.log4j.Logger; @@ -122,13 +102,32 @@ import org.lamsfoundation.lams.util.MessageService; import org.lamsfoundation.lams.util.excel.ExcelRow; import org.lamsfoundation.lams.util.excel.ExcelSheet; - -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.node.ArrayNode; -import com.fasterxml.jackson.databind.node.JsonNodeFactory; -import com.fasterxml.jackson.databind.node.ObjectNode; import org.lamsfoundation.lams.util.hibernate.HibernateSessionManager; +import java.io.IOException; +import java.security.InvalidParameterException; +import java.sql.Timestamp; +import java.text.SimpleDateFormat; +import java.time.LocalDateTime; +import java.time.ZoneId; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import java.util.Date; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Iterator; +import java.util.LinkedHashMap; +import java.util.LinkedList; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.SortedMap; +import java.util.TreeSet; +import java.util.UUID; +import java.util.function.Function; +import java.util.stream.Collectors; + /** * @author Andrey Balan */ @@ -2839,9 +2838,15 @@ } @Override - public void removeLearnerContent(Long toolContentId, Integer userId) throws ToolException { + public void removeLearnerContent(Long toolContentId, Integer userId, boolean resetActivityCompletionOnly) + throws ToolException { if (log.isDebugEnabled()) { - log.debug("Removing Scratchie content for user ID " + userId + " and toolContentId " + toolContentId); + if (resetActivityCompletionOnly) { + log.debug( + "Resetting Scratchie completion for user ID " + userId + " and toolContentId " + toolContentId); + } else { + log.debug("Removing Scratchie content for user ID " + userId + " and toolContentId " + toolContentId); + } } List sessions = scratchieSessionDao.getByContentId(toolContentId); @@ -2850,25 +2855,36 @@ session.getSessionId()); if (user != null) { - NotebookEntry entry = getEntry(session.getSessionId(), CoreNotebookConstants.NOTEBOOK_TOOL, - ScratchieConstants.TOOL_SIGNATURE, userId); - if (entry != null) { - scratchieDao.removeObject(NotebookEntry.class, entry.getUid()); - } + if (resetActivityCompletionOnly) { + user.setSessionFinished(false); + scratchieUserDao.saveObject(user); + if ((session.getGroupLeader() != null) && session.getGroupLeader().getUid().equals(user.getUid())) { + session.setScratchingFinished(false); + session.setSessionEndDate(null); + scratchieSessionDao.update(session); + } + } else { - if ((session.getGroupLeader() != null) && session.getGroupLeader().getUid().equals(user.getUid())) { - session.setGroupLeader(null); - session.setScratchingFinished(false); - session.setSessionEndDate(null); - session.setTimeLimitLaunchedDate(null); - scratchieSessionDao.update(session); + NotebookEntry entry = getEntry(session.getSessionId(), CoreNotebookConstants.NOTEBOOK_TOOL, + ScratchieConstants.TOOL_SIGNATURE, userId); + if (entry != null) { + scratchieDao.removeObject(NotebookEntry.class, entry.getUid()); + } - scratchieAnswerVisitDao.deleteByProperty(ScratchieAnswerVisitLog.class, "sessionId", - session.getSessionId()); - } + if ((session.getGroupLeader() != null) && session.getGroupLeader().getUid().equals(user.getUid())) { + session.setGroupLeader(null); + session.setScratchingFinished(false); + session.setSessionEndDate(null); + session.setTimeLimitLaunchedDate(null); + scratchieSessionDao.update(session); - scratchieUserDao.removeObject(ScratchieUser.class, user.getUid()); - toolService.removeActivityMark(userId, session.getSessionId()); + scratchieAnswerVisitDao.deleteByProperty(ScratchieAnswerVisitLog.class, "sessionId", + session.getSessionId()); + } + + scratchieUserDao.removeObject(ScratchieUser.class, user.getUid()); + toolService.removeActivityMark(userId, session.getSessionId()); + } } } } Index: lams_tool_scribe/src/java/org/lamsfoundation/lams/tool/scribe/service/ScribeService.java =================================================================== diff -u -r20aa6cbca9fc96d341080e6ad39f82593443f792 -rd7bfc30e7d7a056b984f35c292a7abed4635c754 --- lams_tool_scribe/src/java/org/lamsfoundation/lams/tool/scribe/service/ScribeService.java (.../ScribeService.java) (revision 20aa6cbca9fc96d341080e6ad39f82593443f792) +++ lams_tool_scribe/src/java/org/lamsfoundation/lams/tool/scribe/service/ScribeService.java (.../ScribeService.java) (revision d7bfc30e7d7a056b984f35c292a7abed4635c754) @@ -23,15 +23,9 @@ package org.lamsfoundation.lams.tool.scribe.service; -import java.util.ArrayList; -import java.util.Date; -import java.util.HashSet; -import java.util.Iterator; -import java.util.List; -import java.util.Set; -import java.util.SortedMap; -import java.util.TreeMap; - +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.node.ArrayNode; +import com.fasterxml.jackson.databind.node.ObjectNode; import org.apache.log4j.Logger; import org.lamsfoundation.lams.confidencelevel.ConfidenceLevelDTO; import org.lamsfoundation.lams.contentrepository.client.IToolContentHandler; @@ -67,9 +61,14 @@ import org.lamsfoundation.lams.usermanagement.dto.UserDTO; import org.lamsfoundation.lams.util.JsonUtil; -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.node.ArrayNode; -import com.fasterxml.jackson.databind.node.ObjectNode; +import java.util.ArrayList; +import java.util.Date; +import java.util.HashSet; +import java.util.Iterator; +import java.util.List; +import java.util.Set; +import java.util.SortedMap; +import java.util.TreeMap; /** * An implementation of the IScribeService interface. @@ -106,8 +105,9 @@ @Override public void createToolSession(Long toolSessionId, String toolSessionName, Long toolContentId) throws ToolException { if (ScribeService.logger.isDebugEnabled()) { - ScribeService.logger.debug("entering method createToolSession:" + " toolSessionId = " + toolSessionId - + " toolSessionName = " + toolSessionName + " toolContentId = " + toolContentId); + ScribeService.logger.debug( + "entering method createToolSession:" + " toolSessionId = " + toolSessionId + " toolSessionName = " + + toolSessionName + " toolContentId = " + toolContentId); } ScribeSession session = new ScribeSession(); @@ -163,7 +163,7 @@ public List getConfidenceLevels(Long toolSessionId) { return null; } - + @Override public boolean isUserGroupLeader(Long userId, Long toolSessionId) { return false; @@ -180,8 +180,9 @@ public void copyToolContent(Long fromContentId, Long toContentId) throws ToolException { if (ScribeService.logger.isDebugEnabled()) { - ScribeService.logger.debug("entering method copyToolContent:" + " fromContentId=" + fromContentId - + " toContentId=" + toContentId); + ScribeService.logger.debug( + "entering method copyToolContent:" + " fromContentId=" + fromContentId + " toContentId=" + + toContentId); } if (toContentId == null) { @@ -233,26 +234,36 @@ @Override @SuppressWarnings("unchecked") - public void removeLearnerContent(Long toolContentId, Integer userId) throws ToolException { - if (ScribeService.logger.isDebugEnabled()) { - ScribeService.logger - .debug("Removing Scribe contents for user ID " + userId + " and toolContentId " + toolContentId); + public void removeLearnerContent(Long toolContentId, Integer userId, boolean resetActivityCompletionOnly) + throws ToolException { + if (logger.isDebugEnabled()) { + if (resetActivityCompletionOnly) { + logger.debug( + "Resetting Scribe completion for user ID " + userId + " and toolContentId " + toolContentId); + } else { + logger.debug("Removing Scribe content for user ID " + userId + " and toolContentId " + toolContentId); + } } Scribe scribe = scribeDAO.getByContentId(toolContentId); if (scribe == null) { - ScribeService.logger - .warn("Did not find activity with toolContentId: " + toolContentId + " to remove learner content"); + ScribeService.logger.warn( + "Did not find activity with toolContentId: " + toolContentId + " to remove learner content"); return; } - for (ScribeSession session : (Set) scribe.getScribeSessions()) { - if ((session.getAppointedScribe() != null) - && session.getAppointedScribe().getUserId().equals(userId.longValue())) { + for (ScribeSession session : scribe.getScribeSessions()) { + if ((session.getAppointedScribe() != null) && session.getAppointedScribe().getUserId() + .equals(userId.longValue())) { - for (ScribeUser user : (Set) session.getScribeUsers()) { + for (ScribeUser user : session.getScribeUsers()) { if (user.getUserId().equals(userId.longValue())) { - scribeUserDAO.delete(user); + if (resetActivityCompletionOnly) { + user.setFinishedActivity(false); + scribeUserDAO.saveOrUpdate(user); + } else { + scribeUserDAO.delete(user); + } } else { user.setReportApproved(false); scribeUserDAO.saveOrUpdate(user); @@ -267,14 +278,19 @@ } else { ScribeUser user = scribeUserDAO.getByUserIdAndSessionId(userId.longValue(), session.getSessionId()); if (user != null) { - scribeUserDAO.delete(user); + if (resetActivityCompletionOnly) { + user.setFinishedActivity(false); + } else { + scribeUserDAO.delete(user); + } } } - - NotebookEntry entry = getEntry(session.getSessionId(), CoreNotebookConstants.NOTEBOOK_TOOL, - ScribeConstants.TOOL_SIGNATURE, userId); - if (entry != null) { - scribeDAO.delete(entry); + if (!resetActivityCompletionOnly) { + NotebookEntry entry = getEntry(session.getSessionId(), CoreNotebookConstants.NOTEBOOK_TOOL, + ScribeConstants.TOOL_SIGNATURE, userId); + if (entry != null) { + scribeDAO.delete(entry); + } } } } @@ -379,7 +395,7 @@ reports = new HashSet(); session.setScribeReportEntries(reports); } - for (Iterator iter = scribe.getScribeHeadings().iterator(); iter.hasNext();) { + for (Iterator iter = scribe.getScribeHeadings().iterator(); iter.hasNext(); ) { ScribeHeading heading = (ScribeHeading) iter.next(); ScribeReportEntry report = new ScribeReportEntry(); @@ -502,7 +518,7 @@ public void auditLogStartEditingActivityInMonitor(long toolContentID) { toolService.auditLogStartEditingActivityInMonitor(toolContentID); } - + @Override public boolean isLastActivity(Long toolSessionId) { return toolService.isLastActivity(toolSessionId); @@ -634,7 +650,8 @@ return new ToolCompletionStatus(ToolCompletionStatus.ACTIVITY_NOT_ATTEMPTED, null, null); } - return new ToolCompletionStatus(learner.isFinishedActivity() ? ToolCompletionStatus.ACTIVITY_COMPLETED + return new ToolCompletionStatus(learner.isFinishedActivity() + ? ToolCompletionStatus.ACTIVITY_COMPLETED : ToolCompletionStatus.ACTIVITY_ATTEMPTED, null, null); } Index: lams_tool_spreadsheet/src/java/org/lamsfoundation/lams/tool/spreadsheet/service/SpreadsheetServiceImpl.java =================================================================== diff -u -r20aa6cbca9fc96d341080e6ad39f82593443f792 -rd7bfc30e7d7a056b984f35c292a7abed4635c754 --- lams_tool_spreadsheet/src/java/org/lamsfoundation/lams/tool/spreadsheet/service/SpreadsheetServiceImpl.java (.../SpreadsheetServiceImpl.java) (revision 20aa6cbca9fc96d341080e6ad39f82593443f792) +++ lams_tool_spreadsheet/src/java/org/lamsfoundation/lams/tool/spreadsheet/service/SpreadsheetServiceImpl.java (.../SpreadsheetServiceImpl.java) (revision d7bfc30e7d7a056b984f35c292a7abed4635c754) @@ -23,16 +23,6 @@ package org.lamsfoundation.lams.tool.spreadsheet.service; -import java.util.ArrayList; -import java.util.Date; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Set; -import java.util.SortedMap; -import java.util.TreeMap; -import java.util.TreeSet; - import org.apache.log4j.Logger; import org.lamsfoundation.lams.confidencelevel.ConfidenceLevelDTO; import org.lamsfoundation.lams.contentrepository.client.IToolContentHandler; @@ -69,6 +59,16 @@ import org.lamsfoundation.lams.usermanagement.service.IUserManagementService; import org.lamsfoundation.lams.util.MessageService; +import java.util.ArrayList; +import java.util.Date; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.SortedMap; +import java.util.TreeMap; +import java.util.TreeSet; + /** * @author Andrey Balan */ @@ -308,8 +308,7 @@ // send marks to gradebook where applicable if (mark.getMarks() != null) { Double doubleMark = mark.getMarks().doubleValue(); - toolService.updateActivityMark(doubleMark, null, user.getUserId().intValue(), sessionId, - false); + toolService.updateActivityMark(doubleMark, null, user.getUserId().intValue(), sessionId, false); } } } @@ -319,12 +318,12 @@ public boolean isGroupedActivity(long toolContentID) { return toolService.isGroupedActivity(toolContentID); } - + @Override public void auditLogStartEditingActivityInMonitor(long toolContentID) { - toolService.auditLogStartEditingActivityInMonitor(toolContentID); + toolService.auditLogStartEditingActivityInMonitor(toolContentID); } - + @Override public boolean isLastActivity(Long toolSessionId) { return toolService.isLastActivity(toolSessionId); @@ -540,29 +539,39 @@ } @Override - public void removeLearnerContent(Long toolContentId, Integer userId) throws ToolException { + public void removeLearnerContent(Long toolContentId, Integer userId, boolean resetActivityCompletionOnly) + throws ToolException { if (log.isDebugEnabled()) { - log.debug("Removing Spreadsheet contents for user ID " + userId + " and toolContentId " + toolContentId); + if (resetActivityCompletionOnly) { + log.debug("Resetting Spreadsheet completion for user ID " + userId + " and toolContentId " + + toolContentId); + } else { + log.debug("Removing Spreadsheet content for user ID " + userId + " and toolContentId " + toolContentId); + } } List sessions = spreadsheetSessionDao.getByContentId(toolContentId); for (SpreadsheetSession session : sessions) { SpreadsheetUser user = spreadsheetUserDao.getUserByUserIDAndSessionID(userId.longValue(), session.getSessionId()); if (user != null) { - user.setSessionFinished(false); - if (user.getUserModifiedSpreadsheet() != null) { - spreadsheetDao.removeObject(UserModifiedSpreadsheet.class, - user.getUserModifiedSpreadsheet().getUid()); - } + if (resetActivityCompletionOnly) { + user.setSessionFinished(false); + spreadsheetUserDao.saveObject(user); + } else { + if (user.getUserModifiedSpreadsheet() != null) { + spreadsheetDao.removeObject(UserModifiedSpreadsheet.class, + user.getUserModifiedSpreadsheet().getUid()); + } - NotebookEntry entry = getEntry(session.getSessionId(), CoreNotebookConstants.NOTEBOOK_TOOL, - SpreadsheetConstants.TOOL_SIGNATURE, userId); - if (entry != null) { - spreadsheetDao.removeObject(NotebookEntry.class, entry.getUid()); - } + NotebookEntry entry = getEntry(session.getSessionId(), CoreNotebookConstants.NOTEBOOK_TOOL, + SpreadsheetConstants.TOOL_SIGNATURE, userId); + if (entry != null) { + spreadsheetDao.removeObject(NotebookEntry.class, entry.getUid()); + } - spreadsheetUserDao.removeObject(SpreadsheetUser.class, user.getUid()); + spreadsheetUserDao.removeObject(SpreadsheetUser.class, user.getUid()); + } } } } @@ -595,8 +604,9 @@ } else { log.error("Fail to leave tool Session.Could not find shared spreadsheet " + "session by given session id: " + toolSessionId); - throw new DataMissingException("Fail to leave tool Session." - + "Could not find shared spreadsheet session by given session id: " + toolSessionId); + throw new DataMissingException( + "Fail to leave tool Session." + "Could not find shared spreadsheet session by given session id: " + + toolSessionId); } return toolService.completeToolSession(toolSessionId, learnerId); } @@ -632,12 +642,12 @@ public List getToolOutputs(String name, Long toolContentId) { return new ArrayList(); } - + @Override public List getConfidenceLevels(Long toolSessionId) { return null; } - + @Override public boolean isUserGroupLeader(Long userId, Long toolSessionId) { return false; @@ -678,15 +688,16 @@ public Class[] getSupportedToolOutputDefinitionClasses(int definitionType) { return null; } - + @Override public ToolCompletionStatus getCompletionStatus(Long learnerId, Long toolSessionId) { SpreadsheetUser learner = getUserByIDAndSession(learnerId, toolSessionId); if (learner == null) { return new ToolCompletionStatus(ToolCompletionStatus.ACTIVITY_NOT_ATTEMPTED, null, null); } - return new ToolCompletionStatus(learner.isSessionFinished() ? ToolCompletionStatus.ACTIVITY_COMPLETED + return new ToolCompletionStatus(learner.isSessionFinished() + ? ToolCompletionStatus.ACTIVITY_COMPLETED : ToolCompletionStatus.ACTIVITY_ATTEMPTED, null, null); } -} +} \ No newline at end of file Index: lams_tool_survey/src/java/org/lamsfoundation/lams/tool/survey/service/SurveyServiceImpl.java =================================================================== diff -u -r20aa6cbca9fc96d341080e6ad39f82593443f792 -rd7bfc30e7d7a056b984f35c292a7abed4635c754 --- lams_tool_survey/src/java/org/lamsfoundation/lams/tool/survey/service/SurveyServiceImpl.java (.../SurveyServiceImpl.java) (revision 20aa6cbca9fc96d341080e6ad39f82593443f792) +++ lams_tool_survey/src/java/org/lamsfoundation/lams/tool/survey/service/SurveyServiceImpl.java (.../SurveyServiceImpl.java) (revision d7bfc30e7d7a056b984f35c292a7abed4635c754) @@ -23,20 +23,8 @@ package org.lamsfoundation.lams.tool.survey.service; -import java.util.ArrayList; -import java.util.Collection; -import java.util.Date; -import java.util.HashMap; -import java.util.HashSet; -import java.util.Iterator; -import java.util.List; -import java.util.Map; -import java.util.Random; -import java.util.Set; -import java.util.SortedMap; -import java.util.TreeMap; -import java.util.TreeSet; - +import com.fasterxml.jackson.databind.node.ArrayNode; +import com.fasterxml.jackson.databind.node.ObjectNode; import org.apache.log4j.Logger; import org.lamsfoundation.lams.confidencelevel.ConfidenceLevelDTO; import org.lamsfoundation.lams.contentrepository.client.IToolContentHandler; @@ -83,8 +71,19 @@ import org.lamsfoundation.lams.util.JsonUtil; import org.lamsfoundation.lams.util.MessageService; -import com.fasterxml.jackson.databind.node.ArrayNode; -import com.fasterxml.jackson.databind.node.ObjectNode; +import java.util.ArrayList; +import java.util.Collection; +import java.util.Date; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import java.util.Random; +import java.util.Set; +import java.util.SortedMap; +import java.util.TreeMap; +import java.util.TreeSet; /** * @author Dapeng.Ni @@ -404,8 +403,7 @@ @Override public SortedMap> getSummary(Long toolContentId) { - SortedMap> summary = new TreeMap<>( - new SurveySessionComparator()); + SortedMap> summary = new TreeMap<>(new SurveySessionComparator()); Survey survey = surveyDao.getByContentId(toolContentId); // get all question under this survey @@ -459,7 +457,7 @@ * Creates data for export methods. Suitable both for single/multiple users * * @param sessionToUsersMap - * map containing all session to users pairs that require data to be exported + * map containing all session to users pairs that require data to be exported * @return */ private SortedMap>> getExportSummary( @@ -479,8 +477,7 @@ // traverse all sessions for (SurveySession session : sessionToUsersMap.keySet()) { - SortedMap> questionMap = new TreeMap<>( - new QuestionsComparator()); + SortedMap> questionMap = new TreeMap<>(new QuestionsComparator()); // traverse all questions for (SurveyQuestion question : questions) { @@ -548,7 +545,7 @@ public void auditLogStartEditingActivityInMonitor(long toolContentID) { toolService.auditLogStartEditingActivityInMonitor(toolContentID); } - + @Override public boolean isLastActivity(Long toolSessionId) { return toolService.isLastActivity(toolSessionId); @@ -779,28 +776,39 @@ } @Override - public void removeLearnerContent(Long toolContentId, Integer userId) throws ToolException { - if (SurveyServiceImpl.log.isDebugEnabled()) { - SurveyServiceImpl.log - .debug("Removing Survey answers for user ID " + userId + " and toolContentId " + toolContentId); + public void removeLearnerContent(Long toolContentId, Integer userId, boolean resetActivityCompletionOnly) + throws ToolException { + if (log.isDebugEnabled()) { + if (resetActivityCompletionOnly) { + log.debug("Resetting Survey completion for user ID " + userId + " and toolContentId " + toolContentId); + } else { + log.debug("Removing Survey answers for user ID " + userId + " and toolContentId " + toolContentId); + } } - List answers = surveyAnswerDao.getByToolContentIdAndUserId(toolContentId, userId.longValue()); - for (SurveyAnswer answer : answers) { - surveyAnswerDao.removeObject(SurveyAnswer.class, answer.getUid()); + if (!resetActivityCompletionOnly) { + List answers = surveyAnswerDao.getByToolContentIdAndUserId(toolContentId, userId.longValue()); + for (SurveyAnswer answer : answers) { + surveyAnswerDao.removeObject(SurveyAnswer.class, answer.getUid()); + } } List sessions = surveySessionDao.getByContentId(toolContentId); for (SurveySession session : sessions) { SurveyUser user = surveyUserDao.getUserByUserIDAndSessionID(userId.longValue(), session.getSessionId()); if (user != null) { - NotebookEntry entry = getEntry(session.getSessionId(), CoreNotebookConstants.NOTEBOOK_TOOL, - SurveyConstants.TOOL_SIGNATURE, userId); - if (entry != null) { - surveyDao.removeObject(NotebookEntry.class, entry.getUid()); - } + if (resetActivityCompletionOnly) { + user.setSessionFinished(false); + surveyUserDao.saveObject(user); + } else { + NotebookEntry entry = getEntry(session.getSessionId(), CoreNotebookConstants.NOTEBOOK_TOOL, + SurveyConstants.TOOL_SIGNATURE, userId); + if (entry != null) { + surveyDao.removeObject(NotebookEntry.class, entry.getUid()); + } - surveyUserDao.removeObject(SurveyUser.class, user.getUid()); + surveyUserDao.removeObject(SurveyUser.class, user.getUid()); + } } } } @@ -864,7 +872,7 @@ public List getConfidenceLevels(Long toolSessionId) { return null; } - + @Override public boolean isUserGroupLeader(Long userId, Long toolSessionId) { return false; @@ -962,7 +970,8 @@ return new ToolCompletionStatus(ToolCompletionStatus.ACTIVITY_NOT_ATTEMPTED, null, null); } - return new ToolCompletionStatus(learner.isSessionFinished() ? ToolCompletionStatus.ACTIVITY_COMPLETED + return new ToolCompletionStatus(learner.isSessionFinished() + ? ToolCompletionStatus.ACTIVITY_COMPLETED : ToolCompletionStatus.ACTIVITY_ATTEMPTED, null, null); } @@ -980,7 +989,8 @@ * strings, which are the answer text. A question may also have the optional fields: allowOtherTextEntry (default * false), required (default true) * - * There should be at least one question object in the Questions array and at least one option in the Options array. + * There should be at least one question object in the Questions array and at least one option in the Options + * array. */ @Override public void createRestToolContent(Integer userID, Long toolContentID, ObjectNode toolContentJSON) { Index: lams_tool_task/src/java/org/lamsfoundation/lams/tool/taskList/service/TaskListServiceImpl.java =================================================================== diff -u -r2de8f805211b6433aff4efd6fa9275a1b9933033 -rd7bfc30e7d7a056b984f35c292a7abed4635c754 --- lams_tool_task/src/java/org/lamsfoundation/lams/tool/taskList/service/TaskListServiceImpl.java (.../TaskListServiceImpl.java) (revision 2de8f805211b6433aff4efd6fa9275a1b9933033) +++ lams_tool_task/src/java/org/lamsfoundation/lams/tool/taskList/service/TaskListServiceImpl.java (.../TaskListServiceImpl.java) (revision d7bfc30e7d7a056b984f35c292a7abed4635c754) @@ -23,20 +23,6 @@ package org.lamsfoundation.lams.tool.taskList.service; -import java.io.File; -import java.io.FileInputStream; -import java.io.FileNotFoundException; -import java.io.IOException; -import java.sql.Timestamp; -import java.util.ArrayList; -import java.util.Collection; -import java.util.Date; -import java.util.Iterator; -import java.util.LinkedList; -import java.util.List; -import java.util.Set; -import java.util.SortedMap; - import org.apache.commons.lang.StringUtils; import org.apache.log4j.Logger; import org.lamsfoundation.lams.confidencelevel.ConfidenceLevelDTO; @@ -81,6 +67,20 @@ import org.lamsfoundation.lams.usermanagement.service.IUserManagementService; import org.lamsfoundation.lams.util.MessageService; +import java.io.File; +import java.io.FileInputStream; +import java.io.FileNotFoundException; +import java.io.IOException; +import java.sql.Timestamp; +import java.util.ArrayList; +import java.util.Collection; +import java.util.Date; +import java.util.Iterator; +import java.util.LinkedList; +import java.util.List; +import java.util.Set; +import java.util.SortedMap; + /** * Class implements org.lamsfoundation.lams.tool.taskList.service.ITaskListService. * @@ -376,7 +376,8 @@ if (entry != null) { ReflectDTO ref = new ReflectDTO(user); ref.setReflect(entry.getEntry()); - Date postedDate = (entry.getLastModified() != null) ? entry.getLastModified() + Date postedDate = (entry.getLastModified() != null) + ? entry.getLastModified() : entry.getCreateDate(); ref.setDate(postedDate); reflectList.add(ref); @@ -737,50 +738,60 @@ @Override @SuppressWarnings("unchecked") - public void removeLearnerContent(Long toolContentId, Integer userId) throws ToolException { - if (TaskListServiceImpl.log.isDebugEnabled()) { - TaskListServiceImpl.log - .debug("Removing Task List contents for user ID " + userId + " and toolContentId " + toolContentId); + public void removeLearnerContent(Long toolContentId, Integer userId, boolean resetActivityCompletionOnly) + throws ToolException { + if (log.isDebugEnabled()) { + if (resetActivityCompletionOnly) { + log.debug( + "Resetting Task List completion for user ID " + userId + " and toolContentId " + toolContentId); + } else { + log.debug("Removing Task List content for user ID " + userId + " and toolContentId " + toolContentId); + } } + TaskList taskList = taskListDao.getByContentId(toolContentId); if (taskList == null) { - TaskListServiceImpl.log - .warn("Did not find activity with toolContentId: " + toolContentId + " to remove learner content"); + TaskListServiceImpl.log.warn( + "Did not find activity with toolContentId: " + toolContentId + " to remove learner content"); return; } - Set items = taskList.getTaskListItems(); - for (TaskListItem item : items) { - if (TaskListServiceImpl.log.isDebugEnabled()) { - TaskListServiceImpl.log.debug("Removing visit log, comments and attachments for user ID " + userId - + " and item UID " + item.getUid()); - } + if (!resetActivityCompletionOnly) { + Set items = taskList.getTaskListItems(); + for (TaskListItem item : items) { + if (TaskListServiceImpl.log.isDebugEnabled()) { + TaskListServiceImpl.log.debug( + "Removing visit log, comments and attachments for user ID " + userId + " and item UID " + + item.getUid()); + } - TaskListItemVisitLog visitLog = taskListItemVisitDao.getTaskListItemLog(item.getUid(), userId.longValue()); - if (visitLog != null) { - taskListDao.removeObject(TaskListItemVisitLog.class, visitLog.getUid()); - } + TaskListItemVisitLog visitLog = taskListItemVisitDao.getTaskListItemLog(item.getUid(), + userId.longValue()); + if (visitLog != null) { + taskListDao.removeObject(TaskListItemVisitLog.class, visitLog.getUid()); + } - Iterator attachmentIter = item.getAttachments().iterator(); - while (attachmentIter.hasNext()) { - TaskListItemAttachment attachment = attachmentIter.next(); - if (attachment.getCreateBy().getUserId().equals(userId.longValue())) { - try { - taskListToolContentHandler.deleteFile(attachment.getFileUuid()); - } catch (Exception e) { - throw new ToolException("Error while removing Task List attachment", e); + Iterator attachmentIter = item.getAttachments().iterator(); + while (attachmentIter.hasNext()) { + TaskListItemAttachment attachment = attachmentIter.next(); + if (attachment.getCreateBy().getUserId().equals(userId.longValue())) { + try { + taskListToolContentHandler.deleteFile(attachment.getFileUuid()); + } catch (Exception e) { + throw new ToolException("Error while removing Task List attachment", e); + } + taskListDao.removeObject(TaskListItemAttachment.class, attachment.getUid()); + attachmentIter.remove(); } - taskListDao.removeObject(TaskListItemAttachment.class, attachment.getUid()); - attachmentIter.remove(); } - } - Iterator commentIter = item.getComments().iterator(); - while (commentIter.hasNext()) { - TaskListItemComment comment = commentIter.next(); - if (comment.getCreateBy().getUserId().equals(userId.longValue())) { - taskListDao.removeObject(TaskListItemComment.class, comment.getUid()); - commentIter.remove(); + Iterator commentIter = item.getComments().iterator(); + while (commentIter.hasNext()) { + TaskListItemComment comment = commentIter.next(); + if (comment.getCreateBy().getUserId().equals(userId.longValue())) { + taskListDao.removeObject(TaskListItemComment.class, comment.getUid()); + commentIter.remove(); + } } } } @@ -789,13 +800,18 @@ for (TaskListSession session : sessions) { TaskListUser user = taskListUserDao.getUserByUserIDAndSessionID(userId.longValue(), session.getSessionId()); if (user != null) { - NotebookEntry entry = getEntry(user.getSession().getSessionId(), CoreNotebookConstants.NOTEBOOK_TOOL, - TaskListConstants.TOOL_SIGNATURE, userId); - if (entry != null) { - taskListDao.removeObject(NotebookEntry.class, entry.getUid()); - } + if (resetActivityCompletionOnly) { + user.setSessionFinished(false); + taskListUserDao.saveObject(user); + } else { + NotebookEntry entry = getEntry(user.getSession().getSessionId(), + CoreNotebookConstants.NOTEBOOK_TOOL, TaskListConstants.TOOL_SIGNATURE, userId); + if (entry != null) { + taskListDao.removeObject(NotebookEntry.class, entry.getUid()); + } - taskListUserDao.removeObject(TaskListUser.class, user.getUid()); + taskListUserDao.removeObject(TaskListUser.class, user.getUid()); + } } } } @@ -826,10 +842,12 @@ session.setStatus(TaskListConstants.COMPLETED); taskListSessionDao.saveObject(session); } else { - TaskListServiceImpl.log.error("Fail to leave tool Session.Could not find shared taskList " - + "session by given session id: " + toolSessionId); - throw new DataMissingException("Fail to leave tool Session." - + "Could not find shared taskList session by given session id: " + toolSessionId); + TaskListServiceImpl.log.error( + "Fail to leave tool Session.Could not find shared taskList " + "session by given session id: " + + toolSessionId); + throw new DataMissingException( + "Fail to leave tool Session." + "Could not find shared taskList session by given session id: " + + toolSessionId); } return toolService.completeToolSession(toolSessionId, learnerId); } @@ -860,7 +878,7 @@ * Get the tool output for the given tool output name. * * @see org.lamsfoundation.lams.tool.ToolSessionManager#getToolOutput(java.lang.String, java.lang.Long, - * java.lang.Long) + * java.lang.Long) */ @Override public ToolOutput getToolOutput(String name, Long toolSessionId, Long learnerId) { @@ -919,7 +937,7 @@ * * @param contentId * @param sessionId - * sessionId which defines Group + * sessionId which defines Group * @return */ private List getItemListForGroup(Long contentId, Long sessionId) { @@ -1012,4 +1030,4 @@ } } -} +} \ No newline at end of file Index: lams_tool_videorecorder/src/java/org/lamsfoundation/lams/tool/videoRecorder/service/VideoRecorderService.java =================================================================== diff -u -r20aa6cbca9fc96d341080e6ad39f82593443f792 -rd7bfc30e7d7a056b984f35c292a7abed4635c754 --- lams_tool_videorecorder/src/java/org/lamsfoundation/lams/tool/videoRecorder/service/VideoRecorderService.java (.../VideoRecorderService.java) (revision 20aa6cbca9fc96d341080e6ad39f82593443f792) +++ lams_tool_videorecorder/src/java/org/lamsfoundation/lams/tool/videoRecorder/service/VideoRecorderService.java (.../VideoRecorderService.java) (revision d7bfc30e7d7a056b984f35c292a7abed4635c754) @@ -24,10 +24,6 @@ package org.lamsfoundation.lams.tool.videoRecorder.service; -import java.util.ArrayList; -import java.util.List; -import java.util.SortedMap; - import org.lamsfoundation.lams.confidencelevel.ConfidenceLevelDTO; import org.lamsfoundation.lams.tool.ToolCompletionStatus; import org.lamsfoundation.lams.tool.ToolContentManager; @@ -39,6 +35,10 @@ import org.lamsfoundation.lams.tool.exception.ToolException; import org.lamsfoundation.lams.usermanagement.User; +import java.util.ArrayList; +import java.util.List; +import java.util.SortedMap; + public class VideoRecorderService implements ToolSessionManager, ToolContentManager { @Override @@ -54,7 +54,8 @@ } @Override - public void removeLearnerContent(Long toolContentId, Integer userId) throws ToolException { + public void removeLearnerContent(Long toolContentId, Integer userId, boolean resetActivityCompletionOnly) + throws ToolException { } @Override @@ -126,17 +127,17 @@ public ToolOutput getToolOutput(String name, Long toolSessionId, Long learnerId) { return null; } - + @Override public List getToolOutputs(String name, Long toolContentId) { return new ArrayList(); } - + @Override public List getConfidenceLevels(Long toolSessionId) { return null; } - + @Override public boolean isUserGroupLeader(Long userId, Long toolSessionId) { return false; @@ -145,7 +146,7 @@ @Override public void forceCompleteUser(Long toolSessionId, User user) { } - + @Override public ToolCompletionStatus getCompletionStatus(Long learnerId, Long toolSessionId) { return null; Index: lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/service/VoteService.java =================================================================== diff -u -re62e56b0f0d04f6820592e95b0271619784a2c9f -rd7bfc30e7d7a056b984f35c292a7abed4635c754 --- lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/service/VoteService.java (.../VoteService.java) (revision e62e56b0f0d04f6820592e95b0271619784a2c9f) +++ lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/service/VoteService.java (.../VoteService.java) (revision d7bfc30e7d7a056b984f35c292a7abed4635c754) @@ -22,27 +22,9 @@ package org.lamsfoundation.lams.tool.vote.service; -import java.security.InvalidParameterException; -import java.util.ArrayList; -import java.util.Collection; -import java.util.Date; -import java.util.HashMap; -import java.util.HashSet; -import java.util.Iterator; -import java.util.LinkedList; -import java.util.List; -import java.util.Map; -import java.util.Set; -import java.util.SortedMap; -import java.util.SortedSet; -import java.util.TimeZone; -import java.util.TreeMap; -import java.util.TreeSet; -import java.util.stream.Collectors; - -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpSession; - +import com.fasterxml.jackson.databind.node.ArrayNode; +import com.fasterxml.jackson.databind.node.JsonNodeFactory; +import com.fasterxml.jackson.databind.node.ObjectNode; import org.apache.commons.lang.StringUtils; import org.apache.log4j.Logger; import org.lamsfoundation.lams.confidencelevel.ConfidenceLevelDTO; @@ -104,9 +86,25 @@ import org.lamsfoundation.lams.web.util.AttributeNames; import org.springframework.dao.DataAccessException; -import com.fasterxml.jackson.databind.node.ArrayNode; -import com.fasterxml.jackson.databind.node.JsonNodeFactory; -import com.fasterxml.jackson.databind.node.ObjectNode; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpSession; +import java.security.InvalidParameterException; +import java.util.ArrayList; +import java.util.Collection; +import java.util.Date; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Iterator; +import java.util.LinkedList; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.SortedMap; +import java.util.SortedSet; +import java.util.TimeZone; +import java.util.TreeMap; +import java.util.TreeSet; +import java.util.stream.Collectors; /** * The POJO implementation of Voting service. All business logic of Voting tool is implemented in this class. It @@ -236,8 +234,9 @@ public void changeLeaderForGroup(long toolSessionId, long leaderUserId) { VoteSession session = getSessionBySessionId(toolSessionId); if (VoteAppConstants.COMPLETED.equals(session.getSessionStatus())) { - throw new InvalidParameterException("Attempting to assing a new leader with user ID " + leaderUserId - + " to a finished session wtih ID " + toolSessionId); + throw new InvalidParameterException( + "Attempting to assing a new leader with user ID " + leaderUserId + " to a finished session wtih ID " + + toolSessionId); } VoteQueUsr existingLeader = session.getGroupLeader(); @@ -503,7 +502,8 @@ // open votes if (voteContent.isAllowText()) { int userEnteredVotesCount = allSessionsVotesCount - totalStandardVotesCount; - double voteRate = (userEnteredVotesCount != 0) ? ((userEnteredVotesCount * 100) / allSessionsVotesCount) + double voteRate = (userEnteredVotesCount != 0) + ? ((userEnteredVotesCount * 100) / allSessionsVotesCount) : 0; totalMapVoteRates.put(mapIndex, voteRate); } @@ -601,8 +601,8 @@ (totalVotes != 0) ? ((nomination.getNumberOfVotes() * 100) / totalVotes) : 0d); } totalSessionDTO.setOpenTextNumberOfVotes(totalOpenVotes); - totalSessionDTO - .setOpenTextPercentageOfVotes((totalVotes != 0) ? ((totalOpenVotes * 100) / totalVotes) : 0d); + totalSessionDTO.setOpenTextPercentageOfVotes( + (totalVotes != 0) ? ((totalOpenVotes * 100) / totalVotes) : 0d); sessionDTOs.add(totalSessionDTO); } @@ -615,7 +615,7 @@ * the number of people already known to the tool. * * @param voteSessionId - * The tool session id + * The tool session id */ private int getVoteSessionPotentialLearnersCount(Long sessionUid) { VoteSession session = voteSessionDAO.getVoteSessionByUID(sessionUid); @@ -699,8 +699,8 @@ } if (monitoredUserContainerDTOs.size() > 0) { - Map mapMonitoredUserContainerDTO = MonitoringController - .convertToVoteMonitoredUserDTOMap(monitoredUserContainerDTOs); + Map mapMonitoredUserContainerDTO = MonitoringController.convertToVoteMonitoredUserDTOMap( + monitoredUserContainerDTOs); voteMonitoredAnswersDTO.setQuestionAttempts(mapMonitoredUserContainerDTO); monitoredAnswersDTOs.add(voteMonitoredAnswersDTO); @@ -715,10 +715,11 @@ List reflectionsContainerDTO = new LinkedList<>(); if (userID == null) { - for (Iterator sessionIter = voteContent.getVoteSessions().iterator(); sessionIter.hasNext();) { + for (Iterator sessionIter = voteContent.getVoteSessions() + .iterator(); sessionIter.hasNext(); ) { VoteSession voteSession = sessionIter.next(); - for (Iterator userIter = voteSession.getVoteQueUsers().iterator(); userIter.hasNext();) { + for (Iterator userIter = voteSession.getVoteQueUsers().iterator(); userIter.hasNext(); ) { VoteQueUsr user = userIter.next(); NotebookEntry notebookEntry = this.getEntry(voteSession.getVoteSessionId(), @@ -738,9 +739,10 @@ } } } else { - for (Iterator sessionIter = voteContent.getVoteSessions().iterator(); sessionIter.hasNext();) { + for (Iterator sessionIter = voteContent.getVoteSessions() + .iterator(); sessionIter.hasNext(); ) { VoteSession voteSession = sessionIter.next(); - for (Iterator userIter = voteSession.getVoteQueUsers().iterator(); userIter.hasNext();) { + for (Iterator userIter = voteSession.getVoteQueUsers().iterator(); userIter.hasNext(); ) { VoteQueUsr user = userIter.next(); if (user.getQueUsrId().equals(userID)) { NotebookEntry notebookEntry = this.getEntry(voteSession.getVoteSessionId(), @@ -881,9 +883,9 @@ Set questions = voteContent.getVoteQueContents(); // should we add questions from data flow from other activities? - if (Boolean.TRUE.equals(voteContent.getAssignedDataFlowObject()) - && ((voteContent.getMaxExternalInputs() == null) || (voteContent.getExternalInputsAdded() == null) - || (voteContent.getExternalInputsAdded() < voteContent.getMaxExternalInputs()))) { + if (Boolean.TRUE.equals(voteContent.getAssignedDataFlowObject()) && ( + (voteContent.getMaxExternalInputs() == null) || (voteContent.getExternalInputsAdded() == null) || ( + voteContent.getExternalInputsAdded() < voteContent.getMaxExternalInputs()))) { // If we are using tool input, we need to get it now and // create questions. Once they are created, they will be not altered, no matter if another learner gets to // this point and the tool input changed @@ -1008,9 +1010,7 @@ } } } - } - - else if (value instanceof SimpleURL[]) { + } else if (value instanceof SimpleURL[]) { // the input is a list of strings (questions, for example) int nominationIndex = voteContent.getVoteQueContents().size() + 1; SimpleURL[] userUrls = (SimpleURL[]) value; @@ -1069,8 +1069,8 @@ private static boolean isNominationExists(VoteQueContent nomination, Set existingNominations) { if ((existingNominations != null) && (nomination != null)) { for (VoteQueContent existingNomination : existingNominations) { - if ((existingNomination.getQuestion() != null) - && existingNomination.getQuestion().equals(nomination.getQuestion())) { + if ((existingNomination.getQuestion() != null) && existingNomination.getQuestion() + .equals(nomination.getQuestion())) { return true; } } @@ -1252,8 +1252,7 @@ } catch (DataAccessException e) { throw new VoteApplicationException( "Exception occured when lams is getting vote voteUsrRespDAO by user id and que content id: " - + e.getMessage(), - e); + + e.getMessage(), e); } } @@ -1383,9 +1382,14 @@ // @SuppressWarnings("unchecked") @Override - public void removeLearnerContent(Long toolContentId, Integer userId) throws ToolException { + public void removeLearnerContent(Long toolContentId, Integer userId, boolean resetActivityCompletionOnly) + throws ToolException { if (logger.isDebugEnabled()) { - logger.debug("Removing Vote attempts for user ID " + userId + " and toolContentId " + toolContentId); + if (resetActivityCompletionOnly) { + logger.debug("Resetting Vote completion for user ID " + userId + " and toolContentId " + toolContentId); + } else { + logger.debug("Removing Vote attempts for user ID " + userId + " and toolContentId " + toolContentId); + } } VoteContent voteContent = voteContentDAO.getVoteContentByContentId(toolContentId); @@ -1397,15 +1401,20 @@ for (VoteSession session : voteContent.getVoteSessions()) { VoteQueUsr user = voteUserDAO.getVoteUserBySession(userId.longValue(), session.getUid()); if (user != null) { - voteUsrAttemptDAO.removeAttemptsForUserandSession(user.getUid(), session.getUid()); + if (resetActivityCompletionOnly) { + user.setResponseFinalised(false); + voteUserDAO.updateVoteUser(user); + } else { + voteUsrAttemptDAO.removeAttemptsForUserandSession(user.getUid(), session.getUid()); - NotebookEntry entry = getEntry(session.getVoteSessionId(), CoreNotebookConstants.NOTEBOOK_TOOL, - VoteAppConstants.MY_SIGNATURE, userId); - if (entry != null) { - voteContentDAO.delete(entry); - } + NotebookEntry entry = getEntry(session.getVoteSessionId(), CoreNotebookConstants.NOTEBOOK_TOOL, + VoteAppConstants.MY_SIGNATURE, userId); + if (entry != null) { + voteContentDAO.delete(entry); + } - voteUserDAO.removeVoteUser(user); + voteUserDAO.removeVoteUser(user); + } } } } @@ -1735,9 +1744,8 @@ /******** Tablesorter methods ************/ /** * Gets the basic details about an attempt for a nomination. questionUid must not be null, sessionUid may be NULL. - * This is - * unusual for these methods - usually sessionId may not be null. In this case if sessionUid is null then you get - * the values for the whole class, not just the group. + * This is unusual for these methods - usually sessionId may not be null. In this case if sessionUid is null then + * you get the values for the whole class, not just the group. * * Will return List<[login (String), fullname(String), attemptTime(Timestamp]> */ @@ -1820,7 +1828,7 @@ /** * @param voteToolContentHandler - * The voteToolContentHandler to set. + * The voteToolContentHandler to set. */ public void setVoteToolContentHandler(IToolContentHandler voteToolContentHandler) { this.voteToolContentHandler = voteToolContentHandler; @@ -1835,7 +1843,7 @@ /** * @param voteContentDAO - * The voteContentDAO to set. + * The voteContentDAO to set. */ public void setVoteContentDAO(IVoteContentDAO voteContentDAO) { this.voteContentDAO = voteContentDAO; @@ -1850,7 +1858,7 @@ /** * @param voteQueContentDAO - * The voteQueContentDAO to set. + * The voteQueContentDAO to set. */ public void setVoteQueContentDAO(IVoteQueContentDAO voteQueContentDAO) { this.voteQueContentDAO = voteQueContentDAO; @@ -1865,7 +1873,7 @@ /** * @param voteSessionDAO - * The voteSessionDAO to set. + * The voteSessionDAO to set. */ public void setVoteSessionDAO(IVoteSessionDAO voteSessionDAO) { this.voteSessionDAO = voteSessionDAO; @@ -1880,7 +1888,7 @@ /** * @param voteUserDAO - * The voteUserDAO to set. + * The voteUserDAO to set. */ public void setVoteUserDAO(IVoteUserDAO voteUserDAO) { this.voteUserDAO = voteUserDAO; @@ -1895,7 +1903,7 @@ /** * @param voteUsrAttemptDAO - * The voteUsrAttemptDAO to set. + * The voteUsrAttemptDAO to set. */ public void setVoteUsrAttemptDAO(IVoteUsrAttemptDAO voteUsrAttemptDAO) { this.voteUsrAttemptDAO = voteUsrAttemptDAO; @@ -1910,7 +1918,7 @@ /** * @param logEventService - * The logEventService to set. + * The logEventService to set. */ public void setLogEventService(ILogEventService logEventService) { this.logEventService = logEventService; @@ -1933,7 +1941,7 @@ /** * @param coreNotebookService - * The coreNotebookService to set. + * The coreNotebookService to set. */ public void setCoreNotebookService(ICoreNotebookService coreNotebookService) { this.coreNotebookService = coreNotebookService; @@ -1957,7 +1965,7 @@ /** * @param messageService - * The MessageService to set. + * The MessageService to set. */ public void setMessageService(MessageService messageService) { this.messageService = messageService; Index: lams_tool_whiteboard/src/java/org/lamsfoundation/lams/tool/whiteboard/service/WhiteboardService.java =================================================================== diff -u -rfea10410d4806bc95b22b8dbf15c0650bdac4fcd -rd7bfc30e7d7a056b984f35c292a7abed4635c754 --- lams_tool_whiteboard/src/java/org/lamsfoundation/lams/tool/whiteboard/service/WhiteboardService.java (.../WhiteboardService.java) (revision fea10410d4806bc95b22b8dbf15c0650bdac4fcd) +++ lams_tool_whiteboard/src/java/org/lamsfoundation/lams/tool/whiteboard/service/WhiteboardService.java (.../WhiteboardService.java) (revision d7bfc30e7d7a056b984f35c292a7abed4635c754) @@ -988,10 +988,15 @@ } @Override - public void removeLearnerContent(Long toolContentId, Integer userId) throws ToolException { - if (WhiteboardService.log.isDebugEnabled()) { - WhiteboardService.log.debug( - "Removing Whiteboard content for user ID " + userId + " and toolContentId " + toolContentId); + public void removeLearnerContent(Long toolContentId, Integer userId, boolean resetActivityCompletionOnly) + throws ToolException { + if (log.isDebugEnabled()) { + if (resetActivityCompletionOnly) { + log.debug("Resetting Whiteboard completion for user ID " + userId + " and toolContentId " + + toolContentId); + } else { + log.debug("Removing Whiteboard content for user ID " + userId + " and toolContentId " + toolContentId); + } } Whiteboard whiteboard = whiteboardDao.getByContentId(toolContentId); @@ -1006,13 +1011,18 @@ WhiteboardUser user = whiteboardUserDao.getUserByUserIDAndSessionID(userId.longValue(), session.getSessionId()); if (user != null) { - NotebookEntry entry = getEntry(session.getSessionId(), CoreNotebookConstants.NOTEBOOK_TOOL, - WhiteboardConstants.TOOL_SIGNATURE, userId); - if (entry != null) { - whiteboardDao.deleteById(NotebookEntry.class, entry.getUid()); - } + if (resetActivityCompletionOnly) { + user.setSessionFinished(false); + whiteboardUserDao.update(user); + } else { + NotebookEntry entry = getEntry(session.getSessionId(), CoreNotebookConstants.NOTEBOOK_TOOL, + WhiteboardConstants.TOOL_SIGNATURE, userId); + if (entry != null) { + whiteboardDao.deleteById(NotebookEntry.class, entry.getUid()); + } - whiteboardUserDao.deleteById(WhiteboardUser.class, user.getUid()); + whiteboardUserDao.deleteById(WhiteboardUser.class, user.getUid()); + } } } } @@ -1121,8 +1131,8 @@ } // ***************************************************************************** - // set methods for Spring Bean - // ***************************************************************************** +// set methods for Spring Bean +// ***************************************************************************** public void setMessageService(MessageService messageService) { this.messageService = messageService; } Index: lams_tool_wiki/src/java/org/lamsfoundation/lams/tool/wiki/service/WikiService.java =================================================================== diff -u -r20aa6cbca9fc96d341080e6ad39f82593443f792 -rd7bfc30e7d7a056b984f35c292a7abed4635c754 --- lams_tool_wiki/src/java/org/lamsfoundation/lams/tool/wiki/service/WikiService.java (.../WikiService.java) (revision 20aa6cbca9fc96d341080e6ad39f82593443f792) +++ lams_tool_wiki/src/java/org/lamsfoundation/lams/tool/wiki/service/WikiService.java (.../WikiService.java) (revision d7bfc30e7d7a056b984f35c292a7abed4635c754) @@ -23,15 +23,8 @@ package org.lamsfoundation.lams.tool.wiki.service; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Date; -import java.util.HashSet; -import java.util.LinkedList; -import java.util.List; -import java.util.Set; -import java.util.SortedMap; - +import com.fasterxml.jackson.databind.node.ArrayNode; +import com.fasterxml.jackson.databind.node.ObjectNode; import org.apache.log4j.Logger; import org.lamsfoundation.lams.confidencelevel.ConfidenceLevelDTO; import org.lamsfoundation.lams.contentrepository.client.IToolContentHandler; @@ -75,8 +68,14 @@ import org.lamsfoundation.lams.util.JsonUtil; import org.lamsfoundation.lams.util.MessageService; -import com.fasterxml.jackson.databind.node.ArrayNode; -import com.fasterxml.jackson.databind.node.ObjectNode; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Date; +import java.util.HashSet; +import java.util.LinkedList; +import java.util.List; +import java.util.Set; +import java.util.SortedMap; /** * An implementation of the IWikiService interface. @@ -328,10 +327,15 @@ } @Override - public void removeLearnerContent(Long toolContentId, Integer userId) throws ToolException { - if (WikiService.logger.isDebugEnabled()) { - WikiService.logger - .debug("Removing Wiki contents for user ID " + userId + " and toolContentId " + toolContentId); + public void removeLearnerContent(Long toolContentId, Integer userId, boolean resetActivityCompletionOnly) + throws ToolException { + if (logger.isDebugEnabled()) { + if (resetActivityCompletionOnly) { + logger.debug( + "Resetting Wiki completion for user ID " + userId + " and toolContentId " + toolContentId); + } else { + logger.debug("Removing Wiki content for user ID " + userId + " and toolContentId " + toolContentId); + } } Wiki wiki = wikiDAO.getByContentId(toolContentId); @@ -353,10 +357,12 @@ WikiUser user = wikiUserDAO.getByUserIdAndSessionId(userId.longValue(), session.getSessionId()); if (user != null) { - NotebookEntry entry = getEntry(session.getSessionId(), CoreNotebookConstants.NOTEBOOK_TOOL, - WikiConstants.TOOL_SIGNATURE, userId); - if (entry != null) { - wikiDAO.delete(entry); + if (!resetActivityCompletionOnly) { + NotebookEntry entry = getEntry(session.getSessionId(), CoreNotebookConstants.NOTEBOOK_TOOL, + WikiConstants.TOOL_SIGNATURE, userId); + if (entry != null) { + wikiDAO.delete(entry); + } } user.setFinishedActivity(false); // user.setWikiEdits(0); @@ -1120,4 +1126,4 @@ insertUnsavedWikiContent(content); // don't set WikiPages, as it is built from the database column wiki_uid in the wiki_page table } -} +} \ No newline at end of file Index: lams_tool_wookie/src/java/org/lamsfoundation/lams/tool/wookie/service/WookieService.java =================================================================== diff -u -r20aa6cbca9fc96d341080e6ad39f82593443f792 -rd7bfc30e7d7a056b984f35c292a7abed4635c754 --- lams_tool_wookie/src/java/org/lamsfoundation/lams/tool/wookie/service/WookieService.java (.../WookieService.java) (revision 20aa6cbca9fc96d341080e6ad39f82593443f792) +++ lams_tool_wookie/src/java/org/lamsfoundation/lams/tool/wookie/service/WookieService.java (.../WookieService.java) (revision d7bfc30e7d7a056b984f35c292a7abed4635c754) @@ -24,10 +24,6 @@ package org.lamsfoundation.lams.tool.wookie.service; -import java.util.ArrayList; -import java.util.List; -import java.util.SortedMap; - import org.lamsfoundation.lams.confidencelevel.ConfidenceLevelDTO; import org.lamsfoundation.lams.tool.ToolCompletionStatus; import org.lamsfoundation.lams.tool.ToolContentManager; @@ -39,6 +35,10 @@ import org.lamsfoundation.lams.tool.exception.ToolException; import org.lamsfoundation.lams.usermanagement.User; +import java.util.ArrayList; +import java.util.List; +import java.util.SortedMap; + public class WookieService implements ToolSessionManager, ToolContentManager { @Override @@ -54,7 +54,8 @@ } @Override - public void removeLearnerContent(Long toolContentId, Integer userId) throws ToolException { + public void removeLearnerContent(Long toolContentId, Integer userId, boolean resetActivityCompletionOnly) + throws ToolException { } @Override @@ -127,17 +128,17 @@ public ToolOutput getToolOutput(String name, Long toolSessionId, Long learnerId) { return null; } - + @Override public List getToolOutputs(String name, Long toolContentId) { return new ArrayList(); } - + @Override public List getConfidenceLevels(Long toolSessionId) { return null; } - + @Override public boolean isUserGroupLeader(Long userId, Long toolSessionId) { return false; Index: lams_tool_zoom/src/java/org/lamsfoundation/lams/tool/zoom/service/ZoomService.java =================================================================== diff -u -r79f5d06324fa18a32a2d65cf0decd640fb2261a6 -rd7bfc30e7d7a056b984f35c292a7abed4635c754 --- lams_tool_zoom/src/java/org/lamsfoundation/lams/tool/zoom/service/ZoomService.java (.../ZoomService.java) (revision 79f5d06324fa18a32a2d65cf0decd640fb2261a6) +++ lams_tool_zoom/src/java/org/lamsfoundation/lams/tool/zoom/service/ZoomService.java (.../ZoomService.java) (revision d7bfc30e7d7a056b984f35c292a7abed4635c754) @@ -222,11 +222,14 @@ } @Override - public void removeLearnerContent(Long toolContentId, Integer userId) throws ToolException { - if (ZoomService.logger.isDebugEnabled()) { - ZoomService.logger.debug( - "Resetting Web Conference completion flag for user ID " + userId + " and toolContentId " - + toolContentId); + public void removeLearnerContent(Long toolContentId, Integer userId, boolean resetActivityCompletionOnly) + throws ToolException { + if (logger.isDebugEnabled()) { + if (resetActivityCompletionOnly) { + logger.debug("Resetting Zoom completion for user ID " + userId + " and toolContentId " + toolContentId); + } else { + logger.debug("Removing Zoom content for user ID " + userId + " and toolContentId " + toolContentId); + } } Zoom zoom = getZoomByContentId(toolContentId); @@ -239,7 +242,7 @@ for (ZoomSession session : zoom.getZoomSessions()) { for (ZoomUser user : session.getZoomUsers()) { if (user.getUserId().equals(userId)) { - if (user.getNotebookEntryUID() != null) { + if (!resetActivityCompletionOnly && user.getNotebookEntryUID() != null) { NotebookEntry entry = coreNotebookService.getEntry(user.getNotebookEntryUID()); zoomDAO.delete(entry); user.setNotebookEntryUID(null);