Index: lams_tool_lamc/build.xml =================================================================== RCS file: /usr/local/cvsroot/lams_tool_lamc/build.xml,v diff -u -r1.21 -r1.22 --- lams_tool_lamc/build.xml 27 Mar 2006 22:27:54 -0000 1.21 +++ lams_tool_lamc/build.xml 29 Mar 2006 22:28:42 -0000 1.22 @@ -258,6 +258,8 @@ + + Index: lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/McUtils.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/McUtils.java,v diff -u -r1.36 -r1.37 --- lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/McUtils.java 26 Mar 2006 20:47:00 -0000 1.36 +++ lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/McUtils.java 29 Mar 2006 22:28:42 -0000 1.37 @@ -702,7 +702,6 @@ request.getSession().removeAttribute(MAP_USER_RESPONSES); request.getSession().removeAttribute(MAP_MAIN_REPORT); request.getSession().removeAttribute(MAP_STATS); - //request.getSession().removeAttribute(CURRENT_MONITORING_TAB); request.getSession().removeAttribute(REPORT_TITLE_MONITOR); request.getSession().removeAttribute(MONITOR_USER_ID); request.getSession().removeAttribute(MONITORING_REPORT); @@ -734,7 +733,9 @@ logger.debug("completely cleaned the session."); } - + /** + *removes attributes except USER_EXCEPTION_NO_STUDENT_ACTIVITY + */ public static void cleanUpUserExceptions(HttpServletRequest request) { request.getSession().removeAttribute(USER_EXCEPTION_WRONG_FORMAT); @@ -758,7 +759,6 @@ request.getSession().removeAttribute(USER_EXCEPTION_MONITORINGTAB_CONTENTID_REQUIRED); request.getSession().removeAttribute(USER_EXCEPTION_DEFAULTCONTENT_NOTSETUP); request.getSession().removeAttribute(USER_EXCEPTION_NO_TOOL_SESSIONS); - request.getSession().removeAttribute(USER_EXCEPTION_NO_STUDENT_ACTIVITY); request.getSession().removeAttribute(USER_EXCEPTION_MODE_REQUIRED); request.getSession().removeAttribute(USER_EXCEPTION_CONTENT_IN_USE); request.getSession().removeAttribute(USER_EXCEPTION_CONTENT_BEING_MODIFIED); Index: lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/McAction.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/McAction.java,v diff -u -r1.102 -r1.103 --- lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/McAction.java 26 Mar 2006 20:47:00 -0000 1.102 +++ lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/McAction.java 29 Mar 2006 22:28:41 -0000 1.103 @@ -709,15 +709,18 @@ logger.debug("listDefaultOption: " + listDefaultOption); /** normally iterates only once */ - Iterator itDefaultOption=listDefaultOption.iterator(); - Long mapIndex=new Long(1); - while (itDefaultOption.hasNext()) - { - McOptsContent mcOptsContent=(McOptsContent)itDefaultOption.next(); - logger.debug("option text:" + mcOptsContent.getMcQueOptionText()); - mapOptionsContent.put(mapIndex.toString(),mcOptsContent.getMcQueOptionText()); - mapIndex=new Long(mapIndex.longValue()+1); - } + if (listDefaultOption != null) + { + Iterator itDefaultOption=listDefaultOption.iterator(); + Long mapIndex=new Long(1); + while (itDefaultOption.hasNext()) + { + McOptsContent mcOptsContent=(McOptsContent)itDefaultOption.next(); + logger.debug("option text:" + mcOptsContent.getMcQueOptionText()); + mapOptionsContent.put(mapIndex.toString(),mcOptsContent.getMcQueOptionText()); + mapIndex=new Long(mapIndex.longValue()+1); + } + } logger.debug("mapOptionsContent from default content: " + mapOptionsContent); request.getSession().setAttribute(MAP_OPTIONS_CONTENT, mapOptionsContent); logger.debug("MAP_OPTIONS_CONTENT reconstructed from default option content" ); @@ -749,15 +752,18 @@ logger.debug("listDefaultOption: " + listDefaultOption); /* normally iterates only once */ - Iterator itDefaultOption=listDefaultOption.iterator(); - Long mapIndex=new Long(1); - while (itDefaultOption.hasNext()) - { - McOptsContent mcOptsContent=(McOptsContent)itDefaultOption.next(); - logger.debug("option text:" + mcOptsContent.getMcQueOptionText()); - mapOptionsContent.put(mapIndex.toString(),mcOptsContent.getMcQueOptionText()); - mapIndex=new Long(mapIndex.longValue()+1); - } + if (listDefaultOption != null) + { + Iterator itDefaultOption=listDefaultOption.iterator(); + Long mapIndex=new Long(1); + while (itDefaultOption.hasNext()) + { + McOptsContent mcOptsContent=(McOptsContent)itDefaultOption.next(); + logger.debug("option text:" + mcOptsContent.getMcQueOptionText()); + mapOptionsContent.put(mapIndex.toString(),mcOptsContent.getMcQueOptionText()); + mapIndex=new Long(mapIndex.longValue()+1); + } + } logger.debug("mapOptionsContent from default content: " + mapOptionsContent); request.getSession().setAttribute(MAP_OPTIONS_CONTENT, mapOptionsContent); logger.debug("MAP_OPTIONS_CONTENT reconstructed from default option content" ); @@ -1705,24 +1711,41 @@ int passmark=0; logger.debug("isQuestionsSequenced: " + mcAuthoringForm.getQuestionsSequenced()); - if (mcAuthoringForm.getQuestionsSequenced().equalsIgnoreCase(ON)) - isQuestionsSequenced=true; + if (mcAuthoringForm.getQuestionsSequenced() != null) + { + if (mcAuthoringForm.getQuestionsSequenced().equalsIgnoreCase(ON)) + isQuestionsSequenced=true; + } + + logger.debug("isSynchInMonitor: " + mcAuthoringForm.getSynchInMonitor()); - if (mcAuthoringForm.getSynchInMonitor().equalsIgnoreCase(ON)) - isSynchInMonitor=true; + if (mcAuthoringForm.getSynchInMonitor() != null) + { + if (mcAuthoringForm.getSynchInMonitor().equalsIgnoreCase(ON)) + isSynchInMonitor=true; + } logger.debug("isUsernameVisible: " + mcAuthoringForm.getUsernameVisible()); - if (mcAuthoringForm.getUsernameVisible().equalsIgnoreCase(ON)) - isUsernameVisible=true; + if (mcAuthoringForm.getUsernameVisible() != null) + { + if (mcAuthoringForm.getUsernameVisible().equalsIgnoreCase(ON)) + isUsernameVisible=true; + } logger.debug("isRetries: " + mcAuthoringForm.getRetries()); - if (mcAuthoringForm.getRetries().equalsIgnoreCase(ON)) - isRetries=true; + if (mcAuthoringForm.getRetries() != null) + { + if (mcAuthoringForm.getRetries().equalsIgnoreCase(ON)) + isRetries=true; + } logger.debug("isSln" + mcAuthoringForm.getSln()); - if (mcAuthoringForm.getSln().equalsIgnoreCase(ON)) - isSln=true; + if (mcAuthoringForm.getSln() != null) + { + if (mcAuthoringForm.getSln().equalsIgnoreCase(ON)) + isSln=true; + } logger.debug("passmark: " + mcAuthoringForm.getPassmark()); @@ -1808,8 +1831,11 @@ request.getSession().setAttribute(PASSMARK, new Integer(passmark).toString()); logger.debug("isShowFeedback: " + mcAuthoringForm.getShowFeedback()); - if (mcAuthoringForm.getShowFeedback().equalsIgnoreCase(ON)) - isShowFeedback=true; + if (mcAuthoringForm.getShowFeedback() != null) + { + if (mcAuthoringForm.getShowFeedback().equalsIgnoreCase(ON)) + isShowFeedback=true; + } String richTextTitle=(String) request.getSession().getAttribute(RICHTEXT_TITLE); logger.debug("richTextTitle: " + richTextTitle); @@ -1862,24 +1888,44 @@ McContent mcContent=mcService.retrieveMc(toolContentId); logger.debug("existing mcContent:" + mcContent); + String activeModule=(String)request.getSession().getAttribute(ACTIVE_MODULE); + logger.debug("activeModule:" + activeModule); + + if (mcContent != null) { logger.debug("updating mcContent title and instructions:" + mcContent); mcContent.setTitle(richTextTitle); mcContent.setInstructions(richTextInstructions); - mcContent.setQuestionsSequenced(isQuestionsSequenced); - mcContent.setSynchInMonitor(isSynchInMonitor); - mcContent.setUsernameVisible(isUsernameVisible); - mcContent.setRetries(isRetries); + + if (mcAuthoringForm.getQuestionsSequenced() != null) + mcContent.setQuestionsSequenced(isQuestionsSequenced); + + if (mcAuthoringForm.getSynchInMonitor() != null) + mcContent.setSynchInMonitor(isSynchInMonitor); + + if (mcAuthoringForm.getUsernameVisible() != null) + mcContent.setUsernameVisible(isUsernameVisible); + + if (mcAuthoringForm.getRetries() != null) + mcContent.setRetries(isRetries); + + if (mcAuthoringForm.getShowFeedback() != null) + mcContent.setShowFeedback(isShowFeedback); + + if (mcAuthoringForm.getSln() != null) + mcContent.setShowReport(isSln); + mcContent.setPassMark(new Integer(passmark)); - mcContent.setShowFeedback(isShowFeedback); - mcContent.setShowReport(isSln); - mcContent.setEndLearningMessage("Thanks"); - mcContent.setReportTitle(richTextReportTitle); - mcContent.setMonitoringReportTitle("Monitoring Report"); - mcContent.setEndLearningMessage(richTextEndLearningMessage); - mcContent.setOfflineInstructions(richTextOfflineInstructions); - mcContent.setOnlineInstructions(richTextOnlineInstructions); + if (activeModule.equals(AUTHORING)) + { + mcContent.setOfflineInstructions(richTextOfflineInstructions); + mcContent.setOnlineInstructions(richTextOnlineInstructions); + mcContent.setReportTitle(richTextReportTitle); + mcContent.setMonitoringReportTitle("Monitoring Report"); + mcContent.setEndLearningMessage(richTextEndLearningMessage); + } + } else { Index: lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/McExportAction.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/Attic/McExportAction.java,v diff -u -r1.4 -r1.5 --- lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/McExportAction.java 13 Mar 2006 23:17:26 -0000 1.4 +++ lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/McExportAction.java 29 Mar 2006 22:28:41 -0000 1.5 @@ -168,6 +168,7 @@ } exportForm.populateForm(mcContent); + logger.debug("ppulated from with mcContent : " + mcContent.getTitle() + " and " + mcContent.getContent()); return mapping.findForward(EXPORT_PORTFOLIO); } Index: lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/McExportForm.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/McExportForm.java,v diff -u -r1.2 -r1.3 --- lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/McExportForm.java 25 Feb 2006 19:27:26 -0000 1.2 +++ lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/McExportForm.java 29 Mar 2006 22:28:41 -0000 1.3 @@ -138,7 +138,19 @@ public void populateForm(McContent content) { - setTitle(content.getTitle()); - setContent(content.getContent()); + String strTitle=null; + if (content.getTitle() == null) + strTitle=""; + else + strTitle=content.getTitle(); + setTitle(strTitle); + + + String strContent=null; + if (content.getContent() == null) + strContent=""; + else + strContent=content.getContent(); + setContent(strContent); } } Index: lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/McMonitoringStarterAction.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/McMonitoringStarterAction.java,v diff -u -r1.21 -r1.22 --- lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/McMonitoringStarterAction.java 23 Mar 2006 11:48:26 -0000 1.21 +++ lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/McMonitoringStarterAction.java 29 Mar 2006 22:28:41 -0000 1.22 @@ -24,6 +24,7 @@ import java.io.IOException; import java.util.List; import java.util.Map; +import java.util.TreeMap; import javax.servlet.ServletException; import javax.servlet.http.HttpServletRequest; @@ -39,6 +40,7 @@ import org.apache.struts.action.ActionMessages; import org.lamsfoundation.lams.tool.mc.McAppConstants; import org.lamsfoundation.lams.tool.mc.McApplicationException; +import org.lamsfoundation.lams.tool.mc.McComparator; import org.lamsfoundation.lams.tool.mc.McUtils; import org.lamsfoundation.lams.tool.mc.pojos.McContent; import org.lamsfoundation.lams.tool.mc.service.IMcService; @@ -122,6 +124,139 @@ return (mapping.findForward(ERROR_LIST)); request.getSession().setAttribute(CURRENT_MONITORING_TAB, "summary"); + request.getSession().setAttribute(IS_MONITORED_CONTENT_IN_USE, new Boolean(false).toString()); + request.getSession().setAttribute(EDIT_OPTIONS_MODE, new Integer(0)); + + request.getSession().setAttribute(ACTIVE_MODULE, DEFINE_LATER); + request.getSession().setAttribute(DEFINE_LATER_IN_EDIT_MODE, new Boolean(false)); + request.getSession().setAttribute(SHOW_AUTHORING_TABS,new Boolean(false).toString()); + + Long toolContentId=(Long)request.getSession().getAttribute(TOOL_CONTENT_ID); + logger.debug("toolContentId: " + toolContentId); + + IMcService mcService = (IMcService)request.getSession().getAttribute(TOOL_SERVICE); + logger.debug("mcService: " + mcService); + if (mcService == null) + { + logger.debug("will retrieve mcService"); + mcService = McServiceProxy.getMcService(getServlet().getServletContext()); + logger.debug("retrieving mcService from cache: " + mcService); + } + + McContent mcContent=mcService.retrieveMc(toolContentId); + logger.debug("mcContent:" + mcContent); + boolean isContentInUse=McUtils.isContentInUse(mcContent); + logger.debug("isContentInUse:" + isContentInUse); + + request.getSession().setAttribute(IS_MONITORED_CONTENT_IN_USE, new Boolean(false).toString()); + if (isContentInUse == true) + { + //McUtils.cleanUpSessionAbsolute(request); + logger.debug("monitoring url does not allow editActivity since the content is in use."); + persistError(request,"error.content.inUse"); + request.getSession().setAttribute(IS_MONITORED_CONTENT_IN_USE, new Boolean(true).toString()); + } + + /* it is possible that no users has ever logged in for the activity yet*/ + int countAllUsers=mcService.getTotalNumberOfUsers(); + logger.debug("countAllUsers: " + countAllUsers); + + + request.getSession().setAttribute(USER_EXCEPTION_NO_STUDENT_ACTIVITY, new Boolean(false)); + if (countAllUsers == 0) + { + logger.debug("error: countAllUsers is 0"); + request.getSession().setAttribute(USER_EXCEPTION_NO_STUDENT_ACTIVITY, new Boolean(true)); + } + + /* it is possible that no users has ever attempted the activity yet*/ + int totalAttemptCount=MonitoringUtil.getTotalAttemptCount(request); + logger.debug("totalAttemptCount: " + totalAttemptCount); + if (totalAttemptCount == 0) + { + logger.debug("error: totalAttemptCount is 0"); + request.getSession().setAttribute(USER_EXCEPTION_NO_STUDENT_ACTIVITY, new Boolean(true)); + } + + + request.getSession().setAttribute(IS_REVISITING_USER, new Boolean(false)); + request.getSession().setAttribute(RICHTEXT_TITLE,mcContent.getTitle()); + request.getSession().setAttribute(RICHTEXT_INSTRUCTIONS,mcContent.getInstructions()); + request.getSession().setAttribute(PASSMARK, mcContent.getPassMark()); //Integer + + Map mapQuestionsContent=AuthoringUtil.rebuildQuestionMapfromDB(request, toolContentId); + logger.debug("mapQuestionsContent:" + mapQuestionsContent); + request.getSession().setAttribute(MAP_QUESTIONS_CONTENT, mapQuestionsContent); + logger.debug("starter initialized the existing Questions Map: " + request.getSession().getAttribute(MAP_QUESTIONS_CONTENT)); + + Map mapWeights= AuthoringUtil.rebuildWeightsMapfromDB(request, toolContentId); + logger.debug("Check the mapWeights: " + mapWeights); + request.getSession().setAttribute(MAP_WEIGHTS, mapWeights); + + Map mapGeneralOptionsContent= new TreeMap(new McComparator()); + request.getSession().setAttribute(MAP_GENERAL_OPTIONS_CONTENT, mapGeneralOptionsContent); + + Map mapGeneralSelectedOptionsContent= new TreeMap(new McComparator()); + request.getSession().setAttribute(MAP_GENERAL_SELECTED_OPTIONS_CONTENT, mapGeneralSelectedOptionsContent); + + Map mapStartupGeneralOptionsContent= new TreeMap(new McComparator()); + request.getSession().setAttribute(MAP_STARTUP_GENERAL_OPTIONS_CONTENT, mapStartupGeneralOptionsContent); + + Map mapStartupGeneralSelectedOptionsContent= new TreeMap(new McComparator()); + request.getSession().setAttribute(MAP_STARTUP_GENERAL_SELECTED_OPTIONS_CONTENT, mapStartupGeneralSelectedOptionsContent); + + Map mapDisabledQuestions= new TreeMap(new McComparator()); + request.getSession().setAttribute(MAP_DISABLED_QUESTIONS, mapDisabledQuestions); + + Map mapCheckBoxStates= new TreeMap(new McComparator()); + mapCheckBoxStates.put("1" ,"INCORRECT"); + mapCheckBoxStates.put("2" ,"CORRECT"); + request.getSession().setAttribute(MAP_CHECKBOX_STATES, mapCheckBoxStates); + + Map mapSelectedOptions= new TreeMap(new McComparator()); + request.getSession().setAttribute(MAP_SELECTED_OPTIONS, mapSelectedOptions); + + Map mapIncorrectFeedback= new TreeMap(new McComparator()); + request.getSession().setAttribute(MAP_INCORRECT_FEEDBACK, mapIncorrectFeedback); + + Map mapCorrectFeedback= new TreeMap(new McComparator()); + request.getSession().setAttribute(MAP_CORRECT_FEEDBACK, mapCorrectFeedback); + + List listUploadedOffFiles= mcService.retrieveMcUploadedOfflineFilesName(mcContent.getUid()); + logger.debug("existing listUploadedOfflineFileNames:" + listUploadedOffFiles); + request.getSession().setAttribute(LIST_UPLOADED_OFFLINE_FILENAMES,listUploadedOffFiles); + + List listUploadedOnFiles= mcService.retrieveMcUploadedOnlineFilesName(mcContent.getUid()); + logger.debug("existing listUploadedOnlineFileNames:" + listUploadedOnFiles); + request.getSession().setAttribute(LIST_UPLOADED_ONLINE_FILENAMES,listUploadedOnFiles); + + List listOfflineFilesMetaData=mcService.getOfflineFilesMetaData(mcContent.getUid()); + logger.debug("existing listOfflineFilesMetaData, to be structured as McAttachmentDTO: " + listOfflineFilesMetaData); + listOfflineFilesMetaData=AuthoringUtil.populateMetaDataAsAttachments(listOfflineFilesMetaData); + logger.debug("populated listOfflineFilesMetaData: " + listOfflineFilesMetaData); + request.getSession().setAttribute(LIST_OFFLINEFILES_METADATA, listOfflineFilesMetaData); + + List listUploadedOfflineFileNames=AuthoringUtil.populateMetaDataAsFilenames(listOfflineFilesMetaData); + logger.debug("returned from db listUploadedOfflineFileNames: " + listUploadedOfflineFileNames); + request.getSession().setAttribute(LIST_UPLOADED_OFFLINE_FILENAMES, listUploadedOfflineFileNames); + + /*process online files metadata*/ + List listOnlineFilesMetaData=mcService.getOnlineFilesMetaData(mcContent.getUid()); + logger.debug("existing listOnlineFilesMetaData, to be structured as McAttachmentDTO: " + listOnlineFilesMetaData); + listOnlineFilesMetaData=AuthoringUtil.populateMetaDataAsAttachments(listOnlineFilesMetaData); + logger.debug("populated listOnlineFilesMetaData: " + listOnlineFilesMetaData); + request.getSession().setAttribute(LIST_ONLINEFILES_METADATA, listOnlineFilesMetaData); + + List listUploadedOnlineFileNames=AuthoringUtil.populateMetaDataAsFilenames(listOnlineFilesMetaData); + logger.debug("returned from db listUploadedOnlineFileNames: " + listUploadedOnlineFileNames); + request.getSession().setAttribute(LIST_UPLOADED_ONLINE_FILENAMES, listUploadedOnlineFileNames); + + logger.debug("end of execute: "); + logger.debug("SUMMARY_TOOL_SESSIONS_ID: " + request.getSession().getAttribute(SUMMARY_TOOL_SESSIONS_ID)); + logger.debug("SUMMARY_TOOL_SESSIONS: " + request.getSession().getAttribute(SUMMARY_TOOL_SESSIONS)); + logger.debug("SELECTION_CASE: " + request.getSession().getAttribute(SELECTION_CASE)); + logger.debug("LIST_MONITORED_ANSWERS_CONTAINER_DTO: " + request.getSession().getAttribute(LIST_MONITORED_ANSWERS_CONTAINER_DTO)); + return (mapping.findForward(LOAD_MONITORING_CONTENT)); } @@ -138,6 +273,8 @@ */ public boolean initialiseMonitoringData(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) { + logger.debug("initialising MonitoringData..."); + IMcService mcService = (IMcService)request.getSession().getAttribute(TOOL_SERVICE); logger.debug("mcService: " + mcService); if (mcService == null) @@ -209,7 +346,7 @@ /* it is possible that no users has ever logged in for the activity yet*/ int countAllUsers=mcService.getTotalNumberOfUsers(); logger.debug("countAllUsers: " + countAllUsers); - + request.getSession().setAttribute(USER_EXCEPTION_NO_STUDENT_ACTIVITY, new Boolean(false)); if (countAllUsers == 0) { logger.debug("error: countAllUsers is 0"); @@ -248,6 +385,12 @@ request.getSession().setAttribute(LOWEST_MARK, new Integer(lowestMark).toString()); request.getSession().setAttribute(AVERAGE_MARK, new Integer(averageMark).toString()); /* ends here. */ + + logger.debug("end of initialiseMonitoringData: "); + logger.debug("SUMMARY_TOOL_SESSIONS_ID: " + request.getSession().getAttribute(SUMMARY_TOOL_SESSIONS_ID)); + logger.debug("SUMMARY_TOOL_SESSIONS: " + request.getSession().getAttribute(SUMMARY_TOOL_SESSIONS)); + logger.debug("SELECTION_CASE: " + request.getSession().getAttribute(SELECTION_CASE)); + logger.debug("LIST_MONITORED_ANSWERS_CONTAINER_DTO: " + request.getSession().getAttribute(LIST_MONITORED_ANSWERS_CONTAINER_DTO)); return true; } Index: lams_tool_lamc/web/McErrorBox.jsp =================================================================== RCS file: /usr/local/cvsroot/lams_tool_lamc/web/Attic/McErrorBox.jsp,v diff -u -r1.6 -r1.7 --- lams_tool_lamc/web/McErrorBox.jsp 26 Mar 2006 20:49:15 -0000 1.6 +++ lams_tool_lamc/web/McErrorBox.jsp 29 Mar 2006 22:28:42 -0000 1.7 @@ -201,20 +201,4 @@ - - Index: lams_tool_lamc/web/WEB-INF/struts-config.xml =================================================================== RCS file: /usr/local/cvsroot/lams_tool_lamc/web/WEB-INF/struts-config.xml,v diff -u -r1.46 -r1.47 --- lams_tool_lamc/web/WEB-INF/struts-config.xml 22 Mar 2006 22:01:11 -0000 1.46 +++ lams_tool_lamc/web/WEB-INF/struts-config.xml 29 Mar 2006 22:28:42 -0000 1.47 @@ -462,7 +462,7 @@ scope="session" parameter="mode" unknown="false" - validate="true" + validate="false" > -<%@ include file="../sharing/share.jsp" %> <%@ taglib uri="tags-bean" prefix="bean"%> <%@ taglib uri="tags-html" prefix="html"%> <%@ taglib uri="tags-logic" prefix="logic" %> @@ -39,6 +38,9 @@ tabs.add("label.instructions"); pageContext.setAttribute("tabs", tabs); + Set tabsBasic = new LinkedHashSet(); + tabsBasic.add("label.basic"); + pageContext.setAttribute("tabsBasic", tabsBasic); %> @@ -48,22 +50,20 @@ - <bean:message key="label.authoring"/> - author_page/css/aqua.css" rel="stylesheet" type="text/css"> - - - - + <bean:message key="label.authoring"/> - - css/tool_custom.css" rel="stylesheet" type="text/css"> + author_page/css/aqua.css" rel="stylesheet" type="text/css"> + + + + + + + - + + + + + + @@ -139,15 +143,6 @@ - - - - - - - - - @@ -165,8 +160,17 @@ - + + + +
+ + + + + + Fisheye: Tag 1.5 refers to a dead (removed) revision in file `lams_tool_lamc/web/authoring/AuthoringTabsHeader.jsp'. Fisheye: No comparison available. Pass `N' to diff? Index: lams_tool_lamc/web/authoring/OptionsContent.jsp =================================================================== RCS file: /usr/local/cvsroot/lams_tool_lamc/web/authoring/Attic/OptionsContent.jsp,v diff -u -r1.11 -r1.12 --- lams_tool_lamc/web/authoring/OptionsContent.jsp 26 Mar 2006 20:48:39 -0000 1.11 +++ lams_tool_lamc/web/authoring/OptionsContent.jsp 29 Mar 2006 22:28:42 -0000 1.12 @@ -31,6 +31,13 @@ + + +
+ +
+ +
Index: lams_tool_lamc/web/includes/javascript/fckcontroller.js =================================================================== RCS file: /usr/local/cvsroot/lams_tool_lamc/web/includes/javascript/Attic/fckcontroller.js,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ lams_tool_lamc/web/includes/javascript/fckcontroller.js 29 Mar 2006 22:28:41 -0000 1.1 @@ -0,0 +1,212 @@ +var activeEditorIndex = 0; +var oFCKeditor; + +//whether to initialise the editor in textarea mode or preview mode +function initEditor(index){ + var textareaElement = document.getElementById("tx" + index + ".textarea") + if(textareaElement == null) + return; + var text = textareaElement.value; + + if(containsHTML(text)){ + var previewTextElement = document.getElementById("preview" + index + ".text"); + var previewText = document.getElementById("tx" + index + ".textarea").value; + previewTextElement.innerHTML = previewText; + + hideElementById("tx"+index); + showElementById("preview"+index); + } + else{ + hideElementById("preview"+index); + showElementById("tx"+index); + } +} + +// FCKeditor_OnComplete is a special function that is called when an editor +// instance is loaded ad available to the API. It must be named exactly in +// this way. +function FCKeditor_OnComplete( editorInstance ) +{ + //hideElementById("wyswygEditorScreen"); +} + + +function SetContents(content) +{ + // Get the editor instance that we want to interact with. + var oEditor = FCKeditorAPI.GetInstance('FCKeditor1') ; + + // Set the editor contents (replace the actual one). + oEditor.SetHTML(content) ; +} + + +function doWYSWYGEdit(index, size){ + + var oEditor; + try { + oEditor = FCKeditorAPI.GetInstance('FCKeditor1') ; + } + catch(error) { + //browsers like opera can't resolve the FCKeditorAPI classes + alert("The browser you are using doesn't support Rich Text Editor, Please use a supported browser instead."); + return; + } + + if(activeEditorIndex != index && activeEditorIndex != 0){ + saveWYSWYGEdittedText(activeEditorIndex); //save the existing content + doPreview(activeEditorIndex); //update preview panel + } + + activeEditorIndex = index; + + //hide html editor + doPreview(index); + + var previewElement = document.getElementById("preview" + index + ".text"); + var posX = findPosX(previewElement); + var posY = findPosY(previewElement); + + var text = document.getElementById("tx" + index + ".textarea").value; + + oEditor.SetHTML(text) ; + + wyswygEditorScreenElement = document.getElementById("wyswygEditorScreen"); + wyswygEditorScreenElement.style.top = posY + "px"; + wyswygEditorScreenElement.style.left = posX + "px"; + + //resize the fck editor + fckFrameElement = document.getElementById("FCKeditor1___Frame"); + if (size == "small") { + fckFrameElement.style.height = "100px"; + wyswygEditorScreenElement.style.height = "120px"; + } else { + fckFrameElement.style.height = "200px"; + wyswygEditorScreenElement.style.height = "220px"; + } + + showElementById("wyswygEditorScreen"); + + + showElementById("wyswygEditorScreen"); +} + +//convert the text to HTML first, +function doTextToHTML(index){ + var textareaElement = document.getElementById("tx" + index + ".textarea"); + var text = covertTextToHTML(textareaElement.value); + textareaElement.value = text; +} + +function saveWYSWYGEdittedText(index){ + var oEditor = FCKeditorAPI.GetInstance('FCKeditor1') ; + var text = oEditor.GetXHTML( true ) + + + var htmlEditorElement = document.getElementById("tx" + index + ".textarea"); + htmlEditorElement.value = text; + +} + +function doEdit(index){ + hideElementById("wyswygEditorScreen"); + hideElementById("preview"+index); + showElementById("tx"+index); +} + +function doPreview(index){ + var previewTextElement = document.getElementById("preview" + index + ".text"); + var previewText = document.getElementById("tx" + index + ".textarea").value; + previewTextElement.innerHTML = previewText; + + hideElementById("wyswygEditorScreen"); + hideElementById("tx"+index); + showElementById("preview"+index); +} + + +/*** show/hide Elements ***/ +function showElement(element) { + element.style.visibility = 'visible'; + element.style.display = "block"; +} +function hideElement(element) { + element.style.visibility = 'hidden'; + element.style.display = "none"; +} + +function showElementById(id) { + var element = document.getElementById(id); + showElement(element); +} + +function hideElementById(id) { + var element = document.getElementById(id); + hideElement(element); +} + + +/*** findPosX and findPoxY functions are use to locate the x,y location of an element ***/ +function findPosX(obj) { + var curleft = 0; + if(obj.offsetParent) + while(1) + { + curleft += obj.offsetLeft; + if(!obj.offsetParent) + break; + obj = obj.offsetParent; + } + else if(obj.x) + curleft += obj.x; + return curleft; +} + +function findPosY(obj) { + var curtop = 0; + if(obj.offsetParent) + while(1) + { + curtop += obj.offsetTop; + if(!obj.offsetParent) + break; + obj = obj.offsetParent; + } + else if(obj.y) + curtop += obj.y; + return curtop; +} + +/**** Using the regular expressions defined below to convert Text to HTML ****/ +var NEWLINE = "
"; +var GREATER = ">"; +var LESSER = "<"; +//var SPACE = " "; + +var RE_ESCAPE_NEWLINE = new RegExp("\n", "g"); +var RE_ESCAPE_GREATER = new RegExp(">", "g"); +var RE_ESCAPE_LESSER = new RegExp("<", "g"); +//var RE_ESCAPE_SPACE = new RegExp(" ", "g"); + +var RE_HTML_TAG = new RegExp("<.*>|" + LESSER + "|" + GREATER); + +function covertTextToHTML(str){ + return str.replace(RE_ESCAPE_GREATER, GREATER) + .replace(RE_ESCAPE_LESSER, LESSER) + .replace(RE_ESCAPE_NEWLINE, NEWLINE); + + //.replace(RE_ESCAPE_SPACE, SPACE) +} + +/**** Detect whether HTML was used */ +function containsHTML(str){ + return (str.match(RE_HTML_TAG) != null)? true:false; +} + + + +/*** implement the event onSelectTab() which gets trigger when tabs is changed ***/ +function onSelectTab(tabID){ + //hide all active editors + doPreview(activeEditorIndex); +} \ No newline at end of file Index: lams_tool_lamc/web/includes/javascript/tabcontroller.js =================================================================== RCS file: /usr/local/cvsroot/lams_tool_lamc/web/includes/javascript/Attic/tabcontroller.js,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ lams_tool_lamc/web/includes/javascript/tabcontroller.js 29 Mar 2006 22:28:41 -0000 1.1 @@ -0,0 +1,52 @@ +var tabSize = 0; +var selectedTabID = 0; + +/* Initialise the number of tabs in the page */ +function initTabSize(size){ + tabSize = size; +} + +function selectTab(tabID) { + + if(selectedTabID == tabID) + return; + + if(selectedTabID == 0) + selectedTabID = tabID; + + //change the old tab's class + document.getElementById("tab" + selectedTabID).className = "tab tabcentre"; + //swap images of side parts + var tl = document.getElementById("tableft_"+selectedTabID); + tl.src= imgRoot + themeName + "_tab_left.gif"; + tl.height = 22; + var tr = document.getElementById("tabright_"+selectedTabID); + tr.src= imgRoot + themeName + "_tab_right.gif"; + tr.height = 22; + + //change the new tab's class + document.getElementById("tab" + tabID).className = "tab tabcentre_selected"; + var tl = document.getElementById("tableft_"+tabID); + tl.src= imgRoot + themeName + "_tab_s_left.gif"; + tl.height = 25; + var tr = document.getElementById("tabright_"+tabID); + tr.src= imgRoot + themeName + "_tab_s_right.gif"; + tr.height = 25; + + //save tabID as selectedTabID + selectedTabID = tabID; + + //switch the the selected tab on + for(i = 1; i <= tabSize; i++) { + document.getElementById("tabbody" + i).style.display = (i == tabID) ? 'block':'none'; + } + + + try{ + //trigger the custom event listener onSelectTab() + onSelectTab(tabID); + } + catch (error){ + //catch reference error when onSelectTab() is not defined + } +} \ No newline at end of file Index: lams_tool_lamc/web/includes/javascript/xmlrequest.js =================================================================== RCS file: /usr/local/cvsroot/lams_tool_lamc/web/includes/javascript/Attic/xmlrequest.js,v diff -u -r1.1 -r1.2 --- lams_tool_lamc/web/includes/javascript/xmlrequest.js 26 Mar 2006 20:48:39 -0000 1.1 +++ lams_tool_lamc/web/includes/javascript/xmlrequest.js 29 Mar 2006 22:28:41 -0000 1.2 @@ -35,7 +35,12 @@ if (req.readyState == 4) { // only if "OK" if (req.status == 200) { - var select = document.getElementById(target); + var select; + if(typeof target.id != "undefined") + select = target; + else + select = document.getElementById(target); + select.innerHTML = req.responseText; } else { alert("There was a problem retrieving the XML data:\n" + Index: lams_tool_lamc/web/monitoring/Edit.jsp =================================================================== RCS file: /usr/local/cvsroot/lams_tool_lamc/web/monitoring/Edit.jsp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ lams_tool_lamc/web/monitoring/Edit.jsp 29 Mar 2006 22:28:42 -0000 1.1 @@ -0,0 +1,48 @@ +<%-- +Copyright (C) 2005 LAMS Foundation (http://lamsfoundation.org) + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 +USA + +http://www.gnu.org/licenses/gpl.txt +--%> + +<%@ taglib uri="tags-bean" prefix="bean"%> +<%@ taglib uri="tags-html" prefix="html"%> +<%@ taglib uri="tags-logic" prefix="logic" %> +<%@ taglib uri="tags-logic-el" prefix="logic-el" %> +<%@ taglib uri="tags-core" prefix="c"%> +<%@ taglib uri="tags-fmt" prefix="fmt" %> +<%@ taglib uri="fck-editor" prefix="FCK" %> +<%@ taglib uri="tags-lams" prefix="lams" %> + + + + + + + + + + + + + + + +
+ +
+
Index: lams_tool_lamc/web/monitoring/Instructions.jsp =================================================================== RCS file: /usr/local/cvsroot/lams_tool_lamc/web/monitoring/Attic/Instructions.jsp,v diff -u -r1.4 -r1.5 --- lams_tool_lamc/web/monitoring/Instructions.jsp 24 Feb 2006 20:25:28 -0000 1.4 +++ lams_tool_lamc/web/monitoring/Instructions.jsp 29 Mar 2006 22:28:42 -0000 1.5 @@ -31,7 +31,6 @@ -

