Index: lams_tool_nb/src/java/org/lamsfoundation/lams/tool/noticeboard/util/NbWebUtil.java =================================================================== diff -u -r08950e1090443c3423a3d1c587416a2fccd8bbdf -r72fa17227e3f1f28a3919142afea2de07542a981 --- lams_tool_nb/src/java/org/lamsfoundation/lams/tool/noticeboard/util/NbWebUtil.java (.../NbWebUtil.java) (revision 08950e1090443c3423a3d1c587416a2fccd8bbdf) +++ lams_tool_nb/src/java/org/lamsfoundation/lams/tool/noticeboard/util/NbWebUtil.java (.../NbWebUtil.java) (revision 72fa17227e3f1f28a3919142afea2de07542a981) @@ -60,33 +60,6 @@ } - /** - *

This method checks the two tool content flags, defineLater and contentInUse - * to determine whether the tool content is modifiable or not. Returns true if the content is - * modifiable and false otherwise - *
Tool content is modifiable if: - *

  • defineLater is set to true
  • - *
  • defineLater is set to false and contentInUse is set to false
  • - *
    Tool content is not modifiable if: - *
  • contentInUse is set to true
  • - * @param content The instance of NoticeboardContent to check - * @return true if content is modifiable and false otherwise - * @throws NbApplicationException - */ - public static boolean isContentEditable(NoticeboardContent content) throws NbApplicationException - { - if ( (content.isDefineLater() == true) && (content.isContentInUse()==true) ) - { - throw new NbApplicationException("An exception has occurred: There is a bug in this tool, conflicting flags are set"); - //return false; - } - else if ( (content.isDefineLater() == true) && (content.isContentInUse() == false)) - return true; - else if ( (content.isDefineLater() == false) && (content.isContentInUse() == false)) - return true; - else // (content.isContentInUse()==true && content.isDefineLater() == false) - return false; - } /** *

    This method is used in authoring and monitoring to display the list of files that have been uploaded. Index: lams_tool_nb/src/java/org/lamsfoundation/lams/tool/noticeboard/web/NbAuthoringAction.java =================================================================== diff -u -r0eff987dabffcb85157c77e5ec92072fb26a038a -r72fa17227e3f1f28a3919142afea2de07542a981 --- lams_tool_nb/src/java/org/lamsfoundation/lams/tool/noticeboard/web/NbAuthoringAction.java (.../NbAuthoringAction.java) (revision 0eff987dabffcb85157c77e5ec92072fb26a038a) +++ lams_tool_nb/src/java/org/lamsfoundation/lams/tool/noticeboard/web/NbAuthoringAction.java (.../NbAuthoringAction.java) (revision 72fa17227e3f1f28a3919142afea2de07542a981) @@ -163,28 +163,14 @@ * author is not allowed to edit content */ - if (NbWebUtil.isContentEditable(nb)) - { - /* Define later set to true when the edit activity tab is brought up - * So that users cannot start using the content while the staff member is editing the content */ - nbForm.populateFormWithNbContentValues(nb); - nbForm.setContentFolderID(contentFolderId); - nb.setDefineLater(Boolean.parseBoolean(nbForm.getDefineLater())); - nbService.saveNoticeboard(nb); + /* Define later set to true when the edit activity tab is brought up + * So that users cannot start using the content while the staff member is editing the content */ + nbForm.populateFormWithNbContentValues(nb); + nbForm.setContentFolderID(contentFolderId); + nb.setDefineLater(Boolean.parseBoolean(nbForm.getDefineLater())); + nbService.saveNoticeboard(nb); - /** TODO: setup values in the instructions map */ - - } - else - { - //The contentInUse flag is set and a user has already reached this activity. - saveMessages(request, null); //ensure there are no existing messages - ActionMessages message = new ActionMessages(); - message.add(ActionMessages.GLOBAL_MESSAGE, new ActionMessage("message.contentInUseSet")); - saveMessages(request, message); - return mapping.findForward(NoticeboardConstants.DISPLAY_MESSAGE); - - } + /** TODO: setup values in the instructions map */ //Setup the map containing the files that have been uploaded for this particular tool content id attachmentList = NbWebUtil.setupAttachmentList(nbService,nb); Index: lams_tool_nb/src/java/org/lamsfoundation/lams/tool/noticeboard/web/NbMonitoringAction.java =================================================================== diff -u -r4aae0391a4892385de3df761a655e0ab8b1c0183 -r72fa17227e3f1f28a3919142afea2de07542a981 --- lams_tool_nb/src/java/org/lamsfoundation/lams/tool/noticeboard/web/NbMonitoringAction.java (.../NbMonitoringAction.java) (revision 4aae0391a4892385de3df761a655e0ab8b1c0183) +++ lams_tool_nb/src/java/org/lamsfoundation/lams/tool/noticeboard/web/NbMonitoringAction.java (.../NbMonitoringAction.java) (revision 72fa17227e3f1f28a3919142afea2de07542a981) @@ -109,17 +109,13 @@ monitorForm.setOfflineInstructions(content.getOfflineInstructions()); monitorForm.setAttachmentsList(NbWebUtil.setupAttachmentList(nbService, content)); - if ( NbWebUtil.isContentEditable(content) ) { - monitorForm.setContentEditable("true"); - //set up the request parameters to append to the URL - Map map = new HashMap(); - map.put(NoticeboardConstants.TOOL_CONTENT_ID, toolContentId.toString()); - map.put(NoticeboardConstants.DEFINE_LATER, "true"); - map.put(NoticeboardConstants.CONTENT_FOLDER_ID, contentFolderID); - monitorForm.setParametersToAppend(map); - } else { - monitorForm.setContentEditable("false"); - } + monitorForm.setContentEditable("true"); + //set up the request parameters to append to the URL + Map mapParameters = new HashMap(); + mapParameters.put(NoticeboardConstants.TOOL_CONTENT_ID, toolContentId.toString()); + mapParameters.put(NoticeboardConstants.DEFINE_LATER, "true"); + mapParameters.put(NoticeboardConstants.CONTENT_FOLDER_ID, contentFolderID); + monitorForm.setParametersToAppend(mapParameters); //Get the total number of learners that have participated in this tool activity monitorForm.setTotalLearners(nbService.calculateTotalNumberOfUsers(toolContentId));