Index: lams_tool_lamc/web/monitoring/MonitoringMaincontent.jsp =================================================================== RCS file: /usr/local/cvsroot/lams_tool_lamc/web/monitoring/MonitoringMaincontent.jsp,v diff -u -r1.21 -r1.22 --- lams_tool_lamc/web/monitoring/MonitoringMaincontent.jsp 19 Mar 2006 11:00:55 -0000 1.21 +++ lams_tool_lamc/web/monitoring/MonitoringMaincontent.jsp 29 Mar 2006 22:28:42 -0000 1.22 @@ -18,7 +18,6 @@ http://www.gnu.org/licenses/gpl.txt --%> - <%@ taglib uri="tags-bean" prefix="bean"%> <%@ taglib uri="tags-html" prefix="html"%> <%@ taglib uri="tags-logic" prefix="logic" %> @@ -28,30 +27,43 @@ <%@ taglib uri="fck-editor" prefix="FCK" %> <%@ taglib uri="tags-lams" prefix="lams" %> + + +<%@ page import="java.util.LinkedHashSet" %> +<%@ page import="java.util.Set" %> + + <% + Set tabs = new LinkedHashSet(); + tabs.add("label.summary"); + tabs.add("label.instructions"); + tabs.add("label.editActivity"); + tabs.add("label.stats"); + pageContext.setAttribute("tabs", tabs); + %> + + - + <bean:message key="label.monitoring"/> - + author_page/css/aqua.css" rel="stylesheet" type="text/css"> + + + - - + - - css/tool_custom.css" rel="stylesheet" type="text/css"> - + + + + + + + + <%-- chooses which tab to highlight --%> - - - - - - - - - - - - - - -")'> + @@ -116,118 +143,23 @@ - - -
- - - - - - + + - + + +
+ + - -
+ - - - -
  
- - - - - - -
images/aqua_tab_s_left.gif" name="tab_left_su" width="8" height="25" border="0" id="tab_left_su"/> - images/aqua_tab_s_right.gif" name="tab_right_su" width="8" height="25" border="0" id="tab_right_su"/>
-
- - - - - - -
images/aqua_tab_s_left.gif" name="tab_left_i" width="8" height="25" border="0" id="tab_left_i"/> - images/aqua_tab_s_right.gif" name="tab_right_i" width="8" height="25" border="0" id="tab_right_i"/>
-
- - - - - - -
images/aqua_tab_s_left.gif" name="tab_left_e" width="8" height="25" border="0" id="tab_left_e"/> - images/aqua_tab_s_right.gif" name="tab_right_e" width="8" height="25" border="0" id="tab_right_e"/>
-
- - - - - - -
images/aqua_tab_s_left.gif" name="tab_left_s" width="8" height="25" border="0" id="tab_left_s"/> - images/aqua_tab_s_right.gif" name="tab_right_s" width="8" height="25" border="0" id="tab_right_s"/>
-
- - + - - - - -
- -
- -
- - -
- - - - - - - - - - - -
- -
-
-
-
+ - -
- -
-
- - -
- -
-
-
+ + Index: lams_tool_lamc/web/monitoring/Stats.jsp =================================================================== RCS file: /usr/local/cvsroot/lams_tool_lamc/web/monitoring/Stats.jsp,v diff -u -r1.8 -r1.9 --- lams_tool_lamc/web/monitoring/Stats.jsp 13 Mar 2006 23:17:27 -0000 1.8 +++ lams_tool_lamc/web/monitoring/Stats.jsp 29 Mar 2006 22:28:42 -0000 1.9 @@ -31,8 +31,6 @@ - -

Index: lams_tool_lamc/web/monitoring/SummaryContent.jsp =================================================================== RCS file: /usr/local/cvsroot/lams_tool_lamc/web/monitoring/SummaryContent.jsp,v diff -u -r1.12 -r1.13 --- lams_tool_lamc/web/monitoring/SummaryContent.jsp 23 Mar 2006 11:48:28 -0000 1.12 +++ lams_tool_lamc/web/monitoring/SummaryContent.jsp 29 Mar 2006 22:28:42 -0000 1.13 @@ -31,8 +31,6 @@ -

-
@@ -80,13 +78,16 @@ + + @@ -148,6 +149,6 @@
   
+
-
+ \ No newline at end of file Fisheye: Tag 1.2 refers to a dead (removed) revision in file `lams_tool_lamc/web/sharing/share.jsp'. Fisheye: No comparison available. Pass `N' to diff?