Index: lams_admin/src/java/org/lamsfoundation/lams/admin/web/RegisterAction.java =================================================================== diff -u -r3bc65f0652b50074ff432112d8e47a6df3728810 -racc8d2acf5b6b0002e0c8129947040a779ab4077 --- lams_admin/src/java/org/lamsfoundation/lams/admin/web/RegisterAction.java (.../RegisterAction.java) (revision 3bc65f0652b50074ff432112d8e47a6df3728810) +++ lams_admin/src/java/org/lamsfoundation/lams/admin/web/RegisterAction.java (.../RegisterAction.java) (revision acc8d2acf5b6b0002e0c8129947040a779ab4077) @@ -78,7 +78,7 @@ public class RegisterAction extends LamsDispatchAction { private static final Logger log = Logger.getLogger(RegisterAction.class); - private static final String LAMS_COMMUNITY_REGISTER_URL = "http://lamscommunity.org/x/registration"; + private static final String LAMS_COMMUNITY_REGISTER_URL = "http://lamscommunity.org/lams/x/registration"; public static final String LAMS_COMMUNITY_KEY = "17^76iTkqYSywJ73"; private static IUserManagementService userManagementService; @@ -135,41 +135,6 @@ request.setAttribute("registerDTO", registerDTO); - /* - DynaActionForm registerForm = (DynaActionForm) form; - - // Set Server Configuration details in dyna form - registerForm.set("serverurl", Configuration.get(ConfigurationKeys.SERVER_URL)); - registerForm.set("serverversion", Configuration.get(ConfigurationKeys.VERSION)); - registerForm.set("serverbuild", Configuration.get(ConfigurationKeys.SERVER_VERSION_NUMBER)); - registerForm.set("serverlocale", Configuration.get(ConfigurationKeys.SERVER_LANGUAGE)); - registerForm.set("langdate", Configuration.get(ConfigurationKeys.DICTIONARY_DATE_CREATED)); - - // Set user details for registration - UserDTO sysadmin = (UserDTO) SessionManager.getSession().getAttribute(AttributeNames.USER); - - registerForm.set("rname", sysadmin.getFirstName() + " " + sysadmin.getLastName()); - registerForm.set("remail", sysadmin.getEmail()); - - // Get Server statistics for registration - List groups = service.findByProperty(Organisation.class, "organisationType.organisationTypeId", - OrganisationType.COURSE_TYPE); - List subgroups = service.findByProperty(Organisation.class, "organisationType.organisationTypeId", - OrganisationType.CLASS_TYPE); - - //Set statistics in dyna form - registerForm.set("groupno", Integer.valueOf(groups.size())); - registerForm.set("subgroupno", Integer.valueOf(subgroups.size())); - registerForm.set("sysadminno", service.getCountRoleForSystem(Role.ROLE_SYSADMIN)); - registerForm.set("adminno", service.getCountRoleForSystem(Role.ROLE_GROUP_ADMIN)); - registerForm.set("authorno", service.getCountRoleForSystem(Role.ROLE_AUTHOR)); - registerForm.set("monitorno", service.getCountRoleForSystem(Role.ROLE_MONITOR)); - registerForm.set("managerno", service.getCountRoleForSystem(Role.ROLE_GROUP_MANAGER)); - registerForm.set("learnerno", service.getCountRoleForSystem(Role.ROLE_LEARNER)); - registerForm.set("authoradminno", service.getCountRoleForSystem(Role.ROLE_AUTHOR_ADMIN)); - registerForm.set("userno", Integer.valueOf(service.findAll(User.class).size())); - */ - return mapping.findForward("register"); } @@ -196,30 +161,6 @@ registerForm.setPublicDirectory(reg.isPublicDirectory()); registerForm.setEnableLamsCommunityIntegration(reg.isEnableLamsCommunityIntegration()); - - // setting the config values -// registerForm.setServerUrl(Configuration.get(ConfigurationKeys.SERVER_URL)); -// registerForm.setServerVersion(Configuration.get(ConfigurationKeys.VERSION)); -// registerForm.setServerBuild(Configuration.get(ConfigurationKeys.SERVER_VERSION_NUMBER)); -// registerForm.setServerLocale(Configuration.get(ConfigurationKeys.SERVER_LANGUAGE)); -// registerForm.setServerLanguageDate(Configuration.get(ConfigurationKeys.DICTIONARY_DATE_CREATED)); - - // Get Server statistics for registration -// List groups = userManagementService.findByProperty(Organisation.class, "organisationType.organisationTypeId", -// OrganisationType.COURSE_TYPE); -// List subgroups = userManagementService.findByProperty(Organisation.class, -// "organisationType.organisationTypeId", OrganisationType.CLASS_TYPE); -// -// registerForm.setGroupNumber(Integer.valueOf(groups.size())); -// registerForm.setSubgroupNumber(Integer.valueOf(subgroups.size())); -// registerForm.setSysadminNumber(userManagementService.getCountRoleForSystem(Role.ROLE_SYSADMIN)); -// registerForm.setAdminNumber(userManagementService.getCountRoleForSystem(Role.ROLE_GROUP_ADMIN)); -// registerForm.setAuthorNumber(userManagementService.getCountRoleForSystem(Role.ROLE_AUTHOR)); -// registerForm.setMonitorNumber(userManagementService.getCountRoleForSystem(Role.ROLE_MONITOR)); -// registerForm.setManagerNumber(userManagementService.getCountRoleForSystem(Role.ROLE_GROUP_MANAGER)); -// registerForm.setLearnerNumber(userManagementService.getCountRoleForSystem(Role.ROLE_LEARNER)); -// registerForm.setAuthorAdminNumber(userManagementService.getCountRoleForSystem(Role.ROLE_AUTHOR_ADMIN)); -// registerForm.setUserNumber(Integer.valueOf(userManagementService.findAll(User.class).size())); } public void updateRegistration(RegisterForm registerForm, Registration reg) { @@ -245,10 +186,10 @@ if (reg == null) { reg = new Registration(); } - + updateRegistration(registerForm, reg); + if (reg.getServerKey() == null) { - updateRegistration(registerForm, reg); - + String url = LAMS_COMMUNITY_REGISTER_URL; HashMap params = new HashMap(); Index: lams_admin/web/register.jsp =================================================================== diff -u -r3bc65f0652b50074ff432112d8e47a6df3728810 -racc8d2acf5b6b0002e0c8129947040a779ab4077 --- lams_admin/web/register.jsp (.../register.jsp) (revision 3bc65f0652b50074ff432112d8e47a6df3728810) +++ lams_admin/web/register.jsp (.../register.jsp) (revision acc8d2acf5b6b0002e0c8129947040a779ab4077) @@ -481,8 +481,8 @@

"/> - "/> - " onClick="javascript:window.location.href='/sysadminstart.do'"/> + + " onClick="javascript:window.location.href='/admin/sysadminstart.do'"/>

Index: lams_build/build.xml =================================================================== diff -u -r2f21856ec2ab85b47c93cfcc3fa2c8769be65077 -racc8d2acf5b6b0002e0c8129947040a779ab4077 --- lams_build/build.xml (.../build.xml) (revision 2f21856ec2ab85b47c93cfcc3fa2c8769be65077) +++ lams_build/build.xml (.../build.xml) (revision acc8d2acf5b6b0002e0c8129947040a779ab4077) @@ -341,7 +341,6 @@ - + Index: lams_build/common.properties =================================================================== diff -u -r3cae36fc3c73c4ce595adc48b7ef2f8ac166daaf -racc8d2acf5b6b0002e0c8129947040a779ab4077 --- lams_build/common.properties (.../common.properties) (revision 3cae36fc3c73c4ce595adc48b7ef2f8ac166daaf) +++ lams_build/common.properties (.../common.properties) (revision acc8d2acf5b6b0002e0c8129947040a779ab4077) @@ -26,7 +26,7 @@ #conf.application=rams # which o/s related property file do you want? valid values "windows" or "unix" -osPropertiesName=windows +osPropertiesName=unix #Tool information name=lams_tool_${signature} Index: lams_build/deploy-tool/deploy.sh =================================================================== diff -u -rf09e854442df997c78ef3cdc6cbe6c68c20afc10 -racc8d2acf5b6b0002e0c8129947040a779ab4077 --- lams_build/deploy-tool/deploy.sh (.../deploy.sh) (revision f09e854442df997c78ef3cdc6cbe6c68c20afc10) +++ lams_build/deploy-tool/deploy.sh (.../deploy.sh) (revision acc8d2acf5b6b0002e0c8129947040a779ab4077) @@ -1,2 +1,2 @@ -#!/bin/sh -java -classpath lib/lams-tool-deploy.jar:lib/commons-configuration-1.1.jar:lib/commons-lang-2.0.jar:lib/commons-collections.jar:lib/commons-logging.jar:lib/commons-io-1.0.jar:lib/commons-dbutils-1.0.jar:lib/mysql-connector-java-5.0.8-bin.jar:lib/xstream-1.1.2.jar org.lamsfoundation.lams.tool.deploy.Deploy ./deploy.xml +#!/bin/sh +java -classpath lib/lams-tool-deploy.jar:lib/commons-configuration-1.1.jar:lib/commons-lang-2.0.jar:lib/commons-collections.jar:lib/commons-logging.jar:lib/commons-io-1.0.jar:lib/commons-dbutils-1.0.jar:lib/mysql-connector-java-5.0.8-bin.jar:lib/xstream-1.1.2.jar org.lamsfoundation.lams.tool.deploy.Deploy ./deploy.xml Index: lams_build/lib/lams/lams-monitoring.jar =================================================================== diff -u -r68d2988cca350af15ba4087814f74e1527a71997 -racc8d2acf5b6b0002e0c8129947040a779ab4077 Binary files differ Index: lams_build/lib/lams/lams.jar =================================================================== diff -u -r2f21856ec2ab85b47c93cfcc3fa2c8769be65077 -racc8d2acf5b6b0002e0c8129947040a779ab4077 Binary files differ Index: lams_build/librarypackages/shareresourcesforum/language/lams/ApplicationResources_el_GR.properties =================================================================== diff -u -r33555f294f71f8073472c9d368b44fa2132e2d46 -racc8d2acf5b6b0002e0c8129947040a779ab4077 --- lams_build/librarypackages/shareresourcesforum/language/lams/ApplicationResources_el_GR.properties (.../ApplicationResources_el_GR.properties) (revision 33555f294f71f8073472c9d368b44fa2132e2d46) +++ lams_build/librarypackages/shareresourcesforum/language/lams/ApplicationResources_el_GR.properties (.../ApplicationResources_el_GR.properties) (revision acc8d2acf5b6b0002e0c8129947040a779ab4077) @@ -2,13 +2,13 @@ #language code: el #locale code: GR - # CVS ID: $Id$ Exported from the LAMS Community by Ernie Ghiglione on Thu Nov 20 04:10:50 GMT 2008 + # CVS ID: $Id$ Exported from the LAMS Community by Ernie Ghiglione on Thu May 21 06:22:12 CST 2009 #=================== labels for Resources and Forum =================# activity.description =\u03a3\u03c5\u03bd\u03b4\u03c5\u03b1\u03c3\u03bc\u03cc\u03c2 \u039a\u03bf\u03b9\u03bd\u03cc\u03c7\u03c1\u03b7\u03c3\u03c4\u03c9\u03bd \u03a0\u03cc\u03c1\u03c9\u03bd \u03ba\u03b1\u03b9 \u03a3\u03c5\u03b6\u03ae\u03c4\u03b7\u03c3\u03b7\u03c2 -activity.helptext =\u03a4\u03bf \u03c0\u03ac\u03bd\u03c9 \u03c0\u03b1\u03c1\u03ac\u03b8\u03c5\u03c1\u03bf \u03ad\u03c7\u03b5\u03b9 \u03bc\u03b9\u03b1 \u03c0\u03b5\u03c1\u03b9\u03bf\u03c7\u03ae \u039a\u03bf\u03b9\u03bd\u03cc\u03c7\u03c1\u03b7\u03c3\u03c4\u03c9\u03bd \u03a0\u03cc\u03c1\u03c9\u03bd \u03ba\u03b1\u03b9 \u03c4\u03bf \u03ba\u03ac\u03c4\u03c9 \u03c0\u03b1\u03c1\u03ac\u03b8\u03c5\u03c1\u03bf \u03ad\u03c7\u03b5\u03b9 \u03bc\u03af\u03b1 \u03c0\u03b5\u03c1\u03b9\u03bf\u03c7\u03ae \u03c3\u03c5\u03b6\u03ae\u03c4\u03b7\u03c3\u03b7\u03c2 \u03c0\u03c1\u03bf\u03ba\u03b5\u03b9\u03bc\u03ad\u03bd\u03bf\u03c5 \u03bf\u03b9 \u03b5\u03ba\u03c0\u03b1\u03b9\u03b4\u03b5\u03c5\u03cc\u03bc\u03b5\u03bd\u03bf\u03b9 \u03bd\u03b1 \u03c3\u03c5\u03b6\u03b7\u03c4\u03bf\u03cd\u03bd \u03c4\u03b1 \u03c3\u03c4\u03bf\u03b9\u03c7\u03b5\u03af\u03b1 \u03c0\u03bf\u03c5 \u03b5\u03af\u03b4\u03b1\u03bd \u03bc\u03ad\u03c3\u03c9 \u03c4\u03c9\u03bd \u03ba\u03bf\u03b9\u03bd\u03cc\u03c7\u03c1\u03b7\u03c3\u03c4\u03c9\u03bd \u03c0\u03cc\u03c1\u03c9\u03bd. activity.title =\u03a0\u03cc\u03c1\u03bf\u03b9 & \u03a3\u03c5\u03b6\u03ae\u03c4. +activity.helptext =\u03a4\u03bf \u03c0\u03ac\u03bd\u03c9 \u03c0\u03b1\u03c1\u03ac\u03b8\u03c5\u03c1\u03bf \u03ad\u03c7\u03b5\u03b9 \u03bc\u03b9\u03b1 \u03c0\u03b5\u03c1\u03b9\u03bf\u03c7\u03ae \u039a\u03bf\u03b9\u03bd\u03cc\u03c7\u03c1\u03b7\u03c3\u03c4\u03c9\u03bd \u03a0\u03cc\u03c1\u03c9\u03bd \u03ba\u03b1\u03b9 \u03c4\u03bf \u03ba\u03ac\u03c4\u03c9 \u03c0\u03b1\u03c1\u03ac\u03b8\u03c5\u03c1\u03bf \u03ad\u03c7\u03b5\u03b9 \u03bc\u03af\u03b1 \u03c0\u03b5\u03c1\u03b9\u03bf\u03c7\u03ae \u03c3\u03c5\u03b6\u03ae\u03c4\u03b7\u03c3\u03b7\u03c2 \u03c0\u03c1\u03bf\u03ba\u03b5\u03b9\u03bc\u03ad\u03bd\u03bf\u03c5 \u03bf\u03b9 \u03b5\u03ba\u03c0\u03b1\u03b9\u03b4\u03b5\u03c5\u03cc\u03bc\u03b5\u03bd\u03bf\u03b9 \u03bd\u03b1 \u03c3\u03c5\u03b6\u03b7\u03c4\u03bf\u03cd\u03bd \u03c4\u03b1 \u03c3\u03c4\u03bf\u03b9\u03c7\u03b5\u03af\u03b1 \u03c0\u03bf\u03c5 \u03b5\u03af\u03b4\u03b1\u03bd \u03bc\u03ad\u03c3\u03c9 \u03c4\u03c9\u03bd \u03ba\u03bf\u03b9\u03bd\u03cc\u03c7\u03c1\u03b7\u03c3\u03c4\u03c9\u03bd \u03c0\u03cc\u03c1\u03c9\u03bd. #======= End labels: Exported 3 labels for el GR ===== Index: lams_build/shared.properties =================================================================== diff -u -r8176135403562bdf207f9477805d0e092915312a -racc8d2acf5b6b0002e0c8129947040a779ab4077 --- lams_build/shared.properties (.../shared.properties) (revision 8176135403562bdf207f9477805d0e092915312a) +++ lams_build/shared.properties (.../shared.properties) (revision acc8d2acf5b6b0002e0c8129947040a779ab4077) @@ -36,6 +36,7 @@ lams_tool_deploy=lams_tool_deploy lams_www=lams_www lams_gradebook=lams_gradebook +lams_planner=lams_planner sub.build.lib=build/lib sub.build.language=build/lib/language @@ -63,3 +64,4 @@ tool_assessment_dir=lams_tool_assessment tool_videorecorder_dir=lams_tool_videorecorder tool_dimdim_dir=lams_tool_dimdim +tool_mindmap_dir=lams_tool_mindmap Index: lams_build/unix.properties =================================================================== diff -u -r2f21856ec2ab85b47c93cfcc3fa2c8769be65077 -racc8d2acf5b6b0002e0c8129947040a779ab4077 --- lams_build/unix.properties (.../unix.properties) (revision 2f21856ec2ab85b47c93cfcc3fa2c8769be65077) +++ lams_build/unix.properties (.../unix.properties) (revision acc8d2acf5b6b0002e0c8129947040a779ab4077) @@ -28,7 +28,7 @@ contentrepository.directory=/var/opt/${conf.application}/repository #JBoss deploy directory (Unix) -jboss.home=/usr/local/jboss-5/ +jboss.home=/usr/local/jboss-5.1.0.GA/ jboss.server=${jboss.home}server/ jboss.server.instance=${jboss.server}default jboss.server.instance.lib=${jboss.server.instance}/lib Index: lams_central/build.xml =================================================================== diff -u -r6ea112b9b57636ff8cf428beaf3e91df321aa0d9 -racc8d2acf5b6b0002e0c8129947040a779ab4077 --- lams_central/build.xml (.../build.xml) (revision 6ea112b9b57636ff8cf428beaf3e91df321aa0d9) +++ lams_central/build.xml (.../build.xml) (revision acc8d2acf5b6b0002e0c8129947040a779ab4077) @@ -311,7 +311,6 @@ - Index: lams_central/conf/flashxml/lams/authoring/ru_RU_dictionary.xml =================================================================== diff -u -rc6651752fb65bedc8712afa12f99c55fa98db807 -racc8d2acf5b6b0002e0c8129947040a779ab4077 --- lams_central/conf/flashxml/lams/authoring/ru_RU_dictionary.xml (.../ru_RU_dictionary.xml) (revision c6651752fb65bedc8712afa12f99c55fa98db807) +++ lams_central/conf/flashxml/lams/authoring/ru_RU_dictionary.xml (.../ru_RU_dictionary.xml) (revision acc8d2acf5b6b0002e0c8129947040a779ab4077) @@ -1 +1 @@ -
getDictionary3pi_optional_titleОпциональное заданиеTitle for oprional activity property inspectoropt_activity_titleОпциональное заданиеTitle for Optional Activity Containertk_titleИнструментарий для заданийLabel for Activities Toolkit Panelccm_open_activitycontentОткрыть/Редактировать содержание заданияLabel for Custom Context Menupi_num_learnersКоличество учениковPI Num learners labelws_click_virtual_folderНевозможно использовать эту директорию.Alert message for trying to use a virtual folder to save/open a file.group_btn_tooltipСоздать групповое заданиеtool tip message for group button in toolbarpi_daysДнейDays label in property inspector for gate toolcv_invalid_optional_activityПеред тем как делать это задание опциональным, удалите все переходы на него и с него.Alert message when user try to drop an activity with to or from transition into optional containertrans_btn_tooltipИспользуйте эту ручку для создания перехода между заданиями (или удерживайте клавишу CTRL)tool tip message for transition button in toolbarccm_copy_activityКопировать заданиеLabel for Custom Context Menuccm_paste_activityВставить заданиеLabel for Custom Context Menuccm_piИнспектор свойств...Label for Custom Context Menupi_parallel_titleПараллельное заданиеTitle for parallel activity property inspectorws_dlg_descriptionОписаниеLabel for description in Workspace dialog - Properties tabcv_untitled_lblБез названия - 1Label for Design Title bar on canvasmnu_file_recoverВосстановление...Menu bar Recovercv_invalid_trans_target_from_activityПереход от {0} уже существуетError message when a transition from the activity already existcv_activity_helpURL_undefinedСтраница помощи для {0} не найдена Alert message when a tool activity has no help url defined.ws_chk_overwrite_existingЭтот каталог уже содержит файл с именем {0}Alert message when saving a design with the same filename as an existing design.optional_btn_tooltipСоздать ряд опциональных заданий.tool tip message for optional button in toolbarmnu_file_apply_changesПрименить измененияApply Changesapply_changes_btnПрименить измененияApply Changescancel_btnОтменитьToolbar - Cancel Buttoncv_element_readOnly_action_delудаленоAction label for read only alert message for a Canvas Transition.cv_element_readOnly_action_modизмененоAction label for read only alert message for a Canvas Transition.mnu_file_finishЗавершитьMenu bar File - Finish (Edit Mode)about_popup_title_lblО - {0}Title for the About Pop-up window.pi_start_offsetОткрыть затворStart offset labelpi_lbl_groupГруппировкаGrouping label for PIcv_invalid_design_savedВаш проект не прошел верификацию, но он был сохранен, щелкните 'Разрешение проблем', чтобы увидеть причины этого.Message when an invalid design has been savedws_tree_orgsМои группыShown in the top level of the tree in the workspaceabout_popup_version_lblВерсияLabel displaying the version no on the About dialog.none_act_lblНи одногоNo gate activity selectedgate_btnЗатворToolbar > Gate Buttonpi_definelaterОпределить позжеLabel for Define later for PIpi_end_offsetЗакрыть затворEnd offset labelsave_btn_tooltipБыстрое сохранение текущей последовательности заданийtool tip message for save button in toolbarcopy_btn_tooltipКопировать выделенное заданиеtool tip message for copy button in toolbarnew_btn_tooltipОчистить текущую последовательность и восстановить рабочее пространство для дальнейшего использованияTool tip message for new button in toolbarcv_trans_target_act_missingОтсутствует второе задание для перехода.Error message when target activity for transition is missingccm_author_activityhelpПомощь по Редактору заданийLabel for Custom Context Menupaste_btn_tooltipВставить копию выделенного заданияtool tip message for paste button in toolbaract_tool_titleИнструментарий ЗаданийTitle for Activity Toolkit Panelld_val_activity_columnЗаданиеThe heading on the activity in the ValidationIssuesDialogpi_activity_type_gateЗадание затвораActivity type for gate in PIpi_activity_type_groupingГрупповое заданиеActivity type for grouping in Property Inspectorcv_design_export_unsavedВы не можете экспортировать не сохраненный проект.Alert message when trying to export can unsaved design.cv_activity_copy_invalidИзвините! У Вас нет прав скопировать это дочернее задание.Error message when user try to copy child activity from either optional or parallel activity containerpi_lbl_currentgroupТекущая группировкаCurrent grouping label for PIws_chk_overwrite_resourceВнимание, Вы собираетесь перезаписать ресурс!open_btn_tooltipПоказать диалог выбора файлов для открытия последовательности заданийTool tip message for open button in toolbarcv_activity_cut_invalidИзвините! У Вас нет прав вырезать это дочернее задание.Error message when user try to cut child activity from either optional or parallel activity containeral_cannot_move_activityИзвините, Вы не можете переместить это задание.Alert message when user tries to move child activity of any parallel activitypi_group_typeГруппировка типаProperty Inspector Grouping type drop downws_click_folder_fileПожалуйста, выберите Каталог для сохранения или Проект для его перезаписиError msg if no folder or file is selectedws_no_permissionЖаль, Вы не имеете прав на запись в этот ресурсMessage when user does not have write permission to complete actiontrans_dlg_titleПереходTitle for the transition properties dialogsys_error_msg_finishВы, возможно, должны перезапустить LAMS Author , чтобы продолжить. Вы хотите сохранить следующую информацию об этой ошибке, чтобы помочь установить причину этой проблемы?Common System error message finish paragraphws_del_confirm_msgВы уверены, что хотите удалить этот файл/папку?Confirmation message when user tries to delete a file or folder in workspace dialog boxmnu_file_exitВыходFile Menu Exitapp_chk_langloadЯзыковые данные не были загруженыmessage for unsuccessful language loadingapp_fail_continueВыполнение программы не может быть продолжено. Пожалуйста свяжитесь с группой поддержкиmessage if application cannot continue due to any errorchosen_grp_lblВыбратьLabel for the grouping drop down in the PropertyInspectorcv_invalid_trans_targetВы не можете создать переход к этому объектуError message for when transition tool is dropped outside of valid target activitymnu_edit_cutВырезатьMenu bar Edit > Cutmnu_file_newНовыйMenu bar Newnew_btnНовыйToolbar > New Buttonnew_confirm_msgВы уверены, что хотите заменить текущий проект пустым новым?Msg when user clicks new while working on the existing designpi_runofflineВыполнить автономноLabel for Run Oflineal_activity_copy_invalidИзвините! Вы должны выбрать задание, перед тем как его копироватьAlert message when user select copy activity in context menu or clicks copy button in the menu before selecting any activity on the canvasmnu_tools_transДобавить переходMenu bar draw transitionprefix_copyofКопироватьPrefix for copy paste command for canvas activitieslicense_not_selectedВы не выбрали лицензии. Сделайте это, пожалуйста.Shown if no license is selected in the drop down in workspacemnu_tools_optСоздать контейнер опциональных заданийMenu bar Optionalprefs_dlg_cancelОтменить6prefs_dlg_lng_lblЯзык7prefs_dlg_theme_lblТема8prefs_dlg_titleНастройки4preview_btnПредварительный просмотрToolbar > Preview Buttonproperty_inspector_titleСвойстваOn the title bar of the PIrandom_grp_lblСлучайноLabel for the grouping drop down in the PropertyInspectorrename_btnПереименоватьLabel for Rename Buttonsave_btnСохранитьToolbar > Save buttonsched_act_lblРасписаниеLabel for schedule gate activitysynch_act_lblСинхронизироватьUsed as a label for the Synch Gate Activity Typetrans_dlg_cancelОтменитьCancel button on transition dialogtrans_dlg_gateСинхронизацияHeader for the transition props dialogtrans_dlg_gatetypecmbТипGate type combo labelws_RootКорневой каталогRoot folder title for workspaceact_lock_chkПеред тем как делать это задание опциональным, разблокируйте, пожалуйста, контейнер опциональных заданий.Alert Message if user drags the activity to locked optional activity container ws_copy_same_folderКаталоги Источника и Получателя совпадаютThe user has tried to drag and drop to the same placews_dlg_cancel_buttonОтменить2ws_dlg_filenameИмя файлаLabel for File name in workspace windowws_dlg_location_buttonРасположениеWorkspace dialogue Location btn labelws_dlg_open_btnОткрытьWsp Dia Open Button labelws_dlg_properties_buttonСвойстваWorkspace dialogue Properties btn labelws_dlg_save_btnСохранитьWsp Dia Save Button labelws_dlg_titleРабочая среда0ws_newfolder_cancelОтменитьCancel on the new folder name diaws_newfolder_insПожалуйста введите новое имя папкиInstructions on the new name pop upws_rename_insПожалуйста введите новое имяMessage of the new name for the userws_tree_mywspМоя рабочая средаThe root level of the treews_view_license_buttonПосмотретьTo show the license to the usersys_error_msg_startПроизошла следующая ошибка системы:Common System error message starting linesys_errorСистемная ошибкаSystem Error elert window titleal_sendОтправитьSend button label on the system error dialogws_license_comment_lblДополнительные сведения о лицензииLabel for Licence Comment description below license drop downmnu_help_helpСоздание помощиlabel for menu bar Help - Authoring Help optionws_click_file_openПожалуйста нажмите на Проект, чтобы его открыть.Alert message if folder tried to be opened.pi_num_groupsЧисло группNumber of groups in Property inspectorcv_invalid_trans_target_to_activityПереход к {0} уже существуетError message when a transition to the activity already existcv_design_unsavedПроект изменен. Продолжить без сохранения?Alert message when opening/importing when current design on canvas is unsaved or modified.gate_btn_tooltipСоздать точку остановкиtool tip message for gate button in toolbarbranch_btn_tooltipСоздать переход (доступно в LAMS v 2.1)tool tip message for branch button in toolbarmnu_file_exportЭкспортMenu bar Exportws_no_file_openФайлы не найдены.Alert message if no matching file is found to open in selected folder of Workspace.mnu_file_importИмпортMenu bar Importcv_readonly_lblТолько чтениеLabel for top left of canvas shown when a read-only design is open.cv_autosave_rec_titleПредупреждениеAlert title for auto save recovery message.pi_lbl_titleЗаглавиеTitle label for PIpi_minsМинутыMins label in teh property inspectoral_alertПредупреждениеGeneric title for Alert windowal_cancelОтменитьTo Confirm title for LFErroral_confirmПодтвердитьTo Confirm title for LFErrorapp_chk_themeloadДанные темы не были загруженыmessage for unsuccessful theme loadingcopy_btnКопироватьToolbar > Copy Buttoncv_show_validationРазрешение проблемThe button on the confirm dialogcv_valid_design_savedПоздравления! - Ваш проект прошёл верификацию и был сохраненMessage when a valid design has been saveddb_datasend_confirmСпасибо за Отправку данных на серверMessage when user sucessfully dumps data to the serverdelete_btnУдалитьLabel for Delete buttongroup_btnГруппаToolbar > Group Buttongrouping_act_titleГруппироватьDefault title for the grouping activityld_val_doneЗакончитьThe button label for the dialogld_val_issue_columnПроблемаThe heading on the issue in the ValidationIssuesDialogld_val_titleКонтроль ошибокThe title for the dialogmnu_editПравкаMenu bar Editmnu_edit_copyКопироватьMenu bar Edit > Copymnu_edit_pasteВставитьMenu bar Edit > Pastemnu_edit_redoВернутьMenu bar Edit > Redomnu_edit_undoОтменитьMenu bar Edit > Undomnu_fileФайлMenu bar Filemnu_file_closeЗакрытьMenu bar Closeal_okОКOK on the alert dialogmnu_file_openОткрытьMenu bar Openmnu_file_saveСохранитьMenu bar savemnu_file_saveasСохранить как...Menu bar Save asmnu_helpПомощьMenu bar Helpmnu_help_abtО LAMSMenu bar Aboutmnu_toolsСервисMenu bar Toolsmnu_tools_prefsНастройкиMenu bar preferencesopen_btnОткрытьToolbar > Open Buttonoptional_btnОпцииToolbar > Optional Buttonpaste_btnВставитьToolbar > Paste Buttonperm_act_lblПраваLabel for permission gate activitypi_hoursЧасыHours label in Property Inspectorpi_lbl_descОписаниеDescription Label for PIpi_no_groupingНетCombo title for no groupingpi_titleСвойстваOn the title bar of the PIsequence_act_titleПоследовательностьDefault title for Sequence Activity.pi_condmatch_btn_lblЗадать условияLabel for button to open dialog to create output conditions.condmatch_dlg_cond_lst_lblУсловияLabel for primary list heading on Condition to Branch Matching dialog.pi_defaultBranch_cb_lblпо умолчаниюCheckBox label for selecting the Branch as default for the BranchingActivity.to_conditions_dlg_add_btn_lbl+ ДобавитьLabel for button to add a condition.to_conditions_dlg_clear_all_btn_lblОчистить всеLabel for button to clear all conditions.to_conditions_dlg_remove_item_btn_lbl - УдалитьLabel for button to remove condition.to_conditions_dlg_from_lblотLabel for start value in condition range for long or numeric output values.to_conditions_dlg_to_lblдоLabel for end value in condition range for long or numeric output values.to_conditions_dlg_range_lblПромежутокHeading label for section in the dialog to set numeric condition range.branch_mapping_dlg_condition_col_lblУсловиеColumn heading for showing condition description of the mapping.branch_mapping_dlg_group_col_lblГруппаColumn heading for showing group name of the mapping.branch_mapping_dlg_condition_col_valueВ промежутке от {0} до {1}Value for Condition field in mapping datagrid.ws_license_lblЛицензияLabel for Licence drop down on workspace properties tab viewws_file_name_emptyИзвините! Вы не можете сохранить проект с неопределенным названием файла.Error message when user try to save a design with no file nameal_empty_designИзвините, Вы не можете сохранить пустой проектalert message when user want to save an empty designtrans_btnПереходToolbar > Transition Buttongroupmatch_dlg_groups_lst_lblГруппыLabel for Groups list box on Group/Branch Matching Dialog.to_condition_start_valueначальное значениеValue representing the min boundary value of the conditions range.to_condition_end_valueконечно значениеValue representing the max boundary value of the conditions value.al_continueПродолжитьContinue button on Alert dialogpreview_btn_tooltipПредварительный просмотр вашей последовательности, так как это будет показано для учениковTool tip message for preview button in toolbaral_activity_openContent_invalidПрежде чем нажать на пункт меню Открыть/Редактировать содержание задания, Вы должны выбрать какое-нибудь задание.alert message when user click Open/Edit Activity Content menu item in context menu before selecting any activity on the canvascv_invalid_trans_circular_sequenceНельзя создавать замкнутые последовательностиError message when a transition from one activity to another is creating a circular loopbranch_mapping_dlg_condition_linked_singleЭто условиеPhrase used at start of linked conditions alert message when clearing a single entry.optional_act_btnЗаданиеToolbar button for Optional Activity.optional_seq_btnПоследовательностьToolbar button for Sequences within Optional Activity.lbl_num_sequences{0} - ПоследовательностейLabel to describe the amount of sequences in the container.pi_actЗаданияMin and max label postfix when an Optional Activity is selected.pi_seqПоследовательностиMin and max label postfix when an Optional Sequences activity is selected.pi_max_actМаксимум {0}Label for maximum Activities or Sequencespi_min_actМинимум {0}Label for minimum Activities or Sequencesws_dlg_ok_buttonОКWsp Dia OK Button labeltrans_dlg_okОКOK Button on transition dialogws_newfolder_okОКOK on the new folder name diaprefs_dlg_okОК5branching_act_titleРазветвлениеLabel for Branching Activitypi_activity_type_sequenceПоследовательностьActivity type for Sequence (Branch) in Property Inspector.condmatch_dlg_title_lblОпределить соотвествие ветвей условиямDialog title for matching conditions to branches for Tool based Branching.chosen_branch_act_lblВыбор преподавателяBranching type label for Teacher choice Branching.pi_define_monitor_cb_lblОпределить позжеCheckbox label for option to define group to branch mappings in Monitor.groupmatch_dlg_title_lblОпределить соотвествие групп ветвямMap Groups to Branchesbranch_btnРазветвлениеLabel for disabled Branch button shown as submenu for flow button in Toolbarbranch_mapping_no_branch_msgНе была выбрана ветвь.Alert message when adding a Mapping without a Branch (Sequence) being selected.branch_mapping_dlg_branch_col_lblВетвьColumn heading for showing sequence name of the mapping.branch_mapping_auto_condition_msgВсе оставшиеся Условия будут относиться к дефолтовой Ветви.Alert message for notifying the user that the unmapped Conditions will be mapped to the default Branch.branch_mapping_dlg_branches_lst_lblВетвиLabel for Branches list box on Branch Matching Dialogs.sequence_act_title_new{0} {1}Title for a new Sequence Activity for Optional or Branch and including count value.to_conditions_dlg_condition_items_value_col_lblУсловиеColumn header for the Condition Item(s) datagrid column.close_mc_tooltipСвернутьTooltip message for close button on Branching canvas.ws_dlg_insert_btnВставитьButton label on Workspace in INSERT mode.branch_mapping_dlg_branch_item_default{0} (по умолчанию)Item value displayed in the Branches list (Tool Conditions mapping dialog) for the default branch.refresh_btnОбновитьButton label for Refresh button on the Tool Output Conditions dialog.pi_tool_output_matching_btn_lblОпределить соотвествия условий ветвямButton in author that allows you to match conditions to branches for tool-output based branchingto_conditions_dlg_defin_user_defined_typeзадано пользователемType description for a user-defined (boolean set) based ouput definition.cv_autosave_rec_msgВы выбрали восстановление предыдущего или несохраненного проекта. Ваш текущий проект будет удален. Желаете продолжить?Message informing users that they have recovered data for a design.cv_close_return_to_ext_srcЗакрыть и вернуться к {0}Button label used on close and return button in save confirm message popup.cancel_btn_tooltipВернуться в мониторингtool tip message for cancel button in toolbar (edit mode)stream_reference_lblLAMSReference label for the application stream.to_conditions_dlg_defin_item_fn_lbl{0} ({1})Function label value for tool output definition drop-down.to_conditions_dlg_lt_lblМеньше либо равноLess than option for long type conditions.branch_mapping_dlg_condition_col_value_minМеньше либо равно {0}Value for Condition field in mapping datagrid when Less than option is selected.to_conditions_dlg_defin_long_typeдиапазонType description for a long-value based ouput definition.to_conditions_dlg_defin_bool_typeправда/ложьType description for a lboolean-value based ouput definition.to_conditions_dlg_options_item_header_lbl[ Условия ]Header label value (first index) for tool long (range) options drop-down.to_conditions_dlg_gte_lblБольше либо равноGreater than or equal toto_conditions_dlg_lte_lblМеньше либо равноLess than or equal tobranch_mapping_dlg_condition_col_value_maxБольше либо равно {0}Value for Condition field in mapping datagrid when Greater than option is selected.lbl_num_activities{0} - Заданияreplacement for word activitiescv_gateoptional_hit_chkВы не можете сделать Затвор опциональным заданиемError message when user drags gate activity over to optional containertrans_dlg_nogateНе заданDrop down default for gate typeal_doneЗакончитьLabel for dialog completion button.branch_mapping_no_condition_msgНе было выбрано Условие.Alert message when adding a Mapping without a Condition being selected.branch_mapping_dlg_condition_col_value_exactЗначение {0}Value for Condition field in mapping datagrid when range set is only single value.branch_mapping_no_groups_msgНе была выбрана Группа.Alert message when adding a Mapping without a Group being selected.to_condition_invalid_value_direction {0} не может быть больше, чем {1}.Alert message when the start value is greater than end value of the submitted condition.is_remove_warning_msgВНИМАНИЕ: Урок будет удален. Вы хотите сохранить его как {0}? Message for the alert dialog which appears following confirmation dialog for removing a lesson.branch_mapping_dlg_condition_linked_allУсловияPhrase used at start of linked conditions alert message when clearing all.cv_activityProtected_activity_remove_msgЧтобы удалить это задание, снимите с него отметку {0}.Instruction how to delete an Activity linked to a Branching Activity.cv_activityProtected_activity_link_msg{0} соединен с {1}.Alert message when removing a Tool or Grouping Activity that is linked to a Branching Activity on the canvas.cv_activityProtected_child_activity_link_msgУ {0} существует потомок, соединенный с {1}.Alert message when removing a Complex Activity whose child is linked to a Branching Activity on the canvas.optional_seq_btn_tooltipСоздать ряд опциональных последовательностей.Tooltip for Sequences within Optionaly Activity button.flow_btnДвижениеLabel for Flow button in Toolbaract_seq_lock_chkПеред тем как привязывать это задание к опциональной последовательности, разблокируйте, пожалуйста, контейнер опциональных заданий.Alert Message if user drags the activity to locked optional sequences container.bin_tooltipЧтобы удалить это задание из последовательности, перетащите его в корзину.Tool tip message for canvas binbranch_mapping_no_mapping_msgНи одного Соотвествия выбрано не было.Alert message when removing a Mapping without a Mapping being selected.pi_group_matching_btn_lblОпределить соотвествия групп ветвямButton in author that allows you to allocate groups to branches for group based branchingal_activity_paste_invalidИзвините, но Вы не можете вставить задание данного типаAlert message when user is attempting to paste a unsupported activity type.preview_btn_tooltip_disabledЧтобы войти в режим Предварительного просмотра Вашего проекта, Вам сначала необходимо сохранить его, а затем нажать кнопку Предварительный просмотрTool tip message for preview button in toolbar when button is disabled.prefix_copyof_countКопия ({0}) Prefix for copy paste command for canvas activities when copied activity is pasted multiple times.ws_entre_file_nameВведите, пожалуйста, имя проекта, а затем нажмите на кнопку Сохранить.Error message when user try to save a design with no file namecv_eof_changes_appliedИзменения применены.Changes have been successful applied.validation_error_transitionNoActivityBeforeOrAfterПереход должен иметь задание до или после себяA Transition must have an activity before or after the transitionvalidation_error_activityWithNoTransitionЗадание должно иметь входящий или исходящий переходAn activity must have an input or output transitionvalidation_error_inputTransitionType1На это задание нет переходаThis activity has no input transitionvalidation_error_inputTransitionType2У всех заданий есть входящие переходыNo activities are missing their input transition.validation_error_outputTransitionType1Нет перехода из этого заданияThis activity has no output transitionvalidation_error_outputTransitionType2У всех заданий есть исходящие переходыNo activities are missing their output transition.cv_invalid_design_on_apply_changesНевозможно применить изменения. Отсутствует один или более переходовCannot apply changes. There are one or more transitions missing.apply_changes_btn_tooltipПрименить изменения в проекте и вернуться в мониторингtool tip message for save button in toolbarcv_activity_readOnlyЗадание не может быть {0}. Задание только для чтения.Alert message when a user performs an illegal action on a read-only transition.cv_eof_finish_invalid_msgЧтобы завершить редактирование, проект не должен содержать ошибокAlert dialog message when attempting to finish Edit on the Fly when the design is invalid.cv_eof_finish_modified_msgВаш проект был изменен. Завершить его без сохранения?Alert dialog message when attempting to finish Edit-on-the-Fly when the design is unsaved.cv_trans_readOnlyПереход не может быть {0}. Объект, на который осуществляется переход, только для чтения.Alert message when a user performs an illegal action on a read-only canvas element (transition or activity).about_popup_copyright_lbl© 2002-2008 {0} Foundation.Label displaying copyright statement in About dialog.about_popup_trademark_lbl{0} - торговая марка {0} Foundation ( {1} ).Label displaying the trademark statement in the About dialog.stream_urlhttp://{0}foundation.orgURL address for the application stream.to_condition_untitled_item_lblБезымянный {0}The default condition name for new items added to conditions list when setting up conditions for Tool based branching.pi_optSequence_remove_msg_titleУдаленные последовательностиRemoving sequencespi_no_seq_actНомер последовательностиLabel on the Property Inspector for a numeric stepper where the value is the no of sequences in an Optional Activity.ws_save_folder_invalidВы не можете сохранить проект в этой директории. Выберите, пожалуйста, подходящую поддиректорию.Alert message if root My Workspace folder is selected to save a design in.cv_activity_dbclick_readonlyВы не можете редактировать инструменты, если проект только для чтения. Сохраните, пожалуйста, копию проекта и попробуйте снова.Alert message when double-clicking an Activity in an open read-only designactivityDrop_optSequence_error_msgПоместите, пожалуйста, задание в одну из последовательностей.Alert message when user drops an activity onto the Optional Sequences container but not on a contained Sequence Activity.opt_activity_seq_titleКонтейнер опциональных заданийTitle for Optional Sequences Container.to_conditions_dlg_condition_items_name_col_lblИмяColumn header for the Condition Item(s) datagrid column.groupnaming_dialog_col_groupName_lblИмя группыColumn label for editable datagrid in Group Naming dialog.mnu_file_insertdesignВставить/Слить...Menu item label for Inserting a Learning Design.redundant_branch_mappings_msgПроект содержит неиспользованные соответствия, которые будут удалены. Продолжить?Alert confirmation message displayed when the user is saving the design and redundant or unused branch mappings exist in the design.pi_optSequence_remove_msgУдаляемые последовательности могут содержать задания. Эти задания также будут удалены. Все равно удалить?Confirmation message when user is removing optional sequences (Optional Sequences) that contain activities.flow_btn_tooltipСоздать задания, управляющие движениемtool tip message for flow button in toolbarcv_autosave_err_msgПроизошла ошибка при попытке австосохранить Ваш проект. Увеличьте, пожалуйста, размер памяти в настройках вашего Flash Player.Alert error message when auto-save fails.cv_edit_on_fly_lblРедактирование "на лету"Label for canvas lip (where design title is displayed) when in Edit-On-The-Fly mode.about_popup_license_lblЭто программа является free software; Вы можете распространять и/или изменять ее при условиях соответствия GNU General Public License version 2 опубликованной Free Software Foundation. {0}Label displaying the license statement in the About dialog.gpl_license_urlwww.gnu.org/licenses/gpl.txtURL address for GPL licence.groupnaming_dialog_instructions_lblЧтобы поменять имя, щекните на нем.Instructions for Group Naming dialog.pi_branch_tool_acts_lblИнструментLabel for Tool Activity selection (combo box) for Tool-based Branching on the Property Inspector.group_branch_act_lblНа основе группBranching type label for Group-based Branching.groupnaming_dlg_title_lblНазвания группTitle label for Group Naming dialog.pi_group_naming_btn_lblНазвания группLabel for button that opens Group Naming dialog.to_condition_invalid_value_range{0} не может пересекаться с диапазоном другого Условия.Alert message when a submitted condition interferes with another previously submitted condition.ta_iconDrop_optseq_error_msgВ контейнере опциональных заданий нет последовательностей.Error message when a Template Activity icon is dropped onto a empty Optional Sequences container.cv_invalid_optional_seq_activityПеред тем как привязывать {0} к опциональной последовательности, удалите все переходы, связанные с ним.Alert message when user try to drop an activity with to or from transition into optional sequences container.cv_invalid_optional_activity_no_branchesПеред тем как делать {0} опциональным заданием, удалите все разветвления, связанные с ним.Alert message when a Template Activity icon is dropped onto a empty Optional Sequences container.pi_mapping_btn_lblЗадать соответствияLabel for button to open tool output to branch(s) dialog.to_conditions_dlg_title_lblСоздать результирующие УсловияDialog title for creating new tool output conditions.to_conditions_dlg_defin_item_header_lbl[Выберите тип результатов]Header label value (first index) for tool output definition drop-down.tool_branch_act_lblРезультаты ученикаBranching type label for Tool output Branching.grouping_invalid_with_common_names_msgВы не можете сохранить проект, так как групповое задание '{0}' содержит группы с одинаковыми именами. Переименуйте их, пожалуйста, и попробуйте снова.Alert message displayed when the Grouping validation fails during saving a design.branch_mapping_dlg_match_dgd_lblСоотвествияHeading label for Mapping datagrid.branch_mapping_dlg_condtion_items_update_defaultConditions_zeroНевозможно сохранить, так как не заданы Условия. Вам, возможно, потребAlert message when the updating the conditions with a selected output definition that has no default conditions.cv_design_insert_warningКак только вы сольете новую последовательность со старой, у вас не будет возможности отменить это действие - так как ваша новообразованная последовательность будет тутже автоматически сохранена. Чтобы вернуться назад, вам придется удалить все новые задания вручную и затем сохранить. Нажмите кнопку Отменить - чтобы оставить вашу последовательность неизмененной. ОК - чтобы продожить слияние.Warning message when merge/insertpi_branch_typeРазветвляющийсяProperty Inspector Branching type drop down.pi_activity_type_branchingРазветвляющиеся заданияActivity type for Branching in Property Inspector.cv_invalid_optional_seq_activity_no_branchesПеред тем, как добавлять {0} к опциональной последовательности, удалите все ветви, в которых оно участвует.Alert message when user try to drop an activity with connected branches into optional sequences container.branch_mapping_dlg_condition_linked_msg{0} соединен с уже существующей ветвью. Продолжить?Alert message when performing an action which clears the current list of conditions when one or more is connected to a Branch Mapping.condmatch_dlg_message_lblЧтобы задать ветвь "по умолчанию", щелкните на флажке "по умолчанию" в свойствах соотвествующей ветви.Label for a message in the Condition to Branch matching dialog.to_conditions_dlg_condition_items_update_defaultConditionsУсловия для выбранных результирующих определений будут сохранены. Но при этом все ссылки на существующие ветви будут удалены. Продолжить?Confirm message for alert dialog when refreshing the default conditions for a selected definition in the Tool Output Conditions dialog. \ No newline at end of file +
getDictionary3pi_optional_titleОпциональное заданиеopt_activity_titleОпциональное заданиеtk_titleИнструментарий для заданийccm_open_activitycontentОткрыть/Редактировать содержание заданияpi_num_learnersКоличество учениковws_click_virtual_folderНевозможно использовать эту директорию.group_btn_tooltipСоздать групповое заданиеpi_daysДнейcv_invalid_optional_activityПеред тем как делать это задание опциональным, удалите все переходы на него и с него.trans_btn_tooltipИспользуйте эту ручку для создания перехода между заданиями (или удерживайте клавишу CTRL)ccm_copy_activityКопировать заданиеccm_paste_activityВставить заданиеccm_piИнспектор свойств...pi_parallel_titleПараллельное заданиеws_dlg_descriptionОписаниеcv_untitled_lblБез названия - 1mnu_file_recoverВосстановление...cv_invalid_trans_target_from_activityПереход от {0} уже существуетcv_activity_helpURL_undefinedСтраница помощи для {0} не найдена ws_chk_overwrite_existingЭтот каталог уже содержит файл с именем {0}optional_btn_tooltipСоздать ряд опциональных заданий.mnu_file_apply_changesПрименить измененияapply_changes_btnПрименить измененияcancel_btnОтменитьcv_element_readOnly_action_delудаленоcv_element_readOnly_action_modизмененоmnu_file_finishЗавершитьabout_popup_title_lblО - {0}pi_start_offsetОткрыть затворpi_lbl_groupГруппировкаws_tree_orgsМои группыabout_popup_version_lblВерсияnone_act_lblНи одногоgate_btnЗатворpi_end_offsetЗакрыть затворsave_btn_tooltipБыстрое сохранение текущей последовательности заданийcopy_btn_tooltipКопировать выделенное заданиеnew_btn_tooltipОчистить текущую последовательность и восстановить рабочее пространство для дальнейшего использованияcv_trans_target_act_missingОтсутствует второе задание для перехода.ccm_author_activityhelpПомощь по Редактору заданийpaste_btn_tooltipВставить копию выделенного заданияact_tool_titleИнструментарий Заданийld_val_activity_columnЗаданиеpi_activity_type_gateЗадание затвораpi_activity_type_groupingГрупповое заданиеcv_design_export_unsavedВы не можете экспортировать не сохраненный проект.cv_activity_copy_invalidИзвините! У Вас нет прав скопировать это дочернее задание.pi_lbl_currentgroupТекущая группировкаws_chk_overwrite_resourceВнимание, Вы собираетесь перезаписать ресурс!open_btn_tooltipПоказать диалог выбора файлов для открытия последовательности заданийcv_activity_cut_invalidИзвините! У Вас нет прав вырезать это дочернее задание.al_cannot_move_activityИзвините, Вы не можете переместить это задание.pi_group_typeГруппировка типаws_click_folder_fileПожалуйста, выберите Каталог для сохранения или Проект для его перезаписиws_no_permissionЖаль, Вы не имеете прав на запись в этот ресурсtrans_dlg_titleПереходsys_error_msg_finishВы, возможно, должны перезапустить LAMS Author , чтобы продолжить. Вы хотите сохранить следующую информацию об этой ошибке, чтобы помочь установить причину этой проблемы?ws_del_confirm_msgВы уверены, что хотите удалить этот файл/папку?mnu_file_exitВыходapp_chk_langloadЯзыковые данные не были загруженыapp_fail_continueВыполнение программы не может быть продолжено. Пожалуйста свяжитесь с группой поддержкиchosen_grp_lblВыбратьcv_invalid_trans_targetВы не можете создать переход к этому объектуmnu_edit_cutВырезатьmnu_file_newНовыйnew_btnНовыйnew_confirm_msgВы уверены, что хотите заменить текущий проект пустым новым?pi_runofflineВыполнить автономноal_activity_copy_invalidИзвините! Вы должны выбрать задание, перед тем как его копироватьmnu_tools_transДобавить переходprefix_copyofКопироватьlicense_not_selectedВы не выбрали лицензии. Сделайте это, пожалуйста.mnu_tools_optСоздать контейнер опциональных заданийprefs_dlg_cancelОтменитьprefs_dlg_lng_lblЯзыкprefs_dlg_theme_lblТемаpreview_btnПредварительный просмотрproperty_inspector_titleСвойстваrandom_grp_lblСлучайноrename_btnПереименоватьsave_btnСохранитьsched_act_lblРасписаниеsynch_act_lblСинхронизироватьtrans_dlg_cancelОтменитьtrans_dlg_gateСинхронизацияtrans_dlg_gatetypecmbТипws_RootКорневой каталогact_lock_chkПеред тем как делать это задание опциональным, разблокируйте, пожалуйста, контейнер опциональных заданий.ws_copy_same_folderКаталоги Источника и Получателя совпадаютws_dlg_cancel_buttonОтменитьws_dlg_filenameИмя файлаws_dlg_location_buttonРасположениеws_dlg_open_btnОткрытьws_dlg_properties_buttonСвойстваws_dlg_save_btnСохранитьws_dlg_titleРабочая средаws_newfolder_cancelОтменитьws_newfolder_insПожалуйста введите новое имя папкиws_rename_insПожалуйста введите новое имяws_tree_mywspМоя рабочая средаws_view_license_buttonПосмотретьsys_error_msg_startПроизошла следующая ошибка системы:sys_errorСистемная ошибкаal_sendОтправитьws_license_comment_lblДополнительные сведения о лицензииmnu_help_helpСоздание помощиws_click_file_openПожалуйста нажмите на Проект, чтобы его открыть.pi_num_groupsЧисло группcv_invalid_trans_target_to_activityПереход к {0} уже существуетcv_design_unsavedПроект изменен. Продолжить без сохранения?gate_btn_tooltipСоздать точку остановкиmnu_file_exportЭкспортws_no_file_openФайлы не найдены.mnu_file_importИмпортcv_readonly_lblТолько чтениеcv_autosave_rec_titleПредупреждениеpi_lbl_titleЗаглавиеpi_minsМинутыal_alertПредупреждениеal_cancelОтменитьal_confirmПодтвердитьapp_chk_themeloadДанные темы не были загруженыcopy_btnКопироватьcv_show_validationРазрешение проблемcv_valid_design_savedПоздравления! - Ваш проект прошёл верификацию и был сохраненdb_datasend_confirmСпасибо за Отправку данных на серверdelete_btnУдалитьgroup_btnГруппаgrouping_act_titleГруппироватьld_val_doneЗакончитьld_val_issue_columnПроблемаld_val_titleКонтроль ошибокmnu_editПравкаmnu_edit_copyКопироватьmnu_edit_pasteВставитьmnu_edit_redoВернутьmnu_edit_undoОтменитьmnu_fileФайлmnu_file_closeЗакрытьal_okОКmnu_file_openОткрытьmnu_file_saveСохранитьmnu_file_saveasСохранить как...mnu_helpПомощьmnu_help_abtО LAMSmnu_toolsСервисopen_btnОткрытьoptional_btnОпцииpaste_btnВставитьperm_act_lblПраваpi_hoursЧасыpi_lbl_descОписаниеpi_no_groupingНетpi_titleСвойстваsequence_act_titleПоследовательностьpi_condmatch_btn_lblЗадать условияcondmatch_dlg_cond_lst_lblУсловияpi_defaultBranch_cb_lblпо умолчаниюto_conditions_dlg_add_btn_lbl+ Добавитьto_conditions_dlg_clear_all_btn_lblОчистить всеto_conditions_dlg_remove_item_btn_lbl - Удалитьto_conditions_dlg_from_lblотto_conditions_dlg_to_lblдоto_conditions_dlg_range_lblПромежутокbranch_mapping_dlg_condition_col_lblУсловиеbranch_mapping_dlg_group_col_lblГруппаbranch_mapping_dlg_condition_col_valueВ промежутке от {0} до {1}ws_license_lblЛицензияws_file_name_emptyИзвините! Вы не можете сохранить проект с неопределенным названием файла.al_empty_designИзвините, Вы не можете сохранить пустой проектtrans_btnПереходgroupmatch_dlg_groups_lst_lblГруппыto_condition_start_valueначальное значениеto_condition_end_valueконечно значениеal_continueПродолжитьpreview_btn_tooltipПредварительный просмотр вашей последовательности, так как это будет показано для учениковal_activity_openContent_invalidПрежде чем нажать на пункт меню Открыть/Редактировать содержание задания, Вы должны выбрать какое-нибудь задание.cv_invalid_trans_circular_sequenceНельзя создавать замкнутые последовательностиbranch_mapping_dlg_condition_linked_singleЭто условиеoptional_act_btnЗаданиеoptional_seq_btnПоследовательностьlbl_num_sequences{0} - Последовательностейpi_actЗаданияpi_seqПоследовательностиpi_max_actМаксимум {0}pi_min_actМинимум {0}ws_dlg_ok_buttonОКtrans_dlg_okОКws_newfolder_okОКprefs_dlg_okОКbranching_act_titleРазветвлениеpi_activity_type_sequenceПоследовательностьcondmatch_dlg_title_lblОпределить соотвествие ветвей условиямchosen_branch_act_lblВыбор преподавателяpi_define_monitor_cb_lblОпределить позжеgroupmatch_dlg_title_lblОпределить соотвествие групп ветвямbranch_btnРазветвлениеbranch_mapping_no_branch_msgНе была выбрана ветвь.branch_mapping_dlg_branch_col_lblВетвьbranch_mapping_auto_condition_msgВсе оставшиеся Условия будут относиться к дефолтовой Ветви.branch_mapping_dlg_branches_lst_lblВетвиsequence_act_title_new{0} {1}to_conditions_dlg_condition_items_value_col_lblУсловиеclose_mc_tooltipСвернутьws_dlg_insert_btnВставитьbranch_mapping_dlg_branch_item_default{0} (по умолчанию)refresh_btnОбновитьpi_tool_output_matching_btn_lblОпределить соотвествия условий ветвямto_conditions_dlg_defin_user_defined_typeзадано пользователемcv_autosave_rec_msgВы выбрали восстановление предыдущего или несохраненного проекта. Ваш текущий проект будет удален. Желаете продолжить?cv_close_return_to_ext_srcЗакрыть и вернуться к {0}cancel_btn_tooltipВернуться в мониторингstream_reference_lblLAMSto_conditions_dlg_defin_item_fn_lbl{0} ({1})to_conditions_dlg_lt_lblМеньше либо равноbranch_mapping_dlg_condition_col_value_minМеньше либо равно {0}to_conditions_dlg_defin_long_typeдиапазонto_conditions_dlg_defin_bool_typeправда/ложьto_conditions_dlg_options_item_header_lbl[ Условия ]to_conditions_dlg_gte_lblБольше либо равноto_conditions_dlg_lte_lblМеньше либо равноbranch_mapping_dlg_condition_col_value_maxБольше либо равно {0}lbl_num_activities{0} - Заданияcv_gateoptional_hit_chkВы не можете сделать Затвор опциональным заданиемtrans_dlg_nogateНе заданal_doneЗакончитьbranch_mapping_no_condition_msgНе было выбрано Условие.branch_mapping_dlg_condition_col_value_exactЗначение {0}branch_mapping_no_groups_msgНе была выбрана Группа.to_condition_invalid_value_direction {0} не может быть больше, чем {1}.is_remove_warning_msgВНИМАНИЕ: Урок будет удален. Вы хотите сохранить его как {0}? branch_mapping_dlg_condition_linked_allУсловияcv_activityProtected_activity_remove_msgЧтобы удалить это задание, снимите с него отметку {0}.cv_activityProtected_activity_link_msg{0} соединен с {1}.cv_activityProtected_child_activity_link_msgУ {0} существует потомок, соединенный с {1}.optional_seq_btn_tooltipСоздать ряд опциональных последовательностей.flow_btnДвижениеact_seq_lock_chkПеред тем как привязывать это задание к опциональной последовательности, разблокируйте, пожалуйста, контейнер опциональных заданий.branch_mapping_no_mapping_msgНи одного Соотвествия выбрано не было.pi_group_matching_btn_lblОпределить соотвествия групп ветвямal_activity_paste_invalidИзвините, но Вы не можете вставить задание данного типаpreview_btn_tooltip_disabledЧтобы войти в режим Предварительного просмотра Вашего проекта, Вам сначала необходимо сохранить его, а затем нажать кнопку Предварительный просмотрprefix_copyof_countКопия ({0}) ws_entre_file_nameВведите, пожалуйста, имя проекта, а затем нажмите на кнопку Сохранить.validation_error_transitionNoActivityBeforeOrAfterПереход должен иметь задание до или после себяvalidation_error_activityWithNoTransitionЗадание должно иметь входящий или исходящий переходvalidation_error_inputTransitionType1На это задание нет переходаvalidation_error_inputTransitionType2У всех заданий есть входящие переходыvalidation_error_outputTransitionType1Нет перехода из этого заданияvalidation_error_outputTransitionType2У всех заданий есть исходящие переходыcv_invalid_design_on_apply_changesНевозможно применить изменения. Отсутствует один или более переходовapply_changes_btn_tooltipПрименить изменения в проекте и вернуться в мониторингcv_activity_readOnlyЗадание не может быть {0}. Задание только для чтения.cv_eof_finish_invalid_msgЧтобы завершить редактирование, проект не должен содержать ошибокcv_eof_finish_modified_msgВаш проект был изменен. Завершить его без сохранения?cv_trans_readOnlyПереход не может быть {0}. Объект, на который осуществляется переход, только для чтения.about_popup_trademark_lbl{0} - торговая марка {0} Foundation ( {1} ).stream_urlhttp://{0}foundation.orgto_condition_untitled_item_lblБезымянный {0}pi_optSequence_remove_msg_titleУдаленные последовательностиpi_no_seq_actНомер последовательностиws_save_folder_invalidВы не можете сохранить проект в этой директории. Выберите, пожалуйста, подходящую поддиректорию.cv_activity_dbclick_readonlyВы не можете редактировать инструменты, если проект только для чтения. Сохраните, пожалуйста, копию проекта и попробуйте снова.activityDrop_optSequence_error_msgПоместите, пожалуйста, задание в одну из последовательностей.opt_activity_seq_titleКонтейнер опциональных заданийto_conditions_dlg_condition_items_name_col_lblИмяgroupnaming_dialog_col_groupName_lblИмя группыmnu_file_insertdesignВставить/Слить...redundant_branch_mappings_msgПроект содержит неиспользованные соответствия, которые будут удалены. Продолжить?pi_optSequence_remove_msgУдаляемые последовательности могут содержать задания. Эти задания также будут удалены. Все равно удалить?flow_btn_tooltipСоздать задания, управляющие движениемcv_autosave_err_msgПроизошла ошибка при попытке австосохранить Ваш проект. Увеличьте, пожалуйста, размер памяти в настройках вашего Flash Player.cv_edit_on_fly_lblРедактирование "на лету"about_popup_license_lblЭто программа является free software; Вы можете распространять и/или изменять ее при условиях соответствия GNU General Public License version 2 опубликованной Free Software Foundation. {0}gpl_license_urlwww.gnu.org/licenses/gpl.txtgroupnaming_dialog_instructions_lblЧтобы поменять имя, щекните на нем.pi_branch_tool_acts_lblИнструментgroup_branch_act_lblНа основе группgroupnaming_dlg_title_lblНазвания группpi_group_naming_btn_lblНазвания группto_condition_invalid_value_range{0} не может пересекаться с диапазоном другого Условия.ta_iconDrop_optseq_error_msgВ контейнере опциональных заданий нет последовательностей.cv_invalid_optional_seq_activityПеред тем как привязывать {0} к опциональной последовательности, удалите все переходы, связанные с ним.cv_invalid_optional_activity_no_branchesПеред тем как делать {0} опциональным заданием, удалите все разветвления, связанные с ним.pi_mapping_btn_lblЗадать соответствияto_conditions_dlg_title_lblСоздать результирующие Условияto_conditions_dlg_defin_item_header_lbl[Выберите тип результатов]tool_branch_act_lblРезультаты ученикаgrouping_invalid_with_common_names_msgВы не можете сохранить проект, так как групповое задание '{0}' содержит группы с одинаковыми именами. Переименуйте их, пожалуйста, и попробуйте снова.branch_mapping_dlg_match_dgd_lblСоотвествияbranch_mapping_dlg_condtion_items_update_defaultConditions_zeroНевозможно сохранить, так как не заданы Условия. Вам, возможно, потребcv_design_insert_warningКак только вы сольете новую последовательность со старой, у вас не будет возможности отменить это действие - так как ваша новообразованная последовательность будет тутже автоматически сохранена. Чтобы вернуться назад, вам придется удалить все новые задания вручную и затем сохранить. Нажмите кнопку Отменить - чтобы оставить вашу последовательность неизмененной. ОК - чтобы продожить слияние.pi_branch_typeРазветвляющийсяpi_activity_type_branchingРазветвляющиеся заданияcv_invalid_optional_seq_activity_no_branchesПеред тем, как добавлять {0} к опциональной последовательности, удалите все ветви, в которых оно участвует.branch_mapping_dlg_condition_linked_msg{0} соединен с уже существующей ветвью. Продолжить?condmatch_dlg_message_lblЧтобы задать ветвь "по умолчанию", щелкните на флажке "по умолчанию" в свойствах соотвествующей ветви.to_conditions_dlg_condition_items_update_defaultConditionsУсловия для выбранных результирующих определений будут сохранены. Но при этом все ссылки на существующие ветви будут удалены. Продолжить?learner_choice_grp_lblПо выбору ученикаabout_popup_copyright_lbl© 2002-2009 {0} Foundation.bin_tooltipЧтобы удалить задание из последовательности, перетащите его в корзину.cv_eof_changes_appliedИзменения успешно сохранены.competence_editor_add_competence_btnДобавитьws_dlg_date_modified_lblИзменено: {0}ws_save_title_reserved_charsЗаголовок не может содержать символы: {0}mnu_file_import_communityИмпорт из LAMS Community...view_students_before_selectionПросмотреть учеников перед выбором?arrange_act_btnВыстроить заданияsupport_act_btnВспомогательныеsupport_act_btn_tooltipСоздать набор опциональных вспомогательных заданий.support_act_titleВспомогательное заданиеsupport_msg_no_connectionВспомогательные задания не могут быть соеденены с другими заданиямиsupport_msg_invalid_childЗадания типа {0} не могут быть добавлены как вспомогательные заданияsupport_msg_max_children_reachedНе возможно перетащить задание: {0}. Вспомогательное задание позволяет максимум {1} дочерних заданий.support_msg_cannot_be_childНевозможно перетащить вспомогательное задание внутрь другого задания.pi_branch_tool_acts_default--Выбрать--cv_invalid_trans_diff_branchesНевезможно создать переход между заданиями в разных разветвлениях.cv_invalid_branch_target_to_activityРазветвление к {0} уже существует.cv_invalid_branch_target_from_activityРазветвление от {0} уже существует.cv_invalid_trans_closed_sequenceНевозможно создать новый переход к закрытой последовательности.al_group_name_invalid_blankНазвания групп не могут быть пустыми.al_group_name_invalid_existingНазвания групп должны быть уникальными.pi_equal_group_sizesРавные размеры группcompetence_editor_dlgРедактор соответствийcompetences_lblСоответствияcompetence_def_dlgДиалог определения соответствийcompetence_editor_warning_title_existsСоответствие с заголовком {0} уже существует.competence_editor_warning_title_blankЗаголовок соответствия не может быть пустым.map_comptence_btnОпределить соответствияcompetence_mappings_btnОпределения соответствийcompetences_mapped_to_act_lblСоответствияmap_gate_conditions_btnОпределить условия затвораgate_mapping_auto_condition_msgВсе оставшиеся условия будут определены к выбраным затворам с закрытым состоянием.gate_openОткрытgate_closedЗакрытgradebook_output_typeВыходные данные Журналаmnu_tools_prefsНастройкиbranch_btn_tooltipСоздать разветвленияcv_invalid_design_savedВаш проект не прошел верификацию, но он был сохранен, щелкните 'Разрешение проблем', чтобы увидеть причины этого.pi_definelaterОпределить в мониторингеprefs_dlg_titleНастройкиal_cannot_move_to_diff_opt_seqЧтобы переместить задание в другую последовательность в опциональных последовательностях, сначала перетащите задание вне поля опциональной последовательности и затем перетащите его на новое положение внутри опциональной последовательности.competence_editor_warning_competence_mappedСоответствие, которое вы пытаетесь удалить сопоставлено к одному или более заданиям. Удаление соответствия приведет к удалению сопоставления. Вы хотите продолжить?al_activity_view_competence_mappings_invalidВыберите задание, чтобы просмотреть определения соответствий.grp_chk_clear_branch_mappingsПредупреждение: Это действие очистит все существующие определения групп к ветвлениям в данном задании. Вы хотите продолжить? \ No newline at end of file Index: lams_central/conf/flashxml/lams/learner/ru_RU_dictionary.xml =================================================================== diff -u -r90daf84ff3c978e5dd55db7e795c050f6fa81396 -racc8d2acf5b6b0002e0c8129947040a779ab4077 --- lams_central/conf/flashxml/lams/learner/ru_RU_dictionary.xml (.../ru_RU_dictionary.xml) (revision 90daf84ff3c978e5dd55db7e795c050f6fa81396) +++ lams_central/conf/flashxml/lams/learner/ru_RU_dictionary.xml (.../ru_RU_dictionary.xml) (revision acc8d2acf5b6b0002e0c8129947040a779ab4077) @@ -1 +1 @@ -
getDictionary3current_act_tooltipСделайте двойной щелчок, чтобы принять участие в текущем заданииtool tip message for current activity iconln_export_tooltipЭкспорт Ваших вкладов в этот урокtool tip message for export buttonhd_resume_tooltipПерейти к Вашему текущему заданию.tool tip message for resume buttoncompleted_act_tooltipСделайте двойной щелчок, чтобы просмотреть это завершённое заданиеtool tip message for completed activity iconal_doubleclick_todoactivityИзвините, Вы ещё не достигли этого заданияalert message when user double click on the todo activity in the sequence in learner progresshd_exit_lblВыйтиLabel for Exit buttonsys_error_msg_finishВы, возможно, должны перезагрузить это окно браузера, чтобы продолжить. Хотите ли Вы сохранить следующую информацию об этой ошибке, чтобы помочь установить причину этой проблемы?Common System error message finish paragraphal_validation_act_unreachedВы не можете открыть задание, поскольку Вы еще его не достигли.Alert message when clicking on an unreached activity in the progess bar.hd_resume_lblВозобновитьLabel for Resume buttonln_export_btnЭкспортLabel for Export buttonsys_error_msg_startПроизошла следующая ошибка системыCommon System error message starting linesys_errorСистемная ошибкаSystem Error alert window titleal_alertИзвещениеGeneric title for Alert windowal_cancelОтменитьCancel on alert dialogal_confirmПодтвердитьTo Confirm title for LFErrorhd_exit_tooltipВыйдите из среды обучения и закройте окно браузераtool tip message for exit buttonsp_view_lblПросмотреть всёLabel for View All buttonsp_save_lblСохранитьLabel for Save buttonsp_view_tooltipПросмотреть все записи в тетрадиtool tip message for view all buttonsp_save_tooltipСвохранить Ваши записи в тетрадиtool tip message for save buttonsp_title_lblЗаголовокLabel for title field of scratchpad (notebook)sp_panel_lblТетрадьLabel for panel title of scratchpad (notebook)al_okОКOK on alert dialogal_sendОтправитьSend button label on the system error dialogal_timeoutВнимание! Невозможно производить изменения до того, как закончится загрузка. Нажмите ОК, чтобы ее продолжитьAlert message for timeout error when loading learning design. \ No newline at end of file +
getDictionary3current_act_tooltipСделайте двойной щелчок, чтобы принять участие в текущем заданииln_export_tooltipЭкспорт Ваших вкладов в этот урокhd_resume_tooltipПерейти к Вашему текущему заданию.completed_act_tooltipСделайте двойной щелчок, чтобы просмотреть это завершённое заданиеal_doubleclick_todoactivityИзвините, Вы ещё не достигли этого заданияhd_exit_lblВыйтиsys_error_msg_finishВы, возможно, должны перезагрузить это окно браузера, чтобы продолжить. Хотите ли Вы сохранить следующую информацию об этой ошибке, чтобы помочь установить причину этой проблемы?al_validation_act_unreachedВы не можете открыть задание, поскольку Вы еще его не достигли.hd_resume_lblВозобновитьln_export_btnЭкспортsys_error_msg_startПроизошла следующая ошибка системыsys_errorСистемная ошибкаal_alertИзвещениеal_cancelОтменитьal_confirmПодтвердитьhd_exit_tooltipВыйдите из среды обучения и закройте окно браузераsp_view_lblПросмотреть всёsp_save_lblСохранитьsp_view_tooltipПросмотреть все записи в тетрадиsp_save_tooltipСвохранить Ваши записи в тетрадиsp_title_lblЗаголовокsp_panel_lblТетрадьal_okОКal_sendОтправитьal_timeoutВнимание! Невозможно производить изменения до того, как закончится загрузка. Нажмите ОК, чтобы ее продолжитьpermission_gate_tooltipВы не можете пройти дальше этого затвора до тех пор пока преподаватель откроет его.schedule_gate_tooltipЭтот затвор будет открыт {0}synchronise_gate_tooltipЗатвор будет открыт, когда все ученики достигнут этого этапа.not_attempted_act_tooltipВам нужно выполнить другие задания прежде чем перейти к этому.al_act_reached_maxМаксимальное количество вспомогательных заданий уже было достигнуто.pres_panel_lblПрисутствиеpres_colnamelearners_lblУченикиpres_dataproviderloading_lblЗагружается присутствие...support_acts_titleВспомогательные заданияsupport_act_tooltipЩелкните два раза, чтобы участвовать в этом вспомогательном задании \ No newline at end of file Index: lams_central/conf/xdoclet/struts-forms.xml =================================================================== diff -u -r4f33380083bd35fd6d0851de9def290c62ffc3c9 -racc8d2acf5b6b0002e0c8129947040a779ab4077 --- lams_central/conf/xdoclet/struts-forms.xml (.../struts-forms.xml) (revision 4f33380083bd35fd6d0851de9def290c62ffc3c9) +++ lams_central/conf/xdoclet/struts-forms.xml (.../struts-forms.xml) (revision acc8d2acf5b6b0002e0c8129947040a779ab4077) @@ -37,7 +37,6 @@ - Index: lams_central/conf/xdoclet/web-security.xml =================================================================== diff -u -r181a217969dcf7eb7908c0e9244ab51ff462f3a0 -racc8d2acf5b6b0002e0c8129947040a779ab4077 --- lams_central/conf/xdoclet/web-security.xml (.../web-security.xml) (revision 181a217969dcf7eb7908c0e9244ab51ff462f3a0) +++ lams_central/conf/xdoclet/web-security.xml (.../web-security.xml) (revision acc8d2acf5b6b0002e0c8129947040a779ab4077) @@ -37,6 +37,7 @@ /toolcontent/* /development/* /pedagogical_planner/* + /lamscommunity/* /JHB/* Index: lams_central/src/java/org/lamsfoundation/lams/authoring/web/ImportToolContentAction.java =================================================================== diff -u -rbdd916337e3a48589da367f4c8b7705fe3197af2 -racc8d2acf5b6b0002e0c8129947040a779ab4077 --- lams_central/src/java/org/lamsfoundation/lams/authoring/web/ImportToolContentAction.java (.../ImportToolContentAction.java) (revision bdd916337e3a48589da367f4c8b7705fe3197af2) +++ lams_central/src/java/org/lamsfoundation/lams/authoring/web/ImportToolContentAction.java (.../ImportToolContentAction.java) (revision acc8d2acf5b6b0002e0c8129947040a779ab4077) @@ -47,10 +47,12 @@ import org.apache.struts.action.ActionForm; import org.apache.struts.action.ActionForward; import org.apache.struts.action.ActionMapping; +import org.lamsfoundation.lams.config.Registration; import org.lamsfoundation.lams.learningdesign.service.IExportToolContentService; import org.lamsfoundation.lams.usermanagement.User; import org.lamsfoundation.lams.usermanagement.dto.UserDTO; import org.lamsfoundation.lams.usermanagement.service.IUserManagementService; +import org.lamsfoundation.lams.util.Configuration; import org.lamsfoundation.lams.util.FileUtil; import org.lamsfoundation.lams.util.MessageService; import org.lamsfoundation.lams.util.WebUtil; @@ -67,7 +69,8 @@ * @struts.action path = "/authoring/importToolContent" validate = "false" * @struts.action-forward name="upload" path="/toolcontent/import.jsp" * @struts.action-forward name="success" path="/toolcontent/importresult.jsp" - * @struts.action-forward name="successLC" path="/toolcontent/importresultLC.jsp" + * @struts.action-forward name="successLC" + * path="/toolcontent/importresultLC.jsp" * @struts.action-forward name="importLC" path="/toolcontent/importLC.jsp" * * Import tool content servlet. It needs an uploaded learning design zip file. @@ -103,20 +106,26 @@ //display initial page for upload return mapping.findForward("upload"); } else if (StringUtils.equals(param, "importLC")) { - + // Checking the server is registered + Registration reg = Configuration.getRegistration(); + if (reg == null || reg.isEnableLamsCommunityIntegration() == false) { + request.setAttribute("registered", Boolean.FALSE); + } else { + request.setAttribute("registered", Boolean.TRUE); + } + // import from lams community, redirect to sso page if (customCSV != null) { request.setAttribute(AttributeNames.PARAM_CUSTOM_CSV, customCSV); } //display initial lamscommunity import return mapping.findForward("importLC"); } else if (StringUtils.equals(param, "importLCFinish")) { - + // uploading the file from lams commmunity, have to feed the // location from the request - //String learningDesignLocation = WebUtil.readStrParam(request, PARAM_LEARNING_DESIGN_LOCATION); - - String learningDesignLocation = "http://lamscommunity.org/lams/x/downloads?seq_id=712445"; + String learningDesignLocation = WebUtil.readStrParam(request, PARAM_LEARNING_DESIGN_LOCATION); + importLDFromURL(request, learningDesignLocation, customCSV); return mapping.findForward("successLC"); } else { @@ -223,21 +232,21 @@ List toolsErrorMsgs = new ArrayList(); Long ldId = null; - String fileName = FileUtil.generateUniqueContentFolderID() + ".zip"; + String fileExt = WebUtil.readStrParam(request, "ext"); + String fileName = FileUtil.generateUniqueContentFolderID() + "." + fileExt; try { - - // append the lams community auth info - learningDesignLocation = LamsCommunityUtil.appendAuthInfoToURL(learningDesignLocation); - - Integer workspaceFolderUid = null; - //get shared session HttpSession ss = SessionManager.getSession(); //get back login user DTO UserDTO userDto = (UserDTO) ss.getAttribute(AttributeNames.USER); User user = (User) getUserService().findById(User.class, userDto.getUserID()); + // append the lams community auth info + learningDesignLocation = LamsCommunityUtil.appendAuthInfoToURL(learningDesignLocation, user); + + Integer workspaceFolderUid = null; + File designFile = null; String uploadPath = FileUtil.createTempDirectory("_uploaded_learningdesign") + File.separator + FileUtil.getFileName(fileName); Index: lams_central/src/java/org/lamsfoundation/lams/web/DisplayGroupAction.java =================================================================== diff -u -rcd5cef591859ae82025af74f79cf6bf6f9151568 -racc8d2acf5b6b0002e0c8129947040a779ab4077 --- lams_central/src/java/org/lamsfoundation/lams/web/DisplayGroupAction.java (.../DisplayGroupAction.java) (revision cd5cef591859ae82025af74f79cf6bf6f9151568) +++ lams_central/src/java/org/lamsfoundation/lams/web/DisplayGroupAction.java (.../DisplayGroupAction.java) (revision acc8d2acf5b6b0002e0c8129947040a779ab4077) @@ -147,7 +147,7 @@ + "/gradebook/gradebookLearning.do?dispatch=courseLearner&organisationID=" + org.getOrganisationId() + "'," + "750,400,0,0);"; - links.add(new IndexLinkBean("index.coursegradebook.learner", link, "manage-group-button", null)); + links.add(new IndexLinkBean("index.coursegradebook.learner", link, "my-grades-button", null)); } if ((contains(roles, Role.ROLE_GROUP_ADMIN) || contains(roles, Role.ROLE_GROUP_MANAGER) || contains(roles, @@ -176,17 +176,16 @@ + "/gradebook/gradebookMonitoring.do?dispatch=courseMonitor&organisationID=" + org.getOrganisationId() + "'," + "850,400,0,0);"; - moreLinks.add(new IndexLinkBean("index.coursegradebook", link, "manage-group-button", + moreLinks.add(new IndexLinkBean("index.coursegradebook", link, "course-gradebook-button", "index.coursegradebook.tooltip")); } } else {//CLASS_TYPE if (contains(roles, Role.ROLE_GROUP_MANAGER) || contains(roles, Role.ROLE_MONITOR)) - moreLinks.add(new IndexLinkBean("index.coursegradebook", Configuration - .get(ConfigurationKeys.SERVER_URL) - + "/gradebook/ggradebookMonitoring.do?dispatch=courseMonitor&organisationID=" - + org.getParentOrganisation().getOrganisationId() + links.add(new IndexLinkBean("index.addlesson", Configuration.get(ConfigurationKeys.SERVER_URL) + + "/home.do?method=addLesson&courseID=" + org.getParentOrganisation().getOrganisationId() + + "&classID=" + org.getOrganisationId() + "&KeepThis=true&TB_iframe=true&height=480&width=610", "add-lesson-button thickbox" + org.getOrganisationId(), null)); } @@ -302,13 +301,13 @@ if (stateId.equals(OrganisationState.ACTIVE)) { if (contains(roles, Role.ROLE_GROUP_MANAGER) || contains(roles, Role.ROLE_MONITOR)) { lessonLinks.add(new IndexLinkBean("index.monitor", "javascript:openMonitorLesson(" + bean.getId() - + ")")); + + ")", "mycourses-monitor-img", "")); } } else if (stateId.equals(OrganisationState.ARCHIVED)) { if (contains(roles, Role.ROLE_GROUP_MANAGER)) { lessonLinks.add(new IndexLinkBean("index.monitor", "javascript:openMonitorLesson(" + bean.getId() - + ")")); + + ")", "mycourses-monitor-img", "")); } } @@ -320,7 +319,7 @@ + Configuration.get(ConfigurationKeys.SERVER_URL) + "/gradebook/gradebookMonitoring.do?lessonID=" + bean.getId() + "'," + "850,700,0,0);"; - lessonLinks.add(new IndexLinkBean("index.coursegradebookmonitor", link)); + lessonLinks.add(new IndexLinkBean("index.coursegradebookmonitor", link, "mycourses-mark-img", "")); } if (lessonLinks.size() > 0) { Index: lams_central/src/java/org/lamsfoundation/lams/web/LAMSConnectorServlet.java =================================================================== diff -u -rf45cf879dea72c8e1d626058854d9b4b7c91bda2 -racc8d2acf5b6b0002e0c8129947040a779ab4077 --- lams_central/src/java/org/lamsfoundation/lams/web/LAMSConnectorServlet.java (.../LAMSConnectorServlet.java) (revision f45cf879dea72c8e1d626058854d9b4b7c91bda2) +++ lams_central/src/java/org/lamsfoundation/lams/web/LAMSConnectorServlet.java (.../LAMSConnectorServlet.java) (revision acc8d2acf5b6b0002e0c8129947040a779ab4077) @@ -21,15 +21,19 @@ package org.lamsfoundation.lams.web; import java.io.File; +import java.io.FileOutputStream; import java.io.IOException; +import java.io.InputStream; import java.io.PrintWriter; import java.util.HashMap; import java.util.Iterator; import java.util.List; import java.util.Map; +import java.util.Date; import javax.servlet.ServletException; import javax.servlet.http.HttpServlet; +import javax.servlet.http.HttpSession; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import javax.xml.parsers.DocumentBuilder; @@ -40,13 +44,20 @@ import javax.xml.transform.dom.DOMSource; import javax.xml.transform.stream.StreamResult; +import org.jfree.util.Log; import org.lamsfoundation.lams.authoring.web.AuthoringConstants; +import org.lamsfoundation.lams.usermanagement.dto.UserDTO; +import org.lamsfoundation.lams.util.Base64StringToImageUtil; import org.lamsfoundation.lams.util.Configuration; import org.lamsfoundation.lams.util.ConfigurationKeys; import org.lamsfoundation.lams.util.FileUtil; +import org.lamsfoundation.lams.web.session.SessionManager; +import org.lamsfoundation.lams.web.util.AttributeNames; import org.apache.commons.fileupload.DiskFileUpload; import org.apache.commons.fileupload.FileItem; +import org.apache.commons.fileupload.FileUploadException; +import org.apache.commons.io.IOUtils; import org.w3c.dom.Document; import org.w3c.dom.Element; import org.w3c.dom.Node; @@ -258,56 +269,114 @@ String retVal="0"; String newName=""; - if(!commandStr.equals("FileUpload") || !isEnabled(currentFolderStr)) - retVal="203"; - else { - DiskFileUpload upload = new DiskFileUpload(); - try { - List items = upload.parseRequest(request); - - Map fields=new HashMap(); - - Iterator iter = items.iterator(); - while (iter.hasNext()) { - FileItem item = (FileItem) iter.next(); - if (item.isFormField()) - fields.put(item.getFieldName(),item.getString()); - else - fields.put(item.getFieldName(),item); - } - FileItem uplFile=(FileItem)fields.get("NewFile"); - String fileNameLong=uplFile.getName(); - fileNameLong=fileNameLong.replace('\\','/'); - String[] pathParts=fileNameLong.split("/"); - String fileName=pathParts[pathParts.length-1]; - - String nameWithoutExt=getNameWithoutExtension(fileName); - String ext=getExtension(fileName); - File pathToSave=new File(validCurrentDirPath,fileName); - int counter=1; - while(pathToSave.exists()){ - newName=nameWithoutExt+"_"+counter+"."+ext; - retVal="201"; - pathToSave=new File(validCurrentDirPath,newName); - counter++; - } - uplFile.write(pathToSave); - }catch (Exception ex) { - retVal="203"; - } + try { + if(commandStr.equals("PaintUpload")) + newName = createNewPaint(validCurrentDirPath, request); + else if(!commandStr.equals("FileUpload") || !isEnabled(currentFolderStr)) + throw new Exception("Illegal command."); + else + newName = createNewFile(validCurrentDirPath, request); + retVal="201"; + } catch(Exception ex) { + if(debug) System.out.println(ex.getMessage()); + retVal="203"; } - out.println(""); - out.flush(); - out.close(); + if(!commandStr.equals("PaintUpload")) { + out.println(""); + out.flush(); + out.close(); + } else { + // send back URL to new Paint file + String currentWebPath= lamsContextPath + AuthoringConstants.LAMS_WWW_FOLDER + FileUtil.LAMS_WWW_SECURE_DIR + + designFolder + typeStr +"/" + currentFolderStr; + + out.println( currentWebPath + newName); + } if (debug) System.out.println("--- END DOPOST ---"); } + + private String createNewFile(String validCurrentDirPath, HttpServletRequest request) throws FileUploadException, IOException, Exception { + if (debug) System.out.println("--- BEGIN FILE SAVE ---"); + String newName = ""; + DiskFileUpload upload = new DiskFileUpload(); + List items = upload.parseRequest(request); + + Map fields=new HashMap(); + + Iterator iter = items.iterator(); + while (iter.hasNext()) { + FileItem item = (FileItem) iter.next(); + if (item.isFormField()) + fields.put(item.getFieldName(),item.getString()); + else + fields.put(item.getFieldName(),item); + } + + FileItem uplFile = (FileItem)fields.get("NewFile"); + String fileNameLong = uplFile.getName(); + fileNameLong = fileNameLong.replace('\\','/'); + String[] pathParts = fileNameLong.split("/"); + String fileName = pathParts[pathParts.length-1]; + + String nameWithoutExt = getNameWithoutExtension(fileName); + String ext = getExtension(fileName); + + File pathToSave = new File(validCurrentDirPath, fileName); + + int counter=1; + while(pathToSave.exists()){ + fileName = nameWithoutExt+"_"+counter+"."+ext; + pathToSave = new File(validCurrentDirPath, fileName); + counter++; + } + + uplFile.write(pathToSave); + + if (debug) System.out.println("--- END FILE SAVE ---"); + + return fileName; + } + private String createNewPaint(String validCurrentDirPath, HttpServletRequest request) throws IOException { + if (debug) System.out.println("--- BEGIN PAINT SAVE ---"); + + String extension = "png"; + String nameWithoutExt = getUserID() + "_" + String.valueOf(new Date().getTime()); + String fileName = nameWithoutExt + "." + extension; + + File dir = new File(validCurrentDirPath); + File pathToSave = new File(validCurrentDirPath, fileName); + + int counter=1; + while(pathToSave.exists()){ + fileName = nameWithoutExt+"_"+counter+"."+extension; + pathToSave = new File(validCurrentDirPath, fileName); + counter++; + } + + if(!dir.exists()) dir.mkdirs(); + + InputStream is = request.getInputStream(); + FileOutputStream fileos = new FileOutputStream(pathToSave); + + byte[] bs = IOUtils.toByteArray(is); + + fileos.write(bs); + + fileos.flush(); + fileos.close(); + + if (debug) System.out.println("--- END PAINT SAVE ---"); + + return fileName; + } + private void setCreateFolderResponse(String retValue,Node root,Document doc) { Element myEl=doc.createElement("Error"); myEl.setAttribute("number",retValue); @@ -383,5 +452,12 @@ realBaseDir = Configuration.get(ConfigurationKeys.LAMS_EAR_DIR) + File.separator + FileUtil.LAMS_WWW_DIR + File.separator + baseDir; lamsContextPath = "/" + Configuration.get(ConfigurationKeys.SERVER_URL_CONTEXT_PATH) +"/"; } + + private String getUserID() { + HttpSession ss = SessionManager.getSession(); + UserDTO user = (UserDTO) ss.getAttribute(AttributeNames.USER); + return user != null ? user.getUserID().toString() : ""; + } + } Index: lams_central/src/java/org/lamsfoundation/lams/web/tag/UserTag.java =================================================================== diff -u -r08950e1090443c3423a3d1c587416a2fccd8bbdf -racc8d2acf5b6b0002e0c8129947040a779ab4077 --- lams_central/src/java/org/lamsfoundation/lams/web/tag/UserTag.java (.../UserTag.java) (revision 08950e1090443c3423a3d1c587416a2fccd8bbdf) +++ lams_central/src/java/org/lamsfoundation/lams/web/tag/UserTag.java (.../UserTag.java) (revision acc8d2acf5b6b0002e0c8129947040a779ab4077) @@ -23,6 +23,8 @@ package org.lamsfoundation.lams.web.tag; import java.io.IOException; +import java.net.URLEncoder; +import java.util.TimeZone; import javax.servlet.http.HttpSession; import javax.servlet.jsp.JspException; @@ -31,6 +33,7 @@ import org.apache.log4j.Logger; import org.lamsfoundation.lams.usermanagement.dto.UserDTO; +import org.lamsfoundation.lams.usermanagement.User; import org.lamsfoundation.lams.web.session.SessionManager; import org.lamsfoundation.lams.web.util.AttributeNames; import org.apache.commons.beanutils.PropertyUtils; @@ -94,11 +97,19 @@ Object value = null; try { - value = PropertyUtils.getProperty(user, property); - if( property.equals("flashTheme") || property.equals("htmlTheme")) { + if(property.equals("timeZoneDisplayName")) { + String indexLbl = ((TimeZone) PropertyUtils.getProperty(user, "timeZone")).getID(); + value = URLEncoder.encode(indexLbl, "UTF8"); + } else { + value = PropertyUtils.getProperty(user, property); + } + + if( property.equals("flashTheme") || property.equals("htmlTheme")) { CSSThemeBriefDTO cssTheme = (CSSThemeBriefDTO) value; value = (String) cssTheme.getName(); } + + } catch (Exception e) { log.warn("UserTag unable to write out user details due to exception while accessing property value. User id "+user.getUserID(), e); } Index: lams_central/src/java/org/lamsfoundation/lams/webservice/LessonManagerSoapBindingImpl.java =================================================================== diff -u -r68d2988cca350af15ba4087814f74e1527a71997 -racc8d2acf5b6b0002e0c8129947040a779ab4077 --- lams_central/src/java/org/lamsfoundation/lams/webservice/LessonManagerSoapBindingImpl.java (.../LessonManagerSoapBindingImpl.java) (revision 68d2988cca350af15ba4087814f74e1527a71997) +++ lams_central/src/java/org/lamsfoundation/lams/webservice/LessonManagerSoapBindingImpl.java (.../LessonManagerSoapBindingImpl.java) (revision acc8d2acf5b6b0002e0c8129947040a779ab4077) @@ -100,7 +100,7 @@ // 3. schedule lesson Date date = DateUtil.convertFromLAMSFlashFormat(startDate); monitoringService.startLessonOnSchedule(lesson.getLessonId(), date, userMap.getUser() - .getUserId()); + .getUserId(), null); return lesson.getLessonId(); } catch (Exception e) { throw new RemoteException(e.getMessage(), e); Index: lams_central/src/java/org/lamsfoundation/lams/webservice/xml/LessonManagerServlet.java =================================================================== diff -u -r8d1f1d066f2b63b83bdd630609c527fec153675a -racc8d2acf5b6b0002e0c8129947040a779ab4077 --- lams_central/src/java/org/lamsfoundation/lams/webservice/xml/LessonManagerServlet.java (.../LessonManagerServlet.java) (revision 8d1f1d066f2b63b83bdd630609c527fec153675a) +++ lams_central/src/java/org/lamsfoundation/lams/webservice/xml/LessonManagerServlet.java (.../LessonManagerServlet.java) (revision acc8d2acf5b6b0002e0c8129947040a779ab4077) @@ -217,10 +217,12 @@ element = getToolOutputs(document, serverId, datetime, hashValue, username, lsId, courseId, true); } else if (method.equals("toolOutputsUser")) { lsId = new Long(lsIdStr); - element = getToolOutputsForUser(document, serverId, datetime, hashValue, username, lsId, courseId, false, outputsUser); + element = getToolOutputsForUser(document, serverId, datetime, hashValue, username, lsId, courseId, + false, outputsUser); } else if (method.equals("authoredToolOutputsUser")) { lsId = new Long(lsIdStr); - element = getToolOutputsForUser(document, serverId, datetime, hashValue, username, lsId, courseId, true, outputsUser); + element = getToolOutputsForUser(document, serverId, datetime, hashValue, username, lsId, courseId, + true, outputsUser); } else { String msg = "Method :" + method + " is not recognised"; log.error(msg); @@ -279,7 +281,7 @@ * if an error occurred */ public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { - doGet(request, response); + doGet(request, response); } public Long startLesson(String serverId, String datetime, String hashValue, String username, long ldId, @@ -323,7 +325,7 @@ createLessonClass(lesson, orgMap.getOrganisation(), userMap.getUser()); // 3. schedule lesson Date date = DateUtil.convertFromLAMSFlashFormat(startDate); - monitoringService.startLessonOnSchedule(lesson.getLessonId(), date, userMap.getUser().getUserId()); + monitoringService.startLessonOnSchedule(lesson.getLessonId(), date, userMap.getUser().getUserId(), null); return lesson.getLessonId(); } catch (Exception e) { throw new RemoteException(e.getMessage(), e); @@ -701,8 +703,8 @@ /** * - * This method gets the tool outputs for an entire lesson and returns - * them in an XML format. + * This method gets the tool outputs for an entire lesson and returns them + * in an XML format. * * @param document * @param serverId @@ -740,7 +742,8 @@ Iterator learnerIterator = lesson.getAllLearners().iterator(); while (learnerIterator.hasNext()) { User learner = (User) learnerIterator.next(); - toolOutputsElement.appendChild(getLearnerOutputsElement(document, learner, lesson, activities, isAuthoredToolOutputs)); + toolOutputsElement.appendChild(getLearnerOutputsElement(document, learner, lesson, activities, + isAuthoredToolOutputs)); } } else { // TODO: handle this error instead of throwing an exception @@ -759,7 +762,7 @@ /** * - * This method gets the tool outputs for a specific user in a lesson and + * This method gets the tool outputs for a specific user in a lesson and * returns them in XML format. * * @param document @@ -775,7 +778,8 @@ */ @SuppressWarnings("unchecked") public Element getToolOutputsForUser(Document document, String serverId, String datetime, String hashValue, - String username, Long lsId, String courseID, boolean isAuthoredToolOutputs, String userStr) throws Exception { + String username, Long lsId, String courseID, boolean isAuthoredToolOutputs, String userStr) + throws Exception { try { // Create the root node of the xml document Element toolOutputsElement = document.createElement("ToolOutputs"); @@ -799,8 +803,9 @@ toolOutputsElement.setAttribute(CentralConstants.ATTR_LESSON_ID, "" + lsId); toolOutputsElement.setAttribute("name", lesson.getLessonName()); - - toolOutputsElement.appendChild(getLearnerOutputsElement(document, learner, lesson, activities, isAuthoredToolOutputs)); + + toolOutputsElement.appendChild(getLearnerOutputsElement(document, learner, lesson, activities, + isAuthoredToolOutputs)); } } else { // TODO: handle this error instead of throwing an exception @@ -841,11 +846,10 @@ LearnerProgress learnerProgress = monitoringService.getLearnerProgress(learner.getUserId(), lesson .getLessonId()); - if (learnerProgress != null) - { + if (learnerProgress != null) { learnerElement.setAttribute("completedLesson", "" + learnerProgress.isComplete()); } - + /* * Hibernate CGLIB is failing to load the first activity in * the sequence as a ToolActivity for some mysterious reason @@ -924,15 +928,16 @@ for (String outputName : map.keySet()) { try { - + ToolOutputDefinition definition = map.get(outputName); + if (isAuthoredToolOutputs) { Set activityEvaluations = toolAct.getActivityEvaluations(); if (activityEvaluations != null) { for (ActivityEvaluation evaluation : activityEvaluations) { if (outputName.equals(evaluation.getToolOutputDefinition())) { ToolOutput toolOutput = toolService.getOutputFromTool(outputName, toolSession, learner.getUserId()); - activityElement.appendChild(getOutputElement(document, toolOutput)); + activityElement.appendChild(getOutputElement(document, toolOutput, definition)); } } } @@ -941,7 +946,7 @@ .getUserId()); if (toolOutput != null) { - activityElement.appendChild(getOutputElement(document, toolOutput)); + activityElement.appendChild(getOutputElement(document, toolOutput, definition)); } @@ -965,30 +970,49 @@ * @param toolOutput * @return */ - private Element getOutputElement(Document document, ToolOutput toolOutput) { + private Element getOutputElement(Document document, ToolOutput toolOutput, ToolOutputDefinition definition) { Element toolOutputElement = document.createElement("ToolOutput"); toolOutputElement.setAttribute("name", toolOutput.getName()); toolOutputElement.setAttribute("description", toolOutput.getDescription()); toolOutputElement.setAttribute("output", toolOutput.getValue().getString()); + Long marksPossible = getTotalMarksAvailable(definition); + + toolOutputElement.setAttribute("marksPossible", (marksPossible != null) ? marksPossible.toString() : ""); + String type; OutputType outputType = toolOutput.getValue().getType(); - + if (outputType == OutputType.OUTPUT_BOOLEAN) { type = "boolean"; - } else if (outputType == OutputType.OUTPUT_COMPLEX){ + } else if (outputType == OutputType.OUTPUT_COMPLEX) { type = "complex"; - } else if (outputType == OutputType.OUTPUT_DOUBLE){ + } else if (outputType == OutputType.OUTPUT_DOUBLE) { type = "double"; - } else if (outputType == OutputType.OUTPUT_LONG){ + } else if (outputType == OutputType.OUTPUT_LONG) { type = "long"; - } else if (outputType == OutputType.OUTPUT_SET_BOOLEAN){ + } else if (outputType == OutputType.OUTPUT_SET_BOOLEAN) { type = "set_boolean"; } else { type = "string"; } - + toolOutputElement.setAttribute("type", type); return toolOutputElement; } + + /** + * Gets the total marks available for a tool output definition + * + * @param activity + * @return + */ + private Long getTotalMarksAvailable(ToolOutputDefinition definition) { + + Object upperLimit = definition.getEndValue(); + if (upperLimit != null && upperLimit instanceof Long) { + return (Long) upperLimit; + } + return null; + } } Index: lams_central/src/java/org/lamsfoundation/lams/workspace/service/WorkspaceManagementService.java =================================================================== diff -u -red0cc400ab00e2c188be1f4227532770fec5a6e7 -racc8d2acf5b6b0002e0c8129947040a779ab4077 --- lams_central/src/java/org/lamsfoundation/lams/workspace/service/WorkspaceManagementService.java (.../WorkspaceManagementService.java) (revision ed0cc400ab00e2c188be1f4227532770fec5a6e7) +++ lams_central/src/java/org/lamsfoundation/lams/workspace/service/WorkspaceManagementService.java (.../WorkspaceManagementService.java) (revision acc8d2acf5b6b0002e0c8129947040a779ab4077) @@ -330,7 +330,7 @@ getFolderContent(workspaceFolder,permissions,mode,contentDTO,user); if(workspaceFolder.hasSubFolders()) getSubFolderDetails(workspaceFolder,user,contentDTO, skipFolder); - Vector repositoryContent = getContentsFromRepository(workspaceFolder,permissions); + Vector repositoryContent = getContentsFromRepository(workspaceFolder,permissions,user); if(repositoryContent!=null) contentDTO.addAll(repositoryContent); } else { @@ -364,7 +364,7 @@ if ( skipFolderID==null || ! skipFolderID.equals(subFolder.getWorkspaceFolderId()) ) { Integer permissions = getPermissions(subFolder, user); if ( permissions!=WorkspaceFolder.NO_ACCESS) { - subFolderContent.add(new FolderContentDTO(subFolder,permissions)); + subFolderContent.add(new FolderContentDTO(subFolder,permissions, user)); } } } @@ -433,11 +433,14 @@ Iterator iterator = designs.iterator(); while(iterator.hasNext()){ LearningDesign design = (LearningDesign)iterator.next(); + FolderContentDTO folder; if ( design.getUser() != null && design.getUser().equals(user) ) { - folderContent.add(new FolderContentDTO(design,WorkspaceFolder.OWNER_ACCESS)); + folder = new FolderContentDTO(design, WorkspaceFolder.OWNER_ACCESS, user); } else { - folderContent.add(new FolderContentDTO(design,folderPermissions)); + folder = new FolderContentDTO(design, folderPermissions, user); } + + folderContent.add(folder); } return folderContent; @@ -1082,7 +1085,7 @@ * @throws RepositoryCheckedException * @throws Exception */ - private Vector getContentsFromRepository(WorkspaceFolder workspaceFolder, Integer permissions) throws RepositoryCheckedException{ + private Vector getContentsFromRepository(WorkspaceFolder workspaceFolder, Integer permissions, User user) throws RepositoryCheckedException{ log.debug("Trying to get contents from folder "+ workspaceFolder.getName()); Set children = workspaceFolder.getChildWorkspaceFolders(); if(children!=null){ @@ -1098,7 +1101,7 @@ while(contentIterator.hasNext()){ WorkspaceFolderContent workspaceFolderContent = (WorkspaceFolderContent)contentIterator.next(); SortedSet set = repositoryService.getVersionHistory(ticket,workspaceFolderContent.getUuid()); - repositoryContent.add(new FolderContentDTO(permissions, workspaceFolderContent, set)); + repositoryContent.add(new FolderContentDTO(permissions, workspaceFolderContent, set, user)); } return repositoryContent; } @@ -1152,7 +1155,7 @@ if (hasWriteAccess(roles)) { Integer permission = getPermissions(orgFolder,user); if ( !permission.equals(WorkspaceFolder.NO_ACCESS) ) { - folders.add(new FolderContentDTO(orgFolder,permission)); + folders.add(new FolderContentDTO(orgFolder,permission,user)); } } } @@ -1187,7 +1190,7 @@ WorkspaceFolder privateFolder = workspace.getDefaultFolder(); if ( privateFolder != null ) { Integer permissions = getPermissions(privateFolder,user); - return new FolderContentDTO(privateFolder, permissions); + return new FolderContentDTO(privateFolder, permissions, user); } else { log.warn("getUserWorkspaceFolder: User "+userID+" does not have a root folder. Returning no folders."); } @@ -1219,7 +1222,7 @@ if(publicFolder != null) { publicFolder.setName(messageService.getMessage("public.folder")); Integer permissions = getPermissions(publicFolder, user); - return new FolderContentDTO(publicFolder, permissions); + return new FolderContentDTO(publicFolder, permissions, user); } } Index: lams_central/web/WEB-INF/tiles/tiles-defs.xml =================================================================== diff -u -rda2924f4d15aa5587ed5e5dc7152b850994bdd87 -racc8d2acf5b6b0002e0c8129947040a779ab4077 --- lams_central/web/WEB-INF/tiles/tiles-defs.xml (.../tiles-defs.xml) (revision da2924f4d15aa5587ed5e5dc7152b850994bdd87) +++ lams_central/web/WEB-INF/tiles/tiles-defs.xml (.../tiles-defs.xml) (revision acc8d2acf5b6b0002e0c8129947040a779ab4077) @@ -35,7 +35,7 @@ - + @@ -56,11 +56,4 @@ - - - - - - - \ No newline at end of file Index: lams_central/web/WEB-INF/web.xml =================================================================== diff -u -rf0bef7d11b4f82936c417e6e55c25fe9bfdb9a82 -racc8d2acf5b6b0002e0c8129947040a779ab4077 --- lams_central/web/WEB-INF/web.xml (.../web.xml) (revision f0bef7d11b4f82936c417e6e55c25fe9bfdb9a82) +++ lams_central/web/WEB-INF/web.xml (.../web.xml) (revision acc8d2acf5b6b0002e0c8129947040a779ab4077) @@ -235,6 +235,11 @@ + PresenceChatLoggerServlet + org.lamsfoundation.lams.webservice.PresenceChatLoggerServlet + + + updateCollapsedGroup org.lamsfoundation.lams.web.UpdateCollapsedGroupServlet @@ -462,6 +467,10 @@ /fckeditor/editor/filemanager/upload/simpleuploader + PresenceChatLoggerServlet + /PresenceChatLogger + + updateCollapsedGroup /servlet/updateCollapsedGroup @@ -623,7 +632,6 @@ /admin.jsp /author.jsp /authoringConfirm.jsp - /community.jsp /editprofile.jsp /findUserLessons.jsp /findUserLessonsAutocomplete.jsp @@ -653,6 +661,7 @@ /toolcontent/* /development/* /pedagogical_planner/* + /lamscommunity/* /JHB/* Fisheye: Tag acc8d2acf5b6b0002e0c8129947040a779ab4077 refers to a dead (removed) revision in file `lams_central/web/community.jsp'. Fisheye: No comparison available. Pass `N' to diff? Index: lams_central/web/css/ramsthemeHTML.css =================================================================== diff -u -r4f68a533e24967e0185132c5e361a8a054f43941 -racc8d2acf5b6b0002e0c8129947040a779ab4077 --- lams_central/web/css/ramsthemeHTML.css (.../ramsthemeHTML.css) (revision 4f68a533e24967e0185132c5e361a8a054f43941) +++ lams_central/web/css/ramsthemeHTML.css (.../ramsthemeHTML.css) (revision acc8d2acf5b6b0002e0c8129947040a779ab4077) @@ -1,332 +1,330 @@ -a { - color: #b9313d; - border-bottom: 1px dotted #b9313d; - -} - -a:hover { - color: #b9313d; - border-bottom: 1px solid #b9313d; - -} - -a:hover.button-add-item { - color: #f98c3d; -} - -h1 {color:#f88431; - } - -h1.no-tabs-below { - color:#f88431; - } - -h2 {color:#b9313d; - } +a { + color: #b9313d; + border-bottom: 1px dotted #b9313d; +} + +a:hover { + color: #b9313d; + border-bottom: 1px solid #b9313d; + +} + +a:hover.button-add-item { + color: #f98c3d; +} + +h1 {color:#f88431; + } + +h1.no-tabs-below { + color:#f88431; + } + +h2 {color:#b9313d; + } + span.h2font {color:#b9313d; font-size:14px; } - -h3 {color:#f88431; - } - -h4 {color:#b9313d; - } - - -/* LOGIN */ - -#login-left-col h2 { - color:#b9313d; -} - -#login-left-col h3 { - color:#f98c3d; - margin-bottom:5px; -} - -#login-right-col h2 { - color:#f98c3d; -} - -#login-right-col a:hover.button { - background:url('../images/ramsthemecss/btn_over.gif') repeat-x 0px 0px; - color:#f98c3d; -} - -#login-right-col p.version { - color:#ccc; -} - -#content a:hover.button-add-item { - color: #f98c3d; -} - -#footer a{ /*layout of the footer - the bottom of the box */ - color:#999; - border-bottom:1px solid #999; -} - -#footer { /*layout of the footer - the bottom of the box */ - background: url('../images/ramsthemecss/footer_bg.jpg') no-repeat bottom; -} - -#login-page #footer { /*layout of the footer - the bottom of the box */ - background: url('../images/ramsthemecss/footer_bg.jpg') no-repeat top; -} - -#page-mycourses #footer { /*layout of the footer - the bottom of the box */ - background: url('../images/ramsthemecss/footer_bg.jpg') no-repeat top; -} - -/* MY COURSES - AUTHOR */ - -#content { - background: url('../images/ramsthemecss/body_bg.jpg') repeat-y; -} - -#login-content { - background:url('../images/ramsthemecss/body_bg.jpg') repeat-y; -} - - -#content a { - color: #f98c3d; - border-bottom: 1px dotted #f98c3d; -} - -#content a:hover { - color: #f98c3d; - border-bottom: 1px solid #f98c3d; -} - -#content a:hover.button { - background: url('../images/ramsthemecss/btn_over.gif') repeat-x 0px 0px; - color: #f98c3d; -} - -#saveCancelButtons a:hover.button { - background: url('../images/ramsthemecss/btn_over.gif') repeat-x 0px 2px; - color: #f98c3d; -} - -a:hover.button { - background: url('../images/ramsthemecss/btn_over.gif') repeat-x 0px 0px; - color: #f98c3d; -} - -a:hover.button-add-item { - color: #f98c3d; -} - -#content a:hover.add-lesson-button { - color: #f98c3d; -} - -#content a:hover.#content a.sequence-name-link { - color: #f98c3d; - } - -#content a:hover.button-add-item { - color: #f98c3d; -} - -.course-bg h2 { - color:#333; -} - -.course-bg h4 { - color:#333; -} - - -#content a.sequence-action-link { - color:#f98c3d; - } - -#content a:hover.sequence-action-link { - color:#f98c3d; - - } - -#content a.add-lesson-button { - background: url('../images/ramsthemecss/add_lesson.jpg') no-repeat 0px 0px; -} - -#content a:hover.add-lesson-button { - background: url('../images/ramsthemecss/add_lesson.jpg') no-repeat 0px 0px; -} - + +h3 {color:#f88431; + } + +h4 {color:#b9313d; + } + + +/* LOGIN */ + +#login-left-col h2 { + color:#b9313d; +} + +#login-left-col h3 { + color:#f98c3d; + margin-bottom:5px; +} + +#login-right-col h2 { + color:#f98c3d; +} + +#login-right-col a:hover.button { + background:url('../images/ramsthemecss/btn_over.gif') repeat-x 0px 0px; + color:#f98c3d; +} + +#login-right-col p.version { + color:#ccc; +} + +#content a:hover.button-add-item { + color: #f98c3d; +} + +#footer a{ /*layout of the footer - the bottom of the box */ + color:#999; + border-bottom:1px solid #999; +} + +#footer { /*layout of the footer - the bottom of the box */ +/* background: url('../images/ramsthemecss/footer_bg.jpg') no-repeat bottom; */ +} + +#login-page #footer { /*layout of the footer - the bottom of the box */ + background: url('../images/ramsthemecss/footer_bg.jpg') no-repeat top; +} + +#page-mycourses #footer { /*layout of the footer - the bottom of the box */ +/* background: url('../images/ramsthemecss/footer_bg.jpg') no-repeat top; */ +} + +/* MY COURSES - AUTHOR */ + +#content { +/* background: url('../images/ramsthemecss/body_bg.jpg') repeat-y; */ +} + +#login-content { + background:url('../images/ramsthemecss/body_bg.jpg') repeat-y; +} + + +#content a { + color: #f98c3d; + border-bottom: 1px dotted #f98c3d; +} + +#content a:hover { + color: #f98c3d; + border-bottom: 1px solid #f98c3d; +} + +#content a:hover.button { + background: url('../images/ramsthemecss/btn_over.gif') repeat-x 0px 0px; + color: #f98c3d; +} + +#saveCancelButtons a:hover.button { + background: url('../images/ramsthemecss/btn_over.gif') repeat-x 0px 2px; + color: #f98c3d; +} + +a:hover.button { + background: url('../images/ramsthemecss/btn_over.gif') repeat-x 0px 0px; + color: #f98c3d; +} + +a:hover.button-add-item { + color: #f98c3d; +} + +#content a:hover.add-lesson-button { + color: #f98c3d; +} + +#content a:hover.#content a.sequence-name-link { + color: #f98c3d; + } + +#content a:hover.button-add-item { + color: #f98c3d; +} + +.course-bg h2 { + color:#333; +} + +.course-bg h4 { + color:#333; +} + + +#content a.sequence-action-link { + color:#f98c3d; + } + +#content a:hover.sequence-action-link { + color:#f98c3d; + + } + +#content a.add-lesson-button { + background: url('../images/ramsthemecss/add_lesson.jpg') no-repeat 0px 0px; +} + +#content a:hover.add-lesson-button { + background: url('../images/ramsthemecss/add_lesson.jpg') no-repeat 0px 0px; +} + #page { /*whole layout of page*/ margin: 25px auto; - width: 707px; - background: url('../images/ramsthemecss/rams_logo.gif') no-repeat 526px 10px; -} - -#page-mycourses { /*whole layout of page*/ - margin: 25px auto; - width: 707px; - background: url('../images/ramsthemecss/rams_logo.gif') no-repeat left -7px; - -} - -#nav-right a { - color: #fa944a; -} - -#nav-right a:hover { - color: #f88431; -} - -#nav .tab-middle-link { - color: #fa944a; -} - -#nav a:hover.tab-middle-link { - color: #f88431; -} - - -.field-name-alternative-color { -color:#f88431; -} - -.field-name { -color:#b9313d; -} - -h2 {color:#f88431; } - -table.alternative-color th { - background: url('../images/ramsthemecss/green_bg.jpg') repeat-x; - color: #f88431; -} - -a.button-add-item { - background: url('../images/ramsthemecss/btn_add_off.gif') no-repeat 0px 0px; -} - -#content a.button-add-item { - background: url('../images/ramsthemecss/btn_add_off.gif') no-repeat 0px 0px; -} - -a:hover.button-add-item { - background: url('../images/ramsthemecss/btn_add_over.gif') no-repeat 0px 0px; -} - -#content a:hover.button-add-item { - background: url('../images/ramsthemecss/btn_add_over.gif') no-repeat 0px 0px; -} - -input:hover.button { - background: url('../images/ramsthemecss/btn_over.gif') repeat-x 0px 0px; -} - -.tab-left { /* defines left side of selected tab */ - background: url('../images/ramsthemecss/button_left.jpg') no-repeat top left; -} - -.tab-middle { /* defines middle of selected tab */ - background: url('../images/ramsthemecss/button_bg.jpg') repeat-x; -} - -.tab-right { /* defines right side of selected tab */ - background: url('../images/ramsthemecss/button_right.jpg') no-repeat top right; -} - -.tab-middle-highlight { /* defines middle of selected tab */ - background: url('../images/ramsthemecss/button_highlight_bg.jpg') repeat-x; -} - -.tab-left-highlight { /* defines left side of selected tab */ - background: url('../images/ramsthemecss/button_highlight_left.jpg') no-repeat top left; -} - -.tab-right-highlight { /* defines right side of selected tab */ - background: url('../images/ramsthemecss/button_highlight_right.jpg') no-repeat top right; -} - -#nav a.tab-middle-link-selected { - color: #333333 -} - -body.stripes { - background: url('../images/ramsthemecss/diagonal_bg.gif'); -} - -.my-courses { - background: url('../images/ramsthemecss/diagonal_bg.gif') repeat; -} - -#login-right-col { - background: url('../images/ramsthemecss/lams_login_bar.jpg') no-repeat 0 0; -} - -#header { /*layout of the header */ - background: url('../images/ramsthemecss/top_bg.jpg') no-repeat bottom; -} - -#header-no-tabs { /*layout of the header when no-tabs are required. Big enough to line up with LAMS icon - don't use for learner (see header-no-tabs-learner) */ - background:url('../images/ramsthemecss/top_bg.jpg') no-repeat bottom; -} - -/*layout of the header when no-tabs are required */ -#login-header { - background:url('../images/ramsthemecss/top_bg.jpg') no-repeat bottom; -} - -#header-my-courses { /*layout of the header */ - background: url('../images/ramsthemecss/top_bg.jpg') no-repeat bottom; -} - -.course-bg { /*---- box around the green tabbed items -- */ - background:#fff url('../images/ramsthemecss/mycourses_greytab.jpg') no-repeat top; -} - -.user-img {background: url('../images/ramsthemecss/user.jpg') no-repeat 0 3px; margin-right:5px; padding:5px 0px 5px 25px; -} - -.mycourses-monitor-img {background: url('../images/ramsthemecss/mycourses_monitor.jpg') no-repeat 0 3px; margin-right:5px; padding:5px 0px 5px 25px; -} - -.mycourses-addlesson-img {background: url('../images/ramsthemecss/mycourses_addlesson.jpg') no-repeat 0 3px; margin-right:5px; padding:5px 0px 5px 25px; -} - -/*layout of the forum tables with the colored table heading cell */ -table.forum { - width:93%; - margin-left:20px; - padding-top:5px; - margin-bottom:10px; - background:url('../images/css/greyfade_bg.jpg') repeat-x 3px 49px; - text-align:left; - border-bottom:1px solid #efefef;} - -table.forum th { - background: url('../images/ramsthemecss/orange_bg_forum.jpg') repeat-x #fbe9d3; - height:20px; - padding-top:5px; - color:#f88431; - padding-left:15px; - border-left:1px solid #cacdd1; - font-size:12px; - vertical-align:middle; -} - -table.forum td.posted-by { - background: url('../images/ramsthemecss/postedby_orange_bg.jpg') repeat-x; - height:20px; - padding-left:15px; - padding-top:0px; - font-size:10px; - vertical-align:top; - border-left:1px solid #cacdd1; - color:#666; -} - - -table.forum td { - padding-left:20px; - font-size:11px; - vertical-align:top; -} - + background: url('../images/ramsthemecss/rams_logo.gif') no-repeat 526px 10px; +} + +#page-mycourses { /*whole layout of page*/ + margin: 25px auto; + background: url('../images/ramsthemecss/rams_logo.gif') no-repeat left -7px; + +} + +#nav-right a { + color: #fa944a; +} + +#nav-right a:hover { + color: #f88431; +} + +#nav .tab-middle-link { + color: #fa944a; +} + +#nav a:hover.tab-middle-link { + color: #f88431; +} + + +.field-name-alternative-color { +color:#f88431; +} + +.field-name { +color:#b9313d; +} + +h2 {color:#f88431; } + +table.alternative-color th { + background: url('../images/ramsthemecss/green_bg.jpg') repeat-x; + color: #f88431; +} + +a.button-add-item { + background: url('../images/ramsthemecss/btn_add_off.gif') no-repeat 0px 0px; +} + +#content a.button-add-item { + background: url('../images/ramsthemecss/btn_add_off.gif') no-repeat 0px 0px; +} + +a:hover.button-add-item { + background: url('../images/ramsthemecss/btn_add_over.gif') no-repeat 0px 0px; +} + +#content a:hover.button-add-item { + background: url('../images/ramsthemecss/btn_add_over.gif') no-repeat 0px 0px; +} + +input:hover.button { + background: url('../images/ramsthemecss/btn_over.gif') repeat-x 0px 0px; +} + +.tab-left { /* defines left side of selected tab */ + background: url('../images/ramsthemecss/button_left.jpg') no-repeat top left; +} + +.tab-middle { /* defines middle of selected tab */ + background: url('../images/ramsthemecss/button_bg.jpg') repeat-x; +} + +.tab-right { /* defines right side of selected tab */ + background: url('../images/ramsthemecss/button_right.jpg') no-repeat top right; +} + +.tab-middle-highlight { /* defines middle of selected tab */ + background: url('../images/ramsthemecss/button_highlight_bg.jpg') repeat-x; +} + +.tab-left-highlight { /* defines left side of selected tab */ + background: url('../images/ramsthemecss/button_highlight_left.jpg') no-repeat top left; +} + +.tab-right-highlight { /* defines right side of selected tab */ + background: url('../images/ramsthemecss/button_highlight_right.jpg') no-repeat top right; +} + +#nav a.tab-middle-link-selected { + color: #333333 +} + +body.stripes { + background: url('../images/ramsthemecss/diagonal_bg.gif'); +} + +.my-courses { + background: url('../images/ramsthemecss/diagonal_bg.gif') repeat; +} + +#login-right-col { + background: url('../images/ramsthemecss/lams_login_bar.jpg') no-repeat 0 0; +} + +#header { /*layout of the header */ +/* background: url('../images/ramsthemecss/top_bg.jpg') no-repeat bottom; */ +} + +#header-no-tabs { /*layout of the header when no-tabs are required. Big enough to line up with LAMS icon - don't use for learner (see header-no-tabs-learner) */ + background:url('../images/ramsthemecss/top_bg.jpg') no-repeat bottom; +} + +/*layout of the header when no-tabs are required */ +#login-header { + background:url('../images/ramsthemecss/top_bg.jpg') no-repeat bottom; +} + +#header-my-courses { /*layout of the header */ +/* background: url('../images/ramsthemecss/top_bg.jpg') no-repeat bottom; */ +} + +.course-bg { /*---- box around the green tabbed items -- */ +/* background:#fff url('../images/ramsthemecss/mycourses_greytab.jpg') no-repeat top; */ +} + +.user-img {background: url('../images/ramsthemecss/user.jpg') no-repeat 0 3px; margin-right:5px; padding:5px 0px 5px 25px; +} + +.mycourses-monitor-img {background: url('../images/ramsthemecss/mycourses_monitor.jpg') no-repeat 0 3px; margin-right:5px; padding:5px 0px 5px 25px; +} + +.mycourses-addlesson-img {background: url('../images/ramsthemecss/mycourses_addlesson.jpg') no-repeat 0 3px; margin-right:5px; padding:5px 0px 5px 25px; +} + +/*layout of the forum tables with the colored table heading cell */ +table.forum { + width:93%; + margin-left:20px; + padding-top:5px; + margin-bottom:10px; + background:url('../images/css/greyfade_bg.jpg') repeat-x 3px 49px; + text-align:left; + border-bottom:1px solid #efefef;} + +table.forum th { + background: url('../images/ramsthemecss/orange_bg_forum.jpg') repeat-x #fbe9d3; + height:20px; + padding-top:5px; + color:#f88431; + padding-left:15px; + border-left:1px solid #cacdd1; + font-size:12px; + vertical-align:middle; +} + +table.forum td.posted-by { + background: url('../images/ramsthemecss/postedby_orange_bg.jpg') repeat-x; + height:20px; + padding-left:15px; + padding-top:0px; + font-size:10px; + vertical-align:top; + border-left:1px solid #cacdd1; + color:#666; +} + + +table.forum td { + padding-left:20px; + font-size:11px; + vertical-align:top; +} + Index: lams_central/web/forgotPassword.jsp =================================================================== diff -u -rceedac9ef2ea1ca9125f4654db18505dc824f064 -racc8d2acf5b6b0002e0c8129947040a779ab4077 --- lams_central/web/forgotPassword.jsp (.../forgotPassword.jsp) (revision ceedac9ef2ea1ca9125f4654db18505dc824f064) +++ lams_central/web/forgotPassword.jsp (.../forgotPassword.jsp) (revision acc8d2acf5b6b0002e0c8129947040a779ab4077) @@ -13,7 +13,7 @@ - + <fmt:message key="title.forgot.password"/> @@ -104,47 +104,49 @@
-

+
-
- -

- -
- - - - - - - - - - - - - - - -
-   - - - -
-   - - - -
  - - - - -
- - +

+ +

+ +

+ +

+ +

+ + + + + + + + + + + + + + + +
+   + + + +
+   + + + +
  + + + + +
Index: lams_central/web/forgotPasswordChange.jsp =================================================================== diff -u -rceedac9ef2ea1ca9125f4654db18505dc824f064 -racc8d2acf5b6b0002e0c8129947040a779ab4077 --- lams_central/web/forgotPasswordChange.jsp (.../forgotPasswordChange.jsp) (revision ceedac9ef2ea1ca9125f4654db18505dc824f064) +++ lams_central/web/forgotPasswordChange.jsp (.../forgotPasswordChange.jsp) (revision acc8d2acf5b6b0002e0c8129947040a779ab4077) @@ -16,7 +16,7 @@ - + <fmt:message key="title.forgot.password"/> @@ -70,35 +70,36 @@
-

+
- - - - - - - - - - - - - - - -
- : - - -
- : - - -
  - -
+

+ + + + + + + + + + + + + + + +
+ : + + +
+ : + + +
  + +
Index: lams_central/web/forgotPasswordProc.jsp =================================================================== diff -u -rceedac9ef2ea1ca9125f4654db18505dc824f064 -racc8d2acf5b6b0002e0c8129947040a779ab4077 --- lams_central/web/forgotPasswordProc.jsp (.../forgotPasswordProc.jsp) (revision ceedac9ef2ea1ca9125f4654db18505dc824f064) +++ lams_central/web/forgotPasswordProc.jsp (.../forgotPasswordProc.jsp) (revision acc8d2acf5b6b0002e0c8129947040a779ab4077) @@ -22,7 +22,7 @@ - + <fmt:message key="title.forgot.password"/> @@ -45,27 +45,34 @@
- -

-
-
- <%if (stateStr.equals("0")){out.print("");}%> - - <% - if (stateStr.equals("0")) +

+ + + <% + if (stateStr.equals("0")) { + %> +

+ <% + } else { + %> +

+ <% + } + %> + + + <% + if (emailStr!=null && !emailStr.equals("")) { - out.print(""); - } - else if (emailStr!=null && !emailStr.equals("")) - { out.print(emailStr); } - %> -

-

+ %> +

+ +
Index: lams_central/web/groupContents.jsp =================================================================== diff -u -r4c7972524def37c1472ee59358f25f9e564a8fd3 -racc8d2acf5b6b0002e0c8129947040a779ab4077 --- lams_central/web/groupContents.jsp (.../groupContents.jsp) (revision 4c7972524def37c1472ee59358f25f9e564a8fd3) +++ lams_central/web/groupContents.jsp (.../groupContents.jsp) (revision acc8d2acf5b6b0002e0c8129947040a779ab4077) @@ -30,7 +30,7 @@ " >  - + @@ -71,7 +71,7 @@ " >  - + Index: lams_central/web/includes/javascript/browser_detect.js =================================================================== diff -u -r648b5a8880f3160d027da2c7708b891d6f644751 -racc8d2acf5b6b0002e0c8129947040a779ab4077 --- lams_central/web/includes/javascript/browser_detect.js (.../browser_detect.js) (revision 648b5a8880f3160d027da2c7708b891d6f644751) +++ lams_central/web/includes/javascript/browser_detect.js (.../browser_detect.js) (revision acc8d2acf5b6b0002e0c8129947040a779ab4077) @@ -49,7 +49,7 @@ //initialization, browser, os detection var d, dom, nu='', brow='', ie, ie4, ie5, ie5x, ie6, ie7, ie8; var ns4, moz, moz_rv_sub, release_date='', moz_brow, moz_brow_nu='', moz_brow_nu_sub='', rv_full=''; -var mac, win, old, lin, ie5mac, ie5xwin, konq, saf, op, op4, op5, op6, op7; +var mac, win, old, lin, ie5mac, ie5xwin, konq, saf, saf4, op, op4, op5, op6, op7, chrome; d=document; n=navigator; @@ -76,6 +76,7 @@ saf=(nua.indexOf('Safari')!=-1); konq=(!saf && (nua.indexOf('Konqueror')!=-1) ) ? true : false; moz=( (!saf && !konq ) && ( nua.indexOf('Gecko')!=-1 ) ) ? true : false; +chrome=(nua.indexOf('Chrome')!=-1); ie=((nua.indexOf('MSIE')!=-1)&&!op); if (op) { @@ -87,6 +88,9 @@ { str_pos=nua.indexOf('Safari'); nu=nua.substr((str_pos+7),5); + // checks for webkit 528 or higher introduced + // in safari4 + saf4=(saf&&(nu.substring(0,3)>=528)); brow = 'Safari'; } else if (konq) Index: lams_central/web/includes/javascript/fckconfig_custom.js =================================================================== diff -u -rbe63bba91d20f565a65a1acd05dbac9b01cb8a6e -racc8d2acf5b6b0002e0c8129947040a779ab4077 --- lams_central/web/includes/javascript/fckconfig_custom.js (.../fckconfig_custom.js) (revision be63bba91d20f565a65a1acd05dbac9b01cb8a6e) +++ lams_central/web/includes/javascript/fckconfig_custom.js (.../fckconfig_custom.js) (revision acc8d2acf5b6b0002e0c8129947040a779ab4077) @@ -1,6 +1,6 @@ FCKConfig.ToolbarSets["Default"] = [ ['Source','-','FitWindow', 'Preview','PasteWord','Undo','Redo','Bold','Italic','Underline', '-','Subscript','Superscript','OrderedList','UnorderedList','-','Outdent','Indent','JustifyLeft','JustifyCenter','JustifyRight','JustifyFull','TextColor','BGColor','Equation'], - ['MoviePlayer','VideoRecorder','Image','Link','Table','Rule','Smiley','SpecialChar','Templates','FontFormat','FontName','FontSize','About'] + ['Paint_Button','MoviePlayer','VideoRecorder','Image','Link','Table','Rule','Smiley','SpecialChar','Templates','FontFormat','FontName','FontSize','About'] ] ; FCKConfig.ToolbarSets["Default-Learner"] = [ @@ -46,3 +46,4 @@ FCKConfig.Plugins.Add('equation', 'en'); FCKConfig.Plugins.Add('movieplayer', 'en'); FCKConfig.Plugins.Add('videorecorder', 'en'); +FCKConfig.Plugins.Add('paint', 'en'); \ No newline at end of file Index: lams_central/web/includes/javascript/groupDisplay.js =================================================================== diff -u -r179b09b713c13ec35988ac7c95b9daf603160c5c -racc8d2acf5b6b0002e0c8129947040a779ab4077 --- lams_central/web/includes/javascript/groupDisplay.js (.../groupDisplay.js) (revision 179b09b713c13ec35988ac7c95b9daf603160c5c) +++ lams_central/web/includes/javascript/groupDisplay.js (.../groupDisplay.js) (revision acc8d2acf5b6b0002e0c8129947040a779ab4077) @@ -25,11 +25,12 @@ function toggleGroupContents(element, stateId) { jQuery("a.j-group-header, span.j-group-icon", element).click(function() { var row = jQuery("div.row", element); - var orgId = jQuery(row).parent("div.course-bg").attr("id"); + var courseBg = jQuery(row).parent("div.course-bg"); + var orgId = jQuery(courseBg).attr("id"); var course = jQuery(row).nextAll("div.j-course-contents"); var groupIcon = jQuery("span.j-group-icon", element); if (jQuery(course).html() == null) { - loadGroupContents(orgId, stateId); + loadGroupContents(courseBg, stateId); saveCollapsed(orgId, "false"); jQuery(groupIcon).html(""); } else { @@ -61,7 +62,8 @@ }); } - function loadGroupContents(orgId, stateId) { + function loadGroupContents(courseBg, stateId) { + var orgId = jQuery(courseBg).attr("id"); jQuery.ajax({ url: "displayGroup.do", data: { @@ -70,7 +72,7 @@ display: 'contents' }, success: function(html) { - jQuery("#"+orgId).append(html); + jQuery(courseBg).append(html); registerToolTip(this); } }); Index: lams_central/web/includes/javascript/openUrls.js =================================================================== diff -u -r8176135403562bdf207f9477805d0e092915312a -racc8d2acf5b6b0002e0c8129947040a779ab4077 --- lams_central/web/includes/javascript/openUrls.js (.../openUrls.js) (revision 8176135403562bdf207f9477805d0e092915312a) +++ lams_central/web/includes/javascript/openUrls.js (.../openUrls.js) (revision acc8d2acf5b6b0002e0c8129947040a779ab4077) @@ -33,6 +33,7 @@ if (copyrightWin && !copyrightWin.closed) copyrightWin.close(); if (gradebookMonWin && !gradebookMonWin.closed) gradebookMonWin.close(); if (gradebookLrnWin && !gradebookLrnWin.closed) gradebookLrnWin.close(); + if (gradebookMonLessonWin && !gradebookMonLessonWin.closed) gradebookMonLessonWin.close(); } function openProfile() @@ -318,7 +319,7 @@ if(gradebookMonWin && !gradebookMonWin.closed ){ gradebookMonWin.focus(); }else{ - gradebookMonWin = window.open(url, winname,'resizable,left='+left+',top='+top+',width='+width+',height='+height+',scrollbars'); + gradebookMonWin = window.open(url, "gradebookMonWin",'resizable,left='+left+',top='+top+',width='+width+',height='+height+',scrollbars'); gradebookMonWin.focus(); } } @@ -327,7 +328,7 @@ if(gradebookLrnWin && !gradebookLrnWin.closed ){ gradebookLrnWin.focus(); }else{ - gradebookLrnWin = window.open(url, winname,'resizable,left='+left+',top='+top+',width='+width+',height='+height+',scrollbars'); + gradebookLrnWin = window.open(url, "gradebookLrnWin",'resizable,left='+left+',top='+top+',width='+width+',height='+height+',scrollbars'); gradebookLrnWin.focus(); } } @@ -336,7 +337,7 @@ if(gradebookMonLessonWin && !gradebookMonLessonWin.closed ){ gradebookMonLessonWin.focus(); }else{ - gradebookMonLessonWin = window.open(url, winname,'resizable,left='+left+',top='+top+',width='+width+',height='+height+',scrollbars'); + gradebookMonLessonWin = window.open(url, "gradebookMonLessonWin",'resizable,left='+left+',top='+top+',width='+width+',height='+height+',scrollbars'); gradebookMonLessonWin.focus(); } } Index: lams_central/web/launchlearner.jsp =================================================================== diff -u -r8273ac63e5f1bc6caec5a36ef55483395803826f -racc8d2acf5b6b0002e0c8129947040a779ab4077 --- lams_central/web/launchlearner.jsp (.../launchlearner.jsp) (revision 8273ac63e5f1bc6caec5a36ef55483395803826f) +++ lams_central/web/launchlearner.jsp (.../launchlearner.jsp) (revision acc8d2acf5b6b0002e0c8129947040a779ab4077) @@ -10,7 +10,7 @@ <fmt:message key="index.welcome" /> - + @@ -23,7 +23,7 @@
-

+

Fisheye: Tag acc8d2acf5b6b0002e0c8129947040a779ab4077 refers to a dead (removed) revision in file `lams_central/web/pedagogical_planner/grouping.jsp'. Fisheye: No comparison available. Pass `N' to diff? Index: lams_common/db/sql/create_lams_11_tables.sql =================================================================== diff -u -r4f33380083bd35fd6d0851de9def290c62ffc3c9 -racc8d2acf5b6b0002e0c8129947040a779ab4077 --- lams_common/db/sql/create_lams_11_tables.sql (.../create_lams_11_tables.sql) (revision 4f33380083bd35fd6d0851de9def290c62ffc3c9) +++ lams_common/db/sql/create_lams_11_tables.sql (.../create_lams_11_tables.sql) (revision acc8d2acf5b6b0002e0c8129947040a779ab4077) @@ -1006,8 +1006,8 @@ CREATE TABLE lams_events ( uid BIGINT NOT NULL UNIQUE auto_increment - , scope VARCHAR(255) NOT NULL - , name VARCHAR(255) NOT NULL + , scope VARCHAR(128) NOT NULL + , name VARCHAR(128) NOT NULL , event_session_id BIGINT , triggered TINYINT , default_subject VARCHAR(255) Index: lams_common/src/java/org/lamsfoundation/lams/commonContext.xml =================================================================== diff -u -r2f21856ec2ab85b47c93cfcc3fa2c8769be65077 -racc8d2acf5b6b0002e0c8129947040a779ab4077 --- lams_common/src/java/org/lamsfoundation/lams/commonContext.xml (.../commonContext.xml) (revision 2f21856ec2ab85b47c93cfcc3fa2c8769be65077) +++ lams_common/src/java/org/lamsfoundation/lams/commonContext.xml (.../commonContext.xml) (revision acc8d2acf5b6b0002e0c8129947040a779ab4077) @@ -42,7 +42,7 @@ classpath:org/lamsfoundation/lams/learningdesign/Activity.hbm.xml classpath:org/lamsfoundation/lams/learningdesign/BranchActivityEntry.hbm.xml classpath:org/lamsfoundation/lams/learningdesign/BranchCondition.hbm.xml - classpath:org/lamsfoundation/lams/learningdesign/Group.hbm.xml + classpath:org/lamsfoundation/lams/learningdesign/Group.hbm.xml classpath:org/lamsfoundation/lams/learningdesign/GroupUser.hbm.xml classpath:org/lamsfoundation/lams/learningdesign/Grouping.hbm.xml classpath:org/lamsfoundation/lams/learningdesign/LearningDesign.hbm.xml Index: lams_common/src/java/org/lamsfoundation/lams/dbupdates/patch0015_updateFrom22.sql =================================================================== diff -u -rf0bef7d11b4f82936c417e6e55c25fe9bfdb9a82 -racc8d2acf5b6b0002e0c8129947040a779ab4077 --- lams_common/src/java/org/lamsfoundation/lams/dbupdates/patch0015_updateFrom22.sql (.../patch0015_updateFrom22.sql) (revision f0bef7d11b4f82936c417e6e55c25fe9bfdb9a82) +++ lams_common/src/java/org/lamsfoundation/lams/dbupdates/patch0015_updateFrom22.sql (.../patch0015_updateFrom22.sql) (revision acc8d2acf5b6b0002e0c8129947040a779ab4077) @@ -5,8 +5,10 @@ ----------------------Put all sql statements below here------------------------- +-- LI-192 This script needs to be in updaters - before new tools are deployed +--ALTER TABLE lams_tool ADD COLUMN pedagogical_planner_url TEXT; + -- LDEV-1998 ------------- -ALTER TABLE lams_tool ADD COLUMN pedagogical_planner_url TEXT; ALTER TABLE lams_system_tool ADD COLUMN pedagogical_planner_url TEXT; UPDATE lams_system_tool SET pedagogical_planner_url='pedagogicalPlanner/initGrouping.do' WHERE system_tool_id=1; CREATE TABLE lams_planner_nodes ( @@ -28,6 +30,7 @@ -- LDEV-2074 -------------- ALTER TABLE lams_learning_design ADD COLUMN floating_activity_id BIGINT(20); CREATE INDEX idx_design_floating_act ON lams_learning_design (floating_activity_id ASC); +INSERT INTO lams_learning_activity_type VALUES (15, 'FLOATING'); -- LDEV-1983 -------------- insert into lams_configuration (config_key, config_value, description_key, header_name, format, required) @@ -76,7 +79,8 @@ )TYPE=InnoDB; -- LDEV-2174 ------------- -ALTER TABLE lams_tool DROP COLUMN classpath_addition, context_file; +ALTER TABLE lams_tool DROP COLUMN classpath_addition; +ALTER TABLE lams_tool DROP COLUMN context_file; -- LDEV-2205 ------------ Adding couse level settings for gradebook ALTER TABLE lams_organisation ADD COLUMN enable_monitor_gradebook TINYINT(1) NOT NULL DEFAULT 0; @@ -88,6 +92,7 @@ , activity_id BIGINT(20) NOT NULL , user_id BIGINT (20) NOT NULL , mark DOUBLE PRECISION + , marked_in_gradebook TINYINT(1) NOT NULL DEFAULT 0 , feedback TEXT , INDEX (activity_id, user_id) , CONSTRAINT FK_lams_gradebook_user_activity_1 FOREIGN KEY (activity_id) @@ -114,6 +119,16 @@ -- LDEV-2207 ------------ Adding flag in lesson to release marks for gradebook ALTER TABLE lams_lesson ADD COLUMN marks_released TINYINT DEFAULT 0; +-- LDEV-2165 +ALTER TABLE lams_events modify COLUMN name VARCHAR(128) NOT NULL; +ALTER TABLE lams_events modify COLUMN scope VARCHAR(128) NOT NULL; + +-- LDEV-2125 ------------- +ALTER TABLE lams_user ADD COLUMN timezone TINYINT; + +-- LDEV-2054 +ALTER TABLE lams_grouping ADD COLUMN view_students_before_selection TINYINT DEFAULT 0; + -- LDEV-2197 ------------ Presence Chat Logging CREATE TABLE lams_presence_chat_msgs ( uid bigint NOT NULL auto_increment, @@ -132,6 +147,9 @@ insert into lams_configuration (config_key, config_value, description_key, header_name, format, required) values ('Red5RecordingsUrl','', 'config.red5.recordings.url', 'config.header.red5', 'STRING', 0); +-- disable videorecorder +update lams_learning_library set valid_flag=0 where title="VideoRecorder"; + ----------------------Put all sql statements above here------------------------- -- If there were no errors, commit and restore autocommit to on Index: lams_common/src/java/org/lamsfoundation/lams/events/Event.java =================================================================== diff -u -rdab2e119700d02ac373e69b7c3afeeadf1f21d56 -racc8d2acf5b6b0002e0c8129947040a779ab4077 --- lams_common/src/java/org/lamsfoundation/lams/events/Event.java (.../Event.java) (revision dab2e119700d02ac373e69b7c3afeeadf1f21d56) +++ lams_common/src/java/org/lamsfoundation/lams/events/Event.java (.../Event.java) (revision acc8d2acf5b6b0002e0c8129947040a779ab4077) @@ -196,15 +196,15 @@ } /** - * @hibernate.property column="name" + * @hibernate.property column="name" length="128" * @return */ protected String getName() { return name; } /** - * @hibernate.property column="scope" + * @hibernate.property column="scope" length="128" * @return */ protected String getScope() { Index: lams_common/src/java/org/lamsfoundation/lams/learningdesign/TextSearchCondition.java =================================================================== diff -u -r05db875c7974d705f89231416ff6dfe91a5e70f1 -racc8d2acf5b6b0002e0c8129947040a779ab4077 --- lams_common/src/java/org/lamsfoundation/lams/learningdesign/TextSearchCondition.java (.../TextSearchCondition.java) (revision 05db875c7974d705f89231416ff6dfe91a5e70f1) +++ lams_common/src/java/org/lamsfoundation/lams/learningdesign/TextSearchCondition.java (.../TextSearchCondition.java) (revision acc8d2acf5b6b0002e0c8129947040a779ab4077) @@ -79,15 +79,6 @@ */ protected static final int PATTERN_MATCHING_OPTIONS = Pattern.CASE_INSENSITIVE | Pattern.UNICODE_CASE | Pattern.MULTILINE; - /** - * A regular expression pattern that matches HTML tags. - */ - public static final String HTML_TAG_REGEX = "\\<.*?>"; - /** - * A regular expression pattern that matches end-of-line HTML tags. If needed, it can extented to - * (?:
|
|
|
)
. Right now FCKeditor creates only the first option. - */ - public static final String BR_TAG_REGEX = "
"; private static Logger log = Logger.getLogger(TextSearchCondition.class); /** Index: lams_common/src/java/org/lamsfoundation/lams/lesson/Lesson.java =================================================================== diff -u -r72e01661ffe932634adbe4b229d9ee44d6928a45 -racc8d2acf5b6b0002e0c8129947040a779ab4077 --- lams_common/src/java/org/lamsfoundation/lams/lesson/Lesson.java (.../Lesson.java) (revision 72e01661ffe932634adbe4b229d9ee44d6928a45) +++ lams_common/src/java/org/lamsfoundation/lams/lesson/Lesson.java (.../Lesson.java) (revision acc8d2acf5b6b0002e0c8129947040a779ab4077) @@ -200,6 +200,7 @@ this.learnerProgresses = learnerProgresses; this.liveEditEnabled = liveEditEnabled; this.gradebookUserLessons = new HashSet(); + this.marksReleased = false; } /** * Factory method that create a new lesson. It initialized all necessary Index: lams_common/src/java/org/lamsfoundation/lams/lesson/dao/hibernate/LearnerProgressDAO.java =================================================================== diff -u -r96b3b3ff3f62e1bca1d299f75f512995388e420b -racc8d2acf5b6b0002e0c8129947040a779ab4077 --- lams_common/src/java/org/lamsfoundation/lams/lesson/dao/hibernate/LearnerProgressDAO.java (.../LearnerProgressDAO.java) (revision 96b3b3ff3f62e1bca1d299f75f512995388e420b) +++ lams_common/src/java/org/lamsfoundation/lams/lesson/dao/hibernate/LearnerProgressDAO.java (.../LearnerProgressDAO.java) (revision acc8d2acf5b6b0002e0c8129947040a779ab4077) @@ -55,11 +55,13 @@ "from LearnerProgress p where p.lessonComplete > 0 and p.lesson.id = :lessonId"; private final static String COUNT_ATTEMPTED_ACTIVITY ="select count(*) from LearnerProgress prog, " - +" Activity act where act.id = :activityId and " - +" act in elements(prog.attemptedActivities)"; + +" Activity act join prog.attemptedActivities attAct " + +" where act.id = :activityId and " + +" index(attAct) = act"; private final static String COUNT_COMPLETED_ACTIVITY ="select count(*) from LearnerProgress prog, " - +" Activity act where act.id = :activityId and " - +" act in elements(prog.completedActivities)"; + +" Activity act join prog.completedActivities compAct " + +" where act.id = :activityId and " + +" index(compAct) = act"; private final static String COUNT_PROGRESS_BY_LESSON = "select count(*) from LearnerProgress p where p.lesson.id = :lessonId"; Index: lams_common/src/java/org/lamsfoundation/lams/notebook/model/NotebookEntry.java =================================================================== diff -u -r38a6c414e30497d03559a85b5c33155e4a2fc22e -racc8d2acf5b6b0002e0c8129947040a779ab4077 --- lams_common/src/java/org/lamsfoundation/lams/notebook/model/NotebookEntry.java (.../NotebookEntry.java) (revision 38a6c414e30497d03559a85b5c33155e4a2fc22e) +++ lams_common/src/java/org/lamsfoundation/lams/notebook/model/NotebookEntry.java (.../NotebookEntry.java) (revision acc8d2acf5b6b0002e0c8129947040a779ab4077) @@ -54,6 +54,8 @@ private Date lastModified; + private String lessonName; + public NotebookEntry() {} public NotebookEntry(Long externalID, Integer externalIDType, String externalSignature, User user, String title, String entry, Date createDate) { @@ -167,4 +169,12 @@ public void setLastModified(Date lastModified) { this.lastModified = lastModified; } + + public void setLessonName(String name) { + this.lessonName = name; + } + + public String getLessonName() { + return this.lessonName; + } } Index: lams_common/src/java/org/lamsfoundation/lams/notebook/service/CoreNotebookService.java =================================================================== diff -u -r38a6c414e30497d03559a85b5c33155e4a2fc22e -racc8d2acf5b6b0002e0c8129947040a779ab4077 --- lams_common/src/java/org/lamsfoundation/lams/notebook/service/CoreNotebookService.java (.../CoreNotebookService.java) (revision 38a6c414e30497d03559a85b5c33155e4a2fc22e) +++ lams_common/src/java/org/lamsfoundation/lams/notebook/service/CoreNotebookService.java (.../CoreNotebookService.java) (revision acc8d2acf5b6b0002e0c8129947040a779ab4077) @@ -27,21 +27,28 @@ import java.util.Date; import java.util.List; +import java.util.ArrayList; +import java.util.TreeMap; import org.apache.log4j.Logger; +import org.lamsfoundation.lams.dao.IBaseDAO; +import org.lamsfoundation.lams.lesson.Lesson; import org.lamsfoundation.lams.notebook.dao.INotebookEntryDAO; import org.lamsfoundation.lams.notebook.model.NotebookEntry; import org.lamsfoundation.lams.usermanagement.service.IUserManagementService; import org.lamsfoundation.lams.util.MessageService; import org.lamsfoundation.lams.usermanagement.User; +import org.lamsfoundation.lams.usermanagement.Role; public class CoreNotebookService implements ICoreNotebookService, IExtendedCoreNotebookService{ private static Logger log = Logger.getLogger(CoreNotebookService.class); private INotebookEntryDAO notebookEntryDAO; + + private IBaseDAO baseDAO; protected IUserManagementService userManagementService; @@ -55,6 +62,29 @@ saveOrUpdateNotebookEntry(notebookEntry); return notebookEntry.getUid(); } + + public TreeMap> getEntryByLesson(Integer userID, Integer idType) { + TreeMap> entryMap = new TreeMap>(); + List list = getEntry(userID, idType); + + for (NotebookEntry entry : list) { + if(entryMap.containsKey(entry.getExternalID())) { + String lessonName = (String) entryMap.get(entry.getExternalID()).get(0).getLessonName(); + entry.setLessonName(lessonName); + entryMap.get(entry.getExternalID()).add(entry); + } else { + Lesson lesson = (Lesson) baseDAO.find(Lesson.class, entry.getExternalID()); + List newEntryList = new ArrayList(); + + entry.setLessonName(lesson.getLessonName()); + newEntryList.add(entry); + + entryMap.put(entry.getExternalID(), newEntryList); + } + } + + return entryMap; + } public List getEntry(Long id, Integer idType, String signature, Integer userID) { return notebookEntryDAO.get(id, idType, signature, userID); @@ -111,6 +141,10 @@ this.notebookEntryDAO = notebookEntryDAO; } + public void setBaseDAO(IBaseDAO baseDAO) { + this.baseDAO = baseDAO; + } + /** * * @param IUserManagementService The userManagementService to set. Index: lams_common/src/java/org/lamsfoundation/lams/notebook/service/ICoreNotebookService.java =================================================================== diff -u -r38a6c414e30497d03559a85b5c33155e4a2fc22e -racc8d2acf5b6b0002e0c8129947040a779ab4077 --- lams_common/src/java/org/lamsfoundation/lams/notebook/service/ICoreNotebookService.java (.../ICoreNotebookService.java) (revision 38a6c414e30497d03559a85b5c33155e4a2fc22e) +++ lams_common/src/java/org/lamsfoundation/lams/notebook/service/ICoreNotebookService.java (.../ICoreNotebookService.java) (revision acc8d2acf5b6b0002e0c8129947040a779ab4077) @@ -26,6 +26,7 @@ package org.lamsfoundation.lams.notebook.service; import java.util.List; +import java.util.TreeMap; import org.lamsfoundation.lams.usermanagement.User; import org.lamsfoundation.lams.notebook.model.NotebookEntry; @@ -37,6 +38,8 @@ Long createNotebookEntry(Long id, Integer idType, String signature, Integer userID, String title, String entry); + TreeMap> getEntryByLesson(Integer userID, Integer idType); + List getEntry(Long id, Integer idType, String signature, Integer userID); List getEntry(Long id, Integer idType, String signature); Index: lams_common/src/java/org/lamsfoundation/lams/tool/OutputFactory.java =================================================================== diff -u -r877c6ce4786426422d4e9fad0eac1bf237db2bcf -racc8d2acf5b6b0002e0c8129947040a779ab4077 --- lams_common/src/java/org/lamsfoundation/lams/tool/OutputFactory.java (.../OutputFactory.java) (revision 877c6ce4786426422d4e9fad0eac1bf237db2bcf) +++ lams_common/src/java/org/lamsfoundation/lams/tool/OutputFactory.java (.../OutputFactory.java) (revision acc8d2acf5b6b0002e0c8129947040a779ab4077) @@ -39,268 +39,367 @@ import org.lamsfoundation.lams.learningdesign.BranchCondition; /** - * This class forms the basic implementation of an output definition and output value factory, which is the class in a tool that - * creates the output definition and output values for a tool. Each tool that has outputs should create its own factory class that - * extends this class and uses the methods implemented in this class to create the actual ToolOutputDefinition and ToolOutput objects. + * This class forms the basic implementation of an output definition and output + * value factory, which is the class in a tool that creates the output + * definition and output values for a tool. Each tool that has outputs should + * create its own factory class that extends this class and uses the methods + * implemented in this class to create the actual ToolOutputDefinition and + * ToolOutput objects. * - * The implemented factory (in the tool) needs to supply either (a) its own messageService bean (a Spring bean normally - * defined in the tool's applicationContext file in the toolMessageService property or (b) the name of its I18N language package/filename AND - * the the loadedMessageSourceService (which is defined as a Spring bean in the core context). One of the two options (but not - * both) is required so that the getDescription() method can get the internationalised description of the output definition - * from the tool's internationalisation files. If neither the messageService or the I18N name is not supplied then the name - * if the output definition will appear in the description field. + * The implemented factory (in the tool) needs to supply either (a) its own + * messageService bean (a Spring bean normally defined in the tool's + * applicationContext file in the toolMessageService property or (b) the name of + * its I18N language package/filename AND the the loadedMessageSourceService + * (which is defined as a Spring bean in the core context). One of the two + * options (but not both) is required so that the getDescription() method can + * get the internationalised description of the output definition from the + * tool's internationalisation files. If neither the messageService or the I18N + * name is not supplied then the name if the output definition will appear in + * the description field. * - * The implemented factory should implement public SortedMap getToolOutputDefinitions(Object toolContentObject) - * and this method should call the buildBlahDefinition() calls to build the definitions. + * The implemented factory should implement public SortedMap getToolOutputDefinitions(Object toolContentObject) and + * this method should call the buildBlahDefinition() calls to build the + * definitions. * - * It should also implement two methods similar to SortedMap getToolOutput(List names, various tool objects) and - * ToolOutput getToolOutput(String name, various tool objects) to get the actual outputs. The "various tool objects" will vary from tool to - * tool - some tools may wish to pass in the raw session and user ids, others may pass in specific tool objects. As these inputs will vary - * greatly from tool to tool, no abstract method has been included in this parent class. Putting these calls in the factory allows - * all the "work" of the output generation to be grouped together and it also allows the getToolOutput() logic to get to getDescription() - * logic in the factory. + * It should also implement two methods similar to SortedMap getToolOutput(List names, various tool objects) and + * ToolOutput getToolOutput(String name, various tool objects) to get the actual + * outputs. The "various tool objects" will vary from tool to tool - some tools + * may wish to pass in the raw session and user ids, others may pass in specific + * tool objects. As these inputs will vary greatly from tool to tool, no + * abstract method has been included in this parent class. Putting these calls + * in the factory allows all the "work" of the output generation to be grouped + * together and it also allows the getToolOutput() logic to get to + * getDescription() logic in the factory. * - * Example definitions for tool factories: - * - * - * org.lamsfoundation.lams.tool.mc.ApplicationResources - * - * - * - * - * - * + * Example definitions for tool factories: + * org.lamsfoundation.lams.tool.mc.ApplicationResources + * + * + * + * + * + * */ public abstract class OutputFactory { - protected Logger log = Logger.getLogger(OutputFactory.class); + protected Logger log = Logger.getLogger(OutputFactory.class); - private MessageService toolMessageService; - private ILoadedMessageSourceService loadedMessageSourceService; - private String languageFilename; - private MessageSource msgSource = null; // derived from toolMessageService, loadedMessageSourceService, languageFilename - protected final String KEY_PREFIX = "output.desc."; - protected final String CONDITION_NAME_SEPARATOR = "#"; - - /** Create a map of the tool output definitions, suitable for returning from the method - * getToolOutputDefinitions() in the ToolContentManager interface. The class for the toolContentObject - * will be unique to each tool e.g. for Multiple Choice tool it will be the McContent object. - * - * If the toolContentObject should not be null - if the toolContentId supplied in the call to - * getToolOutputDefinitions(Long toolContentId) does not match to any existing content, the content - * should be the tool's default tool content. - * - * @param toolContentObject - * @return SortedMap of ToolOutputDefinitions where the key is the name from each definition - * @throws ToolException - */ - public abstract SortedMap getToolOutputDefinitions(Object toolContentObject) throws ToolException; + private MessageService toolMessageService; + private ILoadedMessageSourceService loadedMessageSourceService; + private String languageFilename; + private MessageSource msgSource = null; // derived from toolMessageService, loadedMessageSourceService, languageFilename + protected final String KEY_PREFIX = "output.desc."; + protected final String CONDITION_NAME_SEPARATOR = "#"; - /** Tool specific toolMessageService, such as the forumMessageService in the Forum tool */ - private MessageService getToolMessageService() { - return toolMessageService; - } + /** + * Create a map of the tool output definitions, suitable for returning from + * the method getToolOutputDefinitions() in the ToolContentManager + * interface. The class for the toolContentObject will be unique to each + * tool e.g. for Multiple Choice tool it will be the McContent object. + * + * If the toolContentObject should not be null - if the toolContentId + * supplied in the call to getToolOutputDefinitions(Long toolContentId) does + * not match to any existing content, the content should be the tool's + * default tool content. + * + * @param toolContentObject + * @return SortedMap of ToolOutputDefinitions where the key is the name from + * each definition + * @throws ToolException + */ + public abstract SortedMap getToolOutputDefinitions(Object toolContentObject) + throws ToolException; - public void setToolMessageService(MessageService toolMessageService) { - this.toolMessageService = toolMessageService; - } + /** + * Tool specific toolMessageService, such as the forumMessageService in the + * Forum tool + */ + private MessageService getToolMessageService() { + return toolMessageService; + } + public void setToolMessageService(MessageService toolMessageService) { + this.toolMessageService = toolMessageService; + } - /** Set the common loadedMessageSourceService, based on the bean defined in the common Spring context. - * If toolMessageService is not set, then the languageFilename - * and loadedMessageSourceService should be set. */ - private ILoadedMessageSourceService getLoadedMessageSourceService() { - return loadedMessageSourceService; - } + /** + * Set the common loadedMessageSourceService, based on the bean defined in + * the common Spring context. If toolMessageService is not set, then the + * languageFilename and loadedMessageSourceService should be set. + */ + private ILoadedMessageSourceService getLoadedMessageSourceService() { + return loadedMessageSourceService; + } - public void setLoadedMessageSourceService( - ILoadedMessageSourceService loadedMessageSourceService) { - this.loadedMessageSourceService = loadedMessageSourceService; - } + public void setLoadedMessageSourceService(ILoadedMessageSourceService loadedMessageSourceService) { + this.loadedMessageSourceService = loadedMessageSourceService; + } - /** Set the filename/path for the tool's I18N files. If toolMessageService is not set, then the languageFilename - * and loadedMessageSourceService should be set. */ - public String getLanguageFilename() { - return languageFilename; - } + /** + * Set the filename/path for the tool's I18N files. If toolMessageService is + * not set, then the languageFilename and loadedMessageSourceService should + * be set. + */ + public String getLanguageFilename() { + return languageFilename; + } - /** Get the filename and path for the tool's I18N files. */ - public void setLanguageFilename(String languageFilename) { - this.languageFilename = languageFilename; - } + /** Get the filename and path for the tool's I18N files. */ + public void setLanguageFilename(String languageFilename) { + this.languageFilename = languageFilename; + } - /** - * Get the I18N description for this key. If the tool has supplied a messageService, then this - * is used to look up the key and hence get the text. Otherwise if the tool has supplied a I18N - * languageFilename then it is accessed via the shared toolActMessageService. If neither are supplied or - * the key is not found, then any "." in the name are converted to space and this is used as the return value. - * - * This is normally used to get the description for a definition, in whic case the key should be in the format - * output.desc.[definition name], key = definition name and addPrefix = true. For example a - * definition name of "learner.mark" becomes output.desc.learner.mark. - * - * If you want to use this to get an arbitrary string from the I18N files, then set addPrefix = false and the - * output.desc will not be added to the beginning. - */ - protected String getI18NText(String key, boolean addPrefix) { - String translatedText = null; + /** + * Get the I18N description for this key. If the tool has supplied a + * messageService, then this is used to look up the key and hence get the + * text. Otherwise if the tool has supplied a I18N languageFilename then it + * is accessed via the shared toolActMessageService. If neither are supplied + * or the key is not found, then any "." in the name are converted to space + * and this is used as the return value. + * + * This is normally used to get the description for a definition, in whic + * case the key should be in the format output.desc.[definition name], key = + * definition name and addPrefix = true. For example a definition name of + * "learner.mark" becomes output.desc.learner.mark. + * + * If you want to use this to get an arbitrary string from the I18N files, + * then set addPrefix = false and the output.desc will not be added to the + * beginning. + */ + protected String getI18NText(String key, boolean addPrefix) { + String translatedText = null; - MessageSource tmpMsgSource = getMsgSource(); - if ( tmpMsgSource != null ) { - if ( addPrefix ) key = KEY_PREFIX + key; - Locale locale = LocaleContextHolder.getLocale(); - try { - translatedText = tmpMsgSource.getMessage(key,null,locale); - } catch ( NoSuchMessageException e ) { - log.warn("Unable to internationalise the text for key "+key+" as no matching key found in the msgSource"); - } - } else { - log.warn("Unable to internationalise the text for key "+key+" as no matching key found in the msgSource. The tool's OutputDefinition factory needs to set either (a) messageSource or (b) loadedMessageSourceService and languageFilename."); - } - - if ( translatedText == null || translatedText.length() == 0 ) { - translatedText = key.replace('.', ' '); - } - - return translatedText; + MessageSource tmpMsgSource = getMsgSource(); + if (tmpMsgSource != null) { + if (addPrefix) + key = KEY_PREFIX + key; + Locale locale = LocaleContextHolder.getLocale(); + try { + translatedText = tmpMsgSource.getMessage(key, null, locale); + } catch (NoSuchMessageException e) { + log.warn("Unable to internationalise the text for key " + key + + " as no matching key found in the msgSource"); + } + } else { + log + .warn("Unable to internationalise the text for key " + + key + + " as no matching key found in the msgSource. The tool's OutputDefinition factory needs to set either (a) messageSource or (b) loadedMessageSourceService and languageFilename."); } - /** - * Get the MsgSource, combining getToolMessageService() and getLoadedMessageSourceService(). Caches the result so it only needs to be calculated once (most tools will require - * more than one call to this code! - */ - private MessageSource getMsgSource() { - if ( msgSource == null ) { - if ( getToolMessageService() != null ) { - msgSource = getToolMessageService().getMessageSource(); - } - if ( msgSource == null && getLoadedMessageSourceService() != null && getLanguageFilename() != null) { - msgSource = getLoadedMessageSourceService().getMessageService(getLanguageFilename()); - } - } - return msgSource; + if (translatedText == null || translatedText.length() == 0) { + translatedText = key.replace('.', ' '); } - /** Generic method for building a tool output definition. It will get the definition's description - * from the I18N file using the getDescription() method. - * Only use if the other buildBlahDefinitions do not suit your needs. */ - protected ToolOutputDefinition buildDefinition(String definitionName, OutputType type, Object startValue, Object endValue, Object complexValue, Boolean showConditionNameOnly) { - ToolOutputDefinition definition = new ToolOutputDefinition(); - definition.setName(definitionName); - definition.setDescription(getI18NText(definitionName, true)); - definition.setType(type); - definition.setStartValue( startValue ); - definition.setEndValue( endValue ); - definition.setComplexDefinition( complexValue ); - definition.setShowConditionNameOnly( showConditionNameOnly ); - return definition; - } + return translatedText; + } - /** Build a tool definition designed for a range of integer values. - * It will get the definition's description from the I18N file using the getDescription() method and - * set the type to OUTPUT_LONG. */ - protected ToolOutputDefinition buildRangeDefinition(String definitionName, Long startValue, Long endValue) { - return buildDefinition(definitionName, OutputType.OUTPUT_LONG, startValue, endValue, null, Boolean.FALSE); + /** + * Get the MsgSource, combining getToolMessageService() and + * getLoadedMessageSourceService(). Caches the result so it only needs to be + * calculated once (most tools will require more than one call to this code! + */ + private MessageSource getMsgSource() { + if (msgSource == null) { + if (getToolMessageService() != null) { + msgSource = getToolMessageService().getMessageSource(); + } + if (msgSource == null && getLoadedMessageSourceService() != null && getLanguageFilename() != null) { + msgSource = getLoadedMessageSourceService().getMessageService(getLanguageFilename()); + } } - - /** Build a tool definition designed for a range of string values. - * It will get the definition's description from the I18N file using the getDescription() method and - * set the type to OUTPUT_LONG. */ - protected ToolOutputDefinition buildRangeDefinition(String definitionName, String startValue, String endValue) { - return buildDefinition(definitionName, OutputType.OUTPUT_STRING, startValue, endValue, null, Boolean.FALSE); - } + return msgSource; + } - /** Build a tool definition designed for a single double value, which is likely to be a statistic number of - * questions answered - * It will get the definition's description from the I18N file using the getDescription() method and - * set the type to OUTPUT_LONG. */ - protected ToolOutputDefinition buildLongOutputDefinition(String definitionName) { - return buildDefinition(definitionName, OutputType.OUTPUT_LONG, null, null, null, Boolean.FALSE); - } + /** + * Generic method for building a tool output definition. It will get the + * definition's description from the I18N file using the getDescription() + * method. Only use if the other buildBlahDefinitions do not suit your + * needs. + */ + protected ToolOutputDefinition buildDefinition(String definitionName, OutputType type, Object startValue, + Object endValue, Object complexValue, Boolean showConditionNameOnly) { + ToolOutputDefinition definition = new ToolOutputDefinition(); + definition.setName(definitionName); + definition.setDescription(getI18NText(definitionName, true)); + definition.setType(type); + definition.setStartValue(startValue); + definition.setEndValue(endValue); + definition.setComplexDefinition(complexValue); + definition.setShowConditionNameOnly(showConditionNameOnly); + return definition; + } - /** Build a tool definition designed for a single double value, which is likely to be a statistic such as average - * number of posts. - * It will get the definition's description from the I18N file using the getDescription() method and - * set the type to OUTPUT_DOUBLE. */ - protected ToolOutputDefinition buildDoubleOutputDefinition(String definitionName) { - return buildDefinition(definitionName, OutputType.OUTPUT_DOUBLE, null, null, null, Boolean.FALSE); - } + /** + * Wrapper method for build definition to set the isDefaultGradebookMark + * flag + */ + protected ToolOutputDefinition buildDefinition(String definitionName, OutputType type, Object startValue, + Object endValue, Object complexValue, Boolean showConditionNameOnly, Boolean isDefaultGradebookMark) { + ToolOutputDefinition definition = this.buildDefinition(definitionName, type, startValue, endValue, + complexValue, showConditionNameOnly); + definition.setIsDefaultGradebookMark(isDefaultGradebookMark); + return definition; + } - /** Build a tool definition designed for a single boolean value, which is likely to be a test such as - * user has answered all questions correctly. It will get the definition's description from the I18N file using the getDescription() method and - * set the type to OUTPUT_BOOLEAN. A Boolean tool definition should have default condition name for the - * true and false conditions. The code will automatically look for two strings in the I18N file - * output.desc..true and output.desc..false */ - protected ToolOutputDefinition buildBooleanOutputDefinition(String definitionName) { - ToolOutputDefinition definition = buildDefinition(definitionName, OutputType.OUTPUT_BOOLEAN, null, null, null, Boolean.FALSE); + /** + * Build a tool definition designed for a range of integer values. It will + * get the definition's description from the I18N file using the + * getDescription() method and set the type to OUTPUT_LONG. + */ + protected ToolOutputDefinition buildRangeDefinition(String definitionName, Long startValue, Long endValue) { + return buildDefinition(definitionName, OutputType.OUTPUT_LONG, startValue, endValue, null, Boolean.FALSE); + } - List defaultConditions = new ArrayList(); - defaultConditions.add(new BranchCondition(null, null, new Integer(1), definitionName, - getI18NText(definitionName+".true", true), - OutputType.OUTPUT_BOOLEAN.toString(), null, null, Boolean.TRUE.toString())); + /** + * Build a tool definition designed for a range of string values. It will + * get the definition's description from the I18N file using the + * getDescription() method and set the type to OUTPUT_LONG. + */ + protected ToolOutputDefinition buildRangeDefinition(String definitionName, String startValue, String endValue) { + return buildDefinition(definitionName, OutputType.OUTPUT_STRING, startValue, endValue, null, Boolean.FALSE); + } - defaultConditions.add(new BranchCondition(null, null, new Integer(2), definitionName, - getI18NText(definitionName+".false", true), - OutputType.OUTPUT_BOOLEAN.toString(), null, null, Boolean.FALSE.toString())); + /** + * Wrapper for buildRangeDefinition so you can set isDefaultGradebookMark + */ + protected ToolOutputDefinition buildRangeDefinition(String definitionName, Long startValue, Long endValue, + Boolean isDefaultGradebookMark) { + return buildDefinition(definitionName, OutputType.OUTPUT_LONG, startValue, endValue, null, Boolean.FALSE, + isDefaultGradebookMark); + } - definition.setDefaultConditions(defaultConditions); - - return definition; - } - - /** Build a tool definition designed for a set of boolean conditions. It will get the definition's description from the - * I18N file using the getDescription() method and set the type to OUTPUT_SET_BOOLEAN. The tool's factory should then - * set up a series of conditions, each of type OUTPUT_BOOLEAN. Sets showConditionNameOnly to true so that the user - * in authoring doesn't see the internal definitions, just the condition name. - */ - protected ToolOutputDefinition buildBooleanSetOutputDefinition(String definitionName) { - ToolOutputDefinition definition = buildDefinition(definitionName, OutputType.OUTPUT_SET_BOOLEAN, null, null, null, Boolean.TRUE); - List defaultConditions = new ArrayList(); - definition.setDefaultConditions(defaultConditions); - return definition; - } - + /** + * Wrapper for buildRangeDefinition so you can set isDefaultGradebookMark + */ + protected ToolOutputDefinition buildRangeDefinition(String definitionName, String startValue, String endValue, + Boolean isDefaultGradebookMark) { + return buildDefinition(definitionName, OutputType.OUTPUT_STRING, startValue, endValue, null, Boolean.FALSE, + isDefaultGradebookMark); + } - /** Build a tool definition designed for a single String value. - * It will get the definition's description from the I18N file using the getDescription() method and - * set the type to OUTPUT_STRING. */ - protected ToolOutputDefinition buildStringOutputDefinition(String definitionName) { - return buildDefinition(definitionName, OutputType.OUTPUT_STRING, null, null, null, Boolean.FALSE); - } + /** + * Build a tool definition designed for a single double value, which is + * likely to be a statistic number of questions answered It will get the + * definition's description from the I18N file using the getDescription() + * method and set the type to OUTPUT_LONG. + */ + protected ToolOutputDefinition buildLongOutputDefinition(String definitionName) { + return buildDefinition(definitionName, OutputType.OUTPUT_LONG, null, null, null, Boolean.FALSE); + } - /** Build a tool definition for a complex value output. - * It will get the definition's description from the I18N file using the getDescription() method and - * set the type to OUTPUT_COMPLEX. */ - protected ToolOutputDefinition buildComplexOutputDefinition(String definitionName) { - return buildDefinition(definitionName, OutputType.OUTPUT_COMPLEX, null, null, null, Boolean.FALSE); - } + /** + * Build a tool definition designed for a single double value, which is + * likely to be a statistic such as average number of posts. It will get the + * definition's description from the I18N file using the getDescription() + * method and set the type to OUTPUT_DOUBLE. + */ + protected ToolOutputDefinition buildDoubleOutputDefinition(String definitionName) { + return buildDefinition(definitionName, OutputType.OUTPUT_DOUBLE, null, null, null, Boolean.FALSE); + } - /** - * Build a condition name based on a definition name. For user customised conditions, the - * conditions name MUST start with the definition name for Flash to be able to match conditions to definition - * in the authoring interface, but then each condition name needs to be unique, hence "uniquePart". - * @param definitionName: Must not be null - * @param uniquePart: May be null if the condition names are to be the same as the definition name. - * @return combined string - */ - protected String buildConditionName(String definitionName, String uniquePart) { - return uniquePart != null && uniquePart.length() > 0 ? definitionName + CONDITION_NAME_SEPARATOR + uniquePart : definitionName; - } + /** + * Build a tool definition designed for a single boolean value, which is + * likely to be a test such as user has answered all questions correctly. It + * will get the definition's description from the I18N file using the + * getDescription() method and set the type to OUTPUT_BOOLEAN. A Boolean + * tool definition should have default condition name for the true and false + * conditions. The code will automatically look for two strings in the I18N + * file output.desc..true and output.desc..false + */ + protected ToolOutputDefinition buildBooleanOutputDefinition(String definitionName) { + ToolOutputDefinition definition = buildDefinition(definitionName, OutputType.OUTPUT_BOOLEAN, null, null, null, + Boolean.FALSE); - /** - * Given a condition name built with buildConditionName, split is back into its definition name and unique part. - * @param conditionName: Must not be null - * @return String[definition name, unique part] - */ - protected String[] splitConditionName(String conditionName) { - int index = conditionName.indexOf(CONDITION_NAME_SEPARATOR); - if ( index > -1 ) { - if ( index+1 defaultConditions = new ArrayList(); + defaultConditions.add(new BranchCondition(null, null, new Integer(1), definitionName, getI18NText( + definitionName + ".true", true), OutputType.OUTPUT_BOOLEAN.toString(), null, null, Boolean.TRUE + .toString())); + + defaultConditions.add(new BranchCondition(null, null, new Integer(2), definitionName, getI18NText( + definitionName + ".false", true), OutputType.OUTPUT_BOOLEAN.toString(), null, null, Boolean.FALSE + .toString())); + + definition.setDefaultConditions(defaultConditions); + + return definition; + } + + /** + * Build a tool definition designed for a set of boolean conditions. It will + * get the definition's description from the I18N file using the + * getDescription() method and set the type to OUTPUT_SET_BOOLEAN. The + * tool's factory should then set up a series of conditions, each of type + * OUTPUT_BOOLEAN. Sets showConditionNameOnly to true so that the user in + * authoring doesn't see the internal definitions, just the condition name. + */ + protected ToolOutputDefinition buildBooleanSetOutputDefinition(String definitionName) { + ToolOutputDefinition definition = buildDefinition(definitionName, OutputType.OUTPUT_SET_BOOLEAN, null, null, + null, Boolean.TRUE); + List defaultConditions = new ArrayList(); + definition.setDefaultConditions(defaultConditions); + return definition; + } + + /** + * Build a tool definition designed for a single String value. It will get + * the definition's description from the I18N file using the + * getDescription() method and set the type to OUTPUT_STRING. + */ + protected ToolOutputDefinition buildStringOutputDefinition(String definitionName) { + return buildDefinition(definitionName, OutputType.OUTPUT_STRING, null, null, null, Boolean.FALSE); + } + + /** + * Build a tool definition for a complex value output. It will get the + * definition's description from the I18N file using the getDescription() + * method and set the type to OUTPUT_COMPLEX. + */ + protected ToolOutputDefinition buildComplexOutputDefinition(String definitionName) { + return buildDefinition(definitionName, OutputType.OUTPUT_COMPLEX, null, null, null, Boolean.FALSE); + } + + /** + * Build a condition name based on a definition name. For user customised + * conditions, the conditions name MUST start with the definition name for + * Flash to be able to match conditions to definition in the authoring + * interface, but then each condition name needs to be unique, hence + * "uniquePart". + * + * @param definitionName: + * Must not be null + * @param uniquePart: + * May be null if the condition names are to be the same as + * the definition name. + * @return combined string + */ + protected String buildConditionName(String definitionName, String uniquePart) { + return uniquePart != null && uniquePart.length() > 0 ? definitionName + CONDITION_NAME_SEPARATOR + uniquePart + : definitionName; + } + + /** + * Given a condition name built with buildConditionName, split is back into + * its definition name and unique part. + * + * @param conditionName: + * Must not be null + * @return String[definition name, unique part] + */ + protected String[] splitConditionName(String conditionName) { + int index = conditionName.indexOf(CONDITION_NAME_SEPARATOR); + if (index > -1) { + if (index + 1 < conditionName.length()) + return new String[] { conditionName.substring(0, index), conditionName.substring(index + 1) }; + else + return new String[] { conditionName.substring(0, index), "" }; + } else { + return new String[] { conditionName, "" }; } + } } Index: lams_common/src/java/org/lamsfoundation/lams/tool/ToolOutputDefinition.java =================================================================== diff -u -r55787e184b4775a776ed958656ba17cda1a8c4c8 -racc8d2acf5b6b0002e0c8129947040a779ab4077 --- lams_common/src/java/org/lamsfoundation/lams/tool/ToolOutputDefinition.java (.../ToolOutputDefinition.java) (revision 55787e184b4775a776ed958656ba17cda1a8c4c8) +++ lams_common/src/java/org/lamsfoundation/lams/tool/ToolOutputDefinition.java (.../ToolOutputDefinition.java) (revision acc8d2acf5b6b0002e0c8129947040a779ab4077) @@ -32,148 +32,174 @@ import org.lamsfoundation.lams.learningdesign.BranchCondition; /** - * Each tool that has outputs will define a set of output definitions. Some definitions will be - * "predefined" for a tool, e.g. "Learner's Mark". Others may be created for a specific tool activity, - * via a Conditions/Output tab in monitoring, e.g. Second answer contains the word "Mercury". + * Each tool that has outputs will define a set of output definitions. Some + * definitions will be "predefined" for a tool, e.g. "Learner's Mark". Others + * may be created for a specific tool activity, via a Conditions/Output tab in + * monitoring, e.g. Second answer contains the word "Mercury". *

- * If the tool contains generated definitions, then they must be copied when the tool content is copied, - * as the conditions may be modified via Live Edit. This must not modify the original design. + * If the tool contains generated definitions, then they must be copied when the + * tool content is copied, as the conditions may be modified via Live Edit. This + * must not modify the original design. *

- * For 2.1, we will not deal with complex outputs, so for now we will not define how a complex definition - * is defined. The field is placed in the object so that we have the place for it when we do design the - * complex output definitions. + * For 2.1, we will not deal with complex outputs, so for now we will not define + * how a complex definition is defined. The field is placed in the object so + * that we have the place for it when we do design the complex output + * definitions. *

- * Sample ToolOutputDefinition: - * ToolOutputDefinition { - * name = "LEARNERS_MARK", - * description = "Mark for an individual learner"; - * type = "NUMERIC"; - * startValue = "0.0"; - * endValue = "10.0"; - * complexDefinition = null; - * } + * Sample ToolOutputDefinition: ToolOutputDefinition { name = "LEARNERS_MARK", + * description = "Mark for an individual learner"; type = "NUMERIC"; startValue = + * "0.0"; endValue = "10.0"; complexDefinition = null; } */ public class ToolOutputDefinition implements Comparable { - + private String name; private String description; private OutputType type; private Object startValue; private Object endValue; private Object complexDefinition; private Boolean showConditionNameOnly; + private Boolean isDefaultGradebookMark; private List defaultConditions; - - /** Name must be unique within the current tool content. This will be used to identify the output. - * If the definition is a predefined definition then the name will always be the same (e.g. LEARNER_MARK) but - * if it is defined in authoring then it will need to made unique for this tool content (e.g. ANSWER_2_CONTAINS_1). - * At lesson time, the tool will be given back the name and will need to be able to uniquely identify the required - * output based on name, the tool session id and possibly the learner's user id. + + /** + * Name must be unique within the current tool content. This will be used to + * identify the output. If the definition is a predefined definition then + * the name will always be the same (e.g. LEARNER_MARK) but if it is defined + * in authoring then it will need to made unique for this tool content (e.g. + * ANSWER_2_CONTAINS_1). At lesson time, the tool will be given back the + * name and will need to be able to uniquely identify the required output + * based on name, the tool session id and possibly the learner's user id. */ - public String getName() { - return name; - } - public void setName(String name) { - this.name = name; - } - /** Description: Description is an internationalised text string which is displayed to the - * user as the output "name". It is the responsibility of the tool to internationalise the - * string. We suggest that the key for each predefined definition follow the convention - * OUTPUT_DESC_ - */ - public String getDescription() { - return description; - } - public void setDescription(String description) { - this.description = description; - } - /** - * The type of the output value. - */ - public OutputType getType() { - return type; - } - public void setType(OutputType type) { - this.type = type; - } - /** If the output value may be compared to a range, then startValue and endValue are the inclusive start values and end values - * for the range. This may be used to customise fixed definitions to ranges appropriate for the current data. - */ - public Object getStartValue() { - return startValue; - } - public void setStartValue(Object startValue) { - this.startValue = startValue; - } - /** See getStartValue() */ - public Object getEndValue() { - return endValue; - } - public void setEndValue(Object endValue) { - this.endValue = endValue; - } - public Object getComplexDefinition() { - return complexDefinition; - } - public void setComplexDefinition(Object complexDefinition) { - this.complexDefinition = complexDefinition; - } - - public String toString() { - return new ToStringBuilder(this) - .append("name", name) - .append("description", description) - .append("type", type) - .append("startValue", startValue) - .append("endValue", endValue) - .toString(); - } + public String getName() { + return name; + } - public boolean equals(Object other) { - if ( (this == other ) ) return true; - if ( !(other instanceof ToolOutputDefinition) ) return false; - ToolOutputDefinition castOther = (ToolOutputDefinition) other; - return new EqualsBuilder() - .append(this.name, castOther.name) - .append(this.type, castOther.type) - .isEquals(); - } + public void setName(String name) { + this.name = name; + } - public int hashCode() { - return new HashCodeBuilder() - .append(name) - .append(type) - .toHashCode(); - } + /** + * Description: Description is an internationalised text string which is + * displayed to the user as the output "name". It is the responsibility of + * the tool to internationalise the string. We suggest that the key for each + * predefined definition follow the convention OUTPUT_DESC_ + */ + public String getDescription() { + return description; + } - public int compareTo(Object o) { - - ToolOutputDefinition myClass = (ToolOutputDefinition) o; - return new CompareToBuilder() - .append(this.name, myClass.name) - .append(this.type, myClass.type) - .toComparison(); - } - /** Default Conditions are sample conditions that should be presented to the user as a starting point - * for using this OutputDefinition - * @return - */ - public List getDefaultConditions() { - return defaultConditions; - } - public void setDefaultConditions(List defaultConditions) { - this.defaultConditions = defaultConditions; - } - /** - * Should Flash show the definition of the branch conditions (e.g. Range from blah to blah) or just the name of the condition. - * Set to true if the definition relates to an internal parameter and will mean nothing to the user - */ - public Boolean isShowConditionNameOnly() { - return showConditionNameOnly; - } - public void setShowConditionNameOnly(Boolean showConditionNameOnly) { - this.showConditionNameOnly = showConditionNameOnly; - } + public void setDescription(String description) { + this.description = description; + } + /** + * The type of the output value. + */ + public OutputType getType() { + return type; + } + public void setType(OutputType type) { + this.type = type; + } + + /** + * If the output value may be compared to a range, then startValue and + * endValue are the inclusive start values and end values for the range. + * This may be used to customise fixed definitions to ranges appropriate for + * the current data. + */ + public Object getStartValue() { + return startValue; + } + + public void setStartValue(Object startValue) { + this.startValue = startValue; + } + + /** See getStartValue() */ + public Object getEndValue() { + return endValue; + } + + public void setEndValue(Object endValue) { + this.endValue = endValue; + } + + public Object getComplexDefinition() { + return complexDefinition; + } + + public void setComplexDefinition(Object complexDefinition) { + this.complexDefinition = complexDefinition; + } + + public String toString() { + return new ToStringBuilder(this).append("name", name).append("description", description).append("type", type) + .append("startValue", startValue).append("endValue", endValue).toString(); + } + + public boolean equals(Object other) { + if ((this == other)) + return true; + if (!(other instanceof ToolOutputDefinition)) + return false; + ToolOutputDefinition castOther = (ToolOutputDefinition) other; + return new EqualsBuilder().append(this.name, castOther.name).append(this.type, castOther.type).isEquals(); + } + + public int hashCode() { + return new HashCodeBuilder().append(name).append(type).toHashCode(); + } + + public int compareTo(Object o) { + + ToolOutputDefinition myClass = (ToolOutputDefinition) o; + return new CompareToBuilder().append(this.name, myClass.name).append(this.type, myClass.type).toComparison(); + } + + /** + * Default Conditions are sample conditions that should be presented to the + * user as a starting point for using this OutputDefinition + * + * @return + */ + public List getDefaultConditions() { + return defaultConditions; + } + + public void setDefaultConditions(List defaultConditions) { + this.defaultConditions = defaultConditions; + } + + /** + * Should Flash show the definition of the branch conditions (e.g. Range + * from blah to blah) or just the name of the condition. Set to true if the + * definition relates to an internal parameter and will mean nothing to the + * user + */ + public Boolean isShowConditionNameOnly() { + return showConditionNameOnly; + } + + public void setShowConditionNameOnly(Boolean showConditionNameOnly) { + this.showConditionNameOnly = showConditionNameOnly; + } + + /** + * If set, this flag makes the current tool output definition the default + * output to go straight to gradebook marks when the user completes an + * activity. There should only be one of these per tool. + * + * @return + */ + public Boolean isDefaultGradebookMark() { + return isDefaultGradebookMark; + } + + public void setIsDefaultGradebookMark(Boolean isDefaultGradebookMark) { + this.isDefaultGradebookMark = isDefaultGradebookMark; + } + } Index: lams_common/src/java/org/lamsfoundation/lams/tool/dto/ToolOutputDefinitionDTO.java =================================================================== diff -u -r55787e184b4775a776ed958656ba17cda1a8c4c8 -racc8d2acf5b6b0002e0c8129947040a779ab4077 --- lams_common/src/java/org/lamsfoundation/lams/tool/dto/ToolOutputDefinitionDTO.java (.../ToolOutputDefinitionDTO.java) (revision 55787e184b4775a776ed958656ba17cda1a8c4c8) +++ lams_common/src/java/org/lamsfoundation/lams/tool/dto/ToolOutputDefinitionDTO.java (.../ToolOutputDefinitionDTO.java) (revision acc8d2acf5b6b0002e0c8129947040a779ab4077) @@ -32,24 +32,27 @@ /** * @author Mitchell Seaton * - * This class acts as a data transfer object for - * transferring information between FLASH and the core module. + * This class acts as a data transfer object for transferring + * information between FLASH and the core module. * - * This class is required in the authoring environment to pass - * information about the ToolOutput for a ToolActivity + * This class is required in the authoring environment to pass + * information about the ToolOutput for a ToolActivity */ public class ToolOutputDefinitionDTO { - + private String name; private String description; private String type; private String startValue; private String endValue; private String complexDefinition; - private Boolean showConditionNameOnly; - private ArrayList defaultConditions; + private Boolean showConditionNameOnly; + private Boolean isDefaultGradebookMark; + private ArrayList defaultConditions; - public ToolOutputDefinitionDTO(String name, String description, String type, String startValue, String endValue, String complexDefinition, Boolean showConditionNameOnly) { + public ToolOutputDefinitionDTO(String name, String description, + String type, String startValue, String endValue, + String complexDefinition, Boolean showConditionNameOnly) { super(); this.name = name; this.description = description; @@ -62,69 +65,83 @@ this.showConditionNameOnly = showConditionNameOnly; } - + public ToolOutputDefinitionDTO(ToolOutputDefinition definition) { super(); this.name = definition.getName(); this.description = definition.getDescription(); - this.type = (definition.getType() != null)? definition.getType().toString() : null; + this.type = (definition.getType() != null) ? definition.getType() + .toString() : null; - this.startValue = (definition.getStartValue() != null) ? definition.getStartValue().toString() : null; - this.endValue = (definition.getEndValue() != null) ? definition.getEndValue().toString() : null; + this.startValue = (definition.getStartValue() != null) ? definition + .getStartValue().toString() : null; + this.endValue = (definition.getEndValue() != null) ? definition + .getEndValue().toString() : null; - this.complexDefinition = (definition.getComplexDefinition() != null) ? definition.getComplexDefinition().toString() : null; - + this.complexDefinition = (definition.getComplexDefinition() != null) ? definition + .getComplexDefinition().toString() + : null; + this.showConditionNameOnly = definition.isShowConditionNameOnly(); - if ( definition.getDefaultConditions() != null && definition.getDefaultConditions().size() > 0 ) { + if (definition.getDefaultConditions() != null + && definition.getDefaultConditions().size() > 0) { defaultConditions = new ArrayList(); - for ( BranchCondition condition : definition.getDefaultConditions() ) { + for (BranchCondition condition : definition.getDefaultConditions()) { defaultConditions.add(condition.getBranchConditionDTO(null)); } } + + this.isDefaultGradebookMark = definition.isDefaultGradebookMark() != null ? definition.isDefaultGradebookMark() : false; } - + /** * Returns the name. + * * @return */ public String getName() { return name; } - + /** * Returns the description. + * * @return */ public String getDescription() { return description; } - + /** * Returns the output type. + * * @return */ public String getType() { return type; } - + /** * Returns the start value. + * * @return */ public String getStartValue() { return startValue; } - + /** * Returns the end value. + * * @return */ public String getEndValue() { return endValue; } - + /** * Returns the complex definition. + * * @return */ public String getComplexDefinition() { @@ -142,17 +159,23 @@ public Boolean getShowConditionNameOnly() { return showConditionNameOnly; } + public void setShowConditionNameOnly(Boolean showConditionNameOnly) { this.showConditionNameOnly = showConditionNameOnly; } public String toString() { - return new ToStringBuilder(this) - .append("name", name) - .append("description", description) - .append("type", type) - .append("startValue", startValue) - .append("endValue", endValue) - .toString(); + return new ToStringBuilder(this).append("name", name).append( + "description", description).append("type", type).append( + "startValue", startValue).append("endValue", endValue).append( + "isDefaultGradebookMark", isDefaultGradebookMark).toString(); } + + public Boolean getIsDefaultGradebookMark() { + return isDefaultGradebookMark; + } + + public void isDefaultGradebookMark(Boolean isDefaultGradebookMark) { + this.isDefaultGradebookMark = isDefaultGradebookMark; + } } Index: lams_common/src/java/org/lamsfoundation/lams/util/DateUtil.java =================================================================== diff -u -r08950e1090443c3423a3d1c587416a2fccd8bbdf -racc8d2acf5b6b0002e0c8129947040a779ab4077 --- lams_common/src/java/org/lamsfoundation/lams/util/DateUtil.java (.../DateUtil.java) (revision 08950e1090443c3423a3d1c587416a2fccd8bbdf) +++ lams_common/src/java/org/lamsfoundation/lams/util/DateUtil.java (.../DateUtil.java) (revision acc8d2acf5b6b0002e0c8129947040a779ab4077) @@ -85,6 +85,34 @@ } /** + * Convert from local time to your client (time zone) time. + * + * @param targetTimeZone time zone converting to. + * @param date date to convert. + * @return your time zone date time. + */ + public static Date convertToTimeZoneFromDefault(TimeZone targetTimeZone, Date date) { + TimeZone defaultTz = TimeZone.getDefault(); + Integer rawOffset = new Integer(defaultTz.getOffset(date.getTime()) - targetTimeZone.getOffset(date.getTime())); + + return new Date(date.getTime() - rawOffset); + } + + /** + * Convert from client (time zone) time to your local time. + * + * @param targetTimeZone time zone converting from. + * @param date date to convert. + * @return your local date time. + */ + public static Date convertFromTimeZoneToDefault(TimeZone targetTimeZone, Date date) { + TimeZone defaultTz = TimeZone.getDefault(); + Integer rawOffset = new Integer(defaultTz.getOffset(date.getTime()) - targetTimeZone.getOffset(date.getTime())); + + return new Date(date.getTime() + rawOffset); + } + + /** * Convert from String formatted date to a Date. Tries the following * date formats: * (WDDX) YYYY-MM-ddTHH:mm:ss Index: lams_common/src/java/org/lamsfoundation/lams/util/WebUtil.java =================================================================== diff -u -r70a60f2862830ca6bd07e2b1252af3d79e4939af -racc8d2acf5b6b0002e0c8129947040a779ab4077 --- lams_common/src/java/org/lamsfoundation/lams/util/WebUtil.java (.../WebUtil.java) (revision 70a60f2862830ca6bd07e2b1252af3d79e4939af) +++ lams_common/src/java/org/lamsfoundation/lams/util/WebUtil.java (.../WebUtil.java) (revision acc8d2acf5b6b0002e0c8129947040a779ab4077) @@ -1,6 +1,5 @@ package org.lamsfoundation.lams.util; -import java.io.DataInputStream; import java.io.DataOutputStream; import java.io.File; import java.io.FileInputStream; @@ -18,7 +17,6 @@ import org.apache.commons.lang.StringUtils; import org.apache.log4j.Logger; -import org.lamsfoundation.lams.learningdesign.TextSearchCondition; import org.lamsfoundation.lams.tool.ToolAccessMode; import org.lamsfoundation.lams.tool.exception.ToolException; @@ -27,21 +25,30 @@ */ public class WebUtil { - //--------------------------------------------------------------------- + // --------------------------------------------------------------------- // Class level constants - Session attributs - //--------------------------------------------------------------------- + // --------------------------------------------------------------------- private static Logger log = Logger.getLogger(WebUtil.class); + /** + * A regular expression pattern that matches HTML tags. + */ + private static final String HTML_TAG_REGEX = "\\<.*?>"; + /** + * A regular expression pattern that matches end-of-line and space tags. If needed, BR tags can be extented to + * (?:
|
|
|
)
. Right now FCKeditor creates only the first option. + */ + private static final String SPACE_TAG_REGEX = "(?:
)|(?: )|(?:

)"; /** */ public static boolean isTokenValid(HttpServletRequest req, String tokenName) { if (req.getSession() != null) { String valueSession = (String) req.getSession().getAttribute(tokenName); - String valueRequest = (String) req.getParameter(tokenName); - log.debug("(Session Token) name : " + tokenName + " value : " + valueSession); - log.debug("(Request Token) name : " + tokenName + " value : " + valueRequest); - if ((valueSession != null) && (valueRequest != null)) { + String valueRequest = req.getParameter(tokenName); + WebUtil.log.debug("(Session Token) name : " + tokenName + " value : " + valueSession); + WebUtil.log.debug("(Request Token) name : " + tokenName + " value : " + valueRequest); + if (valueSession != null && valueRequest != null) { if (valueSession.equals(valueRequest)) { return true; } @@ -70,7 +77,7 @@ resetToken(req, tokenName); } req.getSession().setAttribute(tokenName, tokenValue); - log.debug("(Save Session Token) name : " + tokenName + " value : " + tokenValue); + WebUtil.log.debug("(Save Session Token) name : " + tokenName + " value : " + tokenValue); } @@ -91,10 +98,10 @@ * if not set */ public static void checkObject(String paramName, Object paramValue) throws IllegalArgumentException { - boolean isNull = (paramValue == null); + boolean isNull = paramValue == null; if (!isNull && String.class.isInstance(paramValue)) { String str = (String) paramValue; - isNull = (str.trim().length() == 0); + isNull = str.trim().length() == 0; } if (isNull) { throw new IllegalArgumentException(paramName + " is required '" + paramValue + "'"); @@ -109,8 +116,9 @@ public static Integer checkInteger(String paramName, String paramValue, boolean isOptional) throws IllegalArgumentException { try { - if (!isOptional) + if (!isOptional) { checkObject(paramName, paramValue); + } String value = paramValue != null ? StringUtils.trimToNull(paramValue) : null; return value != null ? new Integer(value) : null; @@ -127,8 +135,9 @@ public static Long checkLong(String paramName, String paramValue, boolean isOptional) throws IllegalArgumentException { try { - if (!isOptional) + if (!isOptional) { checkObject(paramName, paramValue); + } String value = paramValue != null ? StringUtils.trimToNull(paramValue) : null; return value != null ? new Long(value) : null; @@ -138,16 +147,17 @@ } /** - * Get a long version of paramValue, throwing an IllegalArgumentException if - * isOptional = false and the is value is null + * Get a long version of paramValue, throwing an IllegalArgumentException if isOptional = false and the is value is + * null * * @return long value of paramValue * @exception IllegalArgumentException - * if not set or not long */ public static long checkLong(String paramName, Long paramValue, boolean isOptional) throws IllegalArgumentException { - if (!isOptional) + if (!isOptional) { checkObject(paramName, paramValue); + } return paramValue.longValue(); } @@ -174,8 +184,7 @@ } /** - * Read an int parameter, throwing exception if ( not optional and null ) or - * not a integer + * Read an int parameter, throwing exception if ( not optional and null ) or not a integer * * @param req - * @param paramName - @@ -198,8 +207,7 @@ } /** - * Read an long parameter, throwing exception if ( not optional and null ) - * or not a long + * Read an long parameter, throwing exception if ( not optional and null ) or not a long * * @param req - * @param paramName - @@ -226,8 +234,9 @@ * @return parameter value */ public static String readStrParam(HttpServletRequest req, String paramName, boolean isOptional) { - if (!isOptional) + if (!isOptional) { checkObject(paramName, req.getParameter(paramName)); + } return req.getParameter(paramName); } @@ -246,8 +255,7 @@ * @param req - * @param paramName - * @param defaultValue - - * if valid boolean parameter value is not found, return this - * value + * if valid boolean parameter value is not found, return this value * @return parameter value */ public static boolean readBooleanParam(HttpServletRequest req, String paramName, boolean defaultValue) { @@ -263,35 +271,37 @@ } /** - * TODO default proper exception at lams level to replace RuntimeException - * TODO isTesting should be removed when login is done properly. + * TODO default proper exception at lams level to replace RuntimeException TODO isTesting should be removed when + * login is done properly. * * @param req - * @return username from principal object */ public static String getUsername(HttpServletRequest req, boolean isTesting) throws RuntimeException { - if (isTesting) + if (isTesting) { return "test"; + } Principal prin = req.getUserPrincipal(); - if (prin == null) + if (prin == null) { throw new RuntimeException("Trying to get username but principal object missing. Request is " + req.toString()); + } String username = prin.getName(); - if (username == null) + if (username == null) { throw new RuntimeException("Name missing from principal object. Request is " + req.toString() + " Principal object is " + prin.toString()); + } return username; } /** - * Retrieve the tool access mode from http request. This is a utility used - * by the tools that share an implementation for the learner screen. They - * use mode=learner, mode=author and mode=teacher for learning, preview and - * monitoring respectively. Only used if the tool programmer wants to have - * one call that supports all three ways of looking at a learner screen. + * Retrieve the tool access mode from http request. This is a utility used by the tools that share an implementation + * for the learner screen. They use mode=learner, mode=author and mode=teacher for learning, preview and monitoring + * respectively. Only used if the tool programmer wants to have one call that supports all three ways of looking at + * a learner screen. * * @param request * @param param_mode @@ -301,44 +311,44 @@ String mode = readStrParam(request, param_mode, optional); if (mode == null) { return null; - } else if (mode.equals(ToolAccessMode.AUTHOR.toString())) + } else if (mode.equals(ToolAccessMode.AUTHOR.toString())) { return ToolAccessMode.AUTHOR; - else if (mode.equals(ToolAccessMode.LEARNER.toString())) + } else if (mode.equals(ToolAccessMode.LEARNER.toString())) { return ToolAccessMode.LEARNER; - else if (mode.equals(ToolAccessMode.TEACHER.toString())) + } else if (mode.equals(ToolAccessMode.TEACHER.toString())) { return ToolAccessMode.TEACHER; - else + } else { throw new IllegalArgumentException("[" + mode + "] is not a legal mode" + "in LAMS"); + } } /** - * Retrieve the tool access mode from a string value, presumably from a - * Form. This is a utility used by the tools that share an implementation - * for the learner screen. They use mode=learner, mode=author and - * mode=teacher for learning, preview and monitoring respectively. Only used - * if the tool programmer wants to have one call that supports all three - * ways of looking at a learner screen. + * Retrieve the tool access mode from a string value, presumably from a Form. This is a utility used by the tools + * that share an implementation for the learner screen. They use mode=learner, mode=author and mode=teacher for + * learning, preview and monitoring respectively. Only used if the tool programmer wants to have one call that + * supports all three ways of looking at a learner screen. * * @param request * @param param_mode * @return the ToolAccessMode object */ public static ToolAccessMode getToolAccessMode(String modeValue) { if (modeValue != null) { - if (modeValue.equals(ToolAccessMode.AUTHOR.toString())) + if (modeValue.equals(ToolAccessMode.AUTHOR.toString())) { return ToolAccessMode.AUTHOR; - else if (modeValue.equals(ToolAccessMode.LEARNER.toString())) + } else if (modeValue.equals(ToolAccessMode.LEARNER.toString())) { return ToolAccessMode.LEARNER; - else if (modeValue.equals(ToolAccessMode.TEACHER.toString())) + } else if (modeValue.equals(ToolAccessMode.TEACHER.toString())) { return ToolAccessMode.TEACHER; + } } throw new IllegalArgumentException("[" + modeValue + "] is not a legal mode" + "in LAMS"); } /** *

- * This helper method create the struts action forward name using the path. - * It will chop all path related characters, such as "/" and ".do". + * This helper method create the struts action forward name using the path. It will chop all path related + * characters, such as "/" and ".do". *

* *

@@ -377,73 +387,71 @@ *

* This helper append the parameter deliminator for a url. *

- * It is using a null safe String util method to checkup the url String and - * append proper deliminator if necessary. + * It is using a null safe String util method to checkup the url String and append proper deliminator if necessary. * * @param url * the url needs to append deliminator. * @return target url with the deliminator; */ public static String appendParameterDeliminator(String url) { - if (url == null) + if (url == null) { return null; - else if (StringUtils.containsNone(url, "?")) + } else if (StringUtils.containsNone(url, "?")) { return url + "?"; - else + } else { return url + "&"; + } } /** - * Converts a url (such as one from a tool) to a complete url. If the url - * starts with "http" then it is assumed to be a complete url and is - * returned as is. Otherwise it assumes starts with the path of the webapp - * so it is appended to the server url from the LAMS Configuration. + * Converts a url (such as one from a tool) to a complete url. If the url starts with "http" then it is assumed to + * be a complete url and is returned as is. Otherwise it assumes starts with the path of the webapp so it is + * appended to the server url from the LAMS Configuration. * * @param url * e.g. tool/lanb11/starter/learner.do * @return complete url */ public static String convertToFullURL(String url) { - if (url == null) + if (url == null) { return null; - else if (url.startsWith("http")) + } else if (url.startsWith("http")) { return url; - else { + } else { String serverURL = Configuration.get(ConfigurationKeys.SERVER_URL); - if (url.charAt(0) == '/') + if (url.charAt(0) == '/') { return serverURL + url; - else + } else { return serverURL + '/' + url; + } } } /** - * Convert any newslines in a string to
. If input = null, returns - * null. + * Convert any newslines in a string to
. If input = null, returns null. */ public static String convertNewlines(String input) { - if (input != null) + if (input != null) { return input.replaceAll("[\n\r\f]", "
"); - else + } else { return null; + } } /** - * Strips HTML tags and leave "pure" text. Useful for FCKeditor created - * text. + * Strips HTML tags and leave "pure" text. Useful for FCKeditor created text. * * @param text * string to process * @return string after stripping */ public static String removeHTMLtags(String text) { - return text == null ? null : text.replaceAll(TextSearchCondition.BR_TAG_REGEX, " ").replaceAll( - TextSearchCondition.HTML_TAG_REGEX, ""); + return text == null ? null : text.replaceAll(WebUtil.SPACE_TAG_REGEX, " ").replaceAll(WebUtil.HTML_TAG_REGEX, + ""); } /** - * Makes a request to the specified url with the specified parameters and - * returns the response inputstream + * Makes a request to the specified url with the specified parameters and returns the response inputstream * * @param urlStr * @param params @@ -453,44 +461,43 @@ */ public static InputStream getResponseInputStreamFromExternalServer(String urlStr, HashMap params) throws Exception { - if (!urlStr.contains("?")) + if (!urlStr.contains("?")) { urlStr += "?"; + } for (Entry entry : params.entrySet()) { urlStr += "&" + entry.getKey() + "=" + entry.getValue(); } - log.debug("Making request to external servlet: " + urlStr); + WebUtil.log.debug("Making request to external servlet: " + urlStr); URL url = new URL(urlStr); URLConnection conn = url.openConnection(); if (!(conn instanceof HttpURLConnection)) { - log.error("Fail to connect to external server though url: " + urlStr); + WebUtil.log.error("Fail to connect to external server though url: " + urlStr); throw new Exception("Fail to connect to external server though url: " + urlStr); } HttpURLConnection httpConn = (HttpURLConnection) conn; if (httpConn.getResponseCode() != HttpURLConnection.HTTP_OK) { - log.error("Response code from external server: " + httpConn.getResponseCode() - + " Url: " + urlStr); + WebUtil.log.error("Response code from external server: " + httpConn.getResponseCode() + " Url: " + urlStr); } InputStream is = url.openConnection().getInputStream(); if (is == null) { - log.error("Fail to fetch data from external server, return InputStream null: " + urlStr); + WebUtil.log.error("Fail to fetch data from external server, return InputStream null: " + urlStr); throw new Exception("Fail to fetch data from external server, return inputStream null: " + urlStr); } return is; } - + /** - * Uploads a file to the given url. Uses a multi-part http post to - * post the file as well as the user, course, and hash server-authentication - * strings. + * Uploads a file to the given url. Uses a multi-part http post to post the file as well as the user, course, and + * hash server-authentication strings. * - * Some of the java multipart posting libraries clashed with existing jboss - * libraries So instead, the multipart post is put together manually + * Some of the java multipart posting libraries clashed with existing jboss libraries So instead, the multipart post + * is put together manually * * @param f * @param urlString @@ -512,20 +519,19 @@ byte[] buffer; int maxBufferSize = 1 * 1024 * 1024; - //------------------ CLIENT REQUEST + // ------------------ CLIENT REQUEST FileInputStream fileInputStream = new FileInputStream(f); - log.debug("Performing multipart post to: " + urlString); - - // open a URL connection to the Servlet + WebUtil.log.debug("Performing multipart post to: " + urlString); + + // open a URL connection to the Servlet URL url = new URL(urlString); // Open a HTTP connection to the URL conn = (HttpURLConnection) url.openConnection(); - - + if (!(conn instanceof HttpURLConnection)) { - log.error("Fail to connect to external server though url: " + urlString); + WebUtil.log.error("Fail to connect to external server though url: " + urlString); throw new Exception("Fail to connect to external server though url: " + urlString); } @@ -554,10 +560,10 @@ conn.setRequestMethod("POST"); conn.setRequestProperty("Connection", "Keep-Alive"); conn.setRequestProperty("Content-Length", new Long(f.length() + httpRequest.getBytes().length + 64).toString()); - log.debug(f.length()); - log.debug(httpRequest.getBytes().length); - log.debug("" + f.length() + httpRequest.getBytes().length + 64); - log.debug(httpRequest); + WebUtil.log.debug(f.length()); + WebUtil.log.debug(httpRequest.getBytes().length); + WebUtil.log.debug("" + f.length() + httpRequest.getBytes().length + 64); + WebUtil.log.debug(httpRequest); conn.setRequestProperty("Content-Type", "multipart/form-data; boundary=" + boundary); @@ -581,19 +587,18 @@ // send multipart form data necessary after file data... dos.writeBytes(lineEnd); dos.writeBytes(twoHyphens + boundary + twoHyphens + lineEnd); - // Write the file part into the post------------------------------- + // Write the file part into the post------------------------------- // close streams fileInputStream.close(); dos.flush(); dos.close(); - + InputStream ret = conn.getInputStream(); if (ret == null) { - log.error("Fail to get response from extenal server, return InputStream null: " + urlString); + WebUtil.log.error("Fail to get response from extenal server, return InputStream null: " + urlString); throw new Exception("Fail to fetch data from external server, return inputStream null: " + urlString); } - return conn.getInputStream(); } Index: lams_common/src/java/org/lamsfoundation/lams/web/action/LamsDispatchAction.java =================================================================== diff -u -r240222cfb186fccf09aaac380409fb256d3d613d -racc8d2acf5b6b0002e0c8129947040a779ab4077 --- lams_common/src/java/org/lamsfoundation/lams/web/action/LamsDispatchAction.java (.../LamsDispatchAction.java) (revision 240222cfb186fccf09aaac380409fb256d3d613d) +++ lams_common/src/java/org/lamsfoundation/lams/web/action/LamsDispatchAction.java (.../LamsDispatchAction.java) (revision acc8d2acf5b6b0002e0c8129947040a779ab4077) @@ -34,52 +34,58 @@ import org.lamsfoundation.lams.web.util.TokenProcessor; /** - * @author daveg - * + * @author daveg edited by lfoxton + * */ public abstract class LamsDispatchAction extends DispatchAction { - + protected static String className = "Action"; - + + public static final String ENCODING_UTF8 = "UTF8"; + public static final String CONTENT_TYPE_TEXT_PLAIN = "text/plain"; + public static final String CONTENT_TYPE_TEXT_HTML = "text/html"; + public static final String CONTENT_TYPE_TEXT_XML = "text/xml"; + protected static TokenProcessor token = TokenProcessor.getInstance(); - protected static Logger log = Logger.getLogger(LamsDispatchAction.class); + protected static Logger log = Logger.getLogger(LamsDispatchAction.class); - protected void saveToken(javax.servlet.http.HttpServletRequest request) { - token.saveToken(request); - } - - protected boolean isTokenValid(javax.servlet.http.HttpServletRequest request) { - return token.isTokenValid(request, false); - } - - protected boolean isTokenValid(javax.servlet.http.HttpServletRequest request, boolean reset) { - return token.isTokenValid(request, reset); - } - - protected void resetToken(HttpServletRequest request) { - token.resetToken(request); + protected void saveToken(javax.servlet.http.HttpServletRequest request) { + token.saveToken(request); } - - /*protected void saveForward(javax.servlet.http.HttpServletRequest request, ActionForward forward) { - token.saveForward(request, forward); + + protected boolean isTokenValid(javax.servlet.http.HttpServletRequest request) { + return token.isTokenValid(request, false); } - - protected ActionForward getForward(javax.servlet.http.HttpServletRequest request) { - return token.getForward(request, true); - }*/ - - protected void writeAJAXResponse(HttpServletResponse response, String output) throws IOException { - // set it to unicode (LDEV-1275) - response.setContentType("text/html;charset=utf-8"); - PrintWriter writer = response.getWriter(); - if (output.length()>0) { - writer.println(output); - } + protected boolean isTokenValid(javax.servlet.http.HttpServletRequest request, boolean reset) { + return token.isTokenValid(request, reset); + } + + protected void resetToken(HttpServletRequest request) { + token.resetToken(request); + } + + protected void writeAJAXResponse(HttpServletResponse response, String output) throws IOException { + // set it to unicode (LDEV-1275) + response.setContentType("text/html;charset=utf-8"); + PrintWriter writer = response.getWriter(); + + if (output.length() > 0) { + writer.println(output); } + } - protected void writeAJAXOKResponse(HttpServletResponse response) throws IOException { - writeAJAXResponse(response, "OK"); + protected void writeAJAXOKResponse(HttpServletResponse response) throws IOException { + writeAJAXResponse(response, "OK"); + } + + protected void writeResponse(HttpServletResponse response, String contentType, String characterEncoding, String output) throws IOException { + response.setContentType(contentType); + response.setCharacterEncoding(characterEncoding); + PrintWriter writer = response.getWriter(); + if (output.length() > 0) { + writer.println(output); } + } } Index: lams_common/src/java/org/lamsfoundation/lams/workspace/dto/FolderContentDTO.java =================================================================== diff -u -rb9c68da61a40efc2425fb80c0c1e7b06f8fcfe78 -racc8d2acf5b6b0002e0c8129947040a779ab4077 --- lams_common/src/java/org/lamsfoundation/lams/workspace/dto/FolderContentDTO.java (.../FolderContentDTO.java) (revision b9c68da61a40efc2425fb80c0c1e7b06f8fcfe78) +++ lams_common/src/java/org/lamsfoundation/lams/workspace/dto/FolderContentDTO.java (.../FolderContentDTO.java) (revision acc8d2acf5b6b0002e0c8129947040a779ab4077) @@ -24,11 +24,13 @@ package org.lamsfoundation.lams.workspace.dto; import java.util.Date; import java.util.SortedSet; +import java.util.TimeZone; import java.util.Vector; -import org.apache.commons.lang.time.DateUtils; import org.lamsfoundation.lams.learningdesign.LearningDesign; +import org.lamsfoundation.lams.usermanagement.User; import org.lamsfoundation.lams.usermanagement.WorkspaceFolder; +import org.lamsfoundation.lams.util.DateUtil; import org.lamsfoundation.lams.util.wddx.WDDXTAGS; import org.lamsfoundation.lams.workspace.WorkspaceFolderContent; @@ -76,12 +78,12 @@ this.versionDetails = null; this.readOnly = false; } - public FolderContentDTO(LearningDesign design, Integer permissionCode){ + public FolderContentDTO(LearningDesign design, Integer permissionCode, User user){ this.name = design.getTitle(); this.description = design.getDescription(); this.creationDateTime = design.getCreateDateTime(); this.lastModifiedDateTime = design.getLastModifiedDateTime(); - this.formattedLastModifiedDateTime = formatLastModifiedDateTime(); + this.formattedLastModifiedDateTime = formatLastModifiedDateTime(TimeZone.getTimeZone(User.timezoneList[user.getTimeZone()])); this.resourceType = DESIGN; this.resourceID = design.getLearningDesignId(); this.permissionCode = permissionCode; @@ -90,12 +92,12 @@ this.versionDetails = null; this.readOnly = design.getReadOnly(); } - public FolderContentDTO(WorkspaceFolder workspaceFolder, Integer permissionCode){ + public FolderContentDTO(WorkspaceFolder workspaceFolder, Integer permissionCode, User user){ this.name = workspaceFolder.getName(); this.description = "Folder"; this.creationDateTime = workspaceFolder.getCreationDate(); this.lastModifiedDateTime = workspaceFolder.getLastModifiedDate(); - this.formattedLastModifiedDateTime = formatLastModifiedDateTime(); + this.formattedLastModifiedDateTime = formatLastModifiedDateTime(TimeZone.getTimeZone(User.timezoneList[user.getTimeZone()])); this.resourceType = FOLDER; this.resourceTypeID = new Long(workspaceFolder.getWorkspaceFolderType().intValue()); this.resourceID = new Long(workspaceFolder.getWorkspaceFolderId().intValue()); @@ -104,12 +106,12 @@ this.versionDetails = null; this.readOnly = Boolean.FALSE; } - public FolderContentDTO(Integer permissionCode, WorkspaceFolderContent workspaceFolderContent,SortedSet details){ + public FolderContentDTO(Integer permissionCode, WorkspaceFolderContent workspaceFolderContent, SortedSet details, User user){ this.name =workspaceFolderContent.getName(); this.description = workspaceFolderContent.getDescription(); this.creationDateTime = workspaceFolderContent.getCreateDate(); this.lastModifiedDateTime = workspaceFolderContent.getLastModified(); - this.formattedLastModifiedDateTime = formatLastModifiedDateTime(); + this.formattedLastModifiedDateTime = formatLastModifiedDateTime(TimeZone.getTimeZone(User.timezoneList[user.getTimeZone()])); this.resourceID = workspaceFolderContent.getFolderContentID(); this.permissionCode = permissionCode; if(workspaceFolderContent.getContentTypeID().equals(WorkspaceFolderContent.CONTENT_TYPE_FILE)) @@ -209,10 +211,10 @@ this.readOnly = readOnly; } - private String formatLastModifiedDateTime() { + private String formatLastModifiedDateTime(TimeZone tz) { if(this.lastModifiedDateTime != null) { java.text.SimpleDateFormat sdf = new java.text.SimpleDateFormat("dd-MMM-yyyy HH:mm:ss"); - return sdf.format(lastModifiedDateTime); + return sdf.format(DateUtil.convertToTimeZoneFromDefault(tz, this.lastModifiedDateTime)); } else { return null; } Index: lams_gradebook/src/java/org/lamsfoundation/lams/gradebook/dto/GradebookGridRowDTO.java =================================================================== diff -u -r2f21856ec2ab85b47c93cfcc3fa2c8769be65077 -racc8d2acf5b6b0002e0c8129947040a779ab4077 --- lams_gradebook/src/java/org/lamsfoundation/lams/gradebook/dto/GradebookGridRowDTO.java (.../GradebookGridRowDTO.java) (revision 2f21856ec2ab85b47c93cfcc3fa2c8769be65077) +++ lams_gradebook/src/java/org/lamsfoundation/lams/gradebook/dto/GradebookGridRowDTO.java (.../GradebookGridRowDTO.java) (revision acc8d2acf5b6b0002e0c8129947040a779ab4077) @@ -18,11 +18,11 @@ * * http://www.gnu.org/licenses/gpl.txt * **************************************************************** - */ - -/* $Id$ */ -package org.lamsfoundation.lams.gradebook.dto; + */ +/* $Id$ */ +package org.lamsfoundation.lams.gradebook.dto; + import java.text.DecimalFormat; import java.util.ArrayList; @@ -40,16 +40,16 @@ // The name for the row, every gradebook row has some sort of name // Be it the user's name, the activity name, the lesson name etc public String rowName; - + // A unit of time in milliseconds that determines the time taken for the corressponding task public Long timeTaken; - + // Another unit of time that represents average time taken for a corresponding task public Long averageTimeTaken; - + // The mark for the corresponding gradebook grid row task public Double mark; - + // Average mark for the corresponding task public Double averageMark; @@ -94,7 +94,6 @@ return null; } } - protected String markToString() { if (mark != null) { Index: lams_learning/src/java/org/lamsfoundation/lams/learning/export/web/action/ImageBundler.java =================================================================== diff -u -r61df3f3f473a3619f93c63ceb879ae36438020e8 -racc8d2acf5b6b0002e0c8129947040a779ab4077 --- lams_learning/src/java/org/lamsfoundation/lams/learning/export/web/action/ImageBundler.java (.../ImageBundler.java) (revision 61df3f3f473a3619f93c63ceb879ae36438020e8) +++ lams_learning/src/java/org/lamsfoundation/lams/learning/export/web/action/ImageBundler.java (.../ImageBundler.java) (revision acc8d2acf5b6b0002e0c8129947040a779ab4077) @@ -47,7 +47,7 @@ private static Logger log = Logger.getLogger(ImageBundler.class); private static String[] miscImages = new String[] { "dash.gif", "cross.gif", "error.jpg", "spacer.gif", "tick.gif", - "tree_closed.gif", "tree_open.gif" }; + "tree_closed.gif", "tree_open.gif" , "help.jpg"}; Map filesToCopy = null; List directoriesRequired = null; Index: lams_learning/src/java/org/lamsfoundation/lams/learning/learningApplicationContext.xml =================================================================== diff -u -r126d84999e520648cb187e465cb4aaa3baad222e -racc8d2acf5b6b0002e0c8129947040a779ab4077 --- lams_learning/src/java/org/lamsfoundation/lams/learning/learningApplicationContext.xml (.../learningApplicationContext.xml) (revision 126d84999e520648cb187e465cb4aaa3baad222e) +++ lams_learning/src/java/org/lamsfoundation/lams/learning/learningApplicationContext.xml (.../learningApplicationContext.xml) (revision acc8d2acf5b6b0002e0c8129947040a779ab4077) @@ -37,6 +37,7 @@ + Index: lams_learning/src/java/org/lamsfoundation/lams/learning/progress/ProgressEngine.java =================================================================== diff -u -rfc2b6751efa103ff475378442632b752c01c2736 -racc8d2acf5b6b0002e0c8129947040a779ab4077 --- lams_learning/src/java/org/lamsfoundation/lams/learning/progress/ProgressEngine.java (.../ProgressEngine.java) (revision fc2b6751efa103ff475378442632b752c01c2736) +++ lams_learning/src/java/org/lamsfoundation/lams/learning/progress/ProgressEngine.java (.../ProgressEngine.java) (revision acc8d2acf5b6b0002e0c8129947040a779ab4077) @@ -21,7 +21,7 @@ * **************************************************************** */ -/* $$Id$$ */ +/* $$Id$$ */ package org.lamsfoundation.lams.learning.progress; import java.util.Date; @@ -42,234 +42,243 @@ import org.lamsfoundation.lams.usermanagement.User; /** - * The Progress Engine controls how a learner progresses - * through a sequence. - * - * Code must be re-entrant, as there is one progress engine object called by a singleton LearnerService. + * The Progress Engine controls how a learner progresses through a sequence. * - * @author chris, Jacky + * Code must be re-entrant, as there is one progress engine object called by a + * singleton LearnerService. + * + * @author chris, Jacky */ -public class ProgressEngine -{ - protected Logger log = Logger.getLogger(ProgressEngine.class); +public class ProgressEngine { + protected Logger log = Logger.getLogger(ProgressEngine.class); private IActivityDAO activityDAO; /** - * Method determines next step for a learner based on the activity - * they have just completed. Will clear the Parallel Waiting Complete value if it is currently set. - * @param learner The User who is progressing through the Lesson. - * @param completedActivity The Activity the learner has just completed. - * @param lesson The Lesson the learner needs progress for. + * Method determines next step for a learner based on the activity they have + * just completed. Will clear the Parallel Waiting Complete value if it is + * currently set. + * + * @param learner + * The User who is progressing through the + * Lesson. + * @param completedActivity + * The Activity the learner has just + * completed. + * @param lesson + * The Lesson the learner needs progress for. * @param learnerProgress - * @return Progress The VO that contains the data needed to send - * the learner to the next step. - * @throws ProgressException if progress cannot be calculated successfully. + * @return Progress The VO that contains the data needed to send the learner + * to the next step. + * @throws ProgressException + * if progress cannot be calculated successfully. */ - public LearnerProgress calculateProgress(User learner, - Activity completedActivity, - LearnerProgress learnerProgress) throws ProgressException - { - if ( learnerProgress.getParallelWaiting() == LearnerProgress.PARALLEL_WAITING_COMPLETE ) { - learnerProgress.setParallelWaiting(LearnerProgress.PARALLEL_NO_WAIT); - } - return doCalculateProgress(learner, completedActivity, learnerProgress, new LinkedList()); + public LearnerProgress calculateProgress(User learner, Activity completedActivity, LearnerProgress learnerProgress) + throws ProgressException { + if (learnerProgress.getParallelWaiting() == LearnerProgress.PARALLEL_WAITING_COMPLETE) { + learnerProgress.setParallelWaiting(LearnerProgress.PARALLEL_NO_WAIT); + } + return doCalculateProgress(learner, completedActivity, learnerProgress, new LinkedList()); } - - /** Internal method used for recursion. Does the actual "work" of calculateProgress. */ - private LearnerProgress doCalculateProgress(User learner, - Activity completedActivity, - LearnerProgress learnerProgress, - List completedActivityList) throws ProgressException - { - learnerProgress.setProgressState(completedActivity, - LearnerProgress.ACTIVITY_COMPLETED, - activityDAO); - completedActivityList.add(completedActivity.getActivityId()); - if ( completedActivity.isStopAfterActivity() ) { - // special case - terminate the lesson here. - learnerProgress.setProgressState(completedActivity, LearnerProgress.ACTIVITY_COMPLETED,activityDAO); - for ( Activity parentActivity = completedActivity.getParentActivity() ; parentActivity != null; parentActivity = parentActivity.getParentActivity() ) { - learnerProgress.setProgressState(parentActivity, LearnerProgress.ACTIVITY_COMPLETED,activityDAO); - completedActivityList.add(parentActivity.getActivityId()); - } - populateCurrentCompletedActivityList(learnerProgress, completedActivityList); - learnerProgress.setFinishDate(new Date()); - return setLessonComplete(learnerProgress, LearnerProgress.LESSON_IN_DESIGN_COMPLETE); - } else if ( completedActivity.isFloating() && !completedActivity.getParentActivity().isParallelActivity()) { - // special case - floating activity and not parallel activity (floating) child. - return learnerProgress; - } else { - Transition transition = completedActivity.getTransitionFrom(); - if (transition != null) - return progressCompletedActivity(learner, - completedActivity, - learnerProgress, - transition, - completedActivityList); - else - return progressParentActivity(learner, - completedActivity, - learnerProgress, - completedActivityList); - } + /** + * Internal method used for recursion. Does the actual "work" of + * calculateProgress. + */ + private LearnerProgress doCalculateProgress(User learner, Activity completedActivity, + LearnerProgress learnerProgress, List completedActivityList) throws ProgressException { + learnerProgress.setProgressState(completedActivity, LearnerProgress.ACTIVITY_COMPLETED, activityDAO); + completedActivityList.add(completedActivity.getActivityId()); + + if (completedActivity.isStopAfterActivity()) { + // special case - terminate the lesson here. + learnerProgress.setProgressState(completedActivity, LearnerProgress.ACTIVITY_COMPLETED, activityDAO); + for (Activity parentActivity = completedActivity.getParentActivity(); parentActivity != null; parentActivity = parentActivity + .getParentActivity()) { + learnerProgress.setProgressState(parentActivity, LearnerProgress.ACTIVITY_COMPLETED, activityDAO); + completedActivityList.add(parentActivity.getActivityId()); + } + populateCurrentCompletedActivityList(learnerProgress, completedActivityList); + learnerProgress.setFinishDate(new Date()); + return setLessonComplete(learnerProgress, LearnerProgress.LESSON_IN_DESIGN_COMPLETE); + } else if (completedActivity.isFloating() && !completedActivity.getParentActivity().isParallelActivity()) { + // special case - floating activity and not parallel activity (floating) child. + return learnerProgress; + } else { + Transition transition = completedActivity.getTransitionFrom(); + if (transition != null) + return progressCompletedActivity(learner, completedActivity, learnerProgress, transition, + completedActivityList); + else + return progressParentActivity(learner, completedActivity, learnerProgress, completedActivityList); + } } /** * Method determines the start point for a learner when they begin a Lesson. * - * It is also reused to calculate where the learner should be should the progress - * "go wrong". For example, the teacher does live edit and the learner moves to - * the stop gate created for the live edit. When the edit is completed, the stop - * gate is removed. But now there is no current activity for the learner. + * It is also reused to calculate where the learner should be should the + * progress "go wrong". For example, the teacher does live edit and the + * learner moves to the stop gate created for the live edit. When the edit + * is completed, the stop gate is removed. But now there is no current + * activity for the learner. * - * @param LearnerProgress The user's progress details for the User who is starting the Lesson. + * @param LearnerProgress + * The user's progress details for the User + * who is starting the Lesson. * @return LearnerProgress The updated user's progress details. - * @throws ProgressException if the start point cannot be calculated successfully. + * @throws ProgressException + * if the start point cannot be calculated successfully. */ - public LearnerProgress setUpStartPoint(LearnerProgress progress) throws ProgressException - { - - LearningDesign ld = progress.getLesson().getLearningDesign(); - - if (progress.getLesson().getLockedForEdit()) { - // special case - currently setting up the stop gates for live edit. - return clearProgressNowhereToGoNotCompleted(progress,"setUpStartPoint"); - } else if (progress.isComplete() ) { - return progress; - } else if(ld.getFirstActivity()==null) { - throw new ProgressException("Could not find first activity for " - +"learning design ["+ld.getTitle()+"], id[" - +ld.getLearningDesignId().longValue() - +"]"); - } else if ( progress.getCompletedActivities().containsKey(ld.getFirstActivity()) ) { - // special case - recalculating the appropriate current activity. - return doCalculateProgress(progress.getUser(), ld.getFirstActivity(), progress, new LinkedList()); - } else if ( canDoActivity(progress.getLesson(), ld.getFirstActivity()) ) { - // normal case - progress.setCurrentActivity(ld.getFirstActivity()); - progress.setNextActivity(ld.getFirstActivity()); - setActivityAttempted(progress, ld.getFirstActivity()); - return progress; - } else { - // special case - trying to get to a whole new activity (past the stop gate) - // during a live edit - return clearProgressNowhereToGoNotCompleted(progress,"setUpStartPoint"); - } + public LearnerProgress setUpStartPoint(LearnerProgress progress) throws ProgressException { + + LearningDesign ld = progress.getLesson().getLearningDesign(); + + if (progress.getLesson().getLockedForEdit()) { + // special case - currently setting up the stop gates for live edit. + return clearProgressNowhereToGoNotCompleted(progress, "setUpStartPoint"); + } else if (progress.isComplete()) { + return progress; + } else if (ld.getFirstActivity() == null) { + throw new ProgressException("Could not find first activity for " + "learning design [" + ld.getTitle() + + "], id[" + ld.getLearningDesignId().longValue() + "]"); + } else if (progress.getCompletedActivities().containsKey(ld.getFirstActivity())) { + // special case - recalculating the appropriate current activity. + return doCalculateProgress(progress.getUser(), ld.getFirstActivity(), progress, new LinkedList()); + } else if (canDoActivity(progress.getLesson(), ld.getFirstActivity())) { + // normal case + progress.setCurrentActivity(ld.getFirstActivity()); + progress.setNextActivity(ld.getFirstActivity()); + setActivityAttempted(progress, ld.getFirstActivity()); + return progress; + } else { + // special case - trying to get to a whole new activity (past the stop gate) + // during a live edit + return clearProgressNowhereToGoNotCompleted(progress, "setUpStartPoint"); + } } - - /** Is it okay for me to do this activity? Most of the time yes - but you can do it - * if the learning design is marked for edit (due to live edit) and the activity isn't read - * only. This case should only occur if you have snuck past the stop gates while live edit - * was being set up. Hopefully never! + + /** + * Is it okay for me to do this activity? Most of the time yes - but you can + * do it if the learning design is marked for edit (due to live edit) and + * the activity isn't read only. This case should only occur if you have + * snuck past the stop gates while live edit was being set up. Hopefully + * never! * - * See the live edit documentation on the wiki for more details on the Lesson.lockedForEdit - * and LearningDesign.activityReadOnly flags. These are set up in AuthoringService.setupEditOnFlyLock() + * See the live edit documentation on the wiki for more details on the + * Lesson.lockedForEdit and LearningDesign.activityReadOnly flags. These are + * set up in AuthoringService.setupEditOnFlyLock() * * @param design * @param activity * @return */ private boolean canDoActivity(Lesson lesson, Activity activity) { - LearningDesign design = lesson.getLearningDesign(); - return ! lesson.getLockedForEdit() && ( ! design.getEditOverrideLock() || activity.isActivityReadOnly() ) ; + LearningDesign design = lesson.getLearningDesign(); + return !lesson.getLockedForEdit() && (!design.getEditOverrideLock() || activity.isActivityReadOnly()); } - /** - * Oh, dear - nowhere to go. Probably because the sequence is being edited - * while I'm trying to move to an untouched activity, or it is in the process - * of setting up the stop gates for live edit. + /** + * Oh, dear - nowhere to go. Probably because the sequence is being edited + * while I'm trying to move to an untouched activity, or it is in the + * process of setting up the stop gates for live edit. * * Set the current activity and next activity to null, and the progress - * engine should then show the "Sequence Broken" screen. + * engine should then show the "Sequence Broken" screen. * - * Writes a warning to the log if callingMethod is not null. If it is null, we assume - * the calling code has written out a warning/error already. + * Writes a warning to the log if callingMethod is not null. If it is null, + * we assume the calling code has written out a warning/error already. */ private LearnerProgress clearProgressNowhereToGoNotCompleted(LearnerProgress progress, String callingMethod) { - if ( callingMethod != null ) { - log.warn("Learner "+progress.getUser().getFullName()+"("+progress.getUser().getUserId() - +") has a problem with the progress for lesson " - +progress.getLesson().getLessonName()+"("+progress.getLesson().getLessonId() - +"). Completed activities so far was "+progress.getCurrentCompletedActivitiesList() - +". Setting current and next activity to null. Problem detected in method "+callingMethod+"."); - } - - progress.setCurrentActivity(null); - progress.setNextActivity(null); - progress.setLessonComplete(LearnerProgress.LESSON_NOT_COMPLETE); - return progress; + if (callingMethod != null) { + log.warn("Learner " + progress.getUser().getFullName() + "(" + progress.getUser().getUserId() + + ") has a problem with the progress for lesson " + progress.getLesson().getLessonName() + "(" + + progress.getLesson().getLessonId() + "). Completed activities so far was " + + progress.getCurrentCompletedActivitiesList() + + ". Setting current and next activity to null. Problem detected in method " + callingMethod + "."); + } + + progress.setCurrentActivity(null); + progress.setNextActivity(null); + progress.setLessonComplete(LearnerProgress.LESSON_NOT_COMPLETE); + return progress; } - - /** Set the current activity as attempted. If it is a parallel activity, mark its children as attempted too. */ + + /** + * Set the current activity as attempted. If it is a parallel activity, mark + * its children as attempted too. + */ public void setActivityAttempted(LearnerProgress progress, Activity activity) { - progress.setProgressState(activity,LearnerProgress.ACTIVITY_ATTEMPTED, activityDAO); - activity.setReadOnly(true); - - if ( activity.isParallelActivity() ) { - ParallelActivity parallel = (ParallelActivity) activityDAO.getActivityByActivityId(activity.getActivityId(), ParallelActivity.class); - Iterator iter = parallel.getActivities().iterator(); - while (iter.hasNext()) { - Activity element = (Activity) iter.next(); - setActivityAttempted(progress,element); - } - } - - // update activity - activityDAO.insertOrUpdate(activity); + progress.setProgressState(activity, LearnerProgress.ACTIVITY_ATTEMPTED, activityDAO); + activity.setReadOnly(true); + + if (activity.isParallelActivity()) { + ParallelActivity parallel = (ParallelActivity) activityDAO.getActivityByActivityId( + activity.getActivityId(), ParallelActivity.class); + Iterator iter = parallel.getActivities().iterator(); + while (iter.hasNext()) { + Activity element = (Activity) iter.next(); + setActivityAttempted(progress, element); + } + } + + // update activity + activityDAO.insertOrUpdate(activity); } + /** - * We setup the progress data for a completed activity. This happens when - * we find a transition to progress to. It should setup all activity states + * We setup the progress data for a completed activity. This happens when we + * find a transition to progress to. It should setup all activity states * that allow web layer to calculate the url to move one to. * - * @param completedActivity the activity finished either by user or the - * lams. In terms of lams completed activity, it would be - * ParallelActivity, SequenceActivity, - * OptionsActivity and other system driven activities. - * Whereas user activity will be mostly tool activities. - * @param learnerProgress the progress we based on. - * @param transition the transition we progress to. + * @param completedActivity + * the activity finished either by user or the lams. In terms + * of lams completed activity, it would be + * ParallelActivity, + * SequenceActivity, + * OptionsActivity and other system driven + * activities. Whereas user activity will be mostly tool + * activities. + * @param learnerProgress + * the progress we based on. + * @param transition + * the transition we progress to. * @return the learner progress data we calculated. - * @throws ProgressException + * @throws ProgressException */ - private LearnerProgress progressCompletedActivity(User learner, - Activity completedActivity, - LearnerProgress learnerProgress, - Transition transition, - List completedActivityList) throws ProgressException - { - Activity nextActivity = transition.getToActivity(); - - if ( ! learnerProgress.getCompletedActivities().containsKey(nextActivity) ) { - // normal case - the next activity is still yet to be done - - learnerProgress.setPreviousActivity(completedActivity); - - populateCurrentCompletedActivityList(learnerProgress, completedActivityList); - - if ( canDoActivity(learnerProgress.getLesson(), nextActivity) ) { - - learnerProgress.setCurrentActivity(nextActivity); - learnerProgress.setNextActivity(nextActivity); - setActivityAttempted(learnerProgress, nextActivity); - if ( learnerProgress.getParallelWaiting() == LearnerProgress.PARALLEL_WAITING ) - learnerProgress.setParallelWaiting(LearnerProgress.PARALLEL_WAITING_COMPLETE ); - - } else { - return clearProgressNowhereToGoNotCompleted(learnerProgress,"progressCompletedActivity"); - } - - return learnerProgress; - - } else { - // abnormal case: next activity already done. Must have jumped back to an earlier - // optional activity, done another activity and then kept going - - return doCalculateProgress(learner,nextActivity,learnerProgress, completedActivityList); - } - + private LearnerProgress progressCompletedActivity(User learner, Activity completedActivity, + LearnerProgress learnerProgress, Transition transition, List completedActivityList) + throws ProgressException { + Activity nextActivity = transition.getToActivity(); + + if (!learnerProgress.getCompletedActivities().containsKey(nextActivity)) { + // normal case - the next activity is still yet to be done + + learnerProgress.setPreviousActivity(completedActivity); + + populateCurrentCompletedActivityList(learnerProgress, completedActivityList); + + if (canDoActivity(learnerProgress.getLesson(), nextActivity)) { + + learnerProgress.setCurrentActivity(nextActivity); + learnerProgress.setNextActivity(nextActivity); + setActivityAttempted(learnerProgress, nextActivity); + if (learnerProgress.getParallelWaiting() == LearnerProgress.PARALLEL_WAITING) + learnerProgress.setParallelWaiting(LearnerProgress.PARALLEL_WAITING_COMPLETE); + + } else { + return clearProgressNowhereToGoNotCompleted(learnerProgress, "progressCompletedActivity"); + } + + return learnerProgress; + + } else { + // abnormal case: next activity already done. Must have jumped back to an earlier + // optional activity, done another activity and then kept going + + return doCalculateProgress(learner, nextActivity, learnerProgress, completedActivityList); + } + } /** @@ -278,133 +287,127 @@ * is in the leaf node of an activity hierarchy. And we need to travesal the * activity hierarchy upwards to find the progress information. * - * @param learner the current learner. - * @param lesson the lesson that current learner progress belongs to. - * @param completedActivity the activity finished either by user or the - * lams. In terms of lams completed activity, it would be - * ParallelActivity, SequenceActivity, - * OptionsActivity and other system driven activities. - * Whereas user activity will be mostly tool activities. - * @param learnerProgress the progress we based on. + * @param learner + * the current learner. + * @param lesson + * the lesson that current learner progress belongs to. + * @param completedActivity + * the activity finished either by user or the lams. In terms + * of lams completed activity, it would be + * ParallelActivity, + * SequenceActivity, + * OptionsActivity and other system driven + * activities. Whereas user activity will be mostly tool + * activities. + * @param learnerProgress + * the progress we based on. * @return the learner progress data we calculated. * @throws ProgressException */ - private LearnerProgress progressParentActivity(User learner, - Activity completedActivity, - LearnerProgress learnerProgress, - List completedActivityList) throws ProgressException - { - Activity parent = completedActivity.getParentActivity(); - - if (parent != null) - { - if(!(parent.isComplexActivity())) - throw new ProgressException("Parent activity is always expected" + - " to the complex activity. But activity type"+ - parent.getActivityTypeId()+" has been found"); - //move to next activity within parent if not all children are completed. - - - ComplexActivity complexParent = (ComplexActivity) activityDAO.getActivityByActivityId(parent.getActivityId(),ComplexActivity.class); - if (! learnerProgress.getCompletedActivities().containsKey(complexParent) && !complexParent.areChildrenCompleted(learnerProgress)) - { - Activity nextActivity = complexParent.getNextActivityByParent(completedActivity); - - - if (!isNextActivityValid(nextActivity)) { - log.error("Error occurred in progress engine." - + " Unexpected Null activity received when progressing" - + " to the next activity within a incomplete parent activity:" - + " Parent activity id [" - + parent.getActivityId() - + "]"); - learnerProgress = clearProgressNowhereToGoNotCompleted(learnerProgress,null); - } - else if(isParallelWaitActivity(nextActivity)) - { - learnerProgress.setParallelWaiting(LearnerProgress.PARALLEL_WAITING); - // learnerProgress.setNextActivity(null); - populateCurrentCompletedActivityList(learnerProgress, completedActivityList); - } - else if ( canDoActivity(learnerProgress.getLesson(), nextActivity) ) - { - learnerProgress.setNextActivity(nextActivity); - setActivityAttempted(learnerProgress, nextActivity); - populateCurrentCompletedActivityList(learnerProgress, completedActivityList); - } - else { - learnerProgress = clearProgressNowhereToGoNotCompleted(learnerProgress, "progressParentActivity"); - } - } - //recurvisely call back to calculateProgress to calculate completed - //parent activity. - else { - learnerProgress.setPreviousActivity(complexParent); - doCalculateProgress(learner, parent, learnerProgress, completedActivityList); - if ( learnerProgress.getParallelWaiting() == LearnerProgress.PARALLEL_WAITING ) - learnerProgress.setParallelWaiting(LearnerProgress.PARALLEL_WAITING_COMPLETE ); - } - } - //lesson is meant to be completed if there is no transition and no parent. - else { - learnerProgress.setFinishDate(new Date()); - learnerProgress = setLessonComplete(learnerProgress, LearnerProgress.LESSON_END_OF_DESIGN_COMPLETE); - } + private LearnerProgress progressParentActivity(User learner, Activity completedActivity, + LearnerProgress learnerProgress, List completedActivityList) throws ProgressException { + Activity parent = completedActivity.getParentActivity(); - return learnerProgress; - } + if (parent != null) { + if (!(parent.isComplexActivity())) + throw new ProgressException("Parent activity is always expected" + + " to the complex activity. But activity type" + parent.getActivityTypeId() + + " has been found"); + //move to next activity within parent if not all children are completed. - /** - * Set the lesson to complete for this learner. - * - * @param learnerProgress - * @return updated learnerProgress - */ - private LearnerProgress setLessonComplete(LearnerProgress learnerProgress, byte completionStatus) { - learnerProgress.setCurrentActivity(null); - learnerProgress.setNextActivity(null); - learnerProgress.setLessonComplete(completionStatus); - return learnerProgress; + ComplexActivity complexParent = (ComplexActivity) activityDAO.getActivityByActivityId(parent + .getActivityId(), ComplexActivity.class); + if (!learnerProgress.getCompletedActivities().containsKey(complexParent) + && !complexParent.areChildrenCompleted(learnerProgress)) { + Activity nextActivity = complexParent.getNextActivityByParent(completedActivity); + + if (!isNextActivityValid(nextActivity)) { + log.error("Error occurred in progress engine." + + " Unexpected Null activity received when progressing" + + " to the next activity within a incomplete parent activity:" + " Parent activity id [" + + parent.getActivityId() + "]"); + learnerProgress = clearProgressNowhereToGoNotCompleted(learnerProgress, null); + } else if (isParallelWaitActivity(nextActivity)) { + learnerProgress.setParallelWaiting(LearnerProgress.PARALLEL_WAITING); + // learnerProgress.setNextActivity(null); + populateCurrentCompletedActivityList(learnerProgress, completedActivityList); + } else if (canDoActivity(learnerProgress.getLesson(), nextActivity)) { + learnerProgress.setNextActivity(nextActivity); + setActivityAttempted(learnerProgress, nextActivity); + populateCurrentCompletedActivityList(learnerProgress, completedActivityList); + } else { + learnerProgress = clearProgressNowhereToGoNotCompleted(learnerProgress, "progressParentActivity"); + } + } + //recurvisely call back to calculateProgress to calculate completed + //parent activity. + else { + learnerProgress.setPreviousActivity(complexParent); + doCalculateProgress(learner, parent, learnerProgress, completedActivityList); + if (learnerProgress.getParallelWaiting() == LearnerProgress.PARALLEL_WAITING) + learnerProgress.setParallelWaiting(LearnerProgress.PARALLEL_WAITING_COMPLETE); + } } + //lesson is meant to be completed if there is no transition and no parent. + else { + learnerProgress.setFinishDate(new Date()); + learnerProgress = setLessonComplete(learnerProgress, LearnerProgress.LESSON_END_OF_DESIGN_COMPLETE); + } + return learnerProgress; + } + /** + * Set the lesson to complete for this learner. + * + * @param learnerProgress + * @return updated learnerProgress + */ + private LearnerProgress setLessonComplete(LearnerProgress learnerProgress, byte completionStatus) { + learnerProgress.setCurrentActivity(null); + learnerProgress.setNextActivity(null); + learnerProgress.setLessonComplete(completionStatus); + return learnerProgress; + } + + /** * The helper method to setup the completed activity list since the last - * transition. + * transition. + * * @param learnerProgress */ - private void populateCurrentCompletedActivityList(LearnerProgress learnerProgress, List completedActivityList) - { - learnerProgress.setCurrentCompletedActivitiesList(completedActivityList); - completedActivityList.clear(); + private void populateCurrentCompletedActivityList(LearnerProgress learnerProgress, List completedActivityList) { + learnerProgress.setCurrentCompletedActivitiesList(completedActivityList); + completedActivityList.clear(); } - + /** * The next valid is valid if it is not null activity or if it is a parallel * waiting activity. - * @param nextActivity the next activity we progress to. + * + * @param nextActivity + * the next activity we progress to. * @return is the next activity valid. */ - private boolean isNextActivityValid(Activity nextActivity) - { - return !nextActivity.isNull()||isParallelWaitActivity(nextActivity); + private boolean isNextActivityValid(Activity nextActivity) { + return !nextActivity.isNull() || isParallelWaitActivity(nextActivity); } /** - * Check up the object type to see whether it is a parallel waiting + * Check up the object type to see whether it is a parallel waiting * activity. - * @param nextActivity the next activity we progress to. + * + * @param nextActivity + * the next activity we progress to. * @return is the next activity the type of parallel activity. */ - private boolean isParallelWaitActivity(Activity nextActivity) - { - return nextActivity.getActivityTypeId()!=null && nextActivity.getActivityTypeId().intValue()==ParallelWaitActivity.PARALLEL_WAIT_ACTIVITY_TYPE; + private boolean isParallelWaitActivity(Activity nextActivity) { + return nextActivity.getActivityTypeId() != null + && nextActivity.getActivityTypeId().intValue() == ParallelWaitActivity.PARALLEL_WAIT_ACTIVITY_TYPE; } - public void setActivityDAO(IActivityDAO activityDAO) { - this.activityDAO = activityDAO; - } - + public void setActivityDAO(IActivityDAO activityDAO) { + this.activityDAO = activityDAO; + } - - } \ No newline at end of file Index: lams_learning/src/java/org/lamsfoundation/lams/learning/service/LearnerService.java =================================================================== diff -u -rc4bbe0b084234edffd2c0c43dce7d7b1fbf14863 -racc8d2acf5b6b0002e0c8129947040a779ab4077 --- lams_learning/src/java/org/lamsfoundation/lams/learning/service/LearnerService.java (.../LearnerService.java) (revision c4bbe0b084234edffd2c0c43dce7d7b1fbf14863) +++ lams_learning/src/java/org/lamsfoundation/lams/learning/service/LearnerService.java (.../LearnerService.java) (revision acc8d2acf5b6b0002e0c8129947040a779ab4077) @@ -35,12 +35,15 @@ import java.util.TreeMap; import org.apache.log4j.Logger; +import org.lamsfoundation.lams.gradebook.GradebookUserActivity; +import org.lamsfoundation.lams.gradebook.service.IGradebookService; import org.lamsfoundation.lams.learning.progress.ProgressBuilder; import org.lamsfoundation.lams.learning.progress.ProgressEngine; import org.lamsfoundation.lams.learning.progress.ProgressException; import org.lamsfoundation.lams.learning.web.bean.GateActivityDTO; import org.lamsfoundation.lams.learning.web.util.ActivityMapping; import org.lamsfoundation.lams.learningdesign.Activity; +import org.lamsfoundation.lams.learningdesign.ActivityEvaluation; import org.lamsfoundation.lams.learningdesign.BranchActivityEntry; import org.lamsfoundation.lams.learningdesign.BranchCondition; import org.lamsfoundation.lams.learningdesign.BranchingActivity; @@ -65,6 +68,7 @@ import org.lamsfoundation.lams.lesson.service.ILessonService; import org.lamsfoundation.lams.lesson.service.LessonServiceException; import org.lamsfoundation.lams.tool.ToolOutput; +import org.lamsfoundation.lams.tool.ToolOutputValue; import org.lamsfoundation.lams.tool.ToolSession; import org.lamsfoundation.lams.tool.dao.IToolSessionDAO; import org.lamsfoundation.lams.tool.exception.LamsToolServiceException; @@ -98,6 +102,7 @@ private ILessonService lessonService; private static HashMap syncMap = new HashMap(); protected MessageService messageService; + private IGradebookService gradebookService; // --------------------------------------------------------------------- // Inversion of Control Methods - Constructor injection @@ -109,8 +114,9 @@ } /** - * Creates a new instance of LearnerService. To be used by Spring, assuming the Spring will set up the progress - * engine via method injection. If you are creating the bean manually then use the other constructor. + * Creates a new instance of LearnerService. To be used by Spring, assuming + * the Spring will set up the progress engine via method injection. If you + * are creating the bean manually then use the other constructor. */ public LearnerService() { } @@ -219,7 +225,8 @@ } /** - * Get the lesson data for a particular lesson. In a DTO format suitable for sending to the client. + * Get the lesson data for a particular lesson. In a DTO format suitable for + * sending to the client. */ public LessonDTO getLessonData(Long lessonId) { Lesson lesson = getLesson(lessonId); @@ -228,18 +235,21 @@ /** *

- * Joins a User to a lesson as a learner. It could either be a new lesson or a lesson that has been started. + * Joins a User to a lesson as a learner. It could either be a new lesson or + * a lesson that has been started. *

* *

- * In terms of new lesson, a new learner progress would be initialized. Tool session for the next activity will be - * initialized if necessary. + * In terms of new lesson, a new learner progress would be initialized. Tool + * session for the next activity will be initialized if necessary. *

* *

- * In terms of an started lesson, the learner progress will be returned without calculation. Tool session will be - * initialized if necessary. Note that we won't initialize tool session for current activity because we assume tool - * session will always initialize before it becomes a current activity.

0) { + + // Getting the first activity evaluation + ActivityEvaluation eval = toolActivity.getActivityEvaluations().iterator().next(); + + try { + ToolOutput toolOutput = lamsCoreToolService.getOutputFromTool(eval.getToolOutputDefinition(), + toolSession, learner.getUserId()); + + if (toolOutput != null) { + ToolOutputValue outputVal = toolOutput.getValue(); + if (outputVal != null) { + Double outputDouble = outputVal.getDouble(); + + GradebookUserActivity gradebookUserActivity = gradebookService.getGradebookUserActivity( + toolActivity.getActivityId(), learner.getUserId()); + + // Only set the mark if it hasnt previously been set by a teacher + if (gradebookUserActivity == null || !gradebookUserActivity.getMarkedInGradebook()) { + gradebookService.updateUserActivityGradebookMark(lesson, learner, toolActivity, outputDouble, false); + } + } + } + + } catch (ToolException e) { + log.debug("Runtime exception when attempted to get outputs for activity: " + + toolActivity.getActivityId(), e); + } + } + + } + } + /** * Exit a lesson. * @@ -632,8 +692,8 @@ /** * @throws LearnerServiceException - * @see org.lamsfoundation.lams.learning.service.ICoreLearnerService#performGrouping(java.lang.Long, java.lang.Long, - * java.lang.Integer) + * @see org.lamsfoundation.lams.learning.service.ICoreLearnerService#performGrouping(java.lang.Long, + * java.lang.Long, java.lang.Integer) */ public boolean performGrouping(Long lessonId, Long groupingActivityId, Integer learnerId, boolean forceGrouping) throws LearnerServiceException { @@ -803,9 +863,10 @@ } /** - * Get all the learners who may come through this gate. For a Group Based branch and the Teacher Grouped branch, it - * is the group of users in the Branch's group, but only the learners who have started the lesson. Otherwise we just - * get all learners who have started the lesson. + * Get all the learners who may come through this gate. For a Group Based + * branch and the Teacher Grouped branch, it is the group of users in the + * Branch's group, but only the learners who have started the lesson. + * Otherwise we just get all learners who have started the lesson. * * @param gate * @param lesson @@ -880,8 +941,8 @@ } /** - * Get the lesson for this activity. If the activity is not part of a lesson (ie is from an authoring design then it - * will return null. + * Get the lesson for this activity. If the activity is not part of a lesson + * (ie is from an authoring design then it will return null. */ public Lesson getLessonByActivity(Activity activity) { Lesson lesson = lessonDAO.getLessonForActivity(activity.getActivityId()); @@ -899,13 +960,16 @@ /** *

- * Create a lams tool session for learner against a tool activity. This will have concurrency issues interms of - * grouped tool session because it might be inserting some tool session that has already been inserted by other - * member in the group. If the unique_check is broken, we need to query the database to get the instance instead of - * inserting it. It should be done in the Spring rollback strategy. + * Create a lams tool session for learner against a tool activity. This will + * have concurrency issues interms of grouped tool session because it might + * be inserting some tool session that has already been inserted by other + * member in the group. If the unique_check is broken, we need to query the + * database to get the instance instead of inserting it. It should be done + * in the Spring rollback strategy. *

* - * Once lams tool session is inserted, we need to notify the tool to its own session. + * Once lams tool session is inserted, we need to notify the tool to its own + * session. * * @param toolActivity * @param learner @@ -940,7 +1004,8 @@ /** * @throws LearnerServiceException * @see org.lamsfoundation.lams.learning.service.ICoreLearnerService#determineBranch(org.lamsfoundation.lams.lesson.Lesson, - * org.lamsfoundation.lams.learningdesign.BranchingActivity, java.lang.Integer) + * org.lamsfoundation.lams.learningdesign.BranchingActivity, + * java.lang.Integer) */ public SequenceActivity determineBranch(Lesson lesson, BranchingActivity branchingActivity, Integer learnerId) throws LearnerServiceException { @@ -969,9 +1034,10 @@ } /** - * Get all the conditions for this branching activity, ordered by order id. Go through each condition until we find - * one that passes and that is the required branch. If no conditions match, use the branch that is the "default" - * branch for this branching activity. + * Get all the conditions for this branching activity, ordered by order id. + * Go through each condition until we find one that passes and that is the + * required branch. If no conditions match, use the branch that is the + * "default" branch for this branching activity. */ private SequenceActivity determineToolBasedBranch(Lesson lesson, ToolBranchingActivity branchingActivity, User learner) { @@ -1103,7 +1169,8 @@ * gate to check * @param learner * learner who is knocking to the gate - * @return true if learner satisfied any of the conditions and is allowed to pass + * @return true if learner satisfied any of the conditions + * and is allowed to pass */ private boolean determineConditionGateStatus(GateActivity gate, User learner) { boolean shouldOpenGate = false; @@ -1163,11 +1230,13 @@ } /** - * Select a particular branch - we are in preview mode and the author has selected a particular activity. + * Select a particular branch - we are in preview mode and the author has + * selected a particular activity. * * @throws LearnerServiceException * @see org.lamsfoundation.lams.learning.service.ICoreLearnerService#determineBranch(org.lamsfoundation.lams.lesson.Lesson, - * org.lamsfoundation.lams.learningdesign.BranchingActivity, java.lang.Integer) + * org.lamsfoundation.lams.learningdesign.BranchingActivity, + * java.lang.Integer) */ public SequenceActivity selectBranch(Lesson lesson, BranchingActivity branchingActivity, Integer learnerId, Long branchId) throws LearnerServiceException { @@ -1298,4 +1367,8 @@ public Grouping getGrouping(Long groupingId) { return groupingDAO.getGroupingById(groupingId); } + + public void setGradebookService(IGradebookService gradebookService) { + this.gradebookService = gradebookService; + } } \ No newline at end of file Index: lams_learning/src/java/org/lamsfoundation/lams/learning/web/action/NotebookAction.java =================================================================== diff -u -r38a6c414e30497d03559a85b5c33155e4a2fc22e -racc8d2acf5b6b0002e0c8129947040a779ab4077 --- lams_learning/src/java/org/lamsfoundation/lams/learning/web/action/NotebookAction.java (.../NotebookAction.java) (revision 38a6c414e30497d03559a85b5c33155e4a2fc22e) +++ lams_learning/src/java/org/lamsfoundation/lams/learning/web/action/NotebookAction.java (.../NotebookAction.java) (revision acc8d2acf5b6b0002e0c8129947040a779ab4077) @@ -25,6 +25,7 @@ package org.lamsfoundation.lams.learning.web.action; import java.util.List; +import java.util.TreeMap; import java.lang.Integer; import java.io.IOException; @@ -123,9 +124,11 @@ Long lessonID = (Long) notebookForm.get(AttributeNames.PARAM_LESSON_ID); // get all notebook entries for the learner - List entries = notebookService.getEntry(learnerID, CoreNotebookConstants.SCRATCH_PAD); - request.getSession().setAttribute("entries", entries); + + TreeMap> entries = notebookService.getEntryByLesson(learnerID, CoreNotebookConstants.SCRATCH_PAD); + + request.getSession().setAttribute("entries", entries.values()); request.setAttribute("lessonID", lessonID); return mapping.findForward(VIEW_ALL); Index: lams_learning/src/java/org/lamsfoundation/lams/learning/web/util/LearningWebUtil.java =================================================================== diff -u -r02df1b4f76fac80d72ff5583feddace3897844d9 -racc8d2acf5b6b0002e0c8129947040a779ab4077 --- lams_learning/src/java/org/lamsfoundation/lams/learning/web/util/LearningWebUtil.java (.../LearningWebUtil.java) (revision 02df1b4f76fac80d72ff5583feddace3897844d9) +++ lams_learning/src/java/org/lamsfoundation/lams/learning/web/util/LearningWebUtil.java (.../LearningWebUtil.java) (revision acc8d2acf5b6b0002e0c8129947040a779ab4077) @@ -21,7 +21,7 @@ * **************************************************************** */ -/* $$Id$$ */ +/* $$Id$$ */ package org.lamsfoundation.lams.learning.web.util; import java.io.UnsupportedEncodingException; @@ -33,7 +33,6 @@ import org.apache.log4j.Logger; import org.apache.struts.action.ActionForward; -import org.apache.struts.action.ActionMapping; import org.apache.struts.action.DynaActionForm; import org.lamsfoundation.lams.learning.service.ICoreLearnerService; import org.lamsfoundation.lams.learning.service.LearnerServiceException; @@ -52,311 +51,323 @@ import org.springframework.web.context.WebApplicationContext; import org.springframework.web.context.support.WebApplicationContextUtils; - /** * * @author Jacky Fang - * @since 2005-3-10 + * @since 2005-3-10 * @version * */ -public class LearningWebUtil -{ - - private static Logger log = Logger.getLogger(LearningWebUtil.class); +public class LearningWebUtil { + + private static Logger log = Logger.getLogger(LearningWebUtil.class); //--------------------------------------------------------------------- // Class level constants - session attributes //--------------------------------------------------------------------- - public static final String PARAM_PROGRESS_ID = "progressID"; -// public static final String POPUP_WINDOW_NAME = "LearnerActivity"; -// public static final String LEARNER_WINDOW_NAME = "lWindow"; - + public static final String PARAM_PROGRESS_ID = "progressID"; + + // public static final String POPUP_WINDOW_NAME = "LearnerActivity"; + // public static final String LEARNER_WINDOW_NAME = "lWindow"; + /** - * Helper method to retrieve the user data. Gets the id from the user details - * in the shared session + * Helper method to retrieve the user data. Gets the id from the user + * details in the shared session + * * @return the user id */ - public static Integer getUserId() - { - HttpSession ss = SessionManager.getSession(); - UserDTO learner = (UserDTO) ss.getAttribute(AttributeNames.USER); - return learner != null ? learner.getUserID() : null; + public static Integer getUserId() { + HttpSession ss = SessionManager.getSession(); + UserDTO learner = (UserDTO) ss.getAttribute(AttributeNames.USER); + return learner != null ? learner.getUserID() : null; } - + /** - * Helper method to retrieve the user data. Gets the id from the user details - * in the shared session then retrieves the real user object. + * Helper method to retrieve the user data. Gets the id from the user + * details in the shared session then retrieves the real user object. */ - public static User getUser(ICoreLearnerService learnerService) - { - HttpSession ss = SessionManager.getSession(); - UserDTO learner = (UserDTO) ss.getAttribute(AttributeNames.USER); - return learner != null ? (User)learnerService.getUserManagementService().findById(User.class,learner.getUserID()) : null; + public static User getUser(ICoreLearnerService learnerService) { + HttpSession ss = SessionManager.getSession(); + UserDTO learner = (UserDTO) ss.getAttribute(AttributeNames.USER); + return learner != null ? (User) learnerService.getUserManagementService().findById(User.class, + learner.getUserID()) : null; } - - /** - * Put the learner progress in the request. This allows some optimisation between the - * code that updates the progress and the next action which will access the progress. - */ - public static void putLearnerProgressInRequest(HttpServletRequest request, LearnerProgress progress) { - if ( progress != null ) { - request.setAttribute(ActivityAction.LEARNER_PROGRESS_REQUEST_ATTRIBUTE, progress); - } else { - request.removeAttribute(ActivityAction.LEARNER_PROGRESS_REQUEST_ATTRIBUTE); - } + + /** + * Put the learner progress in the request. This allows some optimisation + * between the code that updates the progress and the next action which will + * access the progress. + */ + public static void putLearnerProgressInRequest(HttpServletRequest request, LearnerProgress progress) { + if (progress != null) { + request.setAttribute(ActivityAction.LEARNER_PROGRESS_REQUEST_ATTRIBUTE, progress); + } else { + request.removeAttribute(ActivityAction.LEARNER_PROGRESS_REQUEST_ATTRIBUTE); } - - /** - * Get the current learner progress. Check the request - in some cases it may be there. - * - * If not, the learner progress id might be in the request (if we've just come from complete activity). - * If so, get it from the db using the learner progress. - * - * If the learner progress id isn't available, then we have to look it up using activity - * based on the activity / activity id in the request. - */ - public static LearnerProgress getLearnerProgress(HttpServletRequest request, ICoreLearnerService learnerService) { - LearnerProgress learnerProgress = (LearnerProgress)request.getAttribute(ActivityAction.LEARNER_PROGRESS_REQUEST_ATTRIBUTE); - if ( learnerProgress != null ) { - if ( log.isDebugEnabled() ) { - log.debug("getLearnerProgress: found progress in the request"); - } - return learnerProgress; + } + + /** + * Get the current learner progress. Check the request - in some cases it + * may be there. + * + * If not, the learner progress id might be in the request (if we've just + * come from complete activity). If so, get it from the db using the learner + * progress. + * + * If the learner progress id isn't available, then we have to look it up + * using activity based on the activity / activity id in the request. + */ + public static LearnerProgress getLearnerProgress(HttpServletRequest request, ICoreLearnerService learnerService) { + LearnerProgress learnerProgress = (LearnerProgress) request + .getAttribute(ActivityAction.LEARNER_PROGRESS_REQUEST_ATTRIBUTE); + if (learnerProgress != null) { + if (log.isDebugEnabled()) { + log.debug("getLearnerProgress: found progress in the request"); + } + return learnerProgress; + } + + if (learnerProgress == null) { + Long learnerProgressId = WebUtil.readLongParam(request, LearningWebUtil.PARAM_PROGRESS_ID, true); + // temp hack until Flash side updates it call. + if (learnerProgressId == null) { + learnerProgressId = WebUtil.readLongParam(request, "progressId", true); + if (learnerProgressId != null) + log.warn("Flash client still using progressId, instead of progressID in a learner call"); + } + + if (learnerProgressId != null) { + learnerProgress = learnerService.getProgressById(new Long(learnerProgressId)); + if (learnerProgress != null && log.isDebugEnabled()) { + log.debug("getLearnerProgress: found progress via progress id"); } - - if (learnerProgress == null) - { - Long learnerProgressId = WebUtil.readLongParam(request,LearningWebUtil.PARAM_PROGRESS_ID, true); - // temp hack until Flash side updates it call. - if ( learnerProgressId == null ) { - learnerProgressId = WebUtil.readLongParam(request,"progressId", true); - if ( learnerProgressId != null ) - log.warn("Flash client still using progressId, instead of progressID in a learner call"); - } - - if ( learnerProgressId != null ) { - learnerProgress = learnerService.getProgressById(new Long(learnerProgressId)); - if ( learnerProgress != null && log.isDebugEnabled() ) { - log.debug("getLearnerProgress: found progress via progress id"); - } - } - - } - - if (learnerProgress == null) - { - Integer learnerId = getUserId(); - Activity act = getActivityFromRequest(request, learnerService); - Lesson lesson = learnerService.getLessonByActivity(act); - learnerProgress = learnerService.getProgress(learnerId, lesson.getLessonId()); - if ( learnerProgress != null && log.isDebugEnabled() ) { - log.debug("getLearnerProgress: found progress via learner id and activity"); - } - } - - putLearnerProgressInRequest(request, learnerProgress); - return learnerProgress; + } + } - + + if (learnerProgress == null) { + Integer learnerId = getUserId(); + Activity act = getActivityFromRequest(request, learnerService); + Lesson lesson = learnerService.getLessonByActivity(act); + learnerProgress = learnerService.getProgress(learnerId, lesson.getLessonId()); + if (learnerProgress != null && log.isDebugEnabled()) { + log.debug("getLearnerProgress: found progress via learner id and activity"); + } + } + + putLearnerProgressInRequest(request, learnerProgress); + return learnerProgress; + } + /** * Get the activity from request. We assume there is a parameter coming in - * if there is no activity can be found in the http request. Then the + * if there is no activity can be found in the http request. Then the * activity id parameter is used to retrieve from database. + * * @param request * @return */ - public static Activity getActivityFromRequest(HttpServletRequest request, - ICoreLearnerService learnerService) - { - Activity activity = (Activity)request.getAttribute(ActivityAction.ACTIVITY_REQUEST_ATTRIBUTE); - - if(activity == null) - { - long activityId = WebUtil.readLongParam(request,AttributeNames.PARAM_ACTIVITY_ID); - - activity = learnerService.getActivity(new Long(activityId)); - - if ( activity != null ) { - // getActivityFromRequest() may be called multiple times, so make it quicker next time - request.setAttribute(ActivityAction.ACTIVITY_REQUEST_ATTRIBUTE, activity); - } - } - return activity; + public static Activity getActivityFromRequest(HttpServletRequest request, ICoreLearnerService learnerService) { + Activity activity = (Activity) request.getAttribute(ActivityAction.ACTIVITY_REQUEST_ATTRIBUTE); + + if (activity == null) { + long activityId = WebUtil.readLongParam(request, AttributeNames.PARAM_ACTIVITY_ID); + + activity = learnerService.getActivity(new Long(activityId)); + + if (activity != null) { + // getActivityFromRequest() may be called multiple times, so make it quicker next time + request.setAttribute(ActivityAction.ACTIVITY_REQUEST_ATTRIBUTE, activity); + } + } + return activity; } - + /** - * Put an activity into the request. Calls LearnerService to get the activity, to ensure - * that it is a "real" activity, not one of the cglib proxies. - * activity. + * Put an activity into the request. Calls LearnerService to get the + * activity, to ensure that it is a "real" activity, not one of the cglib + * proxies. activity. + * * @param request * @param activity */ public static void putActivityInRequest(HttpServletRequest request, Activity activity, - ICoreLearnerService learnerService) - { - if ( activity != null ) { - Activity realActivity = learnerService.getActivity(activity.getActivityId()); - request.setAttribute(ActivityAction.ACTIVITY_REQUEST_ATTRIBUTE, realActivity); - } else { - request.setAttribute(ActivityAction.ACTIVITY_REQUEST_ATTRIBUTE, null); - } + ICoreLearnerService learnerService) { + if (activity != null) { + Activity realActivity = learnerService.getActivity(activity.getActivityId()); + request.setAttribute(ActivityAction.ACTIVITY_REQUEST_ATTRIBUTE, realActivity); + } else { + request.setAttribute(ActivityAction.ACTIVITY_REQUEST_ATTRIBUTE, null); + } } - /** "Complete" an activity from the web layer's perspective. Used for CompleteActivityAction and the Gate and Grouping actions. - * Calls the learningService to actually complete the activity and progress. - * @param redirect Should this call redirect to the next screen (true) or use a forward (false) - * @param windowName Name of the window that triggered this code. Normally LearnerActivity (the popup window) or lWindow (normal learner window) - * @throws UnsupportedEncodingException - * + /** + * "Complete" an activity from the web layer's perspective. Used for + * CompleteActivityAction and the Gate and Grouping actions. Calls the + * learningService to actually complete the activity and progress. + * + * @param redirect + * Should this call redirect to the next screen (true) or use + * a forward (false) + * @param windowName + * Name of the window that triggered this code. Normally + * LearnerActivity (the popup window) or lWindow (normal + * learner window) + * @throws UnsupportedEncodingException + * */ public static ActionForward completeActivity(HttpServletRequest request, HttpServletResponse response, - ActivityMapping actionMappings, LearnerProgress currentProgress, Activity currentActivity, - Integer learnerId, ICoreLearnerService learnerService, boolean redirect) throws LearnerServiceException, UnsupportedEncodingException { - - LearnerProgress progress=currentProgress; - Lesson lesson = progress.getLesson(); - - if ( currentActivity == null ) { - progress = learnerService.joinLesson(learnerId, lesson.getLessonId()); - } else if ( progress.getCompletedActivities().containsKey(currentActivity) ) { - return actionMappings.getCloseForward(currentActivity, lesson.getLessonId()); - } else { - // Set activity as complete - progress = learnerService.completeActivity(learnerId, currentActivity,progress); - } - - if ( currentActivity.isFloating() ) - return actionMappings.getCloseForward(currentActivity, lesson.getLessonId()); - - LearningWebUtil.putActivityInRequest(request, progress.getNextActivity(), learnerService); - LearningWebUtil.putLearnerProgressInRequest(request,progress); - return actionMappings.getProgressForward(progress, redirect, false, request, learnerService); + ActivityMapping actionMappings, LearnerProgress currentProgress, Activity currentActivity, + Integer learnerId, ICoreLearnerService learnerService, boolean redirect) throws LearnerServiceException, + UnsupportedEncodingException { + + LearnerProgress progress = currentProgress; + Lesson lesson = progress.getLesson(); + + if (currentActivity == null) { + progress = learnerService.joinLesson(learnerId, lesson.getLessonId()); + } else if (progress.getCompletedActivities().containsKey(currentActivity)) { + return actionMappings.getCloseForward(currentActivity, lesson.getLessonId()); + } else { + // Set activity as complete + progress = learnerService.completeActivity(learnerId, currentActivity, progress); + } + + if (currentActivity != null && currentActivity.isFloating()) + return actionMappings.getCloseForward(currentActivity, lesson.getLessonId()); + + LearningWebUtil.putActivityInRequest(request, progress.getNextActivity(), learnerService); + LearningWebUtil.putLearnerProgressInRequest(request, progress); + return actionMappings.getProgressForward(progress, redirect, false, request, learnerService); } - - /** - * Get the ActionMappings. - */ - public static ActivityMapping getActivityMapping(ServletContext context) { - WebApplicationContext wac = WebApplicationContextUtils.getRequiredWebApplicationContext(context); - return (ActivityMapping)wac.getBean("activityMapping"); + + /** + * Get the ActionMappings. + */ + public static ActivityMapping getActivityMapping(ServletContext context) { + WebApplicationContext wac = WebApplicationContextUtils.getRequiredWebApplicationContext(context); + return (ActivityMapping) wac.getBean("activityMapping"); + } + + /** Setup the progress string, version and lesson id in the activityForm. */ + public static void setupProgressInRequest(ActivityForm activityForm, HttpServletRequest request, + LearnerProgress learnerProgress) { + + putLearnerProgressInRequest(request, learnerProgress); + + // Calculate the progress summary. On join this method gets called twice, and we + // only want to calculate once + String progressSummary = activityForm.getProgressSummary(); + if (progressSummary == null) { + progressSummary = getProgressSummary(learnerProgress); + activityForm.setProgressSummary(progressSummary); } - - /** Setup the progress string, version and lesson id in the activityForm. */ - public static void setupProgressInRequest(ActivityForm activityForm, HttpServletRequest request, LearnerProgress learnerProgress) { - - putLearnerProgressInRequest(request, learnerProgress); - - // Calculate the progress summary. On join this method gets called twice, and we - // only want to calculate once - String progressSummary = activityForm.getProgressSummary(); - if ( progressSummary == null ) { - progressSummary = getProgressSummary(learnerProgress); - activityForm.setProgressSummary(progressSummary); - } - - Lesson currentLesson = learnerProgress.getLesson(); - if(currentLesson != null){ - activityForm.setLessonID(currentLesson.getLessonId()); - - LearningDesign currentDesign = currentLesson.getLearningDesign(); - if(currentDesign != null) - activityForm.setVersion(currentDesign.getDesignVersion()); - } - - - if(log.isDebugEnabled()) - log.debug("Entering activity: progress summary is "+activityForm.getProgressSummary()); - + + Lesson currentLesson = learnerProgress.getLesson(); + if (currentLesson != null) { + activityForm.setLessonID(currentLesson.getLessonId()); + + LearningDesign currentDesign = currentLesson.getLearningDesign(); + if (currentDesign != null) + activityForm.setVersion(currentDesign.getDesignVersion()); } - - /** Setup the progress string, version and lesson id in the actionForm. The values will go in the map with the - * keys "progressSummary", "lessonID", "version". */ - public static void setupProgressInRequest(DynaActionForm actionForm, HttpServletRequest request, LearnerProgress learnerProgress) { - - putLearnerProgressInRequest(request, learnerProgress); - // Calculate the progress summary. On join this method gets called twice, and we - // only want to calculate once - String progressSummary = (String) actionForm.get("progressSummary"); - if ( progressSummary == null ) { - progressSummary = getProgressSummary(learnerProgress); - actionForm.set("progressSummary",progressSummary); - } - - Lesson currentLesson = learnerProgress.getLesson(); - if(currentLesson != null){ - actionForm.set("lessonID",currentLesson.getLessonId()); - - LearningDesign currentDesign = currentLesson.getLearningDesign(); - if(currentDesign != null) - actionForm.set("version",currentDesign.getDesignVersion()); - } - - - if(log.isDebugEnabled()) - log.debug("Entering activity: progress summary is "+actionForm.get("progressSummary")); - + if (log.isDebugEnabled()) + log.debug("Entering activity: progress summary is " + activityForm.getProgressSummary()); + + } + + /** + * Setup the progress string, version and lesson id in the actionForm. The + * values will go in the map with the keys "progressSummary", "lessonID", + * "version". + */ + public static void setupProgressInRequest(DynaActionForm actionForm, HttpServletRequest request, + LearnerProgress learnerProgress) { + + putLearnerProgressInRequest(request, learnerProgress); + + // Calculate the progress summary. On join this method gets called twice, and we + // only want to calculate once + String progressSummary = (String) actionForm.get("progressSummary"); + if (progressSummary == null) { + progressSummary = getProgressSummary(learnerProgress); + actionForm.set("progressSummary", progressSummary); } - private static String getProgressSummary(LearnerProgress learnerProgress) { - StringBuffer progressSummary = new StringBuffer(100); - if ( learnerProgress == null ) { - progressSummary.append("attempted=&completed=¤t="); - progressSummary.append("&lessonID="); - Lesson currentLesson = learnerProgress.getLesson(); - if(currentLesson != null){ - progressSummary.append(currentLesson.getLessonId()); - } + Lesson currentLesson = learnerProgress.getLesson(); + if (currentLesson != null) { + actionForm.set("lessonID", currentLesson.getLessonId()); + + LearningDesign currentDesign = currentLesson.getLearningDesign(); + if (currentDesign != null) + actionForm.set("version", currentDesign.getDesignVersion()); + } + + if (log.isDebugEnabled()) + log.debug("Entering activity: progress summary is " + actionForm.get("progressSummary")); + + } + + private static String getProgressSummary(LearnerProgress learnerProgress) { + StringBuffer progressSummary = new StringBuffer(100); + if (learnerProgress == null) { + progressSummary.append("attempted=&completed=¤t="); + progressSummary.append("&lessonID="); + Lesson currentLesson = learnerProgress.getLesson(); + if (currentLesson != null) { + progressSummary.append(currentLesson.getLessonId()); + } + } else { + progressSummary.append("attempted="); + boolean first = true; + for (Object obj : learnerProgress.getAttemptedActivities().keySet()) { + Activity activity = (Activity) obj; + if (!first) { + progressSummary.append("_"); } else { - progressSummary.append("attempted="); - boolean first = true; - for (Object obj : learnerProgress.getAttemptedActivities().keySet()) { - Activity activity = (Activity ) obj; - if ( ! first ) { - progressSummary.append("_"); - } else { - first = false; - } - progressSummary.append(activity.getActivityId()); - } - - progressSummary.append("&completed="); - first = true; - for ( Object obj : learnerProgress.getCompletedActivities().keySet() ) { - Activity activity = (Activity ) obj; - if ( ! first ) { - progressSummary.append("_"); - } else { - first = false; - } - progressSummary.append(activity.getActivityId()); - } + first = false; + } + progressSummary.append(activity.getActivityId()); + } - progressSummary.append("¤t="); - Activity currentActivity = learnerProgress.getCurrentActivity(); - if ( currentActivity != null ) { - progressSummary.append(currentActivity.getActivityId()); - } - + progressSummary.append("&completed="); + first = true; + for (Object obj : learnerProgress.getCompletedActivities().keySet()) { + Activity activity = (Activity) obj; + if (!first) { + progressSummary.append("_"); + } else { + first = false; } - return progressSummary.toString(); + progressSummary.append(activity.getActivityId()); + } + + progressSummary.append("¤t="); + Activity currentActivity = learnerProgress.getCurrentActivity(); + if (currentActivity != null) { + progressSummary.append(currentActivity.getActivityId()); + } + } + return progressSummary.toString(); + } - public static ActivityURL getActivityURL( ActivityMapping activityMapping, LearnerProgress learnerProgress, Activity activity, boolean defaultURL, boolean isFloating) { - ActivityURL activityURL = new ActivityURL(); - String url = activityMapping.getActivityURL(activity); - activityURL.setUrl(url); - activityURL.setActivityId(activity.getActivityId()); - activityURL.setTitle(activity.getTitle()); - activityURL.setDescription(activity.getDescription()); - - byte status = learnerProgress.getProgressState(activity); - activityURL.setStatus(status); - if ( status == LearnerProgress.ACTIVITY_COMPLETED) { - activityURL.setComplete(true); - } - activityURL.setFloating(isFloating); - activityURL.setDefaultURL(defaultURL); - return activityURL; + public static ActivityURL getActivityURL(ActivityMapping activityMapping, LearnerProgress learnerProgress, + Activity activity, boolean defaultURL, boolean isFloating) { + ActivityURL activityURL = new ActivityURL(); + String url = activityMapping.getActivityURL(activity); + activityURL.setUrl(url); + activityURL.setActivityId(activity.getActivityId()); + activityURL.setTitle(activity.getTitle()); + activityURL.setDescription(activity.getDescription()); + + byte status = learnerProgress.getProgressState(activity); + activityURL.setStatus(status); + if (status == LearnerProgress.ACTIVITY_COMPLETED) { + activityURL.setComplete(true); } + activityURL.setFloating(isFloating); + activityURL.setDefaultURL(defaultURL); + return activityURL; + } } Index: lams_learning/web/WEB-INF/tags/AuthoringButton.tag =================================================================== diff -u -r61df3f3f473a3619f93c63ceb879ae36438020e8 -racc8d2acf5b6b0002e0c8129947040a779ab4077 --- lams_learning/web/WEB-INF/tags/AuthoringButton.tag (.../AuthoringButton.tag) (revision 61df3f3f473a3619f93c63ceb879ae36438020e8) +++ lams_learning/web/WEB-INF/tags/AuthoringButton.tag (.../AuthoringButton.tag) (revision acc8d2acf5b6b0002e0c8129947040a779ab4077) @@ -1,93 +1,93 @@ -<% -/**************************************************************** - * Copyright (C) 2005 LAMS Foundation (http://lamsfoundation.org) - * ============================================================= - * License Information: http://lamsfoundation.org/licensing/lams/2.0/ - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2.0 - * as published by the Free Software Foundation. - * - * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 - * USA - * - * http://www.gnu.org/licenses/gpl.txt - * **************************************************************** - */ - - /** - * AuthoringButton.tag - * Author: Dapeng Ni - * Description: Creates the save/cancel button for authoring page - */ - - %> -<%@ tag body-content="scriptless" %> -<%@ taglib uri="tags-core" prefix="c" %> -<%@ taglib uri="tags-fmt" prefix="fmt" %> -<%@ taglib uri="tags-html" prefix="html" %> - -<%@ attribute name="formID" required="true" rtexprvalue="true" %> -<%@ attribute name="toolSignature" required="true" rtexprvalue="true" %> -<%@ attribute name="toolContentID" required="true" rtexprvalue="true" %> -<%@ attribute name="contentFolderID" required="true" rtexprvalue="true" %> -<%@ attribute name="clearSessionActionUrl" required="true" rtexprvalue="true" %> - -<%-- Optional attribute --%> -<%@ attribute name="accessMode" required="false" rtexprvalue="true" %> -<%@ attribute name="cancelButtonLabelKey" required="false" rtexprvalue="true" %> -<%@ attribute name="saveButtonLabelKey" required="false" rtexprvalue="true" %> -<%@ attribute name="cancelConfirmMsgKey" required="false" rtexprvalue="true" %> -<%@ attribute name="defineLater" required="false" rtexprvalue="true" %> -<%@ attribute name="customiseSessionID" required="false" rtexprvalue="true" %> - -<%-- Default value for message key --%> - - - - - - - - - - - - - - - -

- - - - - - -

+<% +/**************************************************************** + * Copyright (C) 2005 LAMS Foundation (http://lamsfoundation.org) + * ============================================================= + * License Information: http://lamsfoundation.org/licensing/lams/2.0/ + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2.0 + * as published by the Free Software Foundation. + * + * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 + * USA + * + * http://www.gnu.org/licenses/gpl.txt + * **************************************************************** + */ + + /** + * AuthoringButton.tag + * Author: Dapeng Ni + * Description: Creates the save/cancel button for authoring page + */ + + %> +<%@ tag body-content="scriptless" %> +<%@ taglib uri="tags-core" prefix="c" %> +<%@ taglib uri="tags-fmt" prefix="fmt" %> +<%@ taglib uri="tags-html" prefix="html" %> + +<%@ attribute name="formID" required="true" rtexprvalue="true" %> +<%@ attribute name="toolSignature" required="true" rtexprvalue="true" %> +<%@ attribute name="toolContentID" required="true" rtexprvalue="true" %> +<%@ attribute name="contentFolderID" required="true" rtexprvalue="true" %> +<%@ attribute name="clearSessionActionUrl" required="true" rtexprvalue="true" %> + +<%-- Optional attribute --%> +<%@ attribute name="accessMode" required="false" rtexprvalue="true" %> +<%@ attribute name="cancelButtonLabelKey" required="false" rtexprvalue="true" %> +<%@ attribute name="saveButtonLabelKey" required="false" rtexprvalue="true" %> +<%@ attribute name="cancelConfirmMsgKey" required="false" rtexprvalue="true" %> +<%@ attribute name="defineLater" required="false" rtexprvalue="true" %> +<%@ attribute name="customiseSessionID" required="false" rtexprvalue="true" %> + +<%-- Default value for message key --%> + + + + + + + + + + + + + + + +

+ + + + + + +

\ No newline at end of file Index: lams_learning/web/WEB-INF/tags/ProgressOutput.tag =================================================================== diff -u -r61df3f3f473a3619f93c63ceb879ae36438020e8 -racc8d2acf5b6b0002e0c8129947040a779ab4077 --- lams_learning/web/WEB-INF/tags/ProgressOutput.tag (.../ProgressOutput.tag) (revision 61df3f3f473a3619f93c63ceb879ae36438020e8) +++ lams_learning/web/WEB-INF/tags/ProgressOutput.tag (.../ProgressOutput.tag) (revision acc8d2acf5b6b0002e0c8129947040a779ab4077) @@ -58,7 +58,19 @@ - + + + + + + + + + + + + + ${activity.title} Index: lams_learning/web/notebook/viewall.jsp =================================================================== diff -u -rc25a09fb913ad54f4fdf424063e249223b81f4ab -racc8d2acf5b6b0002e0c8129947040a779ab4077 --- lams_learning/web/notebook/viewall.jsp (.../viewall.jsp) (revision c25a09fb913ad54f4fdf424063e249223b81f4ab) +++ lams_learning/web/notebook/viewall.jsp (.../viewall.jsp) (revision acc8d2acf5b6b0002e0c8129947040a779ab4077) @@ -32,76 +32,102 @@

 

- - - - - - -

-
- - - - - - - - -
+ + + + + -
- - - -
-
- -
-
+ + + + + + + + + + + + +

+ + + - + + + - + + +

+ + + + + + +
- -

- - - - - - - - + + +
+ + + +

+ + + - + + + - + + +

+ + + + + + + + + + + + + + + - - - - - - + +
+ + + + + + + + + + + + + +  
- - - - - - - - - - - - - -  
+ + + +
+
+ +
+
+ + +
- - - - - -
-
- -
-
Index: lams_monitoring/src/java/org/lamsfoundation/lams/monitoring/MonitoringConstants.java =================================================================== diff -u -rd9f9e33ff90f8ff1a0077688ad3ee5dbc233c209 -racc8d2acf5b6b0002e0c8129947040a779ab4077 --- lams_monitoring/src/java/org/lamsfoundation/lams/monitoring/MonitoringConstants.java (.../MonitoringConstants.java) (revision d9f9e33ff90f8ff1a0077688ad3ee5dbc233c209) +++ lams_monitoring/src/java/org/lamsfoundation/lams/monitoring/MonitoringConstants.java (.../MonitoringConstants.java) (revision acc8d2acf5b6b0002e0c8129947040a779ab4077) @@ -48,4 +48,5 @@ public static final String KEY_GROUP_ORDER_ID = "orderID"; public static final String KEY_GROUP_LEARNERS = "learners"; public static final Object KEY_USERS = "users"; + public static final String PARAM_SCHEDULE_TIME_ZONE_IDX = "scheduleTimeZoneIdx"; } Index: lams_monitoring/web/WEB-INF/web.xml =================================================================== diff -u -re851ecbb7a28dba597688df7f4466b2ab603405c -racc8d2acf5b6b0002e0c8129947040a779ab4077 --- lams_monitoring/web/WEB-INF/web.xml (.../web.xml) (revision e851ecbb7a28dba597688df7f4466b2ab603405c) +++ lams_monitoring/web/WEB-INF/web.xml (.../web.xml) (revision acc8d2acf5b6b0002e0c8129947040a779ab4077) @@ -5,20 +5,24 @@ javax.servlet.jsp.jstl.fmt.localizationContext org.lamsfoundation.lams.monitoring.ApplicationResources + + messageSource + monitoringMessageSource + + + contextConfigLocation - - classpath:/org/lamsfoundation/lams/applicationContext.xml - classpath:/org/lamsfoundation/lams/lesson/lessonApplicationContext.xml - classpath:/org/lamsfoundation/lams/toolApplicationContext.xml - classpath:/org/lamsfoundation/lams/learning/learningApplicationContext.xml - classpath:/org/lamsfoundation/lams/authoring/authoringApplicationContext.xml - classpath:/org/lamsfoundation/lams/workspace/workspaceApplicationContext.xml - classpath:/org/lamsfoundation/lams/monitoring/monitoringApplicationContext.xml - classpath:/org/lamsfoundation/lams/contentrepository/applicationContext.xml - - + + + locatorFactorySelector + classpath*:/org/lamsfoundation/lams/**/beanRefContext.xml + + + parentContextKey + context.central + SystemSessionFilter @@ -67,6 +71,11 @@ org.springframework.web.context.ContextLoaderListener + + + org.lamsfoundation.lams.web.session.SetMaxTimeoutListener + + initializeLesson @@ -79,6 +88,11 @@ + initializeAndCreateLessons + org.lamsfoundation.lams.monitoring.web.InitializeAndCreateLessonsServlet + + + branchingExportPortfolio org.lamsfoundation.lams.monitoring.web.BranchingExportPortfolioServlet @@ -135,6 +149,10 @@ /monitoring/performChosenGrouping + initializeAndCreateLessons + /initializeAndCreateLessons + + branchingExportPortfolio /branchingExportPortfolio @@ -151,6 +169,10 @@ /createLessonClass + + 120 + +
\ No newline at end of file Index: lams_tool_deploy/src/java/org/lamsfoundation/lams/tool/deploy/AddModuleToApplicationXmlTask.java =================================================================== diff -u -rc4aa762e8a0657466906e592c0847747a148b6fe -racc8d2acf5b6b0002e0c8129947040a779ab4077 --- lams_tool_deploy/src/java/org/lamsfoundation/lams/tool/deploy/AddModuleToApplicationXmlTask.java (.../AddModuleToApplicationXmlTask.java) (revision c4aa762e8a0657466906e592c0847747a148b6fe) +++ lams_tool_deploy/src/java/org/lamsfoundation/lams/tool/deploy/AddModuleToApplicationXmlTask.java (.../AddModuleToApplicationXmlTask.java) (revision acc8d2acf5b6b0002e0c8129947040a779ab4077) @@ -55,7 +55,7 @@ } /** - * Add the given web app to the application.xml file + * Add the given module to the application.xml file * @param args * @throws Exception */ Index: lams_tool_deploy/src/java/org/lamsfoundation/lams/tool/deploy/CreatePackageTask.java =================================================================== diff -u -r08950e1090443c3423a3d1c587416a2fccd8bbdf -racc8d2acf5b6b0002e0c8129947040a779ab4077 --- lams_tool_deploy/src/java/org/lamsfoundation/lams/tool/deploy/CreatePackageTask.java (.../CreatePackageTask.java) (revision 08950e1090443c3423a3d1c587416a2fccd8bbdf) +++ lams_tool_deploy/src/java/org/lamsfoundation/lams/tool/deploy/CreatePackageTask.java (.../CreatePackageTask.java) (revision acc8d2acf5b6b0002e0c8129947040a779ab4077) @@ -38,154 +38,184 @@ import org.apache.tools.ant.DynamicConfigurator; import org.apache.tools.ant.Task; import org.apache.tools.ant.types.FileSet; + /** * @author mtruong, Original design by Fiona Malikoff - * + * * Parent class to all tasks related to the creation of the deployment package. * */ -public abstract class CreatePackageTask extends Task implements DynamicConfigurator { - - public static final String MODE = "mode"; - public static final String MODE_DEVELOPMENT = "development"; - public static final String MODE_PRODUCTION = "production"; - - public static final String CONFIG_FILE = "configFile"; - public static final String OUTPUT_PATH = "outputPath"; - public static final String SCRIPT_PATH = "scriptPath"; - - protected DeployConfig deployConfig; - - private Properties inputProperties; - private Properties deployProperties; - - // private static String defaultFilename = "templateDeployTool.xml"; - private static String outputFilename = "deploy.xml"; - - /* Ant Task Attributes */ - public String mode = MODE_PRODUCTION; - public File outputPath = null; - public File configFile = null; - - /* Dependent on outputPath, and set when outputPath is set */ - private File outputPathLib = null; - private File outputPathSql = null; +public abstract class CreatePackageTask extends Task implements + DynamicConfigurator { - public CreatePackageTask() - { - super(); - deployConfig = null; - deployProperties = null; - inputProperties = new Properties(); - } - - /* ************** Dynamic Configurator Methods *****************************/ - public void setDynamicAttribute(String name, String value) { - inputProperties.setProperty(name, value); - } - - public Object createDynamicElement(String name) throws BuildException { - throw new BuildException("CreatePackage does not support elements"); - } - - public abstract void execute(); - - /** - * add the ant defined properties to deployConfig - */ - protected void applyParameters() { + public static final String MODE = "mode"; + public static final String MODE_DEVELOPMENT = "development"; + public static final String MODE_PRODUCTION = "production"; - log("Applying task properties"); - - Iterator iter = inputProperties.keySet().iterator(); - while ( iter.hasNext() ) { - String key = (String) iter.next(); - // any keys not known to the deployConfig are ignored, so it doesn't matter if we pass mode, etc. - // The only vectors will be filesets. - deployConfig.setProperty(key, (String) inputProperties.getProperty(key)); - } - } + public static final String CONFIG_FILE = "configFile"; + public static final String OUTPUT_PATH = "outputPath"; + public static final String SCRIPT_PATH = "scriptPath"; - protected void applyFilesets(String key, Vector filesets) { - ArrayList filenames = new ArrayList(); - for ( FileSet fileset : filesets) { - DirectoryScanner ds = fileset.getDirectoryScanner(getProject()); - String[] files = ds.getIncludedFiles(); - for ( String filename: files ) { - filenames.add(ds.getBasedir()+File.separator+filename); - } - } - - deployConfig.setFilenames(key, filenames); - } + protected DeployConfig deployConfig; - protected void createDirectory(File dir) { - if ( dir.exists() ) { - if ( ! dir.isDirectory() ) { - throw new BuildException("Unable to write out deploy.properties - path " - +dir+" exists but is not a directory."); - } - if ( ! dir.canWrite() ) { - throw new BuildException("Unable to write out deploy.properties - path " - +dir+" exists but is read only."); - } - } else { - dir.mkdirs(); - } - } - - /** - * @param deployConfig - */ - protected void writeConfigFile() throws IOException { - - String outputName = outputPath+File.separator+outputFilename; - - BufferedWriter out=null; - try { - out = new BufferedWriter(new FileWriter(outputName)); - deployConfig.writePropertiesToFile(out); - } catch (Exception e) { - throw new BuildException("Unable to write out " - +outputName+". Error "+e.getMessage(),e); - } - log("File "+outputName+" written."); - out.close(); - } + private Properties inputProperties; + private Properties deployProperties; - /* private URL getTemplateDeployName() { - URL url = CreatePackageTask_original.class.getResource(defaultFilename); - return url; - } */ - - /** - * @param configFile The configFile to set. - */ - public void setConfigFile(File configFile) { - this.configFile = configFile; - } - /** - * @param mode The mode to set. - */ - public void setMode(String mode) { - this.mode = mode; - } - /** - * @param outputPath The outputPath to set. - */ - public void setOutputPath(File outputPath) { - this.outputPath = outputPath; - if ( outputPath != null ) { - this.outputPathLib = new File(outputPath.getAbsoluteFile()+File.separator+"lib"); - this.outputPathSql = new File(outputPath.getAbsoluteFile()+File.separator+"sql"); - } else { - this.outputPathLib = null; - this.outputPathSql = null; - } - } - - - - + // private static String defaultFilename = "templateDeployTool.xml"; + private static String outputFilename = "deploy.xml"; + private static String templateFileName = "deploy_template.xml"; + /* Ant Task Attributes */ + public String mode = MODE_PRODUCTION; + public File outputPath = null; + public File configFile = null; + + /* Dependent on outputPath, and set when outputPath is set */ + private File outputPathLib = null; + private File outputPathSql = null; + + public CreatePackageTask() { + super(); + deployConfig = null; + deployProperties = null; + inputProperties = new Properties(); + } + + /* ************** Dynamic Configurator Methods **************************** */ + public void setDynamicAttribute(String name, String value) { + inputProperties.setProperty(name, value); + } + + public Object createDynamicElement(String name) throws BuildException { + throw new BuildException("CreatePackage does not support elements"); + } + + public abstract void execute(); + + /** + * add the ant defined properties to deployConfig + */ + protected void applyParameters() { + + log("Applying task properties"); + + Iterator iter = inputProperties.keySet().iterator(); + while (iter.hasNext()) { + String key = (String) iter.next(); + // any keys not known to the deployConfig are ignored, so it doesn't + // matter if we pass mode, etc. + // The only vectors will be filesets. + deployConfig.setProperty(key, (String) inputProperties + .getProperty(key)); + } + } + + protected void applyFilesets(String key, Vector filesets) { + ArrayList filenames = new ArrayList(); + for (FileSet fileset : filesets) { + DirectoryScanner ds = fileset.getDirectoryScanner(getProject()); + String[] files = ds.getIncludedFiles(); + for (String filename : files) { + filenames.add(ds.getBasedir() + File.separator + filename); + } + } + + deployConfig.setFilenames(key, filenames); + } + + protected void createDirectory(File dir) { + if (dir.exists()) { + if (!dir.isDirectory()) { + throw new BuildException( + "Unable to write out deploy.properties - path " + dir + + " exists but is not a directory."); + } + if (!dir.canWrite()) { + throw new BuildException( + "Unable to write out deploy.properties - path " + dir + + " exists but is read only."); + } + } else { + dir.mkdirs(); + } + } + + /** + * @param deployConfig + */ + protected void writeConfigFile() throws IOException { + + String outputName = outputPath + File.separator + outputFilename; + + BufferedWriter out = null; + try { + out = new BufferedWriter(new FileWriter(outputName)); + deployConfig.writePropertiesToFile(out); + } catch (Exception e) { + throw new BuildException("Unable to write out " + outputName + + ". Error " + e.getMessage(), e); + } + log("File " + outputName + " written."); + out.close(); + + // Writing the template file for tools + BufferedWriter out2 = null; + try { + if (deployConfig instanceof DeployToolConfig) { + DeployToolConfig deployToolConfig = (DeployToolConfig) deployConfig; + deployToolConfig.setGenerateForInstallers(true); + deployToolConfig.convertForInstallers(); + String outputName2 = outputPath + File.separator + + templateFileName; + + out2 = new BufferedWriter(new FileWriter(outputName2)); + deployToolConfig.writePropertiesToFile(out2); + log("File " + outputName2 + " written."); + } + } catch (Exception e) { + + } finally { + out.close(); + } + } + + /* + * private URL getTemplateDeployName() { URL url = + * CreatePackageTask_original.class.getResource(defaultFilename); return + * url; } + */ + + /** + * @param configFile + * The configFile to set. + */ + public void setConfigFile(File configFile) { + this.configFile = configFile; + } + + /** + * @param mode + * The mode to set. + */ + public void setMode(String mode) { + this.mode = mode; + } + + /** + * @param outputPath + * The outputPath to set. + */ + public void setOutputPath(File outputPath) { + this.outputPath = outputPath; + if (outputPath != null) { + this.outputPathLib = new File(outputPath.getAbsoluteFile() + + File.separator + "lib"); + this.outputPathSql = new File(outputPath.getAbsoluteFile() + + File.separator + "sql"); + } else { + this.outputPathLib = null; + this.outputPathSql = null; + } + } + } Index: lams_tool_deploy/src/java/org/lamsfoundation/lams/tool/deploy/RemoveModuleFromApplicationXmlTask.java =================================================================== diff -u -r2fe3031016f4bc473032ce3f6f08d9ea4ab641e3 -racc8d2acf5b6b0002e0c8129947040a779ab4077 --- lams_tool_deploy/src/java/org/lamsfoundation/lams/tool/deploy/RemoveModuleFromApplicationXmlTask.java (.../RemoveModuleFromApplicationXmlTask.java) (revision 2fe3031016f4bc473032ce3f6f08d9ea4ab641e3) +++ lams_tool_deploy/src/java/org/lamsfoundation/lams/tool/deploy/RemoveModuleFromApplicationXmlTask.java (.../RemoveModuleFromApplicationXmlTask.java) (revision acc8d2acf5b6b0002e0c8129947040a779ab4077) @@ -19,7 +19,7 @@ public static void main(String[] args) throws Exception { - if ((args.length < 1) || (args[0] == null)) + if ((args.length < 2) || (args[0] == null)) { throw new IllegalArgumentException("Usage: RemoveModuleFromApplicationXmlTask "); } @@ -28,7 +28,7 @@ System.out.println("Attempting to update " + args[0] + "\\META-INF\\application.xml"); RemoveModuleFromApplicationXmlTask remModAppTask = new RemoveModuleFromApplicationXmlTask(); remModAppTask.setLamsEarPath(args[0]); - remModAppTask.setModule("ehcache-1.1.jar"); + remModAppTask.setModule(args[1]); remModAppTask.execute(); System.out.println("application.xml update completed"); } Index: lams_tool_dimdim/conf/xdoclet/web-settings.xml =================================================================== diff -u -r126d84999e520648cb187e465cb4aaa3baad222e -racc8d2acf5b6b0002e0c8129947040a779ab4077 --- lams_tool_dimdim/conf/xdoclet/web-settings.xml (.../web-settings.xml) (revision 126d84999e520648cb187e465cb4aaa3baad222e) +++ lams_tool_dimdim/conf/xdoclet/web-settings.xml (.../web-settings.xml) (revision acc8d2acf5b6b0002e0c8129947040a779ab4077) @@ -5,13 +5,17 @@ org.lamsfoundation.lams.tool.dimdim.ApplicationResources + + contextClass + org.jboss.spring.factory.VFSXmlWebApplicationContext + contextConfigLocation classpath:/org/lamsfoundation/lams/tool/dimdim/dbupdates/autopatchContext.xml locatorFactorySelector - classpath*:/org/lamsfoundation/lams/**/beanRefContext.xml + classpath:/org/lamsfoundation/lams/beanRefContext.xml parentContextKey Index: lams_tool_forum/build.xml =================================================================== diff -u -r10f17eaf12892fe30d780538f96999dd27eb8d84 -racc8d2acf5b6b0002e0c8129947040a779ab4077 --- lams_tool_forum/build.xml (.../build.xml) (revision 10f17eaf12892fe30d780538f96999dd27eb8d84) +++ lams_tool_forum/build.xml (.../build.xml) (revision acc8d2acf5b6b0002e0c8129947040a779ab4077) @@ -102,11 +102,14 @@ + Index: lams_tool_forum/conf/xdoclet/web-settings.xml =================================================================== diff -u -r126d84999e520648cb187e465cb4aaa3baad222e -racc8d2acf5b6b0002e0c8129947040a779ab4077 --- lams_tool_forum/conf/xdoclet/web-settings.xml (.../web-settings.xml) (revision 126d84999e520648cb187e465cb4aaa3baad222e) +++ lams_tool_forum/conf/xdoclet/web-settings.xml (.../web-settings.xml) (revision acc8d2acf5b6b0002e0c8129947040a779ab4077) @@ -9,13 +9,17 @@ + + contextClass + org.jboss.spring.factory.VFSXmlWebApplicationContext + contextConfigLocation classpath:/org/lamsfoundation/lams/tool/forum/dbupdates/autopatchContext.xml locatorFactorySelector - classpath*:/org/lamsfoundation/lams/**/beanRefContext.xml + classpath:/org/lamsfoundation/lams/beanRefContext.xml parentContextKey Index: lams_tool_forum/src/java/org/lamsfoundation/lams/tool/forum/dbupdates/patch20081118_updateFrom22.sql =================================================================== diff -u -r05db875c7974d705f89231416ff6dfe91a5e70f1 -racc8d2acf5b6b0002e0c8129947040a779ab4077 --- lams_tool_forum/src/java/org/lamsfoundation/lams/tool/forum/dbupdates/patch20081118_updateFrom22.sql (.../patch20081118_updateFrom22.sql) (revision 05db875c7974d705f89231416ff6dfe91a5e70f1) +++ lams_tool_forum/src/java/org/lamsfoundation/lams/tool/forum/dbupdates/patch20081118_updateFrom22.sql (.../patch20081118_updateFrom22.sql) (revision acc8d2acf5b6b0002e0c8129947040a779ab4077) @@ -7,6 +7,21 @@ UPDATE lams_tool SET pedagogical_planner_url='tool/lafrum11/authoring/initPedagogicalPlannerForm.do' WHERE tool_signature='lafrum11'; +-- timestamp table +create table tl_lafrum11_timestamp ( + uid BIGINT(20) not null auto_increment, + message_uid BIGINT(20) not null, + timestamp_date DATETIME not null, + forum_user_uid BIGINT(20) not null, + primary key (`uid`), + unique key `uid` (`uid`), + key `message_uid` (`message_uid`), + key `forum_user_uid` (`forum_user_uid`) +)TYPE=InnoDB; + +alter table tl_lafrum11_timestamp add index ForumUserFK (forum_user_uid), add constraint ForumUserFK foreign key (forum_user_uid) references tl_lafrum11_forum_user (uid); +alter table tl_lafrum11_timestamp add index MessageFK (message_uid), add constraint MessageFK foreign key (message_uid) references tl_lafrum11_message (uid); + ----------------------Put all sql statements above here------------------------- -- If there were no errors, commit and restore autocommit to on Index: lams_tool_forum/src/java/org/lamsfoundation/lams/tool/forum/forumApplicationContext.xml =================================================================== diff -u -r126d84999e520648cb187e465cb4aaa3baad222e -racc8d2acf5b6b0002e0c8129947040a779ab4077 --- lams_tool_forum/src/java/org/lamsfoundation/lams/tool/forum/forumApplicationContext.xml (.../forumApplicationContext.xml) (revision 126d84999e520648cb187e465cb4aaa3baad222e) +++ lams_tool_forum/src/java/org/lamsfoundation/lams/tool/forum/forumApplicationContext.xml (.../forumApplicationContext.xml) (revision acc8d2acf5b6b0002e0c8129947040a779ab4077) @@ -130,6 +130,9 @@ + + + 0) { + return ((Number) list.get(0)).intValue(); + } else { + return 0; } - - public int getNumOfPostsByTopic(Long userID, Long topicID) { - List list = this.getHibernateTemplate().find(SQL_QUERY_NUM_POSTS_BY_TOPIC, new Object[]{userID,topicID}); - if(list != null && list.size() > 0) - return ((Number)list.get(0)).intValue(); - else - return 0; - } + } - } Index: lams_tool_forum/src/java/org/lamsfoundation/lams/tool/forum/service/ForumService.java =================================================================== diff -u -rb5af051561cba50d0c72d74c66a19e7e9e403396 -racc8d2acf5b6b0002e0c8129947040a779ab4077 --- lams_tool_forum/src/java/org/lamsfoundation/lams/tool/forum/service/ForumService.java (.../ForumService.java) (revision b5af051561cba50d0c72d74c66a19e7e9e403396) +++ lams_tool_forum/src/java/org/lamsfoundation/lams/tool/forum/service/ForumService.java (.../ForumService.java) (revision acc8d2acf5b6b0002e0c8129947040a779ab4077) @@ -56,6 +56,7 @@ import org.lamsfoundation.lams.contentrepository.service.IRepositoryService; import org.lamsfoundation.lams.contentrepository.service.SimpleCredentials; import org.lamsfoundation.lams.events.IEventNotificationService; +import org.lamsfoundation.lams.gradebook.service.IGradebookService; import org.lamsfoundation.lams.learning.service.ILearnerService; import org.lamsfoundation.lams.learningdesign.service.ExportToolContentException; import org.lamsfoundation.lams.learningdesign.service.IExportToolContentService; @@ -120,7 +121,7 @@ private AttachmentDao attachmentDao; private MessageDao messageDao; - + private TimestampDao timestampDao; private MessageSeqDao messageSeqDao; @@ -152,6 +153,8 @@ private ForumOutputFactory forumOutputFactory; + private IGradebookService gradebookService; + private IEventNotificationService eventNotificationService; private Random generator = new Random(); @@ -247,7 +250,7 @@ MessageSeq msgSeq = messageSeqDao.getByTopicId(message.getUid()); Message root = msgSeq.getRootMessage(); // update reply date - //messageDao.saveOrUpdate(root); // do not update date of root posting + // messageDao.saveOrUpdate(root); // do not update date of root posting return message; } @@ -329,7 +332,7 @@ root.setLastReplyDate(new Date()); // update reply message number for root root.setReplyNumber(root.getReplyNumber() + 1); - //messageDao.saveOrUpdate(root); // do not update the date of root posting + // messageDao.saveOrUpdate(root); // do not update the date of root posting return replyMessage; } @@ -538,6 +541,7 @@ } } messageDao.saveOrUpdate(msg); + } if (notifyLearnersOnMarkRelease) { notificationMessageParameters = new Object[1]; @@ -546,9 +550,18 @@ getEventNotificationService().triggerForSingleUser(ForumConstants.TOOL_SIGNATURE, ForumConstants.EVENT_NAME_NOTIFY_LEARNERS_ON_MARK_RELEASE, forum.getContentId(), userID, notificationMessageParameters); + } } + List users = getUsersBySessionId(sessionID); + if (users != null) { + for (ForumUser user : users) { + // send marks to gradebook where applicable + sendMarksToGradebook(user, sessionID); + } + } + // update session to set MarkRelease flag. session.setMarkReleased(true); forumToolSessionDao.saveOrUpdate(session); @@ -1102,7 +1115,9 @@ } - /** Set the description, throws away the title value as this is not supported in 2.0 */ + /** + * Set the description, throws away the title value as this is not supported in 2.0 + */ public void setReflectiveData(Long toolContentId, String title, String description) throws ToolException, DataMissingException { @@ -1116,6 +1131,33 @@ toolContentObj.setReflectInstructions(description); } + /** + * Sends marks straight to gradebook from a forum report + * + * @param user + * @param toolSessionID + */ + @SuppressWarnings("unchecked") + public void sendMarksToGradebook(ForumUser user, Long toolSessionID) { + + List messages = getMessagesByUserUid(user.getUid(), toolSessionID); + if (messages != null) { + Float totalMark = null; + for (MessageDTO message : messages) { + if (totalMark == null) { + totalMark = message.getMark(); + } else if (message.getMark() != null) { + totalMark += message.getMark(); + } + } + if (totalMark != null) { + Double mark = new Double(totalMark); + gradebookService.updateActivityMark(mark, null, user.getUserId().intValue(), toolSessionID, false); + } + } + + } + // *************************************************************************************************************** // Get / Set methods // *************************************************************************************************************** @@ -1142,13 +1184,13 @@ public void setForumDao(ForumDao forumDao) { this.forumDao = forumDao; } - + public TimestampDao getTimestampDao() { - return timestampDao; + return timestampDao; } public void setTimestampDao(TimestampDao timestampDao) { - this.timestampDao = timestampDao; + this.timestampDao = timestampDao; } public MessageDao getMessageDao() { @@ -1251,6 +1293,10 @@ return messageService.getMessage(key, args); } + public void setGradebookService(IGradebookService gradebookService) { + this.gradebookService = gradebookService; + } + /** * {@inheritDoc} */ @@ -1267,47 +1313,47 @@ } while (uniqueNumber == null); return getForumOutputFactory().buildTextSearchConditionName(uniqueNumber); } - + /** * Get number of new postings. * * @param messageId * @param userId - * @return + * @return */ public int getNewMessagesNum(Long messageId, Long userId) { return timestampDao.getNewMessagesNum(messageId, userId); } - + /** * Get last topic date. * * @param messageId - * @return + * @return */ public Date getLastTopicDate(Long messageId) { return messageDao.getLastTopicDate(messageId); } - + /** * Get timestamp. * * @param messageId * @param forumUserId - * @return + * @return */ public Timestamp getTimestamp(Long MessageId, Long forumUserId) throws PersistenceException { return timestampDao.getTimestamp(MessageId, forumUserId); } - + /** * Save timestamp. * * @param timestamp - * @return + * @return */ public void saveTimestamp(Timestamp timestamp) { timestampDao.saveOrUpdate(timestamp); } - + } \ No newline at end of file Index: lams_tool_forum/src/java/org/lamsfoundation/lams/tool/forum/util/ForumConstants.java =================================================================== diff -u -r59e4b8d442ec5f40e2e7a5bef1bda2059953b59a -racc8d2acf5b6b0002e0c8129947040a779ab4077 --- lams_tool_forum/src/java/org/lamsfoundation/lams/tool/forum/util/ForumConstants.java (.../ForumConstants.java) (revision 59e4b8d442ec5f40e2e7a5bef1bda2059953b59a) +++ lams_tool_forum/src/java/org/lamsfoundation/lams/tool/forum/util/ForumConstants.java (.../ForumConstants.java) (revision acc8d2acf5b6b0002e0c8129947040a779ab4077) @@ -24,6 +24,8 @@ /* $$Id$$ */ package org.lamsfoundation.lams.tool.forum.util; +import java.util.regex.Pattern; + /** * User: conradb Date: 14/06/2005 Time: 10:33:00 */ @@ -140,7 +142,7 @@ public static final String ATTR_REFLECTION_INSTRUCTION = "reflectInstructions"; public static final String ATTR_REFLECTION_ENTRY = "reflectEntry"; - + public static final String ATTR_MINIMUM_REPLY = "minimumReply"; public static final String ATTR_MAXIMUM_REPLY = "maximumReply"; @@ -167,4 +169,10 @@ // a forward key public static final String SUCCESS = "success"; -} + public static final String WORD_REGEX = "\\w+"; + + public static final short SUBJECT_WORD_COUNT = 3; + + public static final int PATTERN_MATCHING_OPTIONS = Pattern.CASE_INSENSITIVE | Pattern.UNICODE_CASE + | Pattern.MULTILINE; +} \ No newline at end of file Index: lams_tool_forum/src/java/org/lamsfoundation/lams/tool/forum/web/actions/AuthoringAction.java =================================================================== diff -u -r8a0ce21a725377050cc155f9edb0edad71ac2fd4 -racc8d2acf5b6b0002e0c8129947040a779ab4077 --- lams_tool_forum/src/java/org/lamsfoundation/lams/tool/forum/web/actions/AuthoringAction.java (.../AuthoringAction.java) (revision 8a0ce21a725377050cc155f9edb0edad71ac2fd4) +++ lams_tool_forum/src/java/org/lamsfoundation/lams/tool/forum/web/actions/AuthoringAction.java (.../AuthoringAction.java) (revision acc8d2acf5b6b0002e0c8129947040a779ab4077) @@ -37,6 +37,8 @@ import java.util.SortedSet; import java.util.TreeMap; import java.util.TreeSet; +import java.util.regex.Matcher; +import java.util.regex.Pattern; import javax.servlet.ServletException; import javax.servlet.http.HttpServletRequest; @@ -1107,21 +1109,46 @@ ActionMessages errors = plannerForm.validate(); if (errors.isEmpty()) { Forum forum = getForumManager().getForumByContentId(plannerForm.getToolContentID()); + forum.setInstructions(plannerForm.getInstructions()); int topicIndex = 0; String topic = null; + String subject = null; Message message = null; List newTopics = new LinkedList(); Iterator forumTopicIterator = forum.getMessages().iterator(); + Pattern regexPattern = Pattern.compile(ForumConstants.WORD_REGEX, ForumConstants.PATTERN_MATCHING_OPTIONS); + + Matcher matcher = null; + do { topic = plannerForm.getTopic(topicIndex); + subject = WebUtil.removeHTMLtags(topic); + + // Getting 3 first words from body and making the subject out of it + if (StringUtils.isBlank(subject)) { + subject = null; + } else { + matcher = regexPattern.matcher(subject); + int currentEnd = subject.length(); + for (short wordIndex = 0; wordIndex < ForumConstants.SUBJECT_WORD_COUNT; wordIndex++) { + if (matcher.find()) { + currentEnd = matcher.end(); + } else { + break; + } + } + subject = subject.substring(0, currentEnd).concat("..."); + } + if (StringUtils.isEmpty(topic)) { plannerForm.removeTopic(topicIndex); } else { if (forumTopicIterator.hasNext()) { message = forumTopicIterator.next(); message.setUpdated(new Date()); - message.setSubject(topic); + message.setSubject(subject); + message.setBody(topic); } else { message = new Message(); message.setIsAuthored(true); @@ -1136,7 +1163,8 @@ message.setCreatedBy(forumUser); message.setModifiedBy(forumUser); - message.setSubject(topic); + message.setSubject(subject); + message.setBody(topic); newTopics.add(message); message.setForum(forum); Index: lams_tool_forum/src/java/org/lamsfoundation/lams/tool/forum/web/actions/LearningAction.java =================================================================== diff -u -r59e4b8d442ec5f40e2e7a5bef1bda2059953b59a -racc8d2acf5b6b0002e0c8129947040a779ab4077 --- lams_tool_forum/src/java/org/lamsfoundation/lams/tool/forum/web/actions/LearningAction.java (.../LearningAction.java) (revision 59e4b8d442ec5f40e2e7a5bef1bda2059953b59a) +++ lams_tool_forum/src/java/org/lamsfoundation/lams/tool/forum/web/actions/LearningAction.java (.../LearningAction.java) (revision acc8d2acf5b6b0002e0c8129947040a779ab4077) @@ -47,7 +47,6 @@ import org.apache.struts.action.ActionMapping; import org.apache.struts.action.ActionMessage; import org.apache.struts.action.ActionMessages; -import org.hibernate.Session; import org.lamsfoundation.lams.events.IEventNotificationService; import org.lamsfoundation.lams.notebook.model.NotebookEntry; import org.lamsfoundation.lams.notebook.service.CoreNotebookConstants; @@ -64,7 +63,6 @@ import org.lamsfoundation.lams.tool.forum.persistence.Message; import org.lamsfoundation.lams.tool.forum.persistence.PersistenceException; import org.lamsfoundation.lams.tool.forum.persistence.Timestamp; -import org.lamsfoundation.lams.tool.forum.service.ForumService; import org.lamsfoundation.lams.tool.forum.service.ForumServiceProxy; import org.lamsfoundation.lams.tool.forum.service.IForumService; import org.lamsfoundation.lams.tool.forum.util.ForumConstants; @@ -82,955 +80,946 @@ * User: conradb Date: 24/06/2005 Time: 10:54:09 */ public class LearningAction extends Action { - private static Logger log = Logger.getLogger(LearningAction.class); + private static Logger log = Logger.getLogger(LearningAction.class); - private static final boolean MODE_OPTIONAL = false; + private static final boolean MODE_OPTIONAL = false; - private IForumService forumService; + private IForumService forumService; - @Override - public final ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, - HttpServletResponse response) throws Exception { - String param = mapping.getParameter(); - // --------------Forum Level ------------------ - if (param.equals("viewForum")) { - return viewForum(mapping, form, request, response); - } - if (param.equals("finish")) { - return finish(mapping, form, request, response); - } + @Override + public final ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, + HttpServletResponse response) throws Exception { + String param = mapping.getParameter(); + // --------------Forum Level ------------------ + if (param.equals("viewForum")) { + return viewForum(mapping, form, request, response); + } + if (param.equals("finish")) { + return finish(mapping, form, request, response); + } - // --------------Topic Level ------------------ - if (param.equals("viewTopic")) { - return viewTopic(mapping, form, request, response); - } - if (param.equals("newTopic")) { - return newTopic(mapping, form, request, response); - } - if (param.equals("createTopic")) { - return createTopic(mapping, form, request, response); - } - if (param.equals("newReplyTopic")) { - return newReplyTopic(mapping, form, request, response); - } - if (param.equals("replyTopic")) { - return replyTopic(mapping, form, request, response); - } - if (param.equals("editTopic")) { - return editTopic(mapping, form, request, response); - } - if (param.equals("updateTopic")) { - return updateTopic(mapping, form, request, response); - } - if (param.equals("deleteAttachment")) { - return deleteAttachment(mapping, form, request, response); - } - if (param.equals("updateMessageHideFlag")) { - return updateMessageHideFlag(mapping, form, request, response); - } + // --------------Topic Level ------------------ + if (param.equals("viewTopic")) { + return viewTopic(mapping, form, request, response); + } + if (param.equals("newTopic")) { + return newTopic(mapping, form, request, response); + } + if (param.equals("createTopic")) { + return createTopic(mapping, form, request, response); + } + if (param.equals("newReplyTopic")) { + return newReplyTopic(mapping, form, request, response); + } + if (param.equals("replyTopic")) { + return replyTopic(mapping, form, request, response); + } + if (param.equals("editTopic")) { + return editTopic(mapping, form, request, response); + } + if (param.equals("updateTopic")) { + return updateTopic(mapping, form, request, response); + } + if (param.equals("deleteAttachment")) { + return deleteAttachment(mapping, form, request, response); + } + if (param.equals("updateMessageHideFlag")) { + return updateMessageHideFlag(mapping, form, request, response); + } - //================ Reflection ======================= - if (param.equals("newReflection")) { - return newReflection(mapping, form, request, response); - } - if (param.equals("submitReflection")) { - return submitReflection(mapping, form, request, response); - } - - return mapping.findForward("error"); + // ================ Reflection ======================= + if (param.equals("newReflection")) { + return newReflection(mapping, form, request, response); } + if (param.equals("submitReflection")) { + return submitReflection(mapping, form, request, response); + } - // ========================================================================================== - // Forum level methods - // ========================================================================================== - /** - * Display root topics of a forum. This page will be the initial page of - * Learner page. - * @throws Exception - * - */ - private ActionForward viewForum(ActionMapping mapping, ActionForm form, HttpServletRequest request, - HttpServletResponse response) throws Exception { + return mapping.findForward("error"); + } - //initial Session Map - String sessionMapID = request.getParameter(ForumConstants.ATTR_SESSION_MAP_ID); - SessionMap sessionMap; - //refresh forum page, not initial enter - if (sessionMapID != null) { - sessionMap = (SessionMap) request.getSession().getAttribute(sessionMapID); - } - else { - sessionMap = new SessionMap(); - request.getSession().setAttribute(sessionMap.getSessionID(), sessionMap); + // ========================================================================================== + // Forum level methods + // ========================================================================================== + /** + * Display root topics of a forum. This page will be the initial page of Learner page. + * + * @throws Exception + * + */ + private ActionForward viewForum(ActionMapping mapping, ActionForm form, HttpServletRequest request, + HttpServletResponse response) throws Exception { - } - request.setAttribute(ForumConstants.ATTR_SESSION_MAP_ID, sessionMap.getSessionID()); + // initial Session Map + String sessionMapID = request.getParameter(ForumConstants.ATTR_SESSION_MAP_ID); + SessionMap sessionMap; + // refresh forum page, not initial enter + if (sessionMapID != null) { + sessionMap = (SessionMap) request.getSession().getAttribute(sessionMapID); + } else { + sessionMap = new SessionMap(); + request.getSession().setAttribute(sessionMap.getSessionID(), sessionMap); - // set the mode into http session - ToolAccessMode mode = null; - try { - mode = WebUtil.readToolAccessModeParam(request, AttributeNames.PARAM_MODE, LearningAction.MODE_OPTIONAL); - } - catch (Exception exp) { - } - if (mode == null) { - //set it as default mode - mode = ToolAccessMode.LEARNER; - } + } + request.setAttribute(ForumConstants.ATTR_SESSION_MAP_ID, sessionMap.getSessionID()); - // get sessionId from HttpServletRequest - Long sessionId = WebUtil.readLongParam(request, AttributeNames.PARAM_TOOL_SESSION_ID); + // set the mode into http session + ToolAccessMode mode = null; + try { + mode = WebUtil.readToolAccessModeParam(request, AttributeNames.PARAM_MODE, LearningAction.MODE_OPTIONAL); + } catch (Exception exp) { + } + if (mode == null) { + // set it as default mode + mode = ToolAccessMode.LEARNER; + } - // Try to get ForumID according to sessionId - forumService = getForumManager(); - ForumToolSession session = forumService.getSessionBySessionId(sessionId); + // get sessionId from HttpServletRequest + Long sessionId = WebUtil.readLongParam(request, AttributeNames.PARAM_TOOL_SESSION_ID); - if (session == null || session.getForum() == null) { - LearningAction.log.error("Failed on getting session by given sessionID:" + sessionId); - throw new Exception("Failed on getting session by given sessionID:" + sessionId); - } + // Try to get ForumID according to sessionId + forumService = getForumManager(); + ForumToolSession session = forumService.getSessionBySessionId(sessionId); - Forum forum = session.getForum(); - //lock on finish - ForumUser forumUser = getCurrentUser(request, sessionId); - boolean lock = forum.getLockWhenFinished() && forumUser.isSessionFinished(); + if (session == null || session.getForum() == null) { + LearningAction.log.error("Failed on getting session by given sessionID:" + sessionId); + throw new Exception("Failed on getting session by given sessionID:" + sessionId); + } - //set some option flag to HttpSession - // if allowRichEditor = true then don't restrict the number of chars - // if isLimitedInput = false then don't restrict the number of chars - // Indicate don't restrict number of chars by allowNumber = 0 - Long forumId = forum.getUid(); - Boolean allowRichEditor = new Boolean(forum.isAllowRichEditor()); - int allowNumber = forum.isLimitedInput() || forum.isAllowRichEditor() ? forum.getLimitedChar() : 0; + Forum forum = session.getForum(); + // lock on finish + ForumUser forumUser = getCurrentUser(request, sessionId); + boolean lock = forum.getLockWhenFinished() && forumUser.isSessionFinished(); - sessionMap.put(ForumConstants.FORUM_ID, forumId); - sessionMap.put(AttributeNames.ATTR_MODE, mode); - sessionMap.put(ForumConstants.ATTR_FINISHED_LOCK, new Boolean(lock)); - sessionMap.put(ForumConstants.ATTR_LOCK_WHEN_FINISHED, forum.getLockWhenFinished()); - sessionMap.put(ForumConstants.ATTR_USER_FINISHED, forumUser.isSessionFinished()); - sessionMap.put(ForumConstants.ATTR_ALLOW_EDIT, forum.isAllowEdit()); - sessionMap.put(ForumConstants.ATTR_ALLOW_UPLOAD, forum.isAllowUpload()); - sessionMap.put(ForumConstants.ATTR_ALLOW_NEW_TOPICS, forum.isAllowNewTopic()); - sessionMap.put(ForumConstants.ATTR_ALLOW_RICH_EDITOR, allowRichEditor); - sessionMap.put(ForumConstants.ATTR_LIMITED_CHARS, new Integer(allowNumber)); - sessionMap.put(AttributeNames.PARAM_TOOL_SESSION_ID, sessionId); - sessionMap.put(ForumConstants.ATTR_FORUM_TITLE, forum.getTitle()); - sessionMap.put(ForumConstants.ATTR_FORUM_INSTRCUTION, forum.getInstructions()); - sessionMap.put(ForumConstants.ATTR_MINIMUM_REPLY, forum.getMinimumReply()); - sessionMap.put(ForumConstants.ATTR_MAXIMUM_REPLY, forum.getMaximumReply()); + // set some option flag to HttpSession + // if allowRichEditor = true then don't restrict the number of chars + // if isLimitedInput = false then don't restrict the number of chars + // Indicate don't restrict number of chars by allowNumber = 0 + Long forumId = forum.getUid(); + Boolean allowRichEditor = new Boolean(forum.isAllowRichEditor()); + int allowNumber = forum.isLimitedInput() || forum.isAllowRichEditor() ? forum.getLimitedChar() : 0; - // Should we show the reflection or not? We shouldn't show it when the screen is accessed - // from the Monitoring Summary screen, but we should when accessed from the Learner Progress screen. - // Need to constantly past this value on, rather than hiding just the once, as the View Forum - // screen has a refresh button. - boolean hideReflection = WebUtil.readBooleanParam(request, ForumConstants.ATTR_HIDE_REFLECTION, false); - sessionMap.put(ForumConstants.ATTR_HIDE_REFLECTION, hideReflection); + sessionMap.put(ForumConstants.FORUM_ID, forumId); + sessionMap.put(AttributeNames.ATTR_MODE, mode); + sessionMap.put(ForumConstants.ATTR_FINISHED_LOCK, new Boolean(lock)); + sessionMap.put(ForumConstants.ATTR_LOCK_WHEN_FINISHED, forum.getLockWhenFinished()); + sessionMap.put(ForumConstants.ATTR_USER_FINISHED, forumUser.isSessionFinished()); + sessionMap.put(ForumConstants.ATTR_ALLOW_EDIT, forum.isAllowEdit()); + sessionMap.put(ForumConstants.ATTR_ALLOW_UPLOAD, forum.isAllowUpload()); + sessionMap.put(ForumConstants.ATTR_ALLOW_NEW_TOPICS, forum.isAllowNewTopic()); + sessionMap.put(ForumConstants.ATTR_ALLOW_RICH_EDITOR, allowRichEditor); + sessionMap.put(ForumConstants.ATTR_LIMITED_CHARS, new Integer(allowNumber)); + sessionMap.put(AttributeNames.PARAM_TOOL_SESSION_ID, sessionId); + sessionMap.put(ForumConstants.ATTR_FORUM_TITLE, forum.getTitle()); + sessionMap.put(ForumConstants.ATTR_FORUM_INSTRCUTION, forum.getInstructions()); + sessionMap.put(ForumConstants.ATTR_MINIMUM_REPLY, forum.getMinimumReply()); + sessionMap.put(ForumConstants.ATTR_MAXIMUM_REPLY, forum.getMaximumReply()); - if (hideReflection) { - sessionMap.put(ForumConstants.ATTR_REFLECTION_ON, false); - sessionMap.put(ForumConstants.ATTR_REFLECTION_INSTRUCTION, ""); - sessionMap.put(ForumConstants.ATTR_REFLECTION_ENTRY, ""); - } - else { - sessionMap.put(ForumConstants.ATTR_REFLECTION_ON, forum.isReflectOnActivity()); - sessionMap.put(ForumConstants.ATTR_REFLECTION_INSTRUCTION, forum.getReflectInstructions()); + // Should we show the reflection or not? We shouldn't show it when the screen is accessed + // from the Monitoring Summary screen, but we should when accessed from the Learner Progress screen. + // Need to constantly past this value on, rather than hiding just the once, as the View Forum + // screen has a refresh button. + boolean hideReflection = WebUtil.readBooleanParam(request, ForumConstants.ATTR_HIDE_REFLECTION, false); + sessionMap.put(ForumConstants.ATTR_HIDE_REFLECTION, hideReflection); - NotebookEntry notebookEntry = forumService.getEntry(sessionId, CoreNotebookConstants.NOTEBOOK_TOOL, - ForumConstants.TOOL_SIGNATURE, forumUser.getUserId().intValue()); - sessionMap.put(ForumConstants.ATTR_REFLECTION_ENTRY, notebookEntry != null ? notebookEntry.getEntry() : ""); - } + if (hideReflection) { + sessionMap.put(ForumConstants.ATTR_REFLECTION_ON, false); + sessionMap.put(ForumConstants.ATTR_REFLECTION_INSTRUCTION, ""); + sessionMap.put(ForumConstants.ATTR_REFLECTION_ENTRY, ""); + } else { + sessionMap.put(ForumConstants.ATTR_REFLECTION_ON, forum.isReflectOnActivity()); + sessionMap.put(ForumConstants.ATTR_REFLECTION_INSTRUCTION, forum.getReflectInstructions()); - //add define later support - if (forum.isDefineLater()) { - return mapping.findForward("defineLater"); - } + NotebookEntry notebookEntry = forumService.getEntry(sessionId, CoreNotebookConstants.NOTEBOOK_TOOL, + ForumConstants.TOOL_SIGNATURE, forumUser.getUserId().intValue()); + sessionMap.put(ForumConstants.ATTR_REFLECTION_ENTRY, notebookEntry != null ? notebookEntry.getEntry() : ""); + } - //set contentInUse flag to true! - forum.setContentInUse(true); - forum.setDefineLater(false); - forumService.updateForum(forum); + // add define later support + if (forum.isDefineLater()) { + return mapping.findForward("defineLater"); + } - //add run offline support - if (forum.getRunOffline()) { - return mapping.findForward("runOffline"); - } + // set contentInUse flag to true! + forum.setContentInUse(true); + forum.setDefineLater(false); + forumService.updateForum(forum); - // get all root topic to display on init page - List rootTopics = forumService.getRootTopics(sessionId); - if (!forum.isAllowNewTopic()) { - // add the number post the learner has made for each topic. - updateNumOfPosts(rootTopics, forumUser); - } - request.setAttribute(ForumConstants.AUTHORING_TOPICS_LIST, rootTopics); + // add run offline support + if (forum.getRunOffline()) { + return mapping.findForward("runOffline"); + } - if (forum.isNotifyLearnersOnMarkRelease()) { - forumService.getEventNotificationService().createEvent(ForumConstants.TOOL_SIGNATURE, - ForumConstants.EVENT_NAME_NOTIFY_LEARNERS_ON_MARK_RELEASE, forum.getContentId(), - forumService.getLocalisedMessage("event.mark.release.subject", null), - forumService.getLocalisedMessage("event.mark.release.body", null)); + // get all root topic to display on init page + List rootTopics = forumService.getRootTopics(sessionId); + if (!forum.isAllowNewTopic()) { + // add the number post the learner has made for each topic. + updateNumOfPosts(rootTopics, forumUser); + } + request.setAttribute(ForumConstants.AUTHORING_TOPICS_LIST, rootTopics); - forumService.getEventNotificationService().subscribe(ForumConstants.TOOL_SIGNATURE, - ForumConstants.EVENT_NAME_NOTIFY_LEARNERS_ON_MARK_RELEASE, forum.getContentId(), - forumUser.getUserId().longValue(), IEventNotificationService.DELIVERY_METHOD_MAIL, - IEventNotificationService.PERIODICITY_SINGLE); - } - - // displaying new postings - for (Iterator iterator = rootTopics.iterator(); iterator.hasNext();) { - MessageDTO messageDTO = (MessageDTO) iterator.next(); - int numOfNewPosts = forumService.getNewMessagesNum( - messageDTO.getMessage().getUid(), forumUser.getUid()); - if (numOfNewPosts == -1) // first time; show all postings as new, including root message - messageDTO.setNewPostingsNum(messageDTO.getMessage().getReplyNumber() + 1); - else - messageDTO.setNewPostingsNum(numOfNewPosts); - - messageDTO.setLastTopicDate(forumService.getLastTopicDate(messageDTO.getMessage().getUid())); - } + if (forum.isNotifyLearnersOnMarkRelease()) { + forumService.getEventNotificationService().createEvent(ForumConstants.TOOL_SIGNATURE, + ForumConstants.EVENT_NAME_NOTIFY_LEARNERS_ON_MARK_RELEASE, forum.getContentId(), + forumService.getLocalisedMessage("event.mark.release.subject", null), + forumService.getLocalisedMessage("event.mark.release.body", null)); - return mapping.findForward("success"); + forumService.getEventNotificationService().subscribe(ForumConstants.TOOL_SIGNATURE, + ForumConstants.EVENT_NAME_NOTIFY_LEARNERS_ON_MARK_RELEASE, forum.getContentId(), + forumUser.getUserId().longValue(), IEventNotificationService.DELIVERY_METHOD_MAIL, + IEventNotificationService.PERIODICITY_SINGLE); } - private void updateNumOfPosts(List rootTopics, ForumUser forumUser) { - for (Iterator iterator = rootTopics.iterator(); iterator.hasNext();) { - MessageDTO messageDTO = (MessageDTO) iterator.next(); - int numOfPosts = forumService.getNumOfPostsByTopic(forumUser.getUserId(), messageDTO.getMessage().getUid()); - messageDTO.setNumOfPosts(numOfPosts); - } + // displaying new postings + for (Iterator iterator = rootTopics.iterator(); iterator.hasNext();) { + MessageDTO messageDTO = (MessageDTO) iterator.next(); + int numOfNewPosts = forumService.getNewMessagesNum(messageDTO.getMessage().getUid(), forumUser.getUid()); + if (numOfNewPosts == -1) { + messageDTO.setNewPostingsNum(messageDTO.getMessage().getReplyNumber() + 1); + } else { + messageDTO.setNewPostingsNum(numOfNewPosts); + } + + messageDTO.setLastTopicDate(forumService.getLastTopicDate(messageDTO.getMessage().getUid())); } - /** - * Learner click "finish" button in forum page, this method will turn on - * session status flag for this learner. - * - * @param mapping - * @param form - * @param request - * @param response - * @return - */ - private ActionForward finish(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) { - String sessionMapID = WebUtil.readStrParam(request, ForumConstants.ATTR_SESSION_MAP_ID); - SessionMap sessionMap = (SessionMap) request.getSession().getAttribute(sessionMapID); + return mapping.findForward("success"); + } - ToolAccessMode mode = (ToolAccessMode) sessionMap.get(AttributeNames.ATTR_MODE); - Long sessionId = (Long) sessionMap.get(AttributeNames.PARAM_TOOL_SESSION_ID); + private void updateNumOfPosts(List rootTopics, ForumUser forumUser) { + for (Iterator iterator = rootTopics.iterator(); iterator.hasNext();) { + MessageDTO messageDTO = (MessageDTO) iterator.next(); + int numOfPosts = forumService.getNumOfPostsByTopic(forumUser.getUserId(), messageDTO.getMessage().getUid()); + messageDTO.setNumOfPosts(numOfPosts); + } + } - forumService = getForumManager(); + /** + * Learner click "finish" button in forum page, this method will turn on session status flag for this learner. + * + * @param mapping + * @param form + * @param request + * @param response + * @return + */ + private ActionForward finish(ActionMapping mapping, ActionForm form, HttpServletRequest request, + HttpServletResponse response) { + String sessionMapID = WebUtil.readStrParam(request, ForumConstants.ATTR_SESSION_MAP_ID); + SessionMap sessionMap = (SessionMap) request.getSession().getAttribute(sessionMapID); - if (mode == ToolAccessMode.LEARNER || mode == ToolAccessMode.AUTHOR) { - if (!validateBeforeFinish(request, sessionMapID)) { - return mapping.getInputForward(); - } + ToolAccessMode mode = (ToolAccessMode) sessionMap.get(AttributeNames.ATTR_MODE); + Long sessionId = (Long) sessionMap.get(AttributeNames.PARAM_TOOL_SESSION_ID); - String nextActivityUrl; - try { - // get session from shared session. - HttpSession ss = SessionManager.getSession(); - UserDTO user = (UserDTO) ss.getAttribute(AttributeNames.USER); - Long userID = new Long(user.getUserID().longValue()); + forumService = getForumManager(); - //finish current session for user - forumService.finishUserSession(getCurrentUser(request, sessionId)); - ToolSessionManager sessionMgrService = ForumServiceProxy.getToolSessionManager(getServlet().getServletContext()); - nextActivityUrl = sessionMgrService.leaveToolSession(sessionId, userID); - response.sendRedirect(nextActivityUrl); - } - catch (DataMissingException e) { - throw new ForumException(e); - } - catch (ToolException e) { - throw new ForumException(e); - } - catch (IOException e) { - throw new ForumException(e); - } - return null; + if (mode == ToolAccessMode.LEARNER || mode == ToolAccessMode.AUTHOR) { + if (!validateBeforeFinish(request, sessionMapID)) { + return mapping.getInputForward(); + } - } - // get all root topic to display on init page - List rootTopics = forumService.getRootTopics(sessionId); - request.setAttribute(ForumConstants.AUTHORING_TOPICS_LIST, rootTopics); + String nextActivityUrl; + try { + // get session from shared session. + HttpSession ss = SessionManager.getSession(); + UserDTO user = (UserDTO) ss.getAttribute(AttributeNames.USER); + Long userID = new Long(user.getUserID().longValue()); - return mapping.getInputForward(); + // finish current session for user + forumService.finishUserSession(getCurrentUser(request, sessionId)); + ToolSessionManager sessionMgrService = ForumServiceProxy.getToolSessionManager(getServlet() + .getServletContext()); + nextActivityUrl = sessionMgrService.leaveToolSession(sessionId, userID); + response.sendRedirect(nextActivityUrl); + } catch (DataMissingException e) { + throw new ForumException(e); + } catch (ToolException e) { + throw new ForumException(e); + } catch (IOException e) { + throw new ForumException(e); + } + return null; + } + // get all root topic to display on init page + List rootTopics = forumService.getRootTopics(sessionId); + request.setAttribute(ForumConstants.AUTHORING_TOPICS_LIST, rootTopics); - /** - * Submit reflection form input database. - * @param mapping - * @param form - * @param request - * @param response - * @return - */ - private ActionForward submitReflection(ActionMapping mapping, ActionForm form, HttpServletRequest request, - HttpServletResponse response) { - ReflectionForm refForm = (ReflectionForm) form; - Integer userId = refForm.getUserID(); + return mapping.getInputForward(); + } - String sessionMapID = WebUtil.readStrParam(request, ForumConstants.ATTR_SESSION_MAP_ID); - SessionMap sessionMap = (SessionMap) request.getSession().getAttribute(sessionMapID); - Long sessionId = (Long) sessionMap.get(AttributeNames.PARAM_TOOL_SESSION_ID); + /** + * Submit reflection form input database. + * + * @param mapping + * @param form + * @param request + * @param response + * @return + */ + private ActionForward submitReflection(ActionMapping mapping, ActionForm form, HttpServletRequest request, + HttpServletResponse response) { + ReflectionForm refForm = (ReflectionForm) form; + Integer userId = refForm.getUserID(); - // check for existing notebook entry - NotebookEntry entry = forumService.getEntry(sessionId, CoreNotebookConstants.NOTEBOOK_TOOL, - ForumConstants.TOOL_SIGNATURE, userId); + String sessionMapID = WebUtil.readStrParam(request, ForumConstants.ATTR_SESSION_MAP_ID); + SessionMap sessionMap = (SessionMap) request.getSession().getAttribute(sessionMapID); + Long sessionId = (Long) sessionMap.get(AttributeNames.PARAM_TOOL_SESSION_ID); - if (entry == null) { - // create new entry - forumService.createNotebookEntry(sessionId, CoreNotebookConstants.NOTEBOOK_TOOL, ForumConstants.TOOL_SIGNATURE, - userId, refForm.getEntryText()); - } - else { - // update existing entry - entry.setEntry(refForm.getEntryText()); - entry.setLastModified(new Date()); - forumService.updateEntry(entry); - } + // check for existing notebook entry + NotebookEntry entry = forumService.getEntry(sessionId, CoreNotebookConstants.NOTEBOOK_TOOL, + ForumConstants.TOOL_SIGNATURE, userId); - return finish(mapping, form, request, response); + if (entry == null) { + // create new entry + forumService.createNotebookEntry(sessionId, CoreNotebookConstants.NOTEBOOK_TOOL, + ForumConstants.TOOL_SIGNATURE, userId, refForm.getEntryText()); + } else { + // update existing entry + entry.setEntry(refForm.getEntryText()); + entry.setLastModified(new Date()); + forumService.updateEntry(entry); } - /** - * Display empty reflection form. - * @param mapping - * @param form - * @param request - * @param response - * @return - */ - private ActionForward newReflection(ActionMapping mapping, ActionForm form, HttpServletRequest request, - HttpServletResponse response) { + return finish(mapping, form, request, response); + } - //get session value - String sessionMapID = WebUtil.readStrParam(request, ForumConstants.ATTR_SESSION_MAP_ID); - if (!validateBeforeFinish(request, sessionMapID)) { - return mapping.getInputForward(); - } + /** + * Display empty reflection form. + * + * @param mapping + * @param form + * @param request + * @param response + * @return + */ + private ActionForward newReflection(ActionMapping mapping, ActionForm form, HttpServletRequest request, + HttpServletResponse response) { - ReflectionForm refForm = (ReflectionForm) form; - HttpSession ss = SessionManager.getSession(); - UserDTO user = (UserDTO) ss.getAttribute(AttributeNames.USER); + // get session value + String sessionMapID = WebUtil.readStrParam(request, ForumConstants.ATTR_SESSION_MAP_ID); + if (!validateBeforeFinish(request, sessionMapID)) { + return mapping.getInputForward(); + } - refForm.setUserID(user.getUserID()); - refForm.setSessionMapID(sessionMapID); + ReflectionForm refForm = (ReflectionForm) form; + HttpSession ss = SessionManager.getSession(); + UserDTO user = (UserDTO) ss.getAttribute(AttributeNames.USER); - // get the existing reflection entry - IForumService submitFilesService = getForumManager(); + refForm.setUserID(user.getUserID()); + refForm.setSessionMapID(sessionMapID); - SessionMap map = (SessionMap) request.getSession().getAttribute(sessionMapID); - Long toolSessionID = (Long) map.get(AttributeNames.PARAM_TOOL_SESSION_ID); - NotebookEntry entry = submitFilesService.getEntry(toolSessionID, CoreNotebookConstants.NOTEBOOK_TOOL, - ForumConstants.TOOL_SIGNATURE, user.getUserID()); + // get the existing reflection entry + IForumService submitFilesService = getForumManager(); - if (entry != null) { - refForm.setEntryText(entry.getEntry()); - } + SessionMap map = (SessionMap) request.getSession().getAttribute(sessionMapID); + Long toolSessionID = (Long) map.get(AttributeNames.PARAM_TOOL_SESSION_ID); + NotebookEntry entry = submitFilesService.getEntry(toolSessionID, CoreNotebookConstants.NOTEBOOK_TOOL, + ForumConstants.TOOL_SIGNATURE, user.getUserID()); - return mapping.findForward("success"); + if (entry != null) { + refForm.setEntryText(entry.getEntry()); } - // ========================================================================================== - // Topic level methods - // ========================================================================================== + return mapping.findForward("success"); + } - /** - * Display read-only page for a special topic. Topic will arrange by Tree - * structure. - * - * @param mapping - * @param form - * @param request - * @param response - * @return - */ - private ActionForward viewTopic(ActionMapping mapping, ActionForm form, HttpServletRequest request, - HttpServletResponse response) { + // ========================================================================================== + // Topic level methods + // ========================================================================================== - forumService = getForumManager(); + /** + * Display read-only page for a special topic. Topic will arrange by Tree structure. + * + * @param mapping + * @param form + * @param request + * @param response + * @return + */ + private ActionForward viewTopic(ActionMapping mapping, ActionForm form, HttpServletRequest request, + HttpServletResponse response) { - Long rootTopicId = WebUtil.readLongParam(request, ForumConstants.ATTR_TOPIC_ID); + forumService = getForumManager(); - String sessionMapID = WebUtil.readStrParam(request, ForumConstants.ATTR_SESSION_MAP_ID); - SessionMap sessionMap = (SessionMap) request.getSession().getAttribute(sessionMapID); - sessionMap.put(ForumConstants.ATTR_ROOT_TOPIC_UID, rootTopicId); + Long rootTopicId = WebUtil.readLongParam(request, ForumConstants.ATTR_TOPIC_ID); - // get forum user and forum - ForumUser forumUser = getCurrentUser(request, (Long) sessionMap.get(AttributeNames.PARAM_TOOL_SESSION_ID)); - Forum forum = forumUser.getSession().getForum(); + String sessionMapID = WebUtil.readStrParam(request, ForumConstants.ATTR_SESSION_MAP_ID); + SessionMap sessionMap = (SessionMap) request.getSession().getAttribute(sessionMapID); + sessionMap.put(ForumConstants.ATTR_ROOT_TOPIC_UID, rootTopicId); - // get root topic list - List msgDtoList = forumService.getTopicThread(rootTopicId); - updateMesssageFlag(msgDtoList); - request.setAttribute(ForumConstants.AUTHORING_TOPIC_THREAD, msgDtoList); + // get forum user and forum + ForumUser forumUser = getCurrentUser(request, (Long) sessionMap.get(AttributeNames.PARAM_TOOL_SESSION_ID)); + Forum forum = forumUser.getSession().getForum(); - // check if we can still make posts in this topic - int numOfPosts = forumService.getNumOfPostsByTopic(forumUser.getUserId(), msgDtoList.get(0).getMessage().getUid()); - boolean noMorePosts = forum.getMaximumReply() != 0 && numOfPosts >= forum.getMaximumReply() && !forum.isAllowNewTopic() ? Boolean.TRUE - : Boolean.FALSE; - request.setAttribute(ForumConstants.ATTR_NO_MORE_POSTS, noMorePosts); - request.setAttribute(ForumConstants.ATTR_NUM_OF_POSTS, numOfPosts); + // get root topic list + List msgDtoList = forumService.getTopicThread(rootTopicId); + updateMesssageFlag(msgDtoList); + request.setAttribute(ForumConstants.AUTHORING_TOPIC_THREAD, msgDtoList); - //transfer SessionMapID as well - request.setAttribute(ForumConstants.ATTR_SESSION_MAP_ID, sessionMapID); + // check if we can still make posts in this topic + int numOfPosts = forumService.getNumOfPostsByTopic(forumUser.getUserId(), msgDtoList.get(0).getMessage() + .getUid()); + boolean noMorePosts = forum.getMaximumReply() != 0 && numOfPosts >= forum.getMaximumReply() + && !forum.isAllowNewTopic() ? Boolean.TRUE : Boolean.FALSE; + request.setAttribute(ForumConstants.ATTR_NO_MORE_POSTS, noMorePosts); + request.setAttribute(ForumConstants.ATTR_NUM_OF_POSTS, numOfPosts); - // Should we show the reflection or not? We shouldn't show it when the View Forum screen is accessed - // from the Monitoring Summary screen, but we should when accessed from the Learner Progress screen. - // Need to constantly past this value on, rather than hiding just the once, as the View Forum - // screen has a refresh button. Need to pass it through the view topic screen and dependent screens - // as it has a link from the view topic screen back to View Forum screen. - boolean hideReflection = WebUtil.readBooleanParam(request, ForumConstants.ATTR_HIDE_REFLECTION, false); - sessionMap.put(ForumConstants.ATTR_HIDE_REFLECTION, hideReflection); - - // Saving or updating user timestamp - saveUserTimestamp(rootTopicId, forumUser); - - return mapping.findForward("success"); + // transfer SessionMapID as well + request.setAttribute(ForumConstants.ATTR_SESSION_MAP_ID, sessionMapID); + + // Should we show the reflection or not? We shouldn't show it when the View Forum screen is accessed + // from the Monitoring Summary screen, but we should when accessed from the Learner Progress screen. + // Need to constantly past this value on, rather than hiding just the once, as the View Forum + // screen has a refresh button. Need to pass it through the view topic screen and dependent screens + // as it has a link from the view topic screen back to View Forum screen. + boolean hideReflection = WebUtil.readBooleanParam(request, ForumConstants.ATTR_HIDE_REFLECTION, false); + sessionMap.put(ForumConstants.ATTR_HIDE_REFLECTION, hideReflection); + + // Saving or updating user timestamp + saveUserTimestamp(rootTopicId, forumUser); + + return mapping.findForward("success"); + } + + /** + * Saving user timestamp + * + * @param toorTopicId + * @param forumUser + * @return + */ + private void saveUserTimestamp(Long rootTopicId, ForumUser forumUser) { + Date curDate = new Date(); + DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + try { + curDate = dateFormat.parse(dateFormat.format(new Date())); + } catch (ParseException pe) { + pe.printStackTrace(); } - - /** - * Saving user timestamp - * - * @param toorTopicId - * @param forumUser - * @return - */ - private void saveUserTimestamp(Long rootTopicId, ForumUser forumUser) - { - Date curDate = new Date(); - DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); - try { - curDate = dateFormat.parse(dateFormat.format(new Date())); - } catch(ParseException pe) { - pe.printStackTrace(); - } - - Timestamp timestamp = forumService.getTimestamp(rootTopicId, forumUser.getUid()); - if (timestamp != null) - { - timestamp.setTimestamp(curDate); - forumService.saveTimestamp(timestamp); - } - else - { - timestamp = new Timestamp(); - timestamp.setMessage(forumService.getMessage(rootTopicId)); - timestamp.setTimestamp(curDate); - timestamp.setForumUser(forumUser); - forumService.saveTimestamp(timestamp); - } + + Timestamp timestamp = forumService.getTimestamp(rootTopicId, forumUser.getUid()); + if (timestamp != null) { + timestamp.setTimestamp(curDate); + forumService.saveTimestamp(timestamp); + } else { + timestamp = new Timestamp(); + timestamp.setMessage(forumService.getMessage(rootTopicId)); + timestamp.setTimestamp(curDate); + timestamp.setForumUser(forumUser); + forumService.saveTimestamp(timestamp); } + } - /** - * Display empty page for a new topic in forum - * - * @param mapping - * @param form - * @param request - * @param response - * @return - */ - private ActionForward newTopic(ActionMapping mapping, ActionForm form, HttpServletRequest request, - HttpServletResponse response) { - //transfer SessionMapID as well - ((MessageForm) form).setSessionMapID(WebUtil.readStrParam(request, ForumConstants.ATTR_SESSION_MAP_ID)); + /** + * Display empty page for a new topic in forum + * + * @param mapping + * @param form + * @param request + * @param response + * @return + */ + private ActionForward newTopic(ActionMapping mapping, ActionForm form, HttpServletRequest request, + HttpServletResponse response) { + // transfer SessionMapID as well + ((MessageForm) form).setSessionMapID(WebUtil.readStrParam(request, ForumConstants.ATTR_SESSION_MAP_ID)); - return mapping.findForward("success"); - } + return mapping.findForward("success"); + } - /** - * Create a new root topic. - * - * @param mapping - * @param form - * @param request - * @param response - * @return - * @throws IOException - * @throws ServletException - * @throws PersistenceException - */ - public ActionForward createTopic(ActionMapping mapping, ActionForm form, HttpServletRequest request, - HttpServletResponse response) throws IOException, ServletException, PersistenceException { + /** + * Create a new root topic. + * + * @param mapping + * @param form + * @param request + * @param response + * @return + * @throws IOException + * @throws ServletException + * @throws PersistenceException + */ + public ActionForward createTopic(ActionMapping mapping, ActionForm form, HttpServletRequest request, + HttpServletResponse response) throws IOException, ServletException, PersistenceException { - MessageForm messageForm = (MessageForm) form; - SessionMap sessionMap = getSessionMap(request, messageForm); - Long forumId = (Long) sessionMap.get(ForumConstants.FORUM_ID); - Long sessionId = (Long) sessionMap.get(AttributeNames.PARAM_TOOL_SESSION_ID); + MessageForm messageForm = (MessageForm) form; + SessionMap sessionMap = getSessionMap(request, messageForm); + Long forumId = (Long) sessionMap.get(ForumConstants.FORUM_ID); + Long sessionId = (Long) sessionMap.get(AttributeNames.PARAM_TOOL_SESSION_ID); - Message message = messageForm.getMessage(); - message.setIsAuthored(false); - message.setCreated(new Date()); - message.setUpdated(new Date()); - message.setLastReplyDate(new Date()); - ForumUser forumUser = getCurrentUser(request, sessionId); - message.setCreatedBy(forumUser); - message.setModifiedBy(forumUser); - setAttachment(messageForm, message); + Message message = messageForm.getMessage(); + message.setIsAuthored(false); + message.setCreated(new Date()); + message.setUpdated(new Date()); + message.setLastReplyDate(new Date()); + ForumUser forumUser = getCurrentUser(request, sessionId); + message.setCreatedBy(forumUser); + message.setModifiedBy(forumUser); + setAttachment(messageForm, message); - // save message into database - forumService = getForumManager(); - forumService.createRootTopic(forumId, sessionId, message); + // save message into database + forumService = getForumManager(); + forumService.createRootTopic(forumId, sessionId, message); - // echo back current root topic to forum init page - List rootTopics = forumService.getRootTopics(sessionId); - request.setAttribute(ForumConstants.AUTHORING_TOPICS_LIST, rootTopics); - request.setAttribute(ForumConstants.ATTR_SESSION_MAP_ID, messageForm.getSessionMapID()); - - saveUserTimestamp(message.getUid(), forumUser); - - for (Iterator iterator = rootTopics.iterator(); iterator.hasNext();) { - MessageDTO messageDTO = (MessageDTO) iterator.next(); - int numOfNewPosts = forumService.getNewMessagesNum( - messageDTO.getMessage().getUid(), forumUser.getUid()); - if (numOfNewPosts == -1) // first time; show all postings as new, including root message - messageDTO.setNewPostingsNum(messageDTO.getMessage().getReplyNumber() + 1); - else - messageDTO.setNewPostingsNum(numOfNewPosts); - - messageDTO.setLastTopicDate(forumService.getLastTopicDate(messageDTO.getMessage().getUid())); - } - - return mapping.findForward("success"); - } + // echo back current root topic to forum init page + List rootTopics = forumService.getRootTopics(sessionId); + request.setAttribute(ForumConstants.AUTHORING_TOPICS_LIST, rootTopics); + request.setAttribute(ForumConstants.ATTR_SESSION_MAP_ID, messageForm.getSessionMapID()); - /** - * Display replay topic page. Message form subject will include parent - * topics same subject. - * - * @param mapping - * @param form - * @param request - * @param response - * @return - */ - private ActionForward newReplyTopic(ActionMapping mapping, ActionForm form, HttpServletRequest request, - HttpServletResponse response) { - String sessionMapID = request.getParameter(ForumConstants.ATTR_SESSION_MAP_ID); + saveUserTimestamp(message.getUid(), forumUser); - MessageForm msgForm = (MessageForm) form; - msgForm.setSessionMapID(sessionMapID); + for (Iterator iterator = rootTopics.iterator(); iterator.hasNext();) { + MessageDTO messageDTO = (MessageDTO) iterator.next(); + int numOfNewPosts = forumService.getNewMessagesNum(messageDTO.getMessage().getUid(), forumUser.getUid()); + if (numOfNewPosts == -1) { + messageDTO.setNewPostingsNum(messageDTO.getMessage().getReplyNumber() + 1); + } else { + messageDTO.setNewPostingsNum(numOfNewPosts); + } - Long parentId = WebUtil.readLongParam(request, ForumConstants.ATTR_PARENT_TOPIC_ID); - // get parent topic, it can decide default subject of reply. - MessageDTO topic = getTopic(parentId); + messageDTO.setLastTopicDate(forumService.getLastTopicDate(messageDTO.getMessage().getUid())); + } - if (topic != null && topic.getMessage() != null) { - String reTitle = topic.getMessage().getSubject(); + return mapping.findForward("success"); + } - MessageDTO originalMessage = MessageDTO.getMessageDTO(topic.getMessage()); + /** + * Display replay topic page. Message form subject will include parent topics same subject. + * + * @param mapping + * @param form + * @param request + * @param response + * @return + */ + private ActionForward newReplyTopic(ActionMapping mapping, ActionForm form, HttpServletRequest request, + HttpServletResponse response) { + String sessionMapID = request.getParameter(ForumConstants.ATTR_SESSION_MAP_ID); - request.setAttribute(ForumConstants.ATTR_ORIGINAL_MESSAGE, originalMessage); + MessageForm msgForm = (MessageForm) form; + msgForm.setSessionMapID(sessionMapID); - // echo back current topic subject to web page - if (reTitle != null && !reTitle.trim().startsWith("Re:")) { - msgForm.getMessage().setSubject("Re:" + reTitle); - } - else { - msgForm.getMessage().setSubject(reTitle); - } - } - SessionMap sessionMap = getSessionMap(request, msgForm); - sessionMap.put(ForumConstants.ATTR_PARENT_TOPIC_ID, parentId); + Long parentId = WebUtil.readLongParam(request, ForumConstants.ATTR_PARENT_TOPIC_ID); + // get parent topic, it can decide default subject of reply. + MessageDTO topic = getTopic(parentId); - // Should we show the reflection or not? We shouldn't show it when the View Forum screen is accessed - // from the Monitoring Summary screen, but we should when accessed from the Learner Progress screen. - // Need to constantly past this value on, rather than hiding just the once, as the View Forum - // screen has a refresh button. Need to pass it through the view topic screen and dependent screens - // as it has a link from the view topic screen back to View Forum screen. - boolean hideReflection = WebUtil.readBooleanParam(request, ForumConstants.ATTR_HIDE_REFLECTION, false); - sessionMap.put(ForumConstants.ATTR_HIDE_REFLECTION, hideReflection); + if (topic != null && topic.getMessage() != null) { + String reTitle = topic.getMessage().getSubject(); - return mapping.findForward("success"); - } + MessageDTO originalMessage = MessageDTO.getMessageDTO(topic.getMessage()); - /** - * Create a replayed topic for a parent topic. - * - * @param mapping - * @param form - * @param request - * @param response - * @return - */ - private ActionForward replyTopic(ActionMapping mapping, ActionForm form, HttpServletRequest request, - HttpServletResponse response) { + request.setAttribute(ForumConstants.ATTR_ORIGINAL_MESSAGE, originalMessage); - MessageForm messageForm = (MessageForm) form; - SessionMap sessionMap = getSessionMap(request, messageForm); - Long parentId = (Long) sessionMap.get(ForumConstants.ATTR_PARENT_TOPIC_ID); - Long sessionId = (Long) sessionMap.get(AttributeNames.PARAM_TOOL_SESSION_ID); + // echo back current topic subject to web page + if (reTitle != null && !reTitle.trim().startsWith("Re:")) { + msgForm.getMessage().setSubject("Re:" + reTitle); + } else { + msgForm.getMessage().setSubject(reTitle); + } + } + SessionMap sessionMap = getSessionMap(request, msgForm); + sessionMap.put(ForumConstants.ATTR_PARENT_TOPIC_ID, parentId); - Message message = messageForm.getMessage(); - message.setIsAuthored(false); - message.setCreated(new Date()); - message.setUpdated(new Date()); - message.setLastReplyDate(new Date()); - ForumUser forumUser = getCurrentUser(request, sessionId); - message.setCreatedBy(forumUser); - message.setModifiedBy(forumUser); - setAttachment(messageForm, message); + // Should we show the reflection or not? We shouldn't show it when the View Forum screen is accessed + // from the Monitoring Summary screen, but we should when accessed from the Learner Progress screen. + // Need to constantly past this value on, rather than hiding just the once, as the View Forum + // screen has a refresh button. Need to pass it through the view topic screen and dependent screens + // as it has a link from the view topic screen back to View Forum screen. + boolean hideReflection = WebUtil.readBooleanParam(request, ForumConstants.ATTR_HIDE_REFLECTION, false); + sessionMap.put(ForumConstants.ATTR_HIDE_REFLECTION, hideReflection); - // save message into database - forumService = getForumManager(); - forumService.replyTopic(parentId, sessionId, message); + return mapping.findForward("success"); + } - // echo back this topic thread into page - Long rootTopicId = forumService.getRootTopicId(parentId); - List msgDtoList = forumService.getTopicThread(rootTopicId); - updateMesssageFlag(msgDtoList); + /** + * Create a replayed topic for a parent topic. + * + * @param mapping + * @param form + * @param request + * @param response + * @return + * @throws InterruptedException + */ + private synchronized ActionForward replyTopic(ActionMapping mapping, ActionForm form, HttpServletRequest request, + HttpServletResponse response) throws InterruptedException { - request.setAttribute(ForumConstants.AUTHORING_TOPIC_THREAD, msgDtoList); - request.setAttribute(ForumConstants.ATTR_SESSION_MAP_ID, messageForm.getSessionMapID()); + MessageForm messageForm = (MessageForm) form; + SessionMap sessionMap = getSessionMap(request, messageForm); + Long parentId = (Long) sessionMap.get(ForumConstants.ATTR_PARENT_TOPIC_ID); + Long sessionId = (Long) sessionMap.get(AttributeNames.PARAM_TOOL_SESSION_ID); - //check whether allow more posts for this user - ForumToolSession session = forumService.getSessionBySessionId(sessionId); - Forum forum = session.getForum(); - int numOfPosts = forumService.getNumOfPostsByTopic(forumUser.getUserId(), ((MessageDTO) msgDtoList.get(0)).getMessage() - .getUid()); - boolean noMorePosts = forum.getMaximumReply() != 0 && numOfPosts >= forum.getMaximumReply() && !forum.isAllowNewTopic() ? Boolean.TRUE - : Boolean.FALSE; - request.setAttribute(ForumConstants.ATTR_NO_MORE_POSTS, noMorePosts); - request.setAttribute(ForumConstants.ATTR_NUM_OF_POSTS, numOfPosts); + Message message = messageForm.getMessage(); + message.setIsAuthored(false); + message.setCreated(new Date()); + message.setUpdated(new Date()); + message.setLastReplyDate(new Date()); + ForumUser forumUser = getCurrentUser(request, sessionId); + message.setCreatedBy(forumUser); + message.setModifiedBy(forumUser); + setAttachment(messageForm, message); - sessionMap.remove(ForumConstants.ATTR_ORIGINAL_MESSAGE); - - // Saving or updating user timestamp - saveUserTimestamp(rootTopicId, forumUser); + // save message into database + forumService = getForumManager(); - return mapping.findForward("success"); - } + forumService.replyTopic(parentId, sessionId, message); - /** - * Display a editable form for a special topic in order to update it. - * - * @param mapping - * @param form - * @param request - * @param response - * @return - * @throws PersistenceException - */ - public ActionForward editTopic(ActionMapping mapping, ActionForm form, HttpServletRequest request, - HttpServletResponse response) throws PersistenceException { - Long topicId = WebUtil.readLongParam(request, ForumConstants.ATTR_TOPIC_ID); + // echo back this topic thread into page + Long rootTopicId = forumService.getRootTopicId(parentId); + List msgDtoList = forumService.getTopicThread(rootTopicId); + updateMesssageFlag(msgDtoList); - MessageDTO topic = getTopic(topicId); + request.setAttribute(ForumConstants.AUTHORING_TOPIC_THREAD, msgDtoList); + request.setAttribute(ForumConstants.ATTR_SESSION_MAP_ID, messageForm.getSessionMapID()); - // echo current topic content to web page - MessageForm msgForm = (MessageForm) form; - if (topic != null) { - msgForm.setMessage(topic.getMessage()); - request.setAttribute(ForumConstants.AUTHORING_TOPIC, topic); - } + // check whether allow more posts for this user + ForumToolSession session = forumService.getSessionBySessionId(sessionId); + Forum forum = session.getForum(); + int numOfPosts = forumService.getNumOfPostsByTopic(forumUser.getUserId(), ((MessageDTO) msgDtoList.get(0)) + .getMessage().getUid()); + boolean noMorePosts = forum.getMaximumReply() != 0 && numOfPosts >= forum.getMaximumReply() + && !forum.isAllowNewTopic() ? Boolean.TRUE : Boolean.FALSE; + request.setAttribute(ForumConstants.ATTR_NO_MORE_POSTS, noMorePosts); + request.setAttribute(ForumConstants.ATTR_NUM_OF_POSTS, numOfPosts); - //cache this topicID, using in Update topic - SessionMap sessionMap = getSessionMap(request, msgForm); - sessionMap.put(ForumConstants.ATTR_TOPIC_ID, topicId); + sessionMap.remove(ForumConstants.ATTR_ORIGINAL_MESSAGE); - // Should we show the reflection or not? We shouldn't show it when the View Forum screen is accessed - // from the Monitoring Summary screen, but we should when accessed from the Learner Progress screen. - // Need to constantly past this value on, rather than hiding just the once, as the View Forum - // screen has a refresh button. Need to pass it through the view topic screen and dependent screens - // as it has a link from the view topic screen back to View Forum screen. - boolean hideReflection = WebUtil.readBooleanParam(request, ForumConstants.ATTR_HIDE_REFLECTION, false); - sessionMap.put(ForumConstants.ATTR_HIDE_REFLECTION, hideReflection); + // Saving or updating user timestamp + saveUserTimestamp(rootTopicId, forumUser); - return mapping.findForward("success"); - } + return mapping.findForward("success"); + } - /** - * Delete attachment from topic. This method only reset attachment information in memory. The finally update - * will happen in updateTopic method. So topic can keep this attachment if user choose "Cancel" edit - * topic. - * - * @param mapping - * @param form - * @param request - * @param response - * @return - */ - private ActionForward deleteAttachment(ActionMapping mapping, ActionForm form, HttpServletRequest request, - HttpServletResponse response) { + /** + * Display a editable form for a special topic in order to update it. + * + * @param mapping + * @param form + * @param request + * @param response + * @return + * @throws PersistenceException + */ + public ActionForward editTopic(ActionMapping mapping, ActionForm form, HttpServletRequest request, + HttpServletResponse response) throws PersistenceException { + Long topicId = WebUtil.readLongParam(request, ForumConstants.ATTR_TOPIC_ID); - //only reset not attachment flag. - MessageDTO dto = new MessageDTO(); - dto.setHasAttachment(false); - request.setAttribute(ForumConstants.AUTHORING_TOPIC, dto); - SessionMap sessionMap = (SessionMap) request.getSession().getAttribute( - WebUtil.readStrParam(request, ForumConstants.ATTR_SESSION_MAP_ID)); - request.setAttribute(ForumConstants.ATTR_ALLOW_UPLOAD, sessionMap.get(ForumConstants.ATTR_ALLOW_UPLOAD)); + MessageDTO topic = getTopic(topicId); - return mapping.findForward("success"); + // echo current topic content to web page + MessageForm msgForm = (MessageForm) form; + if (topic != null) { + msgForm.setMessage(topic.getMessage()); + request.setAttribute(ForumConstants.AUTHORING_TOPIC, topic); } - /** - * Update a topic. - * - * @param mapping - * @param form - * @param request - * @param response - * @return - * @throws PersistenceException - */ - public ActionForward updateTopic(ActionMapping mapping, ActionForm form, HttpServletRequest request, - HttpServletResponse response) throws PersistenceException { + // cache this topicID, using in Update topic + SessionMap sessionMap = getSessionMap(request, msgForm); + sessionMap.put(ForumConstants.ATTR_TOPIC_ID, topicId); - forumService = getForumManager(); + // Should we show the reflection or not? We shouldn't show it when the View Forum screen is accessed + // from the Monitoring Summary screen, but we should when accessed from the Learner Progress screen. + // Need to constantly past this value on, rather than hiding just the once, as the View Forum + // screen has a refresh button. Need to pass it through the view topic screen and dependent screens + // as it has a link from the view topic screen back to View Forum screen. + boolean hideReflection = WebUtil.readBooleanParam(request, ForumConstants.ATTR_HIDE_REFLECTION, false); + sessionMap.put(ForumConstants.ATTR_HIDE_REFLECTION, hideReflection); - MessageForm messageForm = (MessageForm) form; - SessionMap sessionMap = getSessionMap(request, messageForm); - Long topicId = (Long) sessionMap.get(ForumConstants.ATTR_TOPIC_ID); - Message message = messageForm.getMessage(); + return mapping.findForward("success"); + } - boolean makeAuditEntry = ToolAccessMode.TEACHER.equals(sessionMap.get(AttributeNames.ATTR_MODE)); - String oldMessageString = null; + /** + * Delete attachment from topic. This method only reset attachment information in memory. The finally update will + * happen in updateTopic method. So topic can keep this attachment if user choose "Cancel" edit + * topic. + * + * @param mapping + * @param form + * @param request + * @param response + * @return + */ + private ActionForward deleteAttachment(ActionMapping mapping, ActionForm form, HttpServletRequest request, + HttpServletResponse response) { - // get PO from database and sync with Form - Message messagePO = forumService.getMessage(topicId); - if (makeAuditEntry) { - oldMessageString = messagePO.toString(); - } - messagePO.setSubject(message.getSubject()); - messagePO.setBody(message.getBody()); - messagePO.setUpdated(new Date()); - messagePO.setModifiedBy(getCurrentUser(request, (Long) sessionMap.get(AttributeNames.PARAM_TOOL_SESSION_ID))); - setAttachment(messageForm, messagePO); + // only reset not attachment flag. + MessageDTO dto = new MessageDTO(); + dto.setHasAttachment(false); + request.setAttribute(ForumConstants.AUTHORING_TOPIC, dto); + SessionMap sessionMap = (SessionMap) request.getSession().getAttribute( + WebUtil.readStrParam(request, ForumConstants.ATTR_SESSION_MAP_ID)); + request.setAttribute(ForumConstants.ATTR_ALLOW_UPLOAD, sessionMap.get(ForumConstants.ATTR_ALLOW_UPLOAD)); - if (makeAuditEntry) { - Long userId = 0L; - String loginName = "Default"; - if (message.getCreatedBy() != null) { - userId = message.getCreatedBy().getUserId(); - loginName = message.getCreatedBy().getLoginName(); - } - forumService.getAuditService().logChange(ForumConstants.TOOL_SIGNATURE, userId, loginName, oldMessageString, - messagePO.toString()); - } + return mapping.findForward("success"); + } - // save message into database - // if we are in monitoring then we are probably editing some else's entry so log the change. - forumService.updateTopic(messagePO); + /** + * Update a topic. + * + * @param mapping + * @param form + * @param request + * @param response + * @return + * @throws PersistenceException + */ + public ActionForward updateTopic(ActionMapping mapping, ActionForm form, HttpServletRequest request, + HttpServletResponse response) throws PersistenceException { - // echo back this topic thread into page - Long rootTopicId = forumService.getRootTopicId(topicId); - List msgDtoList = forumService.getTopicThread(rootTopicId); - updateMesssageFlag(msgDtoList); + forumService = getForumManager(); - // check if we can still make posts in this topic - ForumUser forumUser = getCurrentUser(request, (Long) sessionMap.get(AttributeNames.PARAM_TOOL_SESSION_ID)); - Forum forum = forumUser.getSession().getForum(); - int numOfPosts = forumService.getNumOfPostsByTopic(forumUser.getUserId(), ((MessageDTO) msgDtoList.get(0)).getMessage() - .getUid()); - boolean noMorePosts = forum.getMaximumReply() != 0 && numOfPosts >= forum.getMaximumReply() && !forum.isAllowNewTopic() ? Boolean.TRUE - : Boolean.FALSE; - request.setAttribute(ForumConstants.ATTR_NO_MORE_POSTS, noMorePosts); - request.setAttribute(ForumConstants.ATTR_NUM_OF_POSTS, numOfPosts); + MessageForm messageForm = (MessageForm) form; + SessionMap sessionMap = getSessionMap(request, messageForm); + Long topicId = (Long) sessionMap.get(ForumConstants.ATTR_TOPIC_ID); + Message message = messageForm.getMessage(); - request.setAttribute(ForumConstants.AUTHORING_TOPIC_THREAD, msgDtoList); - request.setAttribute(ForumConstants.ATTR_SESSION_MAP_ID, messageForm.getSessionMapID()); - - // Saving or updating user timestamp - saveUserTimestamp(rootTopicId, forumUser); - - return mapping.findForward("success"); + boolean makeAuditEntry = ToolAccessMode.TEACHER.equals(sessionMap.get(AttributeNames.ATTR_MODE)); + String oldMessageString = null; + + // get PO from database and sync with Form + Message messagePO = forumService.getMessage(topicId); + if (makeAuditEntry) { + oldMessageString = messagePO.toString(); } + messagePO.setSubject(message.getSubject()); + messagePO.setBody(message.getBody()); + messagePO.setUpdated(new Date()); + messagePO.setModifiedBy(getCurrentUser(request, (Long) sessionMap.get(AttributeNames.PARAM_TOOL_SESSION_ID))); + setAttachment(messageForm, messagePO); - /** - * Sets the visibility of a message by updating the hide flag for a message - * - * @param mapping - * @param form - * @param request - * @param response - * @return - */ - public ActionForward updateMessageHideFlag(ActionMapping mapping, ActionForm form, HttpServletRequest request, - HttpServletResponse response) { + if (makeAuditEntry) { + Long userId = 0L; + String loginName = "Default"; + if (message.getCreatedBy() != null) { + userId = message.getCreatedBy().getUserId(); + loginName = message.getCreatedBy().getLoginName(); + } + forumService.getAuditService().logChange(ForumConstants.TOOL_SIGNATURE, userId, loginName, + oldMessageString, messagePO.toString()); + } - Long msgId = new Long(WebUtil.readLongParam(request, ForumConstants.ATTR_TOPIC_ID)); - Boolean hideFlag = new Boolean(WebUtil.readBooleanParam(request, "hideFlag")); - forumService = getForumManager(); + // save message into database + // if we are in monitoring then we are probably editing some else's entry so log the change. + forumService.updateTopic(messagePO); - // TODO Skipping permissions for now, currently having issues with default learning designs not having an create_by field - // Long sessionId = WebUtil.readLongParam(request, AttributeNames.PARAM_TOOL_SESSION_ID); - // check if the user has permission to hide posts. - // ForumToolSession toolSession = forumService - // .getSessionBySessionId(sessionId); - // - // Forum forum = toolSession.getForum(); - // ForumUser currentUser = getCurrentUser(request,sessionId); - // ForumUser forumCreatedBy = forum.getCreatedBy(); + // echo back this topic thread into page + Long rootTopicId = forumService.getRootTopicId(topicId); + List msgDtoList = forumService.getTopicThread(rootTopicId); + updateMesssageFlag(msgDtoList); - // we should be looking at whether a user is a teacher and more specifically staff - // if (currentUser.getUserId().equals(forumCreatedBy.getUserId())) { - forumService.updateMessageHideFlag(msgId, hideFlag.booleanValue()); - // } else { - // log.info(currentUser + "does not have permission to hide/show postings in forum: " + forum.getUid()); - // log.info("Forum created by :" + forumCreatedBy.getUid() + ", Current User is: " + currentUser.getUid()); - // } + // check if we can still make posts in this topic + ForumUser forumUser = getCurrentUser(request, (Long) sessionMap.get(AttributeNames.PARAM_TOOL_SESSION_ID)); + Forum forum = forumUser.getSession().getForum(); + int numOfPosts = forumService.getNumOfPostsByTopic(forumUser.getUserId(), ((MessageDTO) msgDtoList.get(0)) + .getMessage().getUid()); + boolean noMorePosts = forum.getMaximumReply() != 0 && numOfPosts >= forum.getMaximumReply() + && !forum.isAllowNewTopic() ? Boolean.TRUE : Boolean.FALSE; + request.setAttribute(ForumConstants.ATTR_NO_MORE_POSTS, noMorePosts); + request.setAttribute(ForumConstants.ATTR_NUM_OF_POSTS, numOfPosts); - // echo back this topic thread into page - Long rootTopicId = forumService.getRootTopicId(msgId); - List msgDtoList = forumService.getTopicThread(rootTopicId); - updateMesssageFlag(msgDtoList); - request.setAttribute(ForumConstants.AUTHORING_TOPIC_THREAD, msgDtoList); - request.setAttribute(ForumConstants.ATTR_SESSION_MAP_ID, WebUtil - .readStrParam(request, ForumConstants.ATTR_SESSION_MAP_ID)); - - return mapping.findForward("success"); - } + request.setAttribute(ForumConstants.AUTHORING_TOPIC_THREAD, msgDtoList); + request.setAttribute(ForumConstants.ATTR_SESSION_MAP_ID, messageForm.getSessionMapID()); - // ========================================================================================== - // Utility methods - // ========================================================================================== - /** - * Validation method to check whether user posts meet minimum number. - */ - private boolean validateBeforeFinish(HttpServletRequest request, String sessionMapID) { - SessionMap sessionMap = (SessionMap) request.getSession().getAttribute(sessionMapID); - Long sessionId = (Long) sessionMap.get(AttributeNames.PARAM_TOOL_SESSION_ID); + // Saving or updating user timestamp + saveUserTimestamp(rootTopicId, forumUser); - ForumToolSession session = forumService.getSessionBySessionId(sessionId); - Forum forum = session.getForum(); - // get session from shared session. - HttpSession ss = SessionManager.getSession(); - UserDTO user = (UserDTO) ss.getAttribute(AttributeNames.USER); - Long userID = new Long(user.getUserID().longValue()); - if (!forum.getRunOffline() && !forum.isAllowNewTopic()) { + return mapping.findForward("success"); + } - List list = forumService.getRootTopics(sessionId); - for (MessageDTO msgDto : list) { - Long topicId = msgDto.getMessage().getUid(); - int numOfPostsInTopic = forumService.getNumOfPostsByTopic(userID, topicId); - if (numOfPostsInTopic < forum.getMinimumReply()) { - //create error - ActionMessages errors = new ActionMessages(); - errors.add(ActionMessages.GLOBAL_MESSAGE, new ActionMessage("error.less.mini.post", forum.getMinimumReply())); - saveErrors(request, errors); + /** + * Sets the visibility of a message by updating the hide flag for a message + * + * @param mapping + * @param form + * @param request + * @param response + * @return + */ + public ActionForward updateMessageHideFlag(ActionMapping mapping, ActionForm form, HttpServletRequest request, + HttpServletResponse response) { - // get all root topic to display on init page - List rootTopics = forumService.getRootTopics(sessionId); - request.setAttribute(ForumConstants.AUTHORING_TOPICS_LIST, rootTopics); - request.setAttribute(ForumConstants.ATTR_SESSION_MAP_ID, sessionMapID); - return false; - } + Long msgId = new Long(WebUtil.readLongParam(request, ForumConstants.ATTR_TOPIC_ID)); + Boolean hideFlag = new Boolean(WebUtil.readBooleanParam(request, "hideFlag")); + forumService = getForumManager(); - } - } - return true; - } + // TODO Skipping permissions for now, currently having issues with default learning designs not having an + // create_by field + // Long sessionId = WebUtil.readLongParam(request, AttributeNames.PARAM_TOOL_SESSION_ID); + // check if the user has permission to hide posts. + // ForumToolSession toolSession = forumService + // .getSessionBySessionId(sessionId); + // + // Forum forum = toolSession.getForum(); + // ForumUser currentUser = getCurrentUser(request,sessionId); + // ForumUser forumCreatedBy = forum.getCreatedBy(); - /** - * This method will set flag in message DTO: - *
  • If this topic is created by current login user, then set Author mark - * true.
  • - * - * @param msgDtoList - */ - private void updateMesssageFlag(List msgDtoList) { - // set current user to web page, so that can display "edit" button - // correct. Only author alow to edit. - HttpSession ss = SessionManager.getSession(); - // get back login user DTO - UserDTO user = (UserDTO) ss.getAttribute(AttributeNames.USER); + // we should be looking at whether a user is a teacher and more specifically staff + // if (currentUser.getUserId().equals(forumCreatedBy.getUserId())) { + forumService.updateMessageHideFlag(msgId, hideFlag.booleanValue()); + // } else { + // log.info(currentUser + "does not have permission to hide/show postings in forum: " + forum.getUid()); + // log.info("Forum created by :" + forumCreatedBy.getUid() + ", Current User is: " + currentUser.getUid()); + // } - Long currUserId = new Long(user.getUserID().intValue()); - Iterator iter = msgDtoList.iterator(); - while (iter.hasNext()) { - MessageDTO dto = (MessageDTO) iter.next(); - if (dto.getMessage().getCreatedBy() != null && currUserId.equals(dto.getMessage().getCreatedBy().getUserId())) { - dto.setAuthor(true); - } - else { - dto.setAuthor(false); - } + // echo back this topic thread into page + Long rootTopicId = forumService.getRootTopicId(msgId); + List msgDtoList = forumService.getTopicThread(rootTopicId); + updateMesssageFlag(msgDtoList); + request.setAttribute(ForumConstants.AUTHORING_TOPIC_THREAD, msgDtoList); + request.setAttribute(ForumConstants.ATTR_SESSION_MAP_ID, WebUtil.readStrParam(request, + ForumConstants.ATTR_SESSION_MAP_ID)); + + return mapping.findForward("success"); + } + + // ========================================================================================== + // Utility methods + // ========================================================================================== + /** + * Validation method to check whether user posts meet minimum number. + */ + private boolean validateBeforeFinish(HttpServletRequest request, String sessionMapID) { + SessionMap sessionMap = (SessionMap) request.getSession().getAttribute(sessionMapID); + Long sessionId = (Long) sessionMap.get(AttributeNames.PARAM_TOOL_SESSION_ID); + + ForumToolSession session = forumService.getSessionBySessionId(sessionId); + Forum forum = session.getForum(); + // get session from shared session. + HttpSession ss = SessionManager.getSession(); + UserDTO user = (UserDTO) ss.getAttribute(AttributeNames.USER); + Long userID = new Long(user.getUserID().longValue()); + if (!forum.getRunOffline() && !forum.isAllowNewTopic()) { + + List list = forumService.getRootTopics(sessionId); + for (MessageDTO msgDto : list) { + Long topicId = msgDto.getMessage().getUid(); + int numOfPostsInTopic = forumService.getNumOfPostsByTopic(userID, topicId); + if (numOfPostsInTopic < forum.getMinimumReply()) { + // create error + ActionMessages errors = new ActionMessages(); + errors.add(ActionMessages.GLOBAL_MESSAGE, new ActionMessage("error.less.mini.post", forum + .getMinimumReply())); + saveErrors(request, errors); + + // get all root topic to display on init page + List rootTopics = forumService.getRootTopics(sessionId); + request.setAttribute(ForumConstants.AUTHORING_TOPICS_LIST, rootTopics); + request.setAttribute(ForumConstants.ATTR_SESSION_MAP_ID, sessionMapID); + return false; } - } - /** - * @param topicId - * @return - */ - private MessageDTO getTopic(Long topicId) { - // get Topic content according to TopicID - forumService = getForumManager(); - MessageDTO topic = MessageDTO.getMessageDTO(forumService.getMessage(topicId)); - return topic; + } } + return true; + } - /** - * Get login user information from system level session. Check it whether it - * exists in database or not, and save it if it does not exists. Return an - * instance of PO of ForumUser. - * - * @param request - * @param sessionId - * @return Current user instance - */ - private ForumUser getCurrentUser(HttpServletRequest request, Long sessionId) { - // get login user (author) - HttpSession ss = SessionManager.getSession(); - // get back login user DTO - UserDTO user = (UserDTO) ss.getAttribute(AttributeNames.USER); - ForumUser forumUser = forumService.getUserByUserAndSession(new Long(user.getUserID().intValue()), sessionId); - if (forumUser == null) { - // if user not exist, create new one in database - ForumToolSession session = forumService.getSessionBySessionId(sessionId); - forumUser = new ForumUser(user, session); - forumService.createUser(forumUser); - } - return forumUser; + /** + * This method will set flag in message DTO: + *
  • If this topic is created by current login user, then set Author mark true.
  • + * + * @param msgDtoList + */ + private void updateMesssageFlag(List msgDtoList) { + // set current user to web page, so that can display "edit" button + // correct. Only author alow to edit. + HttpSession ss = SessionManager.getSession(); + // get back login user DTO + UserDTO user = (UserDTO) ss.getAttribute(AttributeNames.USER); + + Long currUserId = new Long(user.getUserID().intValue()); + Iterator iter = msgDtoList.iterator(); + while (iter.hasNext()) { + MessageDTO dto = (MessageDTO) iter.next(); + if (dto.getMessage().getCreatedBy() != null + && currUserId.equals(dto.getMessage().getCreatedBy().getUserId())) { + dto.setAuthor(true); + } else { + dto.setAuthor(false); + } } + } - /** - * Get Forum Service. - * - * @return - */ - private IForumService getForumManager() { - if (forumService == null) { - WebApplicationContext wac = WebApplicationContextUtils.getRequiredWebApplicationContext(getServlet() - .getServletContext()); - forumService = (IForumService) wac.getBean(ForumConstants.FORUM_SERVICE); - } - return forumService; + /** + * @param topicId + * @return + */ + private MessageDTO getTopic(Long topicId) { + // get Topic content according to TopicID + forumService = getForumManager(); + MessageDTO topic = MessageDTO.getMessageDTO(forumService.getMessage(topicId)); + return topic; + } + + /** + * Get login user information from system level session. Check it whether it exists in database or not, and save it + * if it does not exists. Return an instance of PO of ForumUser. + * + * @param request + * @param sessionId + * @return Current user instance + */ + private ForumUser getCurrentUser(HttpServletRequest request, Long sessionId) { + // get login user (author) + HttpSession ss = SessionManager.getSession(); + // get back login user DTO + UserDTO user = (UserDTO) ss.getAttribute(AttributeNames.USER); + ForumUser forumUser = forumService.getUserByUserAndSession(new Long(user.getUserID().intValue()), sessionId); + if (forumUser == null) { + // if user not exist, create new one in database + ForumToolSession session = forumService.getSessionBySessionId(sessionId); + forumUser = new ForumUser(user, session); + forumService.createUser(forumUser); } + return forumUser; + } - /** - * @param messageForm - * @param message - */ - private void setAttachment(MessageForm messageForm, Message message) { - if (messageForm.getAttachmentFile() != null && !StringUtils.isBlank(messageForm.getAttachmentFile().getFileName())) { - forumService = getForumManager(); - Attachment att = forumService.uploadAttachment(messageForm.getAttachmentFile()); - Set attSet = message.getAttachments(); - if (attSet == null) { - attSet = new HashSet(); - } - // only allow one attachment, so replace whatever - attSet.clear(); - attSet.add(att); - message.setAttachments(attSet); - } - else if (!messageForm.isHasAttachment()) { - //user already called deleteAttachment in AJAX call - if (message.getAttachments() != null) { - Set atts = message.getAttachments(); - atts.clear(); - message.setAttachments(atts); - } - else { - message.setAttachments(null); - } - } + /** + * Get Forum Service. + * + * @return + */ + private IForumService getForumManager() { + if (forumService == null) { + WebApplicationContext wac = WebApplicationContextUtils.getRequiredWebApplicationContext(getServlet() + .getServletContext()); + forumService = (IForumService) wac.getBean(ForumConstants.FORUM_SERVICE); } + return forumService; + } - private SessionMap getSessionMap(HttpServletRequest request, MessageForm messageForm) { - SessionMap sessionMap = (SessionMap) request.getSession().getAttribute(messageForm.getSessionMapID()); - return sessionMap; + /** + * @param messageForm + * @param message + */ + private void setAttachment(MessageForm messageForm, Message message) { + if (messageForm.getAttachmentFile() != null + && !StringUtils.isBlank(messageForm.getAttachmentFile().getFileName())) { + forumService = getForumManager(); + Attachment att = forumService.uploadAttachment(messageForm.getAttachmentFile()); + Set attSet = message.getAttachments(); + if (attSet == null) { + attSet = new HashSet(); + } + // only allow one attachment, so replace whatever + attSet.clear(); + attSet.add(att); + message.setAttachments(attSet); + } else if (!messageForm.isHasAttachment()) { + // user already called deleteAttachment in AJAX call + if (message.getAttachments() != null) { + Set atts = message.getAttachments(); + atts.clear(); + message.setAttachments(atts); + } else { + message.setAttachments(null); + } } + } + private SessionMap getSessionMap(HttpServletRequest request, MessageForm messageForm) { + SessionMap sessionMap = (SessionMap) request.getSession().getAttribute(messageForm.getSessionMapID()); + return sessionMap; + } + } Index: lams_tool_forum/src/java/org/lamsfoundation/lams/tool/forum/web/actions/MonitoringAction.java =================================================================== diff -u -rbcc173ec7635b144dd12f22e8472bd81a2b5f12e -racc8d2acf5b6b0002e0c8129947040a779ab4077 --- lams_tool_forum/src/java/org/lamsfoundation/lams/tool/forum/web/actions/MonitoringAction.java (.../MonitoringAction.java) (revision bcc173ec7635b144dd12f22e8472bd81a2b5f12e) +++ lams_tool_forum/src/java/org/lamsfoundation/lams/tool/forum/web/actions/MonitoringAction.java (.../MonitoringAction.java) (revision acc8d2acf5b6b0002e0c8129947040a779ab4077) @@ -81,812 +81,794 @@ public class MonitoringAction extends Action { - private static Logger log = Logger.getLogger(MonitoringAction.class); + private static Logger log = Logger.getLogger(MonitoringAction.class); - private IForumService forumService; + private IForumService forumService; - private class SessionDTOComparator implements Comparator { - public int compare(SessionDTO o1, SessionDTO o2) { - if (o1 != null && o2 != null) { - return o1.getSessionName().compareTo(o2.getSessionName()); - } - else if (o1 != null) { - return 1; - } - else { - return -1; - } - } + private class SessionDTOComparator implements Comparator { + public int compare(SessionDTO o1, SessionDTO o2) { + if (o1 != null && o2 != null) { + return o1.getSessionName().compareTo(o2.getSessionName()); + } else if (o1 != null) { + return 1; + } else { + return -1; + } } + } - private class ForumUserComparator implements Comparator { - public int compare(ForumUser o1, ForumUser o2) { - if (o1 != null && o2 != null) { - return o1.getLoginName().compareTo(o2.getLoginName()); - } - else if (o1 != null) { - return 1; - } - else { - return -1; - } - } + private class ForumUserComparator implements Comparator { + public int compare(ForumUser o1, ForumUser o2) { + if (o1 != null && o2 != null) { + return o1.getLoginName().compareTo(o2.getLoginName()); + } else if (o1 != null) { + return 1; + } else { + return -1; + } } + } - private class UserDTOComparator implements Comparator { - public int compare(UserDTO o1, UserDTO o2) { - if (o1 != null && o2 != null) { - return o1.getLoginName().compareTo(o2.getLoginName()); - } - else if (o1 != null) { - return 1; - } - else { - return -1; - } - } + private class UserDTOComparator implements Comparator { + public int compare(UserDTO o1, UserDTO o2) { + if (o1 != null && o2 != null) { + return o1.getLoginName().compareTo(o2.getLoginName()); + } else if (o1 != null) { + return 1; + } else { + return -1; + } } + } - /** - * Action method entry. - */ - @Override - public final ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, - HttpServletResponse response) throws Exception { - String param = mapping.getParameter(); + /** + * Action method entry. + */ + @Override + public final ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, + HttpServletResponse response) throws Exception { + String param = mapping.getParameter(); - if (param.equals("init")) { - return init(mapping, form, request, response); - } - //refresh statistic page by Ajax call. - if (param.equals("statistic")) { - return statistic(mapping, form, request, response); - } - // ***************** Marks Functions ******************** - if (param.equals("viewAllMarks")) { - return viewAllMarks(mapping, form, request, response); - } - if (param.equals("downloadMarks")) { - return downloadMarks(mapping, form, request, response); - } - if (param.equals("viewUserMark")) { - return viewUserMark(mapping, form, request, response); - } - if (param.equals("editMark")) { - return editMark(mapping, form, request, response); - } - if (param.equals("updateMark")) { - return updateMark(mapping, form, request, response); - } + if (param.equals("init")) { + return init(mapping, form, request, response); + } + //refresh statistic page by Ajax call. + if (param.equals("statistic")) { + return statistic(mapping, form, request, response); + } + // ***************** Marks Functions ******************** + if (param.equals("viewAllMarks")) { + return viewAllMarks(mapping, form, request, response); + } + if (param.equals("downloadMarks")) { + return downloadMarks(mapping, form, request, response); + } + if (param.equals("viewUserMark")) { + return viewUserMark(mapping, form, request, response); + } + if (param.equals("editMark")) { + return editMark(mapping, form, request, response); + } + if (param.equals("updateMark")) { + return updateMark(mapping, form, request, response); + } - if (param.equals("releaseMark")) { - return releaseMark(mapping, form, request, response); - } + if (param.equals("releaseMark")) { + return releaseMark(mapping, form, request, response); + } - // ***************** Miscellaneous ******************** - if (param.equals("viewTopic")) { - return viewTopic(mapping, form, request, response); - } - if (param.equals("viewTopicTree")) { - return viewTopicTree(mapping, form, request, response); - } + // ***************** Miscellaneous ******************** + if (param.equals("viewTopic")) { + return viewTopic(mapping, form, request, response); + } + if (param.equals("viewTopicTree")) { + return viewTopicTree(mapping, form, request, response); + } - if (param.equals("viewReflection")) { - return viewReflection(mapping, form, request, response); - } - - return mapping.findForward("error"); + if (param.equals("viewReflection")) { + return viewReflection(mapping, form, request, response); } - /** - * The initial method for monitoring - */ - private ActionForward init(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) { + return mapping.findForward("error"); + } - // perform the actions for all the tabs. - doTabs(mapping, form, request, response); + /** + * The initial method for monitoring + */ + private ActionForward init(ActionMapping mapping, ActionForm form, HttpServletRequest request, + HttpServletResponse response) { - return mapping.findForward("load"); - } + // perform the actions for all the tabs. + doTabs(mapping, form, request, response); - private ActionForward doTabs(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) { - //set back tool content ID - String contentFolderID = WebUtil.readStrParam(request, AttributeNames.PARAM_CONTENT_FOLDER_ID); - request.setAttribute(AttributeNames.PARAM_CONTENT_FOLDER_ID, contentFolderID); + return mapping.findForward("load"); + } - Long toolContentID = new Long(WebUtil.readLongParam(request, AttributeNames.PARAM_TOOL_CONTENT_ID)); - request.setAttribute(AttributeNames.PARAM_TOOL_CONTENT_ID, toolContentID); + private ActionForward doTabs(ActionMapping mapping, ActionForm form, HttpServletRequest request, + HttpServletResponse response) { + //set back tool content ID + String contentFolderID = WebUtil.readStrParam(request, AttributeNames.PARAM_CONTENT_FOLDER_ID); + request.setAttribute(AttributeNames.PARAM_CONTENT_FOLDER_ID, contentFolderID); - request.setAttribute("initialTabId", WebUtil.readLongParam(request, AttributeNames.PARAM_CURRENT_TAB, true)); + Long toolContentID = new Long(WebUtil.readLongParam(request, AttributeNames.PARAM_TOOL_CONTENT_ID)); + request.setAttribute(AttributeNames.PARAM_TOOL_CONTENT_ID, toolContentID); - this.summary(mapping, form, request, response); - this.viewInstructions(mapping, form, request, response); - this.viewActivity(mapping, form, request, response, toolContentID); - this.statistic(mapping, form, request, response); - return mapping.findForward("load"); - } + request.setAttribute("initialTabId", WebUtil.readLongParam(request, AttributeNames.PARAM_CURRENT_TAB, true)); - /** - * The initial method for monitoring. List all users according to given - * Content ID. - * - * @param mapping - * @param form - * @param request - * @param response - * @return - */ - private ActionForward summary(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) { - Long toolContentID = new Long(WebUtil.readLongParam(request, AttributeNames.PARAM_TOOL_CONTENT_ID)); + this.summary(mapping, form, request, response); + this.viewInstructions(mapping, form, request, response); + this.viewActivity(mapping, form, request, response, toolContentID); + this.statistic(mapping, form, request, response); + return mapping.findForward("load"); + } - forumService = getForumService(); - List sessionsList = forumService.getSessionsByContentId(toolContentID); + /** + * The initial method for monitoring. List all users according to given + * Content ID. + * + * @param mapping + * @param form + * @param request + * @param response + * @return + */ + private ActionForward summary(ActionMapping mapping, ActionForm form, HttpServletRequest request, + HttpServletResponse response) { + Long toolContentID = new Long(WebUtil.readLongParam(request, AttributeNames.PARAM_TOOL_CONTENT_ID)); - // A forum clone required for listing the advanced options LDEV-1662 - Forum forumClone = null; + forumService = getForumService(); + List sessionsList = forumService.getSessionsByContentId(toolContentID); - Map sessionUsersMap = new TreeMap(this.new SessionDTOComparator()); - // build a map with all users in the submitFilesSessionList - Iterator it = sessionsList.iterator(); - while (it.hasNext()) { - SessionDTO sessionDto = new SessionDTO(); - ForumToolSession fts = (ForumToolSession) it.next(); - boolean hasReflection = fts.getForum().isReflectOnActivity(); + // A forum clone required for listing the advanced options LDEV-1662 + Forum forumClone = null; - if (forumClone == null) { - forumClone = (Forum) fts.getForum().clone(); - request.setAttribute("forum", forumClone); - } + Map sessionUsersMap = new TreeMap(this.new SessionDTOComparator()); + // build a map with all users in the submitFilesSessionList + Iterator it = sessionsList.iterator(); + while (it.hasNext()) { + SessionDTO sessionDto = new SessionDTO(); + ForumToolSession fts = (ForumToolSession) it.next(); + boolean hasReflection = fts.getForum().isReflectOnActivity(); - sessionDto.setSessionID(fts.getSessionId()); - sessionDto.setSessionName(fts.getSessionName()); - List userList = forumService.getUsersBySessionId(fts.getSessionId()); + if (forumClone == null) { + forumClone = (Forum) fts.getForum().clone(); + request.setAttribute("forum", forumClone); + } - //sort and create DTO list - List topicList = forumService.getAllTopicsFromSession(fts.getSessionId()); - Map topicsByUser = getTopicsSortedByAuthor(topicList); + sessionDto.setSessionID(fts.getSessionId()); + sessionDto.setSessionName(fts.getSessionName()); + List userList = forumService.getUsersBySessionId(fts.getSessionId()); - Set dtoList = new TreeSet(this.new UserDTOComparator()); - Iterator iter = userList.iterator(); - while (iter.hasNext()) { - ForumUser user = (ForumUser) iter.next(); - UserDTO userDTO = new UserDTO(user); - userDTO.setHasRefection(hasReflection); + //sort and create DTO list + List topicList = forumService.getAllTopicsFromSession(fts.getSessionId()); + Map topicsByUser = getTopicsSortedByAuthor(topicList); - userDTO.setAnyPostsMarked(false); - userDTO.setNoOfPosts(0); + Set dtoList = new TreeSet(this.new UserDTOComparator()); + Iterator iter = userList.iterator(); + while (iter.hasNext()) { + ForumUser user = (ForumUser) iter.next(); + UserDTO userDTO = new UserDTO(user); + userDTO.setHasRefection(hasReflection); - List messages = (List) topicsByUser.get(user); - if (messages != null && messages.size() > 0) { - userDTO.setNoOfPosts(messages.size()); - for (MessageDTO message : messages) { - if (message.getMark() != null) { - userDTO.setAnyPostsMarked(true); - break; - } - } - } - dtoList.add(userDTO); - } + userDTO.setAnyPostsMarked(false); + userDTO.setNoOfPosts(0); - sessionUsersMap.put(sessionDto, dtoList); + List messages = (List) topicsByUser.get(user); + if (messages != null && messages.size() > 0) { + userDTO.setNoOfPosts(messages.size()); + for (MessageDTO message : messages) { + if (message.getMark() != null) { + userDTO.setAnyPostsMarked(true); + break; + } + } } + dtoList.add(userDTO); + } - // request.setAttribute(AttributeNames.PARAM_TOOL_SESSION_ID,sessionID); - request.setAttribute("sessionUserMap", sessionUsersMap); - return mapping.findForward("success"); - + sessionUsersMap.put(sessionDto, dtoList); } - /** - * Download marks for all users in a speical session. - * - * @param mapping - * @param form - * @param request - * @param response - * @return - */ - private ActionForward downloadMarks(ActionMapping mapping, ActionForm form, HttpServletRequest request, - HttpServletResponse response) { - Long sessionID = new Long(WebUtil.readLongParam(request, AttributeNames.PARAM_TOOL_SESSION_ID)); - forumService = getForumService(); - List topicList = forumService.getAllTopicsFromSession(sessionID); - // construct Excel file format and download - ActionMessages errors = new ActionMessages(); - try { - // create an empty excel file - HSSFWorkbook wb = new HSSFWorkbook(); + // request.setAttribute(AttributeNames.PARAM_TOOL_SESSION_ID,sessionID); + request.setAttribute("sessionUserMap", sessionUsersMap); + return mapping.findForward("success"); - HSSFSheet sheet = wb.createSheet("Marks"); - sheet.setColumnWidth((short) 0, (short) 5000); - HSSFRow row = null; - HSSFCell cell; - Iterator iter = getTopicsSortedByAuthor(topicList).values().iterator(); - Iterator dtoIter; - boolean first = true; - int idx = 0; - int fileCount = 0; - while (iter.hasNext()) { - List list = (List) iter.next(); - dtoIter = list.iterator(); - first = true; + } - while (dtoIter.hasNext()) { - MessageDTO dto = (MessageDTO) dtoIter.next(); - if (first) { - first = false; - row = sheet.createRow(0); - cell = row.createCell((short) idx); - cell.setEncoding(HSSFCell.ENCODING_UTF_16); - cell.setCellValue(getMessageService().getMessage("lable.topic.title.subject")); - sheet.setColumnWidth((short) idx, (short) 8000); - ++idx; + /** + * Download marks for all users in a speical session. + * + * @param mapping + * @param form + * @param request + * @param response + * @return + */ + private ActionForward downloadMarks(ActionMapping mapping, ActionForm form, HttpServletRequest request, + HttpServletResponse response) { + Long sessionID = new Long(WebUtil.readLongParam(request, AttributeNames.PARAM_TOOL_SESSION_ID)); + forumService = getForumService(); + List topicList = forumService.getAllTopicsFromSession(sessionID); + // construct Excel file format and download + ActionMessages errors = new ActionMessages(); + try { + // create an empty excel file + HSSFWorkbook wb = new HSSFWorkbook(); - cell = row.createCell((short) idx); - cell.setEncoding(HSSFCell.ENCODING_UTF_16); - cell.setCellValue(getMessageService().getMessage("lable.topic.title.author")); - sheet.setColumnWidth((short) idx, (short) 8000); - ++idx; + HSSFSheet sheet = wb.createSheet("Marks"); + sheet.setColumnWidth((short) 0, (short) 5000); + HSSFRow row = null; + HSSFCell cell; + Iterator iter = getTopicsSortedByAuthor(topicList).values().iterator(); + Iterator dtoIter; + boolean first = true; + int idx = 0; + int fileCount = 0; + while (iter.hasNext()) { + List list = (List) iter.next(); + dtoIter = list.iterator(); + first = true; - cell = row.createCell((short) idx); - cell.setEncoding(HSSFCell.ENCODING_UTF_16); - cell.setCellValue(getMessageService().getMessage("label.download.marks.heading.date")); - sheet.setColumnWidth((short) idx, (short) 8000); - ++idx; + while (dtoIter.hasNext()) { + MessageDTO dto = (MessageDTO) dtoIter.next(); + if (first) { + first = false; + row = sheet.createRow(0); + cell = row.createCell((short) idx); + cell.setEncoding(HSSFCell.ENCODING_UTF_16); + cell.setCellValue(getMessageService().getMessage("lable.topic.title.subject")); + sheet.setColumnWidth((short) idx, (short) 8000); + ++idx; - cell = row.createCell((short) idx); - cell.setEncoding(HSSFCell.ENCODING_UTF_16); - cell.setCellValue(getMessageService().getMessage("label.download.marks.heading.marks")); - sheet.setColumnWidth((short) idx, (short) 8000); - ++idx; + cell = row.createCell((short) idx); + cell.setEncoding(HSSFCell.ENCODING_UTF_16); + cell.setCellValue(getMessageService().getMessage("lable.topic.title.author")); + sheet.setColumnWidth((short) idx, (short) 8000); + ++idx; - cell = row.createCell((short) idx); - cell.setEncoding(HSSFCell.ENCODING_UTF_16); - cell.setCellValue(getMessageService().getMessage("label.download.marks.heading.comments")); - sheet.setColumnWidth((short) idx, (short) 8000); - ++idx; - } - ++fileCount; - idx = 0; - row = sheet.createRow(fileCount); - cell = row.createCell((short) idx++); - cell.setEncoding(HSSFCell.ENCODING_UTF_16); - cell.setCellValue(dto.getMessage().getSubject()); + cell = row.createCell((short) idx); + cell.setEncoding(HSSFCell.ENCODING_UTF_16); + cell.setCellValue(getMessageService().getMessage("label.download.marks.heading.date")); + sheet.setColumnWidth((short) idx, (short) 8000); + ++idx; - cell = row.createCell((short) idx++); - cell.setEncoding(HSSFCell.ENCODING_UTF_16); - cell.setCellValue(dto.getAuthor()); + cell = row.createCell((short) idx); + cell.setEncoding(HSSFCell.ENCODING_UTF_16); + cell.setCellValue(getMessageService().getMessage("label.download.marks.heading.marks")); + sheet.setColumnWidth((short) idx, (short) 8000); + ++idx; - cell = row.createCell((short) idx++); - cell.setEncoding(HSSFCell.ENCODING_UTF_16); - cell.setCellValue(DateFormat.getInstance().format(dto.getMessage().getCreated())); + cell = row.createCell((short) idx); + cell.setEncoding(HSSFCell.ENCODING_UTF_16); + cell.setCellValue(getMessageService().getMessage("label.download.marks.heading.comments")); + sheet.setColumnWidth((short) idx, (short) 8000); + ++idx; + } + ++fileCount; + idx = 0; + row = sheet.createRow(fileCount); + cell = row.createCell((short) idx++); + cell.setEncoding(HSSFCell.ENCODING_UTF_16); + cell.setCellValue(dto.getMessage().getSubject()); - cell = row.createCell((short) idx++); - cell.setEncoding(HSSFCell.ENCODING_UTF_16); + cell = row.createCell((short) idx++); + cell.setEncoding(HSSFCell.ENCODING_UTF_16); + cell.setCellValue(dto.getAuthor()); - if (dto.getMessage() != null && dto.getMessage().getReport() != null - && dto.getMessage().getReport().getMark() != null) { - cell.setCellValue(NumberUtil.formatLocalisedNumber(dto.getMessage().getReport().getMark(), request - .getLocale(), 2)); - } - else { - cell.setCellValue(""); - } + cell = row.createCell((short) idx++); + cell.setEncoding(HSSFCell.ENCODING_UTF_16); + cell.setCellValue(DateFormat.getInstance().format(dto.getMessage().getCreated())); - cell = row.createCell((short) idx++); - cell.setEncoding(HSSFCell.ENCODING_UTF_16); - if (dto.getMessage() != null && dto.getMessage().getReport() != null) { - cell.setCellValue(dto.getMessage().getReport().getComment()); - } - else { - cell.setCellValue(""); - } - } - } - ByteArrayOutputStream bos = new ByteArrayOutputStream(); - wb.write(bos); - // construct download file response header - String fileName = "marks" + sessionID + ".xls"; - String mineType = "application/vnd.ms-excel"; - String header = "attachment; filename=\"" + fileName + "\";"; - response.setContentType(mineType); - response.setHeader("Content-Disposition", header); + cell = row.createCell((short) idx++); + cell.setEncoding(HSSFCell.ENCODING_UTF_16); - byte[] data = bos.toByteArray(); - response.getOutputStream().write(data, 0, data.length); - response.getOutputStream().flush(); - } - catch (IOException e) { - MonitoringAction.log.error(e); - errors.add(ActionMessages.GLOBAL_MESSAGE, new ActionMessage("monitoring.download.error", e.toString())); - } + if (dto.getMessage() != null && dto.getMessage().getReport() != null + && dto.getMessage().getReport().getMark() != null) { + cell.setCellValue(NumberUtil.formatLocalisedNumber(dto.getMessage().getReport().getMark(), + request.getLocale(), 2)); + } else { + cell.setCellValue(""); + } - if (!errors.isEmpty()) { - saveErrors(request, errors); - request.setAttribute(AttributeNames.PARAM_TOOL_SESSION_ID, sessionID); - return mapping.getInputForward(); + cell = row.createCell((short) idx++); + cell.setEncoding(HSSFCell.ENCODING_UTF_16); + if (dto.getMessage() != null && dto.getMessage().getReport() != null) { + cell.setCellValue(dto.getMessage().getReport().getComment()); + } else { + cell.setCellValue(""); + } } + } + ByteArrayOutputStream bos = new ByteArrayOutputStream(); + wb.write(bos); + // construct download file response header + String fileName = "marks" + sessionID + ".xls"; + String mineType = "application/vnd.ms-excel"; + String header = "attachment; filename=\"" + fileName + "\";"; + response.setContentType(mineType); + response.setHeader("Content-Disposition", header); - return null; + byte[] data = bos.toByteArray(); + response.getOutputStream().write(data, 0, data.length); + response.getOutputStream().flush(); + } catch (IOException e) { + MonitoringAction.log.error(e); + errors.add(ActionMessages.GLOBAL_MESSAGE, new ActionMessage("monitoring.download.error", e.toString())); } - /** - * View activity for content. - * - * @param mapping - * @param form - * @param request - * @param response - * @return - */ - private ActionForward viewActivity(ActionMapping mapping, ActionForm form, HttpServletRequest request, - HttpServletResponse response, Long toolContentID) { + if (!errors.isEmpty()) { + saveErrors(request, errors); + request.setAttribute(AttributeNames.PARAM_TOOL_SESSION_ID, sessionID); + return mapping.getInputForward(); + } - forumService = getForumService(); - Forum forum = forumService.getForumByContentId(toolContentID); - // if can not find out forum, echo back error message - if (forum == null) { - ActionErrors errors = new ActionErrors(); - errors.add("activity.globel", new ActionMessage("error.fail.get.forum")); - this.addErrors(request, errors); - return mapping.getInputForward(); - } - String title = forum.getTitle(); - String instruction = forum.getInstructions(); + return null; + } - boolean isForumEditable = ForumWebUtils.isForumEditable(forum); - request.setAttribute(ForumConstants.PAGE_EDITABLE, new Boolean(isForumEditable)); - request.setAttribute("title", title); - request.setAttribute("instruction", instruction); - return mapping.findForward("success"); + /** + * View activity for content. + * + * @param mapping + * @param form + * @param request + * @param response + * @return + */ + private ActionForward viewActivity(ActionMapping mapping, ActionForm form, HttpServletRequest request, + HttpServletResponse response, Long toolContentID) { + + forumService = getForumService(); + Forum forum = forumService.getForumByContentId(toolContentID); + // if can not find out forum, echo back error message + if (forum == null) { + ActionErrors errors = new ActionErrors(); + errors.add("activity.globel", new ActionMessage("error.fail.get.forum")); + this.addErrors(request, errors); + return mapping.getInputForward(); } + String title = forum.getTitle(); + String instruction = forum.getInstructions(); - /** - * View instruction information for a content. - * - * @param mapping - * @param form - * @param request - * @param response - * @return - */ - private ActionForward viewInstructions(ActionMapping mapping, ActionForm form, HttpServletRequest request, - HttpServletResponse response) { - Long toolContentID = new Long(WebUtil.readLongParam(request, AttributeNames.PARAM_TOOL_CONTENT_ID)); + boolean isForumEditable = ForumWebUtils.isForumEditable(forum); + request.setAttribute(ForumConstants.PAGE_EDITABLE, new Boolean(isForumEditable)); + request.setAttribute("title", title); + request.setAttribute("instruction", instruction); + return mapping.findForward("success"); + } - forumService = getForumService(); - Forum forum = forumService.getForumByContentId(toolContentID); - // if can not find out forum, echo back error message - if (forum == null) { - ActionErrors errors = new ActionErrors(); - errors.add("instruction.globel", new ActionMessage("error.fail.get.forum")); - this.addErrors(request, errors); - return mapping.getInputForward(); - } + /** + * View instruction information for a content. + * + * @param mapping + * @param form + * @param request + * @param response + * @return + */ + private ActionForward viewInstructions(ActionMapping mapping, ActionForm form, HttpServletRequest request, + HttpServletResponse response) { + Long toolContentID = new Long(WebUtil.readLongParam(request, AttributeNames.PARAM_TOOL_CONTENT_ID)); - ForumForm forumForm = new ForumForm(); - forumForm.setForum(forum); - - request.setAttribute("forumBean", forumForm); - return mapping.findForward("success"); + forumService = getForumService(); + Forum forum = forumService.getForumByContentId(toolContentID); + // if can not find out forum, echo back error message + if (forum == null) { + ActionErrors errors = new ActionErrors(); + errors.add("instruction.globel", new ActionMessage("error.fail.get.forum")); + this.addErrors(request, errors); + return mapping.getInputForward(); } - /** - * Show statisitc page for a session. - * - * @param mapping - * @param form - * @param request - * @param response - * @return - */ - private ActionForward statistic(ActionMapping mapping, ActionForm form, HttpServletRequest request, - HttpServletResponse response) { - Long toolContentID = new Long(WebUtil.readLongParam(request, AttributeNames.PARAM_TOOL_CONTENT_ID)); + ForumForm forumForm = new ForumForm(); + forumForm.setForum(forum); - forumService = getForumService(); - Map sessionTopicsMap = new TreeMap>(this.new SessionDTOComparator()); - Map sessionAvaMarkMap = new HashMap(); - Map sessionTotalMsgMap = new HashMap(); + request.setAttribute("forumBean", forumForm); + return mapping.findForward("success"); + } - List sessList = forumService.getSessionsByContentId(toolContentID); - Iterator sessIter = sessList.iterator(); - while (sessIter.hasNext()) { - ForumToolSession session = (ForumToolSession) sessIter.next(); - List topicList = forumService.getRootTopics(session.getSessionId()); - Iterator iter = topicList.iterator(); - int totalMsg = 0; - int msgNum; - float totalMsgMarkSum = 0; - float msgMarkSum = 0; - for (; iter.hasNext();) { - MessageDTO msgDto = (MessageDTO) iter.next(); - // get all message under this topic - List topicThread = forumService.getTopicThread(msgDto.getMessage().getUid()); - // loop all message under this topic - msgMarkSum = 0; - Iterator threadIter = topicThread.iterator(); - for (msgNum = 0; threadIter.hasNext(); msgNum++) { - MessageDTO dto = (MessageDTO) threadIter.next(); - if (dto.getMark() != null) { - msgMarkSum += dto.getMark().floatValue(); - } - } - // summary to total mark - totalMsgMarkSum += msgMarkSum; - // set average mark to topic message DTO for display use - msgDto.setMark(msgMarkSum / msgNum); - totalMsg += msgNum; - } + /** + * Show statisitc page for a session. + * + * @param mapping + * @param form + * @param request + * @param response + * @return + */ + private ActionForward statistic(ActionMapping mapping, ActionForm form, HttpServletRequest request, + HttpServletResponse response) { + Long toolContentID = new Long(WebUtil.readLongParam(request, AttributeNames.PARAM_TOOL_CONTENT_ID)); - float averMark = totalMsg == 0 ? 0 : totalMsgMarkSum / totalMsg; + forumService = getForumService(); + Map sessionTopicsMap = new TreeMap>(this.new SessionDTOComparator()); + Map sessionAvaMarkMap = new HashMap(); + Map sessionTotalMsgMap = new HashMap(); - SessionDTO sessionDto = new SessionDTO(); - sessionDto.setSessionID(session.getSessionId()); - sessionDto.setSessionName(session.getSessionName()); - - sessionTopicsMap.put(sessionDto, topicList); - sessionAvaMarkMap.put(session.getSessionId(), averMark); - sessionTotalMsgMap.put(session.getSessionId(), new Integer(totalMsg)); + List sessList = forumService.getSessionsByContentId(toolContentID); + Iterator sessIter = sessList.iterator(); + while (sessIter.hasNext()) { + ForumToolSession session = (ForumToolSession) sessIter.next(); + List topicList = forumService.getRootTopics(session.getSessionId()); + Iterator iter = topicList.iterator(); + int totalMsg = 0; + int msgNum; + float totalMsgMarkSum = 0; + float msgMarkSum = 0; + for (; iter.hasNext();) { + MessageDTO msgDto = (MessageDTO) iter.next(); + // get all message under this topic + List topicThread = forumService.getTopicThread(msgDto.getMessage().getUid()); + // loop all message under this topic + msgMarkSum = 0; + Iterator threadIter = topicThread.iterator(); + for (msgNum = 0; threadIter.hasNext(); msgNum++) { + MessageDTO dto = (MessageDTO) threadIter.next(); + if (dto.getMark() != null) { + msgMarkSum += dto.getMark().floatValue(); + } } - request.setAttribute("topicList", sessionTopicsMap); - request.setAttribute("markAverage", sessionAvaMarkMap); - request.setAttribute("totalMessage", sessionTotalMsgMap); - return mapping.findForward("success"); - } + // summary to total mark + totalMsgMarkSum += msgMarkSum; + // set average mark to topic message DTO for display use + msgDto.setMark(msgMarkSum / msgNum); + totalMsg += msgNum; + } - /** - * View all messages under one topic. - * - * @param mapping - * @param form - * @param request - * @param response - * @return - */ - private ActionForward viewTopicTree(ActionMapping mapping, ActionForm form, HttpServletRequest request, - HttpServletResponse response) { + float averMark = totalMsg == 0 ? 0 : totalMsgMarkSum / totalMsg; - Long rootTopicId = WebUtil.readLongParam(request, ForumConstants.ATTR_TOPIC_ID); - forumService = getForumService(); - // get root topic list - List msgDtoList = forumService.getTopicThread(rootTopicId); - request.setAttribute(ForumConstants.AUTHORING_TOPIC_THREAD, msgDtoList); + SessionDTO sessionDto = new SessionDTO(); + sessionDto.setSessionID(session.getSessionId()); + sessionDto.setSessionName(session.getSessionName()); - return mapping.findForward("success"); + sessionTopicsMap.put(sessionDto, topicList); + sessionAvaMarkMap.put(session.getSessionId(), averMark); + sessionTotalMsgMap.put(session.getSessionId(), new Integer(totalMsg)); } + request.setAttribute("topicList", sessionTopicsMap); + request.setAttribute("markAverage", sessionAvaMarkMap); + request.setAttribute("totalMessage", sessionTotalMsgMap); + return mapping.findForward("success"); + } - private ActionForward viewReflection(ActionMapping mapping, ActionForm form, HttpServletRequest request, - HttpServletResponse response) { + /** + * View all messages under one topic. + * + * @param mapping + * @param form + * @param request + * @param response + * @return + */ + private ActionForward viewTopicTree(ActionMapping mapping, ActionForm form, HttpServletRequest request, + HttpServletResponse response) { - Long uid = WebUtil.readLongParam(request, ForumConstants.ATTR_USER_UID); - Long sessionID = WebUtil.readLongParam(request, AttributeNames.PARAM_TOOL_SESSION_ID); + Long rootTopicId = WebUtil.readLongParam(request, ForumConstants.ATTR_TOPIC_ID); + forumService = getForumService(); + // get root topic list + List msgDtoList = forumService.getTopicThread(rootTopicId); + request.setAttribute(ForumConstants.AUTHORING_TOPIC_THREAD, msgDtoList); - ForumUser user = forumService.getUser(uid); - NotebookEntry notebookEntry = forumService.getEntry(sessionID, CoreNotebookConstants.NOTEBOOK_TOOL, - ForumConstants.TOOL_SIGNATURE, user.getUserId().intValue()); + return mapping.findForward("success"); + } - ForumToolSession session = forumService.getSessionBySessionId(sessionID); + private ActionForward viewReflection(ActionMapping mapping, ActionForm form, HttpServletRequest request, + HttpServletResponse response) { - UserDTO userDTO = new UserDTO(user); - if (notebookEntry == null) { - userDTO.setFinishReflection(false); - userDTO.setReflect(null); - } - else { - userDTO.setFinishReflection(true); - userDTO.setReflect(notebookEntry.getEntry()); - } - userDTO.setReflectInstrctions(session.getForum().getReflectInstructions()); + Long uid = WebUtil.readLongParam(request, ForumConstants.ATTR_USER_UID); + Long sessionID = WebUtil.readLongParam(request, AttributeNames.PARAM_TOOL_SESSION_ID); - request.setAttribute("userDTO", userDTO); - return mapping.findForward("success"); - } + ForumUser user = forumService.getUser(uid); + NotebookEntry notebookEntry = forumService.getEntry(sessionID, CoreNotebookConstants.NOTEBOOK_TOOL, + ForumConstants.TOOL_SIGNATURE, user.getUserId().intValue()); - /** - * View topic subject, content and attachement. - * - * @param mapping - * @param form - * @param request - * @param response - * @return - */ - private ActionForward viewTopic(ActionMapping mapping, ActionForm form, HttpServletRequest request, - HttpServletResponse response) { + ForumToolSession session = forumService.getSessionBySessionId(sessionID); - Long msgUid = new Long(WebUtil.readLongParam(request, ForumConstants.ATTR_TOPIC_ID)); - - forumService = getForumService(); - Message topic = forumService.getMessage(msgUid); - - request.setAttribute(ForumConstants.AUTHORING_TOPIC, MessageDTO.getMessageDTO(topic)); - return mapping.findForward("success"); + UserDTO userDTO = new UserDTO(user); + if (notebookEntry == null) { + userDTO.setFinishReflection(false); + userDTO.setReflect(null); + } else { + userDTO.setFinishReflection(true); + userDTO.setReflect(notebookEntry.getEntry()); } + userDTO.setReflectInstrctions(session.getForum().getReflectInstructions()); - private ActionForward releaseMark(ActionMapping mapping, ActionForm form, HttpServletRequest request, - HttpServletResponse response) { - //get service then update report table - forumService = getForumService(); - Long sessionID = new Long(WebUtil.readLongParam(request, AttributeNames.PARAM_TOOL_SESSION_ID)); - forumService.releaseMarksForSession(sessionID); + request.setAttribute("userDTO", userDTO); + return mapping.findForward("success"); + } - try { - response.setContentType("text/html;charset=utf-8"); - PrintWriter out = response.getWriter(); - ForumToolSession session = forumService.getSessionBySessionId(sessionID); - String sessionName = ""; - if (session != null) { - sessionName = session.getSessionName(); - } - out.write(getMessageService().getMessage("msg.mark.released", new String[] { sessionName })); - out.flush(); + /** + * View topic subject, content and attachement. + * + * @param mapping + * @param form + * @param request + * @param response + * @return + */ + private ActionForward viewTopic(ActionMapping mapping, ActionForm form, HttpServletRequest request, + HttpServletResponse response) { - } - catch (IOException e) { - } - return null; - } + Long msgUid = new Long(WebUtil.readLongParam(request, ForumConstants.ATTR_TOPIC_ID)); - // ========================================================================================== - // View and update marks methods - // ========================================================================================== + forumService = getForumService(); + Message topic = forumService.getMessage(msgUid); - /** - * View all user marks for a special Session ID - * - * @param mapping - * @param form - * @param request - * @param response - * @return - */ - private ActionForward viewAllMarks(ActionMapping mapping, ActionForm form, HttpServletRequest request, - HttpServletResponse response) { - //only one param for session scope marks - Long sessionID = new Long(WebUtil.readLongParam(request, AttributeNames.PARAM_TOOL_SESSION_ID)); + request.setAttribute(ForumConstants.AUTHORING_TOPIC, MessageDTO.getMessageDTO(topic)); + return mapping.findForward("success"); + } - //create sessionMap - SessionMap sessionMap = new SessionMap(); - request.getSession().setAttribute(sessionMap.getSessionID(), sessionMap); - sessionMap.put(AttributeNames.PARAM_TOOL_SESSION_ID, sessionID); - sessionMap.put(ForumConstants.PARAM_UPDATE_MODE, ForumConstants.MARK_UPDATE_FROM_SESSION); + private ActionForward releaseMark(ActionMapping mapping, ActionForm form, HttpServletRequest request, + HttpServletResponse response) { + //get service then update report table + forumService = getForumService(); + Long sessionID = new Long(WebUtil.readLongParam(request, AttributeNames.PARAM_TOOL_SESSION_ID)); + forumService.releaseMarksForSession(sessionID); - request.setAttribute(ForumConstants.ATTR_SESSION_MAP_ID, sessionMap.getSessionID()); + try { + response.setContentType("text/html;charset=utf-8"); + PrintWriter out = response.getWriter(); + ForumToolSession session = forumService.getSessionBySessionId(sessionID); + String sessionName = ""; + if (session != null) { + sessionName = session.getSessionName(); + } + out.write(getMessageService().getMessage("msg.mark.released", new String[] { sessionName })); + out.flush(); - //get tool session scope topics - forumService = getForumService(); - List topicList = forumService.getAllTopicsFromSession(sessionID); - - Map topicsByUser = getTopicsSortedByAuthor(topicList); - request.setAttribute(ForumConstants.ATTR_REPORT, topicsByUser); - return mapping.findForward("success"); + } catch (IOException e) { } + return null; + } - /** - * View a special user's mark - * - * @param mapping - * @param form - * @param request - * @param response - * @return - */ - private ActionForward viewUserMark(ActionMapping mapping, ActionForm form, HttpServletRequest request, - HttpServletResponse response) { - Long userUid = new Long(WebUtil.readLongParam(request, ForumConstants.USER_UID)); - Long sessionId = new Long(WebUtil.readLongParam(request, AttributeNames.PARAM_TOOL_SESSION_ID)); + // ========================================================================================== + // View and update marks methods + // ========================================================================================== - //create sessionMap - SessionMap sessionMap = new SessionMap(); - request.getSession().setAttribute(sessionMap.getSessionID(), sessionMap); + /** + * View all user marks for a special Session ID + * + * @param mapping + * @param form + * @param request + * @param response + * @return + */ + private ActionForward viewAllMarks(ActionMapping mapping, ActionForm form, HttpServletRequest request, + HttpServletResponse response) { + //only one param for session scope marks + Long sessionID = new Long(WebUtil.readLongParam(request, AttributeNames.PARAM_TOOL_SESSION_ID)); - sessionMap.put(AttributeNames.PARAM_TOOL_SESSION_ID, sessionId); - sessionMap.put(ForumConstants.PARAM_UPDATE_MODE, ForumConstants.MARK_UPDATE_FROM_USER); + //create sessionMap + SessionMap sessionMap = new SessionMap(); + request.getSession().setAttribute(sessionMap.getSessionID(), sessionMap); + sessionMap.put(AttributeNames.PARAM_TOOL_SESSION_ID, sessionID); + sessionMap.put(ForumConstants.PARAM_UPDATE_MODE, ForumConstants.MARK_UPDATE_FROM_SESSION); - request.setAttribute(ForumConstants.ATTR_SESSION_MAP_ID, sessionMap.getSessionID()); - //get this user's all topics - forumService = getForumService(); - List messageList = forumService.getMessagesByUserUid(userUid, sessionId); - ForumUser user = forumService.getUser(userUid); + request.setAttribute(ForumConstants.ATTR_SESSION_MAP_ID, sessionMap.getSessionID()); - // each back to web page - Map> report = new TreeMap(this.new ForumUserComparator()); - report.put(user, messageList); - request.setAttribute(ForumConstants.ATTR_REPORT, report); + //get tool session scope topics + forumService = getForumService(); + List topicList = forumService.getAllTopicsFromSession(sessionID); - return mapping.findForward("success"); - } + Map topicsByUser = getTopicsSortedByAuthor(topicList); + request.setAttribute(ForumConstants.ATTR_REPORT, topicsByUser); + return mapping.findForward("success"); + } - /** - * Edit a special user's mark. - * - * @param mapping - * @param form - * @param request - * @param response - * @return - */ - private ActionForward editMark(ActionMapping mapping, ActionForm form, HttpServletRequest request, - HttpServletResponse response) { - MarkForm markForm = (MarkForm) form; - SessionMap sessionMap = (SessionMap) request.getSession().getAttribute(markForm.getSessionMapID()); - String updateMode = (String) sessionMap.get(ForumConstants.PARAM_UPDATE_MODE); - //view forum mode - if (StringUtils.isBlank(updateMode)) { - sessionMap.put(ForumConstants.PARAM_UPDATE_MODE, ForumConstants.MARK_UPDATE_FROM_FORUM); - sessionMap.put(ForumConstants.ATTR_ROOT_TOPIC_UID, markForm.getTopicID()); - } + /** + * View a special user's mark + * + * @param mapping + * @param form + * @param request + * @param response + * @return + */ + private ActionForward viewUserMark(ActionMapping mapping, ActionForm form, HttpServletRequest request, + HttpServletResponse response) { + Long userUid = new Long(WebUtil.readLongParam(request, ForumConstants.USER_UID)); + Long sessionId = new Long(WebUtil.readLongParam(request, AttributeNames.PARAM_TOOL_SESSION_ID)); - // get Message and User from database - forumService = getForumService(); - Message msg = forumService.getMessage(markForm.getTopicID()); - ForumUser user = msg.getCreatedBy(); + //create sessionMap + SessionMap sessionMap = new SessionMap(); + request.getSession().setAttribute(sessionMap.getSessionID(), sessionMap); - // echo back to web page - if (msg.getReport() != null) { - if (msg.getReport().getMark() != null) { - markForm.setMark(NumberUtil.formatLocalisedNumber(msg.getReport().getMark(), request.getLocale(), 2)); - } - else { - markForm.setMark(""); - } - markForm.setComment(msg.getReport().getComment()); - } + sessionMap.put(AttributeNames.PARAM_TOOL_SESSION_ID, sessionId); + sessionMap.put(ForumConstants.PARAM_UPDATE_MODE, ForumConstants.MARK_UPDATE_FROM_USER); - // each back to web page - request.setAttribute(ForumConstants.ATTR_TOPIC, MessageDTO.getMessageDTO(msg)); - request.setAttribute(ForumConstants.ATTR_USER, user); + request.setAttribute(ForumConstants.ATTR_SESSION_MAP_ID, sessionMap.getSessionID()); + //get this user's all topics + forumService = getForumService(); + List messageList = forumService.getMessagesByUserUid(userUid, sessionId); + ForumUser user = forumService.getUser(userUid); - // Should we show the reflection or not? We shouldn't show it when the View Forum screen is accessed - // from the Monitoring Summary screen, but we should when accessed from the Learner Progress screen. - // Need to constantly past this value on, rather than hiding just the once, as the View Forum - // screen has a refresh button. Need to pass it through the view topic screen and dependent screens - // as it has a link from the view topic screen back to View Forum screen. - boolean hideReflection = WebUtil.readBooleanParam(request, ForumConstants.ATTR_HIDE_REFLECTION, false); - sessionMap.put(ForumConstants.ATTR_HIDE_REFLECTION, hideReflection); + // each back to web page + Map> report = new TreeMap(this.new ForumUserComparator()); + report.put(user, messageList); + request.setAttribute(ForumConstants.ATTR_REPORT, report); - return mapping.findForward("success"); + return mapping.findForward("success"); + } + + /** + * Edit a special user's mark. + * + * @param mapping + * @param form + * @param request + * @param response + * @return + */ + private ActionForward editMark(ActionMapping mapping, ActionForm form, HttpServletRequest request, + HttpServletResponse response) { + MarkForm markForm = (MarkForm) form; + SessionMap sessionMap = (SessionMap) request.getSession().getAttribute(markForm.getSessionMapID()); + String updateMode = (String) sessionMap.get(ForumConstants.PARAM_UPDATE_MODE); + //view forum mode + if (StringUtils.isBlank(updateMode)) { + sessionMap.put(ForumConstants.PARAM_UPDATE_MODE, ForumConstants.MARK_UPDATE_FROM_FORUM); + sessionMap.put(ForumConstants.ATTR_ROOT_TOPIC_UID, markForm.getTopicID()); } - /** - * Update mark for a special user - * - * @param mapping - * @param form - * @param request - * @param response - * @return - */ - private ActionForward updateMark(ActionMapping mapping, ActionForm form, HttpServletRequest request, - HttpServletResponse response) { - MarkForm markForm = (MarkForm) form; + // get Message and User from database + forumService = getForumService(); + Message msg = forumService.getMessage(markForm.getTopicID()); + ForumUser user = msg.getCreatedBy(); - request.setAttribute(ForumConstants.ATTR_SESSION_MAP_ID, markForm.getSessionMapID()); - String markStr = markForm.getMark(); - Float mark = null; - ActionMessages errors = new ActionMessages(); - if (StringUtils.isBlank(markStr)) { - ActionMessage error = new ActionMessage("error.valueReqd"); - errors.add("report.mark", error); - } - else { - try { - mark = NumberUtil.getLocalisedFloat(markStr, request.getLocale()); - } - catch (Exception e) { - ActionMessage error = new ActionMessage("error.mark.invalid.number"); - errors.add("report.mark", error); - } - } + // echo back to web page + if (msg.getReport() != null) { + if (msg.getReport().getMark() != null) { + markForm.setMark(NumberUtil.formatLocalisedNumber(msg.getReport().getMark(), request.getLocale(), 2)); + } else { + markForm.setMark(""); + } + markForm.setComment(msg.getReport().getComment()); + } - forumService = getForumService(); - // echo back to web page - Message msg = forumService.getMessage(markForm.getTopicID()); - ForumUser user = msg.getCreatedBy(); + // each back to web page + request.setAttribute(ForumConstants.ATTR_TOPIC, MessageDTO.getMessageDTO(msg)); + request.setAttribute(ForumConstants.ATTR_USER, user); - request.setAttribute(ForumConstants.ATTR_USER, user); - if (!errors.isEmpty()) { - // each back to web page - request.setAttribute(ForumConstants.ATTR_TOPIC, MessageDTO.getMessageDTO(msg)); - saveErrors(request, errors); - return mapping.getInputForward(); - } + // Should we show the reflection or not? We shouldn't show it when the View Forum screen is accessed + // from the Monitoring Summary screen, but we should when accessed from the Learner Progress screen. + // Need to constantly past this value on, rather than hiding just the once, as the View Forum + // screen has a refresh button. Need to pass it through the view topic screen and dependent screens + // as it has a link from the view topic screen back to View Forum screen. + boolean hideReflection = WebUtil.readBooleanParam(request, ForumConstants.ATTR_HIDE_REFLECTION, false); + sessionMap.put(ForumConstants.ATTR_HIDE_REFLECTION, hideReflection); - //update message report + return mapping.findForward("success"); + } - forumService = getForumService(); - ForumReport report = msg.getReport(); - if (report == null) { - report = new ForumReport(); - msg.setReport(report); - } + /** + * Update mark for a special user + * + * @param mapping + * @param form + * @param request + * @param response + * @return + */ + private ActionForward updateMark(ActionMapping mapping, ActionForm form, HttpServletRequest request, + HttpServletResponse response) { + MarkForm markForm = (MarkForm) form; - SessionMap sessionMap = (SessionMap) request.getSession().getAttribute(markForm.getSessionMapID()); - Long sessionId = (Long) sessionMap.get(AttributeNames.PARAM_TOOL_SESSION_ID); - String updateMode = (String) sessionMap.get(ForumConstants.PARAM_UPDATE_MODE); + request.setAttribute(ForumConstants.ATTR_SESSION_MAP_ID, markForm.getSessionMapID()); + String markStr = markForm.getMark(); + Float mark = null; + ActionMessages errors = new ActionMessages(); + if (StringUtils.isBlank(markStr)) { + ActionMessage error = new ActionMessage("error.valueReqd"); + errors.add("report.mark", error); + } else { + try { + mark = NumberUtil.getLocalisedFloat(markStr, request.getLocale()); + } catch (Exception e) { + ActionMessage error = new ActionMessage("error.mark.invalid.number"); + errors.add("report.mark", error); + } + } - //only session has been released mark, the data of mark release will have value. - ForumToolSession toolSession = forumService.getSessionBySessionId(sessionId); - if (toolSession.isMarkReleased()) { - report.setDateMarksReleased(new Date()); - } + forumService = getForumService(); + // echo back to web page + Message msg = forumService.getMessage(markForm.getTopicID()); + ForumUser user = msg.getCreatedBy(); - report.setMark(mark); - report.setComment(markForm.getComment()); - forumService.updateTopic(msg); + request.setAttribute(ForumConstants.ATTR_USER, user); + if (!errors.isEmpty()) { + // each back to web page + request.setAttribute(ForumConstants.ATTR_TOPIC, MessageDTO.getMessageDTO(msg)); + saveErrors(request, errors); + return mapping.getInputForward(); + } - //echo back to topic list page: it depends which screen is come from: view special user mark, or view all user marks. - if (StringUtils.equals(updateMode, ForumConstants.MARK_UPDATE_FROM_SESSION)) { - List topicList = forumService.getAllTopicsFromSession(sessionId); - Map topicsByUser = getTopicsSortedByAuthor(topicList); - request.setAttribute(ForumConstants.ATTR_REPORT, topicsByUser); - //listMark or listAllMark. - return mapping.findForward("success"); - } - else if (StringUtils.equals(updateMode, ForumConstants.MARK_UPDATE_FROM_USER)) { - List messageList = forumService.getMessagesByUserUid(user.getUid(), sessionId); - Map> topicMap = new TreeMap(this.new ForumUserComparator()); - topicMap.put(user, messageList); - request.setAttribute(ForumConstants.ATTR_REPORT, topicMap); - //listMark or listAllMark. - return mapping.findForward("success"); - } - else { //mark from view forum - return mapping.findForward("viewTopic"); - } + //update message report + forumService = getForumService(); + ForumReport report = msg.getReport(); + if (report == null) { + report = new ForumReport(); + msg.setReport(report); } - // ========================================================================================== - // Utility methods - // ========================================================================================== + SessionMap sessionMap = (SessionMap) request.getSession().getAttribute(markForm.getSessionMapID()); + Long sessionId = (Long) sessionMap.get(AttributeNames.PARAM_TOOL_SESSION_ID); + String updateMode = (String) sessionMap.get(ForumConstants.PARAM_UPDATE_MODE); - /** - * Get Forum Service. - * - * @return - */ - private IForumService getForumService() { - if (forumService == null) { - WebApplicationContext wac = WebApplicationContextUtils.getRequiredWebApplicationContext(getServlet() - .getServletContext()); - forumService = (IForumService) wac.getBean(ForumConstants.FORUM_SERVICE); - } - return forumService; + report.setMark(mark); + report.setComment(markForm.getComment()); + forumService.updateTopic(msg); + + //echo back to topic list page: it depends which screen is come from: view special user mark, or view all user marks. + if (StringUtils.equals(updateMode, ForumConstants.MARK_UPDATE_FROM_SESSION)) { + List topicList = forumService.getAllTopicsFromSession(sessionId); + Map topicsByUser = getTopicsSortedByAuthor(topicList); + request.setAttribute(ForumConstants.ATTR_REPORT, topicsByUser); + //listMark or listAllMark. + return mapping.findForward("success"); + } else if (StringUtils.equals(updateMode, ForumConstants.MARK_UPDATE_FROM_USER)) { + List messageList = forumService.getMessagesByUserUid(user.getUid(), sessionId); + Map> topicMap = new TreeMap(this.new ForumUserComparator()); + topicMap.put(user, messageList); + request.setAttribute(ForumConstants.ATTR_REPORT, topicMap); + //listMark or listAllMark. + return mapping.findForward("success"); + } else { //mark from view forum + return mapping.findForward("viewTopic"); } - /** - * @param topicList - * @return - */ - private Map getTopicsSortedByAuthor(List topicList) { - Map> topicsByUser = new TreeMap(this.new ForumUserComparator()); - Iterator iter = topicList.iterator(); - forumService = getForumService(); - while (iter.hasNext()) { - MessageDTO dto = (MessageDTO) iter.next(); - if (dto.getMessage().getIsAuthored()) { - continue; - } - dto.getMessage().getReport(); - ForumUser user = (ForumUser) dto.getMessage().getCreatedBy().clone(); - List list = topicsByUser.get(user); - if (list == null) { - list = new ArrayList(); - topicsByUser.put(user, list); - } - list.add(dto); - } - return topicsByUser; + } + + // ========================================================================================== + // Utility methods + // ========================================================================================== + + /** + * Get Forum Service. + * + * @return + */ + private IForumService getForumService() { + if (forumService == null) { + WebApplicationContext wac = WebApplicationContextUtils.getRequiredWebApplicationContext(getServlet() + .getServletContext()); + forumService = (IForumService) wac.getBean(ForumConstants.FORUM_SERVICE); } + return forumService; + } - /** - * Return ResourceService bean. - */ - private MessageService getMessageService() { - WebApplicationContext wac = WebApplicationContextUtils.getRequiredWebApplicationContext(getServlet().getServletContext()); - return (MessageService) wac.getBean("forumMessageService"); + /** + * @param topicList + * @return + */ + private Map getTopicsSortedByAuthor(List topicList) { + Map> topicsByUser = new TreeMap(this.new ForumUserComparator()); + Iterator iter = topicList.iterator(); + forumService = getForumService(); + while (iter.hasNext()) { + MessageDTO dto = (MessageDTO) iter.next(); + if (dto.getMessage().getIsAuthored()) { + continue; + } + dto.getMessage().getReport(); + ForumUser user = (ForumUser) dto.getMessage().getCreatedBy().clone(); + List list = topicsByUser.get(user); + if (list == null) { + list = new ArrayList(); + topicsByUser.put(user, list); + } + list.add(dto); } + return topicsByUser; + } + + /** + * Return ResourceService bean. + */ + private MessageService getMessageService() { + WebApplicationContext wac = WebApplicationContextUtils.getRequiredWebApplicationContext(getServlet() + .getServletContext()); + return (MessageService) wac.getBean("forumMessageService"); + } } Index: lams_tool_forum/src/java/org/lamsfoundation/lams/tool/forum/web/forms/ForumPedagogicalPlannerForm.java =================================================================== diff -u -r00a6e145b37916eb1561ea5c68319b0fc691681b -racc8d2acf5b6b0002e0c8129947040a779ab4077 --- lams_tool_forum/src/java/org/lamsfoundation/lams/tool/forum/web/forms/ForumPedagogicalPlannerForm.java (.../ForumPedagogicalPlannerForm.java) (revision 00a6e145b37916eb1561ea5c68319b0fc691681b) +++ lams_tool_forum/src/java/org/lamsfoundation/lams/tool/forum/web/forms/ForumPedagogicalPlannerForm.java (.../ForumPedagogicalPlannerForm.java) (revision acc8d2acf5b6b0002e0c8129947040a779ab4077) @@ -40,6 +40,7 @@ public class ForumPedagogicalPlannerForm extends PedagogicalPlannerActivityForm { private List topic; private String contentFolderID; + private String instructions; @Override public ActionMessages validate() { @@ -68,13 +69,14 @@ public void fillForm(Forum forum) { if (forum != null) { setToolContentID(forum.getContentId()); + setInstructions(forum.getInstructions()); topic = new ArrayList(); Set messages = forum.getMessages(); if (messages != null) { int topicIndex = 0; for (Message message : (Set) messages) { - setTopic(topicIndex++, message.getSubject()); + setTopic(topicIndex++, message.getBody()); } } } @@ -120,4 +122,12 @@ public List getTopicList() { return topic; } + + public String getInstructions() { + return instructions; + } + + public void setInstructions(String instructions) { + this.instructions = instructions; + } } \ No newline at end of file Fisheye: Tag b1ef965ad3a0cd4ea7bb807bd313d1f0cf68d1e7 refers to a dead (removed) revision in file `lams_tool_forum/web/WEB-INF/struts/validator-rules.xml'. Fisheye: No comparison available. Pass `N' to diff? Index: lams_tool_forum/web/jsps/authoring/addCondition.jsp =================================================================== diff -u -rc081e2b0c9c82fc97d2d39fb7109c9c2f10ff224 -racc8d2acf5b6b0002e0c8129947040a779ab4077 --- lams_tool_forum/web/jsps/authoring/addCondition.jsp (.../addCondition.jsp) (revision c081e2b0c9c82fc97d2d39fb7109c9c2f10ff224) +++ lams_tool_forum/web/jsps/authoring/addCondition.jsp (.../addCondition.jsp) (revision acc8d2acf5b6b0002e0c8129947040a779ab4077) @@ -38,9 +38,9 @@ - - Index: lams_tool_forum/web/jsps/authoring/pedagogicalPlannerForm.jsp =================================================================== diff -u -r3e3519176330a8254149c9447702b0c3dead09b5 -racc8d2acf5b6b0002e0c8129947040a779ab4077 --- lams_tool_forum/web/jsps/authoring/pedagogicalPlannerForm.jsp (.../pedagogicalPlannerForm.jsp) (revision 3e3519176330a8254149c9447702b0c3dead09b5) +++ lams_tool_forum/web/jsps/authoring/pedagogicalPlannerForm.jsp (.../pedagogicalPlannerForm.jsp) (revision acc8d2acf5b6b0002e0c8129947040a779ab4077) @@ -47,6 +47,10 @@ } function prepareFormData(){ //FCKeditor content is not submitted when sending by jQuery; we need to do this + + var instructions = FCKeditorAPI.GetInstance('instructions').GetXHTML(); + document.getElementById("instructions").value=instructions; + var topicIndex = 0; do{ var topic = document.getElementById("topic["+topicIndex+"]"); @@ -65,14 +69,23 @@
    <%@ include file="/common/messages.jsp"%> -

    + +

    + + + +

    Index: lams_tool_gmap/conf/language/lams/ApplicationResources.properties =================================================================== diff -u -rae79693b9b338e156d4c2b82d947876e2d9b9f66 -racc8d2acf5b6b0002e0c8129947040a779ab4077 --- lams_tool_gmap/conf/language/lams/ApplicationResources.properties (.../ApplicationResources.properties) (revision ae79693b9b338e156d4c2b82d947876e2d9b9f66) +++ lams_tool_gmap/conf/language/lams/ApplicationResources.properties (.../ApplicationResources.properties) (revision acc8d2acf5b6b0002e0c8129947040a779ab4077) @@ -2,7 +2,7 @@ #language code: en #locale code: AU - # CVS ID: $Id$ Exported from the LAMS Community by Ernie Ghiglione on Mon Nov 24 01:10:52 GMT 2008 + # CVS ID: $Id$ Exported from the LAMS Community by Ernie Ghiglione on Thu May 14 00:22:06 CST 2009 #=================== labels for Google Maps =================# @@ -112,13 +112,14 @@ admin.gmapKey =Google Maps API Key admin.success =Configuration successfully saved. admin.return =Return to maintain LAMS +label.unsavedMarkers =You have one or more markers on the map without a title, if you continue these markers will not be saved. Do you want to continue anyway? advanced.reflectOnActivity =Add Notebook at end of Gmap with the following instructions: button.continue =Continue monitor.summary.td.addNotebook =Add Notebook at end of Gmap button.placeMarker =Place marker message.alertContentEdit =Warning: One of more learners have accessed this activity. Changing this content will result in learners getting different information. button.fitMarkers =Fit All Markers in Map -label.unsavedMarkers =You have one or more markers on the map without a title, if you continue these markers will not be saved. Do you want to continue anyway? +label.nogroups =No groups found for activity. -#======= End labels: Exported 113 labels for en AU ===== +#======= End labels: Exported 114 labels for en AU ===== Index: lams_tool_gmap/conf/language/lams/ApplicationResources_en_AU.properties =================================================================== diff -u -rae79693b9b338e156d4c2b82d947876e2d9b9f66 -racc8d2acf5b6b0002e0c8129947040a779ab4077 --- lams_tool_gmap/conf/language/lams/ApplicationResources_en_AU.properties (.../ApplicationResources_en_AU.properties) (revision ae79693b9b338e156d4c2b82d947876e2d9b9f66) +++ lams_tool_gmap/conf/language/lams/ApplicationResources_en_AU.properties (.../ApplicationResources_en_AU.properties) (revision acc8d2acf5b6b0002e0c8129947040a779ab4077) @@ -2,7 +2,7 @@ #language code: en #locale code: AU - # CVS ID: $Id$ Exported from the LAMS Community by Ernie Ghiglione on Mon Nov 24 01:10:52 GMT 2008 + # CVS ID: $Id$ Exported from the LAMS Community by Ernie Ghiglione on Thu May 14 00:22:06 CST 2009 #=================== labels for Google Maps =================# @@ -112,13 +112,14 @@ admin.gmapKey =Google Maps API Key admin.success =Configuration successfully saved. admin.return =Return to maintain LAMS +label.unsavedMarkers =You have one or more markers on the map without a title, if you continue these markers will not be saved. Do you want to continue anyway? advanced.reflectOnActivity =Add Notebook at end of Gmap with the following instructions: button.continue =Continue monitor.summary.td.addNotebook =Add Notebook at end of Gmap button.placeMarker =Place marker message.alertContentEdit =Warning: One of more learners have accessed this activity. Changing this content will result in learners getting different information. button.fitMarkers =Fit All Markers in Map -label.unsavedMarkers =You have one or more markers on the map without a title, if you continue these markers will not be saved. Do you want to continue anyway? +label.nogroups =No groups found for activity. -#======= End labels: Exported 113 labels for en AU ===== +#======= End labels: Exported 114 labels for en AU ===== Index: lams_tool_gmap/conf/xdoclet/web-settings.xml =================================================================== diff -u -r126d84999e520648cb187e465cb4aaa3baad222e -racc8d2acf5b6b0002e0c8129947040a779ab4077 --- lams_tool_gmap/conf/xdoclet/web-settings.xml (.../web-settings.xml) (revision 126d84999e520648cb187e465cb4aaa3baad222e) +++ lams_tool_gmap/conf/xdoclet/web-settings.xml (.../web-settings.xml) (revision acc8d2acf5b6b0002e0c8129947040a779ab4077) @@ -5,13 +5,17 @@ org.lamsfoundation.lams.tool.gmap.ApplicationResources + + contextClass + org.jboss.spring.factory.VFSXmlWebApplicationContext + contextConfigLocation classpath:/org/lamsfoundation/lams/tool/gmap/dbupdates/autopatchContext.xml locatorFactorySelector - classpath*:/org/lamsfoundation/lams/**/beanRefContext.xml + classpath:/org/lamsfoundation/lams/beanRefContext.xml parentContextKey Index: lams_tool_gmap/src/java/org/lamsfoundation/lams/tool/gmap/web/actions/MonitoringAction.java =================================================================== diff -u -r941ce68be457b4cb4fcf2d830a44a9361f6f5370 -racc8d2acf5b6b0002e0c8129947040a779ab4077 --- lams_tool_gmap/src/java/org/lamsfoundation/lams/tool/gmap/web/actions/MonitoringAction.java (.../MonitoringAction.java) (revision 941ce68be457b4cb4fcf2d830a44a9361f6f5370) +++ lams_tool_gmap/src/java/org/lamsfoundation/lams/tool/gmap/web/actions/MonitoringAction.java (.../MonitoringAction.java) (revision acc8d2acf5b6b0002e0c8129947040a779ab4077) @@ -89,22 +89,25 @@ GmapDTO gmapDT0 = new GmapDTO(gmap); // Adding the markers lists to a map with tool sessions as the key - //Map > sessionMarkersMap = new HashMap >(); - for (GmapSessionDTO sessionDTO : gmapDT0.getSessionDTOs()) { - Long toolSessionID = sessionDTO.getSessionID(); - sessionDTO.setMarkerDTOs(gmapService.getGmapMarkersBySessionId(toolSessionID)); - for (GmapUserDTO userDTO : sessionDTO.getUserDTOs()) { - // get the notebook entry. - NotebookEntry notebookEntry = gmapService.getEntry(toolSessionID, CoreNotebookConstants.NOTEBOOK_TOOL, - GmapConstants.TOOL_SIGNATURE, userDTO.getUserId().intValue()); - if (notebookEntry != null) { - userDTO.setFinishedReflection(true); - //userDTO.setNotebookEntry(notebookEntry.getEntry()); - } else { - userDTO.setFinishedReflection(false); + if (gmapDT0.getSessionDTOs() != null) { + for (GmapSessionDTO sessionDTO : gmapDT0.getSessionDTOs()) { + Long toolSessionID = sessionDTO.getSessionID(); + sessionDTO.setMarkerDTOs(gmapService.getGmapMarkersBySessionId(toolSessionID)); + + for (GmapUserDTO userDTO : sessionDTO.getUserDTOs()) { + // get the notebook entry. + NotebookEntry notebookEntry = gmapService.getEntry(toolSessionID, + CoreNotebookConstants.NOTEBOOK_TOOL, GmapConstants.TOOL_SIGNATURE, userDTO.getUserId() + .intValue()); + if (notebookEntry != null) { + userDTO.setFinishedReflection(true); + //userDTO.setNotebookEntry(notebookEntry.getEntry()); + } else { + userDTO.setFinishedReflection(false); + } + sessionDTO.getUserDTOs().add(userDTO); } - sessionDTO.getUserDTOs().add(userDTO); } } Index: lams_tool_gmap/web/pages/monitoring/summary.jsp =================================================================== diff -u -rcf00c458d8f6d4cef59b8280c3ecfc45db474bee -racc8d2acf5b6b0002e0c8129947040a779ab4077 --- lams_tool_gmap/web/pages/monitoring/summary.jsp (.../summary.jsp) (revision cf00c458d8f6d4cef59b8280c3ecfc45db474bee) +++ lams_tool_gmap/web/pages/monitoring/summary.jsp (.../summary.jsp) (revision acc8d2acf5b6b0002e0c8129947040a779ab4077) @@ -195,7 +195,7 @@ - + Index: lams_tool_images/web/WEB-INF/web.xml =================================================================== diff -u -r126d84999e520648cb187e465cb4aaa3baad222e -racc8d2acf5b6b0002e0c8129947040a779ab4077 --- lams_tool_images/web/WEB-INF/web.xml (.../web.xml) (revision 126d84999e520648cb187e465cb4aaa3baad222e) +++ lams_tool_images/web/WEB-INF/web.xml (.../web.xml) (revision acc8d2acf5b6b0002e0c8129947040a779ab4077) @@ -9,13 +9,18 @@ javax.servlet.jsp.jstl.fmt.localizationContextorg.lamsfoundation.lams.tool.imageGallery.ApplicationResources + + + contextClass + org.jboss.spring.factory.VFSXmlWebApplicationContext + contextConfigLocation classpath:/org/lamsfoundation/lams/tool/imageGallery/dbupdates/autopatchContext.xml locatorFactorySelector - classpath*:/org/lamsfoundation/lams/**/beanRefContext.xml + classpath:/org/lamsfoundation/lams/beanRefContext.xml parentContextKey @@ -213,10 +218,10 @@ - - Secure Content + + Secure Content /* - + LEARNER TEACHER @@ -229,61 +234,61 @@ - - Authoring Update + + Authoring Update /authoring/* - + AUTHOR AUTHOR ADMIN SYSADMIN - - Staff Content + + Staff Content /monitoring.do - + MONITOR TEACHER - - Staff Content + + Staff Content /definelater.do - + MONITOR TEACHER - - Adminstrator Content + + Adminstrator Content /admin.do - + ADMIN - - LAMS System Adminstrator Content + + LAMS System Adminstrator Content /sysadmin.do - + SYSADMIN - - Download Files + + Download Files /download/ - + LEARNER AUTHOR Index: lams_tool_lamc/conf/language/lams/ApplicationResources_ja_JP.properties =================================================================== diff -u -r063e7b6d6e0c516f5ef5c570c543b5fe956f6986 -racc8d2acf5b6b0002e0c8129947040a779ab4077 --- lams_tool_lamc/conf/language/lams/ApplicationResources_ja_JP.properties (.../ApplicationResources_ja_JP.properties) (revision 063e7b6d6e0c516f5ef5c570c543b5fe956f6986) +++ lams_tool_lamc/conf/language/lams/ApplicationResources_ja_JP.properties (.../ApplicationResources_ja_JP.properties) (revision acc8d2acf5b6b0002e0c8129947040a779ab4077) @@ -2,10 +2,13 @@ #language code: ja #locale code: JP - # CVS ID: $Id$ Exported from the LAMS Community by Ernie Ghiglione on Tue Jul 08 08:45:31 BST 2008 + # CVS ID: $Id$ Exported from the LAMS Community by Ernie Ghiglione on Thu Jun 18 01:30:20 CST 2009 #=================== labels for Multiple Choice Questions =================# +monitor.summary.th.advancedSettings =\u9ad8\u5ea6\u306a\u8a2d\u5b9a +label.off =OFF +label.reflect =\u4ee5\u4e0b\u306e\u6307\u793a\u306b\u5f93\u3063\u3066\u3001\u9078\u629e\u554f\u984c\u306e\u5b8c\u4e86\u6642\u306b\u30ce\u30fc\u30c8\u30d6\u30c3\u30af\u3092\u8ffd\u52a0\u3057\u3066\u304f\u3060\u3055\u3044: label.final.attempt =\u6700\u5f8c\u306e\u53d7\u9a13: errors.maxfilesize =\u30a2\u30c3\u30d7\u30ed\u30fc\u30c9\u3055\u308c\u305f\u30d5\u30a1\u30a4\u30eb\u306f\u3001\u6700\u5927\u30d5\u30a1\u30a4\u30eb\u30b5\u30a4\u30ba\u5236\u9650\u306e {0} \u30d0\u30a4\u30c8\u3092\u8d85\u3048\u3066\u3044\u307e\u3059 output.desc.learner.mark =\u5b66\u7fd2\u8005\u306e\u5408\u8a08\u70b9 @@ -20,6 +23,7 @@ label.monitoring.downloadMarks.button =\u8a55\u70b9\u306e\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9 label.monitoring.downloadMarks.username =\u30e6\u30fc\u30b6\u30fc\u540d label.yourAnswers =\u5b66\u7fd2\u8005\u306e\u56de\u7b54: +error.noStudentActivity =\u30ec\u30dd\u30fc\u30c8\u3092\u751f\u6210\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u305b\u3093\u3002\u3069\u306e\u5b66\u7fd2\u8005\u3082\u30a2\u30af\u30c6\u30a3\u30d3\u30c6\u30a3\u3092\u307e\u3060\u5b9f\u884c\u3057\u3066\u3044\u307e\u305b\u3093\u3002 label.learner =\u5b66\u7fd2\u8005 button.try.again =\u518d\u8a66\u884c label.feedback =\u554f\u984c\u306e\u30d5\u30a3\u30fc\u30c9\u30d0\u30c3\u30af: @@ -40,8 +44,6 @@ label.report.title.col =\u30ec\u30dd\u30fc\u30c8\u30bf\u30a4\u30c8\u30eb: label.report.endLearningMessage.col =\u30a2\u30af\u30c6\u30a3\u30d3\u30c6\u30a3\u306e\u7d42\u4e86\u30e1\u30c3\u30bb\u30fc\u30b8: label.continue =\u7d9a\u884c -label.notebook.entries =\u30ce\u30fc\u30c8\u30d6\u30c3\u30af\u30fb\u30a8\u30f3\u30c8\u30ea -label.reflection =\u30ce\u30fc\u30c8\u30d6\u30c3\u30af\u30fb\u30a8\u30f3\u30c8\u30ea label.view.reflection =\u30ce\u30fc\u30c8\u30d6\u30c3\u30af\u306e\u9805\u76ee\u3092\u8868\u793a\u3059\u308b label.close =\u9589\u3058\u308b label.question.marks =\u70b9\u6570 @@ -61,7 +63,6 @@ label.tip.moveCandidateDown =\u9078\u629e\u80a2\u3092\u4e0b\u306b\u79fb\u52d5 label.tip.moveCandidateUp =\u9078\u629e\u80a2\u3092\u4e0a\u306b\u79fb\u52d5 label.upload =\u30a2\u30c3\u30d7\u30ed\u30fc\u30c9 -question.blank =\u4fee\u6b63\u70b9: \u554f\u984c\u6587\u306f\u30d6\u30e9\u30f3\u30af\u306b\u3067\u304d\u307e\u305b\u3093\u3002 question.duplicate =\u4fee\u6b63\u70b9: \u91cd\u8907\u3059\u308b\u9078\u629e\u80a2\u304c\u3042\u308a\u307e\u3059\u3002 questions.none.submitted =\u554f\u984c\u304c\u4e00\u3064\u3082\u3042\u308a\u307e\u305b\u3093\u3002\u5c11\u306a\u304f\u3068\u3082\u554f\u984c\u3092 1 \u3064\u8ffd\u52a0\u3057\u3066\u304f\u3060\u3055\u3044\u3002 label.edit.question =\u554f\u984c\u3092\u7de8\u96c6 @@ -71,7 +72,6 @@ candidates.groupSize.warning =\u4fee\u6b63\u70b9: \u5c11\u306a\u304f\u3068\u3082 2 \u3064\u306e\u9078\u629e\u80a2\u304c\u5fc5\u8981\u3067\u3059\u3002 candidates.unremovable.groupSize =2 \u3064\u4ee5\u4e0a\u306e\u9078\u629e\u80a2\u304c\u5fc5\u8981\u3067\u3042\u308b\u305f\u3081\u3001\u9078\u629e\u80a2\u3092\u524a\u9664\u3067\u304d\u307e\u305b\u3093\u3002 candidates.setFirst =\u6700\u521d\u306e\u9078\u629e\u80a2\u304c\u9078\u629e\u3055\u308c\u305f\u3053\u3068\u3092\u628a\u63e1\u3057\u3066\u304a\u3044\u3066\u304f\u3060\u3055\u3044\u3002 -candidates.blank =\u4fee\u6b63\u70b9: \u9078\u629e\u80a2\u306f\u30d6\u30e9\u30f3\u30af\u306b\u3067\u304d\u307e\u305b\u3093\u3002 answers.submitted.none =\u9001\u4fe1\u3067\u304d\u307e\u305b\u3093\u3002\u5404\u554f\u984c\u306b\u56de\u7b54\u3057\u3066\u304f\u3060\u3055\u3044\u3002 message.no.reflection.available =\u5229\u7528\u3067\u304d\u308b\u30ce\u30fc\u30c8\u304c\u3042\u308a\u307e\u305b\u3093 label.attempt.count =\u53d7\u9a13\u56de\u6570: @@ -110,7 +110,6 @@ label.response =\u56de\u7b54 label.learning.forceOfflineMessage =\u3053\u306e\u30a2\u30af\u30c6\u30a3\u30d3\u30c6\u30a3\u306f\u30b3\u30f3\u30d4\u30e5\u30fc\u30bf\u3067\u5b9f\u884c\u3055\u308c\u3066\u3044\u307e\u305b\u3093\u3002\u8a73\u7d30\u306b\u3064\u3044\u3066\u306f\u5148\u751f\u306b\u805e\u3044\u3066\u304f\u3060\u3055\u3044\u3002 error.defineLater =\u5148\u751f\u304c\u3053\u306e\u30a2\u30af\u30c6\u30a3\u30d3\u30c6\u30a3\u306e\u5185\u5bb9\u3092\u5b8c\u6210\u3055\u305b\u308b\u307e\u3067\u3001\u304a\u5f85\u3061\u304f\u3060\u3055\u3044\u3002 -error.noStudentActivity =\u30ec\u30dd\u30fc\u30c8\u3092\u751f\u6210\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u305b\u3093\u3002\u5b66\u7fd2\u8005\u306f\u307e\u3060\u30a2\u30af\u30c6\u30a3\u30d3\u30c6\u30a3\u3092\u5b9f\u884c\u3057\u3066\u3044\u307e\u305b\u3093\u3002 group.label =\u30b0\u30eb\u30fc\u30d7 button.summary =\u6982\u8981 button.editActivity =\u7de8\u96c6 @@ -254,7 +253,14 @@ label.mcqSummary =\u9078\u629e\u554f\u984c\u306e\u6982\u8981 label.displayAnswers =\u6700\u5f8c\u306e\u554f\u306b\u56de\u7b54\u3057\u305f\u5f8c\u306b\u3001\u6b63\u89e3\u3068\u5f97\u70b9\u3092\u8868\u793a\u3057\u307e\u3059\u3002 label.showMarks =\u6700\u9ad8\u70b9\u3068\u5e73\u5747\u70b9\u3092\u8868\u793a\u3059\u308b -label.reflect =\u4ee5\u4e0b\u306e\u6307\u793a\u306b\u5f93\u3063\u3066\u3001\u9078\u629e\u554f\u984c\u306e\u5b8c\u4e86\u6642\u306b\u30ce\u30fc\u30c8\u3092\u8ffd\u52a0\u3057\u3066\u304f\u3060\u3055\u3044: +monitor.summary.td.notebookInstructions =\u30ce\u30fc\u30c8\u30d6\u30c3\u30af\u306e\u6307\u793a +label.notebook.entries =\u30ce\u30fc\u30c8\u30d6\u30c3\u30af\u30fb\u30a8\u30f3\u30c8\u30ea +label.reflection =\u30ce\u30fc\u30c8\u30d6\u30c3\u30af\u30fb\u30a8\u30f3\u30c8\u30ea +monitor.summary.td.addNotebook =\u9078\u629e\u554f\u984c\u306e\u5b8c\u4e86\u6642\u306b\u30ce\u30fc\u30c8\u30d6\u30c3\u30af\u3092\u8ffd\u52a0\u3057\u3066\u304f\u3060\u3055\u3044 +label.on =\u30aa\u30f3 +candidates.blank =\u4fee\u6b63\u70b9: \u9078\u629e\u80a2\u306f\u7a7a\u6b04\u306b\u3067\u304d\u307e\u305b\u3093\u3002 +question.blank =\u4fee\u6b63\u70b9: \u554f\u984c\u6587\u306f\u7a7a\u6b04\u306b\u3067\u304d\u307e\u305b\u3093\u3002 +error.pedagogical.planner.empty.answer.selected =\u554f\u984c {0} \u3067\u306e\u6b63\u89e3\u306f\u7a7a\u6b04\u306b\u3067\u304d\u307e\u305b\u3093\u3002 -#======= End labels: Exported 249 labels for ja JP ===== +#======= End labels: Exported 255 labels for ja JP ===== Index: lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/service/MCOutputFactory.java =================================================================== diff -u -r6afc94420f7d7de30f01461b904f7a99a630fc37 -racc8d2acf5b6b0002e0c8129947040a779ab4077 --- lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/service/MCOutputFactory.java (.../MCOutputFactory.java) (revision 6afc94420f7d7de30f01461b904f7a99a630fc37) +++ lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/service/MCOutputFactory.java (.../MCOutputFactory.java) (revision acc8d2acf5b6b0002e0c8129947040a779ab4077) @@ -23,11 +23,8 @@ /* $Id$ */ package org.lamsfoundation.lams.tool.mc.service; -import java.util.ArrayList; -import java.util.HashMap; import java.util.Iterator; import java.util.List; -import java.util.Map; import java.util.SortedMap; import java.util.TreeMap; @@ -40,140 +37,140 @@ import org.lamsfoundation.lams.tool.mc.pojos.McQueUsr; import org.lamsfoundation.lams.tool.mc.pojos.McSession; import org.lamsfoundation.lams.tool.mc.pojos.McUsrAttempt; -import org.lamsfoundation.lams.tool.mc.web.LearningUtil; public class MCOutputFactory extends OutputFactory { - protected static final String OUTPUT_NAME_LEARNER_MARK = "learner.mark"; - protected static final String OUTPUT_NAME_LEARNER_ALL_CORRECT = "learner.all.correct"; - - /** - * @see org.lamsfoundation.lams.tool.OutputDefinitionFactory#getToolOutputDefinitions(java.lang.Object) - */ - public SortedMap getToolOutputDefinitions(Object toolContentObject) { - - TreeMap definitionMap = new TreeMap(); - ToolOutputDefinition definition = buildBooleanOutputDefinition(OUTPUT_NAME_LEARNER_ALL_CORRECT); - definitionMap.put(OUTPUT_NAME_LEARNER_ALL_CORRECT, definition); + protected static final String OUTPUT_NAME_LEARNER_MARK = "learner.mark"; + protected static final String OUTPUT_NAME_LEARNER_ALL_CORRECT = "learner.all.correct"; - if ( toolContentObject != null ) { - McContent content = (McContent) toolContentObject; - - definition = buildRangeDefinition(OUTPUT_NAME_LEARNER_MARK, - new Long(0), - new Long ( content.getTotalMarksPossible().longValue() ) ); - definitionMap.put(OUTPUT_NAME_LEARNER_MARK, definition); - } else { - log.error("Unable to build content based output definitions for Multiple Choice as no tool content object supplied. Only including the definitions that do not need any content."); - } + /** + * @see org.lamsfoundation.lams.tool.OutputDefinitionFactory#getToolOutputDefinitions(java.lang.Object) + */ + public SortedMap getToolOutputDefinitions(Object toolContentObject) { - return definitionMap; + TreeMap definitionMap = new TreeMap(); + ToolOutputDefinition definition = buildBooleanOutputDefinition(OUTPUT_NAME_LEARNER_ALL_CORRECT); + definitionMap.put(OUTPUT_NAME_LEARNER_ALL_CORRECT, definition); + + if (toolContentObject != null) { + McContent content = (McContent) toolContentObject; + + definition = buildRangeDefinition(OUTPUT_NAME_LEARNER_MARK, new Long(0), new Long(content + .getTotalMarksPossible().longValue()), true); + definitionMap.put(OUTPUT_NAME_LEARNER_MARK, definition); + } else { + log + .error("Unable to build content based output definitions for Multiple Choice as no tool content object supplied. Only including the definitions that do not need any content."); } - public SortedMap getToolOutput(List names, IMcService mcService, Long toolSessionId, Long learnerId) { - - TreeMap output = new TreeMap(); + return definitionMap; + } - McSession session = mcService.findMcSessionById(toolSessionId); - if ( session != null ) { + public SortedMap getToolOutput(List names, IMcService mcService, Long toolSessionId, + Long learnerId) { - McQueUsr queUser = mcService.getMcUserBySession(learnerId, session.getUid()); - if ( queUser != null ) { - - if ( names == null || names.contains(OUTPUT_NAME_LEARNER_MARK) ) { - output.put(OUTPUT_NAME_LEARNER_MARK, getLearnerMark(queUser) ); - } - if ( names == null || names.contains(OUTPUT_NAME_LEARNER_ALL_CORRECT) ) { - output.put(OUTPUT_NAME_LEARNER_ALL_CORRECT, getLearnerAllCorrect(mcService, queUser) ); - } - } - } - - return output; - } + TreeMap output = new TreeMap(); - public ToolOutput getToolOutput(String name, IMcService mcService, Long toolSessionId, Long learnerId) { - if ( name != null ) { - McSession session = mcService.findMcSessionById(toolSessionId); - if ( session != null ) { - McQueUsr queUser = mcService.getMcUserBySession(learnerId, session.getUid()); - - if ( queUser != null ) { - if ( name.equals(OUTPUT_NAME_LEARNER_MARK) ) { - return getLearnerMark(queUser); - } else if ( name.equals(OUTPUT_NAME_LEARNER_ALL_CORRECT) ){ - return getLearnerAllCorrect(mcService, queUser); - } - } - } + McSession session = mcService.findMcSessionById(toolSessionId); + if (session != null) { + + McQueUsr queUser = mcService.getMcUserBySession(learnerId, session.getUid()); + if (queUser != null) { + + if (names == null || names.contains(OUTPUT_NAME_LEARNER_MARK)) { + output.put(OUTPUT_NAME_LEARNER_MARK, getLearnerMark(queUser)); } - return null; + if (names == null || names.contains(OUTPUT_NAME_LEARNER_ALL_CORRECT)) { + output.put(OUTPUT_NAME_LEARNER_ALL_CORRECT, getLearnerAllCorrect(mcService, queUser)); + } + } } - /** - * Get the mark for a specific user. This gets the mark associated with the last attempt. - * Will always return a ToolOutput object. - */ - private ToolOutput getLearnerMark(McQueUsr queUser) { - Long mark; - if (queUser != null && queUser.getLastAttemptTotalMark() != null) { - mark = queUser.getLastAttemptTotalMark().longValue(); - } else { - mark = new Long(0); + return output; + } + + public ToolOutput getToolOutput(String name, IMcService mcService, Long toolSessionId, Long learnerId) { + if (name != null) { + McSession session = mcService.findMcSessionById(toolSessionId); + if (session != null) { + McQueUsr queUser = mcService.getMcUserBySession(learnerId, session.getUid()); + + if (queUser != null) { + if (name.equals(OUTPUT_NAME_LEARNER_MARK)) { + return getLearnerMark(queUser); + } else if (name.equals(OUTPUT_NAME_LEARNER_ALL_CORRECT)) { + return getLearnerAllCorrect(mcService, queUser); + } } - return new ToolOutput(MCOutputFactory.OUTPUT_NAME_LEARNER_MARK, - getI18NText(MCOutputFactory.OUTPUT_NAME_LEARNER_MARK, true), mark); + } } + return null; + } - /** - * Did the user get the questions all correct. This checks the answers associated with the last attempt. - * Assumes all correct if the mark is equal to the maximum possible mark. - * Will always return a ToolOutput object. - */ - private ToolOutput getLearnerAllCorrect(IMcService mcService, McQueUsr queUser) { - boolean allCorrect = allQuestionsCorrect(mcService, queUser); - return new ToolOutput(MCOutputFactory.OUTPUT_NAME_LEARNER_ALL_CORRECT, - getI18NText(MCOutputFactory.OUTPUT_NAME_LEARNER_ALL_CORRECT, true), allCorrect); + /** + * Get the mark for a specific user. This gets the mark associated with the + * last attempt. Will always return a ToolOutput object. + */ + private ToolOutput getLearnerMark(McQueUsr queUser) { + Long mark; + if (queUser != null && queUser.getLastAttemptTotalMark() != null) { + mark = queUser.getLastAttemptTotalMark().longValue(); + } else { + mark = new Long(0); } + return new ToolOutput(MCOutputFactory.OUTPUT_NAME_LEARNER_MARK, getI18NText( + MCOutputFactory.OUTPUT_NAME_LEARNER_MARK, true), mark); + } - // written to cope with more than one correct option for each question but only tested with - // one correct option for a question. + /** + * Did the user get the questions all correct. This checks the answers + * associated with the last attempt. Assumes all correct if the mark is + * equal to the maximum possible mark. Will always return a ToolOutput + * object. + */ + private ToolOutput getLearnerAllCorrect(IMcService mcService, McQueUsr queUser) { + boolean allCorrect = allQuestionsCorrect(mcService, queUser); + return new ToolOutput(MCOutputFactory.OUTPUT_NAME_LEARNER_ALL_CORRECT, getI18NText( + MCOutputFactory.OUTPUT_NAME_LEARNER_ALL_CORRECT, true), allCorrect); + } + + // written to cope with more than one correct option for each question but only tested with + // one correct option for a question. private boolean allQuestionsCorrect(IMcService mcService, McQueUsr queUser) { - // Build a list of all the correct answers. If we hit any options that are not a correct option - // we can abort as we know there is a wrong answer. - // Otherwise count the number of correct options overall (for comparison later). - long correctlearnerOptions = 0; - List latestAttempts = (List) mcService.getLatestAttemptsForAUser(queUser.getUid()); - for ( McUsrAttempt mcUsrAttempt : latestAttempts ) { - McOptsContent mcOptsContent = mcUsrAttempt.getMcOptionsContent(); - if ( ! mcOptsContent.isCorrectOption() ) { - // wrong answer so no point going any further - return false; - } else { - correctlearnerOptions++; - } - } + // Build a list of all the correct answers. If we hit any options that are not a correct option + // we can abort as we know there is a wrong answer. + // Otherwise count the number of correct options overall (for comparison later). + long correctlearnerOptions = 0; + List latestAttempts = (List) mcService.getLatestAttemptsForAUser(queUser.getUid()); + for (McUsrAttempt mcUsrAttempt : latestAttempts) { + McOptsContent mcOptsContent = mcUsrAttempt.getMcOptionsContent(); + if (!mcOptsContent.isCorrectOption()) { + // wrong answer so no point going any further + return false; + } else { + correctlearnerOptions++; + } + } - // now count the overall number of correct options - long correctOptions = 0; - McContent mcContent = queUser.getMcSession().getMcContent(); - Iterator questionIterator = mcContent.getMcQueContents().iterator(); - while (questionIterator.hasNext()) - { - McQueContent mcQueContent = (McQueContent) questionIterator.next(); - Iterator optionIterator = mcQueContent.getMcOptionsContents().iterator(); - while ( optionIterator.hasNext() ) { - McOptsContent mcOptsContent = (McOptsContent) optionIterator.next(); - if ( mcOptsContent.isCorrectOption() ) { - correctOptions++; - } - } - } + // now count the overall number of correct options + long correctOptions = 0; + McContent mcContent = queUser.getMcSession().getMcContent(); + Iterator questionIterator = mcContent.getMcQueContents().iterator(); + while (questionIterator.hasNext()) { + McQueContent mcQueContent = (McQueContent) questionIterator.next(); + Iterator optionIterator = mcQueContent.getMcOptionsContents().iterator(); + while (optionIterator.hasNext()) { + McOptsContent mcOptsContent = (McOptsContent) optionIterator.next(); + if (mcOptsContent.isCorrectOption()) { + correctOptions++; + } + } + } - // We know the user didn't get everything wrong, but did they answer enough options correctly? - // This case is used when there is more than one correct option for each answer. Simple way, compare counts! - return correctOptions == correctlearnerOptions; + // We know the user didn't get everything wrong, but did they answer enough options correctly? + // This case is used when there is more than one correct option for each answer. Simple way, compare counts! + return correctOptions == correctlearnerOptions; } } Index: lams_tool_lamc/web/WEB-INF/web.xml =================================================================== diff -u -r126d84999e520648cb187e465cb4aaa3baad222e -racc8d2acf5b6b0002e0c8129947040a779ab4077 --- lams_tool_lamc/web/WEB-INF/web.xml (.../web.xml) (revision 126d84999e520648cb187e465cb4aaa3baad222e) +++ lams_tool_lamc/web/WEB-INF/web.xml (.../web.xml) (revision acc8d2acf5b6b0002e0c8129947040a779ab4077) @@ -6,13 +6,17 @@ org.lamsfoundation.lams.tool.mc.ApplicationResources + + contextClass + org.jboss.spring.factory.VFSXmlWebApplicationContext + contextConfigLocation classpath:/org/lamsfoundation/lams/tool/mc/dbupdates/autopatchContext.xml locatorFactorySelector - classpath*:/org/lamsfoundation/lams/**/beanRefContext.xml + classpath:/org/lamsfoundation/lams/beanRefContext.xml parentContextKey Index: lams_tool_laqa/conf/hibernate/mappings/org/lamsfoundation/lams/tool/qa/QaContent.hbm.xml =================================================================== diff -u -r33f9171c071c179459972380a9b732f1aeec87bf -racc8d2acf5b6b0002e0c8129947040a779ab4077 --- lams_tool_laqa/conf/hibernate/mappings/org/lamsfoundation/lams/tool/qa/QaContent.hbm.xml (.../QaContent.hbm.xml) (revision 33f9171c071c179459972380a9b732f1aeec87bf) +++ lams_tool_laqa/conf/hibernate/mappings/org/lamsfoundation/lams/tool/qa/QaContent.hbm.xml (.../QaContent.hbm.xml) (revision acc8d2acf5b6b0002e0c8129947040a779ab4077) @@ -138,7 +138,13 @@ length="1" /> - + conditions) { + Set qaSessions, Set qaUploadedFiles, Set conditions, boolean allowRichEditor) { this.qaContentId = qaContentId; this.content = content; this.title = title; @@ -164,6 +166,7 @@ this.qaSessions = qaSessions; this.qaUploadedFiles = qaUploadedFiles; this.conditions = conditions; + this.allowRichEditor = allowRichEditor; QaContent.logger.debug(QaContent.logger + " " + this.getClass().getName() + "in full constructor: QaContent()"); } @@ -186,7 +189,7 @@ .isQuestionsSequenced(), qa.isUsernameVisible(), qa.isSynchInMonitor(), qa.isLockWhenFinished(), qa .isContentLocked(), qa.isShowOtherAnswers(), qa.isReflect(), qa.getReflectionSubject(), qa .getCreationDate(), qa.getUpdateDate(), new TreeSet(), new TreeSet(), new TreeSet(), - new TreeSet(new TextSearchConditionComparator())); + new TreeSet(new TextSearchConditionComparator()), qa.isAllowRichEditor()); newContent.setQaQueContents(qa.deepCopyQaQueContent(newContent)); @@ -628,7 +631,16 @@ public void setLockWhenFinished(boolean lockWhenFinished) { this.lockWhenFinished = lockWhenFinished; } + + + public boolean isAllowRichEditor() { + return allowRichEditor; + } + public void setAllowRichEditor(boolean allowRichEditor) { + this.allowRichEditor = allowRichEditor; + } + /** * @return Returns the showOtherAnswers. */ Index: lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/QaGeneralAuthoringDTO.java =================================================================== diff -u -rc527318c8c79f72151f6261342c5cc1a830d1e4d -racc8d2acf5b6b0002e0c8129947040a779ab4077 --- lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/QaGeneralAuthoringDTO.java (.../QaGeneralAuthoringDTO.java) (revision c527318c8c79f72151f6261342c5cc1a830d1e4d) +++ lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/QaGeneralAuthoringDTO.java (.../QaGeneralAuthoringDTO.java) (revision acc8d2acf5b6b0002e0c8129947040a779ab4077) @@ -59,6 +59,7 @@ protected String lockWhenFinished; protected String editActivityEditMode; protected String reflectionSubject; + protected Boolean allowRichEditor; protected String monitoredContentInUse; @@ -600,4 +601,14 @@ public void setShowOtherAnswers(String showOtherAnswers) { this.showOtherAnswers = showOtherAnswers; } + + public Boolean getAllowRichEditor() { + return allowRichEditor; + } + + public void setAllowRichEditor(Boolean allowRichEditor) { + this.allowRichEditor = allowRichEditor; + } + + } Index: lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/dao/hibernate/QaQueUsrDAO.java =================================================================== diff -u -r328cd4dbe60d9e5c588e13cc16b7e7414893b0af -racc8d2acf5b6b0002e0c8129947040a779ab4077 --- lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/dao/hibernate/QaQueUsrDAO.java (.../QaQueUsrDAO.java) (revision 328cd4dbe60d9e5c588e13cc16b7e7414893b0af) +++ lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/dao/hibernate/QaQueUsrDAO.java (.../QaQueUsrDAO.java) (revision acc8d2acf5b6b0002e0c8129947040a779ab4077) @@ -38,8 +38,8 @@ /** * @author Ozgur Demirtas * - * TODO To change the template for this generated type comment go to Window - - * Preferences - Java - Code Style - Code Templates + * TODO To change the template for this generated type comment go to Window - Preferences - Java - Code Style - Code + * Templates */ public class QaQueUsrDAO extends HibernateDaoSupport implements IQaQueUsrDAO { @@ -51,14 +51,15 @@ private static final String GET_USER_COUNT_FOR_CONTENT = "select count(*) from QaQueUsr quser, QaSession qses, QaQueContent qcon where " + "quser.qaSession=qses and " + "qses.qaContent=qcon and " + "qcon.uid=:uid"; - // select count(*) from tl_laqa11_que_usr quser, tl_laqa11_session qses where quser.qa_session_id=qses.uid and qses.qa_content_id=5378; + // select count(*) from tl_laqa11_que_usr quser, tl_laqa11_session qses where quser.qa_session_id=qses.uid and + // qses.qa_content_id=5378; public QaQueUsr getQaUserByUID(Long uid) { return (QaQueUsr) this.getHibernateTemplate().get(QaQueUsr.class, uid); } public int countSessionUser(QaSession qaSession) { - return (getHibernateTemplate().findByNamedParam(COUNT_SESSION_USER, "qaSession", qaSession)).size(); + return getHibernateTemplate().findByNamedParam(QaQueUsrDAO.COUNT_SESSION_USER, "qaSession", qaSession).size(); } public QaQueUsr getQaQueUsrById(long qaQueUsrId) { @@ -90,7 +91,7 @@ public List getUserBySessionOnly(final QaSession qaSession) { HibernateTemplate templ = this.getHibernateTemplate(); - List list = getSession().createQuery(LOAD_USER_FOR_SESSION).setLong("qaSessionId", + List list = getSession().createQuery(QaQueUsrDAO.LOAD_USER_FOR_SESSION).setLong("qaSessionId", qaSession.getUid().longValue()).list(); return list; } @@ -118,13 +119,14 @@ int returnInt = 0; if (qa != null && qa.getUid() != null) { - List result = getSession().createQuery(GET_USER_COUNT_FOR_CONTENT).setLong("uid", qa.getUid()).list(); - Integer resultInt = (result.get(0) != null) ? (Integer) result.get(0) : new Integer(0); - returnInt = resultInt.intValue(); + List result = getSession().createQuery(QaQueUsrDAO.GET_USER_COUNT_FOR_CONTENT).setLong("uid", qa.getUid()) + .list(); + Long resultLong = result.get(0) != null ? (Long) result.get(0) : new Long(0); + returnInt = resultLong.intValue(); } else { - logger.error("Attempt to count users from null content"); + QaQueUsrDAO.logger.error("Attempt to count users from null content"); } - return returnInt; + return returnInt; } } \ No newline at end of file Index: lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/dbupdates/patch20081126_updateFrom22.sql =================================================================== diff -u -r05db875c7974d705f89231416ff6dfe91a5e70f1 -racc8d2acf5b6b0002e0c8129947040a779ab4077 --- lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/dbupdates/patch20081126_updateFrom22.sql (.../patch20081126_updateFrom22.sql) (revision 05db875c7974d705f89231416ff6dfe91a5e70f1) +++ lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/dbupdates/patch20081126_updateFrom22.sql (.../patch20081126_updateFrom22.sql) (revision acc8d2acf5b6b0002e0c8129947040a779ab4077) @@ -7,6 +7,8 @@ UPDATE lams_tool SET pedagogical_planner_url='tool/laqa11/pedagogicalPlanner.do' WHERE tool_signature='laqa11'; +alter table tl_laqa11_content add column allow_rich_editor TINYINT(1) NOT NULL DEFAULT 0; + ----------------------Put all sql statements above here------------------------- -- If there were no errors, commit and restore autocommit to on Index: lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/AuthoringUtil.java =================================================================== diff -u -r328cd4dbe60d9e5c588e13cc16b7e7414893b0af -racc8d2acf5b6b0002e0c8129947040a779ab4077 --- lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/AuthoringUtil.java (.../AuthoringUtil.java) (revision 328cd4dbe60d9e5c588e13cc16b7e7414893b0af) +++ lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/AuthoringUtil.java (.../AuthoringUtil.java) (revision acc8d2acf5b6b0002e0c8129947040a779ab4077) @@ -49,6 +49,7 @@ import org.lamsfoundation.lams.tool.qa.util.QaQueContentComparator; import org.lamsfoundation.lams.tool.qa.util.QaQuestionContentDTOComparator; import org.lamsfoundation.lams.usermanagement.dto.UserDTO; +import org.lamsfoundation.lams.util.WebUtil; import org.lamsfoundation.lams.web.session.SessionManager; import org.lamsfoundation.lams.web.util.AttributeNames; @@ -349,6 +350,9 @@ String questionsSequenced = request.getParameter(QaAppConstants.QUESTIONS_SEQUENCED); String lockWhenFinished = request.getParameter("lockWhenFinished"); + + String allowRichEditor = request.getParameter("allowRichEditor"); + String richTextOfflineInstructions = request.getParameter(QaAppConstants.OFFLINE_INSTRUCTIONS); String richTextOnlineInstructions = request.getParameter(QaAppConstants.ONLINE_INSTRUCTIONS); @@ -370,6 +374,7 @@ boolean usernameVisibleBoolean = false; boolean showOtherAnswersBoolean = false; boolean reflectBoolean = false; + boolean allowRichEditorBoolean = false; if (questionsSequenced != null && questionsSequenced.equalsIgnoreCase("1")) { questionsSequencedBoolean = true; @@ -390,6 +395,10 @@ if (showOtherAnswers != null && showOtherAnswers.equalsIgnoreCase("1")) { showOtherAnswersBoolean = true; } + + if (allowRichEditor != null && allowRichEditor.equalsIgnoreCase("1")) { + allowRichEditorBoolean = true; + } if (reflect != null && reflect.equalsIgnoreCase("1")) { reflectBoolean = true; @@ -431,6 +440,7 @@ qaContent.setSynchInMonitor(synchInMonitorBoolean); qaContent.setReflect(reflectBoolean); qaContent.setReflectionSubject(reflectionSubject); + qaContent.setAllowRichEditor(allowRichEditorBoolean); } Index: lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/QaAuthoringForm.java =================================================================== diff -u -rc527318c8c79f72151f6261342c5cc1a830d1e4d -racc8d2acf5b6b0002e0c8129947040a779ab4077 --- lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/QaAuthoringForm.java (.../QaAuthoringForm.java) (revision c527318c8c79f72151f6261342c5cc1a830d1e4d) +++ lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/QaAuthoringForm.java (.../QaAuthoringForm.java) (revision acc8d2acf5b6b0002e0c8129947040a779ab4077) @@ -97,6 +97,8 @@ protected String defaultContentIdStr; protected Map mapQuestionContent; protected IQaService qaService; + + protected boolean allowRichEditor; public void resetUserAction() { this.addContent = null; @@ -112,6 +114,7 @@ this.editActivityMonitoring = null; this.statsMonitoring = null; this.edit = null; + this.allowRichEditor = false; } public void reset() { @@ -143,6 +146,7 @@ this.questionsSequenced = null; this.lockWhenFinished = null; this.reflect = null; + this.allowRichEditor = false; this.summaryMonitoring = null; this.instructionsMonitoring = null; @@ -159,6 +163,7 @@ this.questionsSequenced = OPTION_OFF; this.lockWhenFinished = OPTION_OFF; this.reflect = OPTION_OFF; + this.allowRichEditor = false; } public String toString() { @@ -878,4 +883,12 @@ public void setShowOtherAnswers(String showOtherAnswers) { this.showOtherAnswers = showOtherAnswers; } + + public boolean isAllowRichEditor() { + return allowRichEditor; + } + + public void setAllowRichEditor(boolean allowRichEditor) { + this.allowRichEditor = allowRichEditor; + } } Index: lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/QaLearningAction.java =================================================================== diff -u -r328cd4dbe60d9e5c588e13cc16b7e7414893b0af -racc8d2acf5b6b0002e0c8129947040a779ab4077 --- lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/QaLearningAction.java (.../QaLearningAction.java) (revision 328cd4dbe60d9e5c588e13cc16b7e7414893b0af) +++ lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/QaLearningAction.java (.../QaLearningAction.java) (revision acc8d2acf5b6b0002e0c8129947040a779ab4077) @@ -230,6 +230,9 @@ boolean lockWhenFinished = qaContent.isLockWhenFinished(); generalLearnerFlowDTO.setLockWhenFinished(new Boolean(lockWhenFinished).toString()); + + boolean allowRichEditor = qaContent.isAllowRichEditor(); + generalLearnerFlowDTO.setAllowRichEditor(new Boolean(allowRichEditor).toString()); boolean showOtherAnswers = qaContent.isShowOtherAnswers(); generalLearnerFlowDTO.setShowOtherAnswers(new Boolean(showOtherAnswers).toString()); @@ -311,6 +314,9 @@ generalLearnerFlowDTO.setUserNameVisible(new Boolean(qaContent.isUsernameVisible()).toString()); generalLearnerFlowDTO.setShowOtherAnswers(new Boolean(qaContent.isShowOtherAnswers()).toString()); + + boolean allowRichEditor = qaContent.isAllowRichEditor(); + generalLearnerFlowDTO.setAllowRichEditor(new Boolean(allowRichEditor).toString()); /* * Learning mode requires this setting for jsp to generate the user's report @@ -526,6 +532,9 @@ boolean lockWhenFinished = qaContent.isLockWhenFinished(); generalLearnerFlowDTO.setLockWhenFinished(new Boolean(lockWhenFinished).toString()); + + boolean allowRichEditor = qaContent.isAllowRichEditor(); + generalLearnerFlowDTO.setAllowRichEditor(new Boolean(allowRichEditor).toString()); HttpSession ss = SessionManager.getSession(); /* get back login user DTO */ @@ -642,6 +651,9 @@ boolean lockWhenFinished = qaContent.isLockWhenFinished(); generalLearnerFlowDTO.setLockWhenFinished(new Boolean(lockWhenFinished).toString()); + + boolean allowRichEditor = qaContent.isAllowRichEditor(); + generalLearnerFlowDTO.setAllowRichEditor(new Boolean(allowRichEditor).toString()); HttpSession ss = SessionManager.getSession(); /* get back login user DTO */ @@ -995,6 +1007,9 @@ boolean lockWhenFinished = qaContent.isLockWhenFinished(); generalLearnerFlowDTO.setLockWhenFinished(new Boolean(lockWhenFinished).toString()); + + boolean allowRichEditor = qaContent.isAllowRichEditor(); + generalLearnerFlowDTO.setAllowRichEditor(new Boolean(allowRichEditor).toString()); NotebookEntry notebookEntry = qaService.getEntry(new Long(toolSessionID), CoreNotebookConstants.NOTEBOOK_TOOL, MY_SIGNATURE, new Integer(userID)); Index: lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/QaLearningStarterAction.java =================================================================== diff -u -r328cd4dbe60d9e5c588e13cc16b7e7414893b0af -racc8d2acf5b6b0002e0c8129947040a779ab4077 --- lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/QaLearningStarterAction.java (.../QaLearningStarterAction.java) (revision 328cd4dbe60d9e5c588e13cc16b7e7414893b0af) +++ lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/QaLearningStarterAction.java (.../QaLearningStarterAction.java) (revision acc8d2acf5b6b0002e0c8129947040a779ab4077) @@ -435,9 +435,13 @@ boolean lockWhenFinished = qaContent.isLockWhenFinished(); logger.debug("lockWhenFinished: " + lockWhenFinished); + boolean allowRichEditor = qaContent.isAllowRichEditor(); + generalLearnerFlowDTO.setAllowRichEditor(new Boolean(allowRichEditor).toString()); + String sessionStatus = qaSession.getSession_status(); logger.debug("sessionStatus: " + sessionStatus); + if (userID != null) { QaQueUsr qaQueUsr = qaService.getQaUserBySession(new Long(userID), qaSession.getUid()); Index: lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/QaStarterAction.java =================================================================== diff -u -r328cd4dbe60d9e5c588e13cc16b7e7414893b0af -racc8d2acf5b6b0002e0c8129947040a779ab4077 --- lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/QaStarterAction.java (.../QaStarterAction.java) (revision 328cd4dbe60d9e5c588e13cc16b7e7414893b0af) +++ lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/QaStarterAction.java (.../QaStarterAction.java) (revision acc8d2acf5b6b0002e0c8129947040a779ab4077) @@ -359,7 +359,9 @@ SortedSet conditionList = getQaConditionList(sessionMap); conditionList.clear(); conditionList.addAll(qaContent.getConditions()); - + + qaGeneralAuthoringDTO.setAllowRichEditor(qaContent.isAllowRichEditor()); + qaAuthoringForm.setAllowRichEditor(qaContent.isAllowRichEditor()); sessionMap.put(QaAppConstants.ATTR_QA_AUTHORING_FORM, qaAuthoringForm); Index: lams_tool_laqa/web/WEB-INF/web.xml =================================================================== diff -u -r126d84999e520648cb187e465cb4aaa3baad222e -racc8d2acf5b6b0002e0c8129947040a779ab4077 --- lams_tool_laqa/web/WEB-INF/web.xml (.../web.xml) (revision 126d84999e520648cb187e465cb4aaa3baad222e) +++ lams_tool_laqa/web/WEB-INF/web.xml (.../web.xml) (revision acc8d2acf5b6b0002e0c8129947040a779ab4077) @@ -6,14 +6,18 @@ javax.servlet.jsp.jstl.fmt.localizationContext org.lamsfoundation.lams.tool.qa.ApplicationResources - + + + contextClass + org.jboss.spring.factory.VFSXmlWebApplicationContext + contextConfigLocation classpath:/org/lamsfoundation/lams/tool/qa/dbupdates/autopatchContext.xml locatorFactorySelector - classpath*:/org/lamsfoundation/lams/**/beanRefContext.xml + classpath:/org/lamsfoundation/lams/beanRefContext.xml parentContextKey Index: lams_tool_laqa/web/authoring/AdvancedContent.jsp =================================================================== diff -u -r1c37dbd473cc5cb2e200de97fb96eb4c5535ca7e -racc8d2acf5b6b0002e0c8129947040a779ab4077 --- lams_tool_laqa/web/authoring/AdvancedContent.jsp (.../AdvancedContent.jsp) (revision 1c37dbd473cc5cb2e200de97fb96eb4c5535ca7e) +++ lams_tool_laqa/web/authoring/AdvancedContent.jsp (.../AdvancedContent.jsp) (revision acc8d2acf5b6b0002e0c8129947040a779ab4077) @@ -86,11 +86,18 @@

    +

    + + + +

    - Index: lams_tool_laqa/web/authoring/addCondition.jsp =================================================================== diff -u -r0af4ed13b963a588f3499b080801863d57f8ad95 -racc8d2acf5b6b0002e0c8129947040a779ab4077 --- lams_tool_laqa/web/authoring/addCondition.jsp (.../addCondition.jsp) (revision 0af4ed13b963a588f3499b080801863d57f8ad95) +++ lams_tool_laqa/web/authoring/addCondition.jsp (.../addCondition.jsp) (revision acc8d2acf5b6b0002e0c8129947040a779ab4077) @@ -38,9 +38,9 @@ - - Index: lams_tool_laqa/web/authoring/newQuestionBox.jsp =================================================================== diff -u -r194d8a673fc1b8879a57d47ffb81e13823e93ff3 -racc8d2acf5b6b0002e0c8129947040a779ab4077 --- lams_tool_laqa/web/authoring/newQuestionBox.jsp (.../newQuestionBox.jsp) (revision 194d8a673fc1b8879a57d47ffb81e13823e93ff3) +++ lams_tool_laqa/web/authoring/newQuestionBox.jsp (.../newQuestionBox.jsp) (revision acc8d2acf5b6b0002e0c8129947040a779ab4077) @@ -23,193 +23,193 @@ <%@ include file="/common/taglibs.jsp"%> - - <%@ include file="/common/header.jsp"%> - <%@ include file="/includes/jsp/qaWizardCommon.jsp"%> - - - - + - - - + var heightOffSet = 0; + $(document).ready(function() { + $("a#gwizard").click(function() { + $("div.wizard").toggle(); + + if (heightOffSet == 0) + { + heightOffSet = document.getElementById('wizardDiv').offsetHeight; + } + window.top.resizeIframe(heightOffSet,0); + heightOffSet = heightOffSet * -1; + }); + }); + + // Inserts the question template into the new question fckeditor area + function useQuestionTemplate(aMenu) { + if (aMenu.selectedIndex > 0) { + var obj = document.getElementById("newQuestion"); + obj.value += aMenu.options[aMenu.selectedIndex].text; + var oEditor = FCKeditorAPI.GetInstance("newQuestion"); + oEditor.InsertHtml(aMenu.options[aMenu.selectedIndex].text); + } + } + + + + function setUpTripleMenu() {} + + + + + + - - - - - - - - - - - - - - - -
    No groups found for lesson.
    - - - - - - - - - - - - - -
    -
    -
    -
    -
    - - - - - -
    - - - - - -
    - - + + + + + + + + + + + + + + + + + -
    - -
    +
    + +
    - + -
    - -
    - - - - - - - - - -
    - +
    + +
    + + + + + + + + + +
    +
    Index: lams_tool_laqa/web/learning/CombinedAnswersContent.jsp =================================================================== diff -u -r26e2c0cef30f96d91999c26177c8203d30dba235 -racc8d2acf5b6b0002e0c8129947040a779ab4077 --- lams_tool_laqa/web/learning/CombinedAnswersContent.jsp (.../CombinedAnswersContent.jsp) (revision 26e2c0cef30f96d91999c26177c8203d30dba235) +++ lams_tool_laqa/web/learning/CombinedAnswersContent.jsp (.../CombinedAnswersContent.jsp) (revision acc8d2acf5b6b0002e0c8129947040a779ab4077) @@ -51,8 +51,17 @@

    - - + + + + + + + + + + Index: lams_tool_laqa/web/learning/SequentialAnswersContent.jsp =================================================================== diff -u -r26e2c0cef30f96d91999c26177c8203d30dba235 -racc8d2acf5b6b0002e0c8129947040a779ab4077 --- lams_tool_laqa/web/learning/SequentialAnswersContent.jsp (.../SequentialAnswersContent.jsp) (revision 26e2c0cef30f96d91999c26177c8203d30dba235) +++ lams_tool_laqa/web/learning/SequentialAnswersContent.jsp (.../SequentialAnswersContent.jsp) (revision acc8d2acf5b6b0002e0c8129947040a779ab4077) @@ -53,12 +53,21 @@

    + + + + + + + + + + + + - - - Index: lams_tool_larsrc/lib/jaxen/jaxen-full.jar =================================================================== diff -u -r0a704617c31a5847217132f6b7cd73a4b9b43c9f -racc8d2acf5b6b0002e0c8129947040a779ab4077 Binary files differ Index: lams_tool_larsrc/lib/reload_2_0_1/xercesImpl.jar =================================================================== diff -u -r0a704617c31a5847217132f6b7cd73a4b9b43c9f -racc8d2acf5b6b0002e0c8129947040a779ab4077 Binary files differ Index: lams_tool_larsrc/src/java/org/lamsfoundation/lams/tool/rsrc/web/action/ViewItemAction.java =================================================================== diff -u -rbad14832678336bd441496ffadf365a0a5ea02b7 -racc8d2acf5b6b0002e0c8129947040a779ab4077 --- lams_tool_larsrc/src/java/org/lamsfoundation/lams/tool/rsrc/web/action/ViewItemAction.java (.../ViewItemAction.java) (revision bad14832678336bd441496ffadf365a0a5ea02b7) +++ lams_tool_larsrc/src/java/org/lamsfoundation/lams/tool/rsrc/web/action/ViewItemAction.java (.../ViewItemAction.java) (revision acc8d2acf5b6b0002e0c8129947040a779ab4077) @@ -97,11 +97,17 @@ * @return */ private ActionForward openUrlPopup(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) { - Long itemUid = WebUtil.readLongParam(request, ResourceConstants.PARAM_RESOURCE_ITEM_UID, false); + String mode = request.getParameter(AttributeNames.ATTR_MODE); + if (resourceService == null) { resourceService = ResourceServiceProxy.getResourceService(getServlet().getServletContext()); } - ResourceItem item = resourceService.getResourceItemByUid(itemUid); + + String sessionMapID = WebUtil.readStrParam(request, ResourceConstants.ATTR_SESSION_MAP_ID); + SessionMap sessionMap = (SessionMap)request.getSession().getAttribute(sessionMapID); + + ResourceItem item = getResourceItem(request,sessionMap, mode); + request.setAttribute(ResourceConstants.PARAM_OPEN_URL_POPUP,item.getUrl()); request.setAttribute(ResourceConstants.PARAM_TITLE,item.getTitle()); return mapping.findForward(ResourceConstants.SUCCESS); @@ -192,11 +198,12 @@ sessionMap.put(ResourceConstants.ATT_LEARNING_OBJECT,item); } //set url to content frame - request.setAttribute(ResourceConstants.ATTR_RESOURCE_REVIEW_URL,getReviewUrl(item,sessionMapID)); + + int itemIdx = NumberUtils.stringToInt(request.getParameter(ResourceConstants.PARAM_ITEM_INDEX)); + request.setAttribute(ResourceConstants.ATTR_RESOURCE_REVIEW_URL,getReviewUrl(item,sessionMapID,mode,itemIdx)); //these attribute will be use to instruction navigator page request.setAttribute(AttributeNames.ATTR_MODE,mode); - int itemIdx = NumberUtils.stringToInt(request.getParameter(ResourceConstants.PARAM_ITEM_INDEX)); request.setAttribute(ResourceConstants.PARAM_ITEM_INDEX,itemIdx); Long itemUid = NumberUtils.createLong(request.getParameter(ResourceConstants.PARAM_RESOURCE_ITEM_UID)); request.setAttribute(ResourceConstants.PARAM_RESOURCE_ITEM_UID,itemUid); @@ -239,7 +246,7 @@ private static Pattern wikipediaPattern = Pattern.compile("wikipedia", Pattern.CASE_INSENSITIVE | Pattern.UNICODE_CASE); - private Object getReviewUrl(ResourceItem item, String sessionMapID) { + private Object getReviewUrl(ResourceItem item, String sessionMapID, String mode, int itemIdx) { short type = item.getType(); String url = null; switch (type) { @@ -249,7 +256,11 @@ boolean wikipediaInURL = matcher.find(); if(item.isOpenUrlNewWindow() || wikipediaInURL) { - url = "/openUrlPopup.do?"+ResourceConstants.PARAM_RESOURCE_ITEM_UID+"=" + item.getUid(); + if(ResourceConstants.MODE_AUTHOR_SESSION.equals(mode)){ + url = "/openUrlPopup.do?"+AttributeNames.ATTR_MODE+"=" + mode + "&" + ResourceConstants.PARAM_ITEM_INDEX + "=" + itemIdx + "&" + ResourceConstants.ATTR_SESSION_MAP_ID + "=" + sessionMapID; + } else { + url = "/openUrlPopup.do?"+ResourceConstants.PARAM_RESOURCE_ITEM_UID+"=" + item.getUid() + "&" + ResourceConstants.ATTR_SESSION_MAP_ID + "=" + sessionMapID; + } }else url = ResourceWebUtils.protocol(item.getUrl()); break; Index: lams_tool_larsrc/web/WEB-INF/web.xml =================================================================== diff -u -r126d84999e520648cb187e465cb4aaa3baad222e -racc8d2acf5b6b0002e0c8129947040a779ab4077 --- lams_tool_larsrc/web/WEB-INF/web.xml (.../web.xml) (revision 126d84999e520648cb187e465cb4aaa3baad222e) +++ lams_tool_larsrc/web/WEB-INF/web.xml (.../web.xml) (revision acc8d2acf5b6b0002e0c8129947040a779ab4077) @@ -9,13 +9,18 @@ javax.servlet.jsp.jstl.fmt.localizationContext org.lamsfoundation.lams.tool.rsrc.ApplicationResources + + + contextClass + org.jboss.spring.factory.VFSXmlWebApplicationContext + contextConfigLocation classpath:/org/lamsfoundation/lams/tool/rsrc/dbupdates/autopatchContext.xml locatorFactorySelector - classpath*:/org/lamsfoundation/lams/**/beanRefContext.xml + classpath:/org/lamsfoundation/lams/beanRefContext.xml parentContextKey Index: lams_tool_larsrc/web/pages/authoring/parts/instructions.jsp =================================================================== diff -u -r529adc13063b7d012d49a4c7ed47a27716c76a94 -racc8d2acf5b6b0002e0c8129947040a779ab4077 --- lams_tool_larsrc/web/pages/authoring/parts/instructions.jsp (.../instructions.jsp) (revision 529adc13063b7d012d49a4c7ed47a27716c76a94) +++ lams_tool_larsrc/web/pages/authoring/parts/instructions.jsp (.../instructions.jsp) (revision acc8d2acf5b6b0002e0c8129947040a779ab4077) @@ -25,7 +25,7 @@ + id="instructionItemDesc${status.index}" size="60" maxlength="255" value="${item}"> Index: lams_tool_larsrc/web/pages/itemreview/instructionsnav.jsp =================================================================== diff -u -raf0f333826569e48655569fbf9c8b13decd475b0 -racc8d2acf5b6b0002e0c8129947040a779ab4077 --- lams_tool_larsrc/web/pages/itemreview/instructionsnav.jsp (.../instructionsnav.jsp) (revision af0f333826569e48655569fbf9c8b13decd475b0) +++ lams_tool_larsrc/web/pages/itemreview/instructionsnav.jsp (.../instructionsnav.jsp) (revision acc8d2acf5b6b0002e0c8129947040a779ab4077) @@ -83,6 +83,8 @@ }); } + } else { + window.parent.close(); } } @@ -99,13 +101,20 @@
    +

    - - - - + + + + + + + +   +

    - + + Index: lams_tool_larsrc/web/pages/learning/addfile.jsp =================================================================== diff -u -r18e5e690d2e1a7c3d918759f7a2827c8205feaac -racc8d2acf5b6b0002e0c8129947040a779ab4077 --- lams_tool_larsrc/web/pages/learning/addfile.jsp (.../addfile.jsp) (revision 18e5e690d2e1a7c3d918759f7a2827c8205feaac) +++ lams_tool_larsrc/web/pages/learning/addfile.jsp (.../addfile.jsp) (revision acc8d2acf5b6b0002e0c8129947040a779ab4077) @@ -32,9 +32,10 @@
    - - + + + - + -
    ?sessionMapID=${sessionMapID}&mode=${mode}&toolSessionID=${toolSessionID}&reqID="+reqIDVar.getTime(); + + document.location.href = "?sessionMapID=${sessionMapID}&mode=${mode}&toolSessionID=${toolSessionID}&reqID="+reqIDVar.getTime(); + return false; } function viewItem(itemUid){ @@ -105,10 +107,10 @@ ${item.title} - + [${item.createBy.loginName}] - + Index: lams_tool_mindmap/.classpath =================================================================== diff -u -r26ce6de9fba8494203a85a4ce076b6ffea4238ed -racc8d2acf5b6b0002e0c8129947040a779ab4077 --- lams_tool_mindmap/.classpath (.../.classpath) (revision 26ce6de9fba8494203a85a4ce076b6ffea4238ed) +++ lams_tool_mindmap/.classpath (.../.classpath) (revision acc8d2acf5b6b0002e0c8129947040a779ab4077) @@ -1,23 +1,17 @@ - - - - - - - - - - - - + + + + + + + + + + + + + + + Index: lams_tool_mindmap/conf/xdoclet/web-settings.xml =================================================================== diff -u -r26ce6de9fba8494203a85a4ce076b6ffea4238ed -racc8d2acf5b6b0002e0c8129947040a779ab4077 --- lams_tool_mindmap/conf/xdoclet/web-settings.xml (.../web-settings.xml) (revision 26ce6de9fba8494203a85a4ce076b6ffea4238ed) +++ lams_tool_mindmap/conf/xdoclet/web-settings.xml (.../web-settings.xml) (revision acc8d2acf5b6b0002e0c8129947040a779ab4077) @@ -5,6 +5,10 @@ org.lamsfoundation.lams.tool.mindmap.ApplicationResources + + contextClass + org.jboss.spring.factory.VFSXmlWebApplicationContext + contextConfigLocation @@ -14,7 +18,7 @@ locatorFactorySelector - classpath*:/org/lamsfoundation/lams/**/beanRefContext.xml + classpath:/org/lamsfoundation/lams/beanRefContext.xml Index: lams_tool_nb/conf/language/lams/ApplicationResources_es_ES.properties =================================================================== diff -u -rfbbc8abd933da6ee584c8a4fd777f9834aee92e3 -racc8d2acf5b6b0002e0c8129947040a779ab4077 --- lams_tool_nb/conf/language/lams/ApplicationResources_es_ES.properties (.../ApplicationResources_es_ES.properties) (revision fbbc8abd933da6ee584c8a4fd777f9834aee92e3) +++ lams_tool_nb/conf/language/lams/ApplicationResources_es_ES.properties (.../ApplicationResources_es_ES.properties) (revision acc8d2acf5b6b0002e0c8129947040a779ab4077) @@ -2,16 +2,14 @@ #language code: es #locale code: ES - # CVS ID: $Id$ Exported from the LAMS Community by Ernie Ghiglione on Wed Nov 19 18:23:33 GMT 2008 + # CVS ID: $Id$ Exported from the LAMS Community by Ernie Ghiglione on Thu May 14 00:12:50 CST 2009 #=================== labels for Noticeboard =================# message.defineLaterSet =Por favor espere a que el profesor complete los contenidos de esta actividad. heading.totalLearners =N\u00famero total de estudiantes: heading.totalLearnersInGroup =N\u00famero de estudiantes en grupo: activity.title =Cartelera -activity.description =Herramienta para anuncios en formato HTML que puede contener texto, enlaces, imagenes y otros tipos de media -activity.helptext =Cartelera que muestra texto modelado, enlaces, imagenes, etc. tool.display.name =Herramienta Cartelera tool.description =Herramienta que permite mostrar una Cartelera label.authoring.heading.basic =B\u00e1sico @@ -32,7 +30,6 @@ link.view =Ver link.download =Descargar link.delete =Borrar -message.runOfflineSet =Esta actividad ha sido marcado como actividad de desarrollo Offline. Por favor contacte a su profesor para recibir instrucciones. button.edit =Editar titleHeading.summary =Sumario titleHeading.instructions =Instrucciones @@ -50,7 +47,6 @@ error.exceedMaxFileSize =El archivo es m\u00e1s grande de lo permitido error.exception.NbApplication =Ha ocurrido un error interno en la Cartelera. Por favor reporte el siguiente problema: {0} error.contentrepository =Ha ocurrido un error gravando o borrando el siguiente archivo: {0}. -advanced.reflectOnActivity =A\u00f1adaa Anotaciones al final de la Cartelera con las siguientes instrucciones: button.try.again =Refrescar authoring.msg.cancel.save =Esta seguro que desea cancelar? Sus cambios no seran guardados button.continue =Continuar @@ -60,12 +56,16 @@ message.no.reflections =No hay reflexiones disponibles. errors.maxfilesize =El archivo que intent\u00f3 adjuntar excede el m\u00e1ximo de {0} bytes. message.alertContentEdit =Atenci\u00f3n: uno o m\u00e1s estudiantes han accedido esta actividad. Si desea cambiar el contenido, tenga en cuenta que algunos alumnos recibir\u00e1n informaci\u00f3n diferente. +activity.description =Herramienta para anuncios en formato HTML que puede contener texto, enlaces, imagenes y otros tipos de media label.on =Si label.off =No monitor.summary.th.advancedSettings =Opciones Avanzadas monitor.summary.td.addNotebook =Agregar anotador al finalizar Cartelera monitor.summary.td.notebookInstructions =Instrucciones del anotador +activity.helptext =Cartelera que muestra texto modelado, enlaces, imagenes, etc. button.finish =Finalizar +advanced.reflectOnActivity =A\u00f1adir anotaci\u00f3n al final de esta actividad con las siguientes instrucciones: +message.runOfflineSet =Esta actividad ha sido se\u00f1alada para realizarse en forma offline. Por favor, consulte con su profesor. #======= End labels: Exported 60 labels for es ES ===== Index: lams_tool_nb/conf/xdoclet/servlets.xml =================================================================== diff -u -rfdb3e5c043522549d839142cfb3ef4e919913bbd -racc8d2acf5b6b0002e0c8129947040a779ab4077 --- lams_tool_nb/conf/xdoclet/servlets.xml (.../servlets.xml) (revision fdb3e5c043522549d839142cfb3ef4e919913bbd) +++ lams_tool_nb/conf/xdoclet/servlets.xml (.../servlets.xml) (revision acc8d2acf5b6b0002e0c8129947040a779ab4077) @@ -22,9 +22,7 @@ - download - Instructions Download - Instructions Download + download org.lamsfoundation.lams.contentrepository.client.ToolDownload toolContentHandlerBeanName @@ -35,8 +33,6 @@ exportPortfolio - Export Portfolio - Export Portfolio org.lamsfoundation.lams.tool.noticeboard.web.NbExportServlet Index: lams_tool_nb/conf/xdoclet/web-settings.xml =================================================================== diff -u -r126d84999e520648cb187e465cb4aaa3baad222e -racc8d2acf5b6b0002e0c8129947040a779ab4077 --- lams_tool_nb/conf/xdoclet/web-settings.xml (.../web-settings.xml) (revision 126d84999e520648cb187e465cb4aaa3baad222e) +++ lams_tool_nb/conf/xdoclet/web-settings.xml (.../web-settings.xml) (revision acc8d2acf5b6b0002e0c8129947040a779ab4077) @@ -2,13 +2,18 @@ javax.servlet.jsp.jstl.fmt.localizationContext org.lamsfoundation.lams.tool.noticeboard.ApplicationResources + + + contextClass + org.jboss.spring.factory.VFSXmlWebApplicationContext + contextConfigLocation classpath:/org/lamsfoundation/lams/tool/noticeboard/dbupdates/autopatchContext.xml locatorFactorySelector - classpath*:/org/lamsfoundation/lams/**/beanRefContext.xml + classpath:/org/lamsfoundation/lams/beanRefContext.xml parentContextKey Index: lams_tool_notebook/.classpath =================================================================== diff -u -r94978257a4e34f04f7997f60558db2762811c72b -racc8d2acf5b6b0002e0c8129947040a779ab4077 --- lams_tool_notebook/.classpath (.../.classpath) (revision 94978257a4e34f04f7997f60558db2762811c72b) +++ lams_tool_notebook/.classpath (.../.classpath) (revision acc8d2acf5b6b0002e0c8129947040a779ab4077) @@ -5,9 +5,12 @@ - - - + + + + + + @@ -18,4 +21,4 @@ - + Index: lams_tool_notebook/conf/xdoclet/servlets.xml =================================================================== diff -u -r0732f5d12802da95cf69e474b30630653924abc5 -racc8d2acf5b6b0002e0c8129947040a779ab4077 --- lams_tool_notebook/conf/xdoclet/servlets.xml (.../servlets.xml) (revision 0732f5d12802da95cf69e474b30630653924abc5) +++ lams_tool_notebook/conf/xdoclet/servlets.xml (.../servlets.xml) (revision acc8d2acf5b6b0002e0c8129947040a779ab4077) @@ -39,7 +39,6 @@ Attachment Download - Attachment Download download org.lamsfoundation.lams.contentrepository.client.ToolDownload Index: lams_tool_notebook/conf/xdoclet/web-settings.xml =================================================================== diff -u -r126d84999e520648cb187e465cb4aaa3baad222e -racc8d2acf5b6b0002e0c8129947040a779ab4077 --- lams_tool_notebook/conf/xdoclet/web-settings.xml (.../web-settings.xml) (revision 126d84999e520648cb187e465cb4aaa3baad222e) +++ lams_tool_notebook/conf/xdoclet/web-settings.xml (.../web-settings.xml) (revision acc8d2acf5b6b0002e0c8129947040a779ab4077) @@ -5,13 +5,17 @@ org.lamsfoundation.lams.tool.notebook.ApplicationResources + + contextClass + org.jboss.spring.factory.VFSXmlWebApplicationContext + contextConfigLocation classpath:/org/lamsfoundation/lams/tool/notebook/dbupdates/autopatchContext.xml locatorFactorySelector - classpath*:/org/lamsfoundation/lams/**/beanRefContext.xml + classpath:/org/lamsfoundation/lams/beanRefContext.xml parentContextKey Index: lams_tool_notebook/web/pages/authoring/addCondition.jsp =================================================================== diff -u -re64f3e306f3139c78e8917240c33ea232e75e848 -racc8d2acf5b6b0002e0c8129947040a779ab4077 --- lams_tool_notebook/web/pages/authoring/addCondition.jsp (.../addCondition.jsp) (revision e64f3e306f3139c78e8917240c33ea232e75e848) +++ lams_tool_notebook/web/pages/authoring/addCondition.jsp (.../addCondition.jsp) (revision acc8d2acf5b6b0002e0c8129947040a779ab4077) @@ -36,9 +36,9 @@ - - Index: lams_tool_pixlr/conf/xdoclet/web-settings.xml =================================================================== diff -u -r126d84999e520648cb187e465cb4aaa3baad222e -racc8d2acf5b6b0002e0c8129947040a779ab4077 --- lams_tool_pixlr/conf/xdoclet/web-settings.xml (.../web-settings.xml) (revision 126d84999e520648cb187e465cb4aaa3baad222e) +++ lams_tool_pixlr/conf/xdoclet/web-settings.xml (.../web-settings.xml) (revision acc8d2acf5b6b0002e0c8129947040a779ab4077) @@ -5,13 +5,17 @@ org.lamsfoundation.lams.tool.pixlr.ApplicationResources + + contextClass + org.jboss.spring.factory.VFSXmlWebApplicationContext + contextConfigLocation classpath:/org/lamsfoundation/lams/tool/pixlr/dbupdates/autopatchContext.xml locatorFactorySelector - classpath*:/org/lamsfoundation/lams/**/beanRefContext.xml + classpath:/org/lamsfoundation/lams/beanRefContext.xml parentContextKey Index: lams_tool_sbmt/conf/xdoclet/web-settings.xml =================================================================== diff -u -r126d84999e520648cb187e465cb4aaa3baad222e -racc8d2acf5b6b0002e0c8129947040a779ab4077 --- lams_tool_sbmt/conf/xdoclet/web-settings.xml (.../web-settings.xml) (revision 126d84999e520648cb187e465cb4aaa3baad222e) +++ lams_tool_sbmt/conf/xdoclet/web-settings.xml (.../web-settings.xml) (revision acc8d2acf5b6b0002e0c8129947040a779ab4077) @@ -1,13 +1,17 @@ LAMS Learning Activity Management System + + contextClass + org.jboss.spring.factory.VFSXmlWebApplicationContext + contextConfigLocation classpath:/org/lamsfoundation/lams/tool/sbmt/dbupdates/autopatchContext.xml locatorFactorySelector - classpath*:/org/lamsfoundation/lams/**/beanRefContext.xml + classpath:/org/lamsfoundation/lams/beanRefContext.xml parentContextKey Index: lams_tool_sbmt/src/java/org/lamsfoundation/lams/tool/sbmt/service/SubmitFilesService.java =================================================================== diff -u -r0f8935bc85059df40ad07b28c5b9b2ed844fc74d -racc8d2acf5b6b0002e0c8129947040a779ab4077 --- lams_tool_sbmt/src/java/org/lamsfoundation/lams/tool/sbmt/service/SubmitFilesService.java (.../SubmitFilesService.java) (revision 0f8935bc85059df40ad07b28c5b9b2ed844fc74d) +++ lams_tool_sbmt/src/java/org/lamsfoundation/lams/tool/sbmt/service/SubmitFilesService.java (.../SubmitFilesService.java) (revision acc8d2acf5b6b0002e0c8129947040a779ab4077) @@ -58,9 +58,9 @@ import org.lamsfoundation.lams.contentrepository.WorkspaceNotFoundException; import org.lamsfoundation.lams.contentrepository.client.IToolContentHandler; import org.lamsfoundation.lams.contentrepository.service.IRepositoryService; -import org.lamsfoundation.lams.contentrepository.service.RepositoryProxy; import org.lamsfoundation.lams.contentrepository.service.SimpleCredentials; import org.lamsfoundation.lams.events.IEventNotificationService; +import org.lamsfoundation.lams.gradebook.service.IGradebookService; import org.lamsfoundation.lams.learning.service.ILearnerService; import org.lamsfoundation.lams.learningdesign.service.ExportToolContentException; import org.lamsfoundation.lams.learningdesign.service.IExportToolContentService; @@ -143,6 +143,8 @@ private ILessonService lessonService; + private IGradebookService gradebookService; + private class FileDtoComparator implements Comparator { public int compare(FileDetailsDTO o1, FileDetailsDTO o2) { @@ -181,7 +183,8 @@ /** * (non-Javadoc) * - * @see org.lamsfoundation.lams.tool.ToolContentManager#copyToolContent(java.lang.Long, java.lang.Long) + * @see org.lamsfoundation.lams.tool.ToolContentManager#copyToolContent(java.lang.Long, + * java.lang.Long) */ public void copyToolContent(Long fromContentId, Long toContentId) throws ToolException { if (toContentId == null) { @@ -223,8 +226,9 @@ } /** - * If the toolContentID does not exist, then get default tool content id from tool core and initialize a emtpy - * SubmitFilesContent return. + * If the toolContentID does not exist, then get default tool content id + * from tool core and initialize a emtpy SubmitFilesContent + * return. * * @param toolContentId * @return @@ -289,7 +293,8 @@ } /** - * Export the XML fragment for the tool's content, along with any files needed for the content. + * Export the XML fragment for the tool's content, along with any files + * needed for the content. * * @throws ExportToolContentException */ @@ -354,12 +359,14 @@ } /** - * Get the definitions for possible output for an activity, based on the toolContentId. These may be definitions - * that are always available for the tool (e.g. number of marks for Multiple Choice) or a custom definition created - * for a particular activity such as the answer to the third question contains the word Koala and hence the need for - * the toolContentId + * Get the definitions for possible output for an activity, based on the + * toolContentId. These may be definitions that are always available for the + * tool (e.g. number of marks for Multiple Choice) or a custom definition + * created for a particular activity such as the answer to the third + * question contains the word Koala and hence the need for the toolContentId * - * @return SortedMap of ToolOutputDefinitions with the key being the name of each definition + * @return SortedMap of ToolOutputDefinitions with the key being the name of + * each definition */ public SortedMap getToolOutputDefinitions(Long toolContentId) throws ToolException { return new TreeMap(); @@ -404,11 +411,12 @@ } /** - * This method verifies the credentials of the SubmitFiles Tool and gives it the Ticket to login and - * access the Content Repository. + * This method verifies the credentials of the SubmitFiles Tool and gives it + * the Ticket to login and access the Content Repository. * - * A valid ticket is needed in order to access the content from the repository. This method would be called evertime - * the tool needs to upload/download files from the content repository. + * A valid ticket is needed in order to access the content from the + * repository. This method would be called evertime the tool needs to + * upload/download files from the content repository. * * @return ITicket The ticket for repostory access * @throws SubmitFilesException @@ -429,8 +437,8 @@ } /** - * This method deletes the content with the given uuid and versionID from the content - * repository + * This method deletes the content with the given uuid and + * versionID from the content repository * * @param uuid * The uuid of the node to be deleted @@ -574,8 +582,8 @@ /** * Get the tool output for the given tool output names. * - * @see org.lamsfoundation.lams.tool.ToolSessionManager#getToolOutput(java.util.List, java.lang.Long, - * java.lang.Long) + * @see org.lamsfoundation.lams.tool.ToolSessionManager#getToolOutput(java.util.List, + * java.lang.Long, java.lang.Long) */ public SortedMap getToolOutput(List names, Long toolSessionId, Long learnerId) { return new TreeMap(); @@ -584,8 +592,8 @@ /** * 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) + * @see org.lamsfoundation.lams.tool.ToolSessionManager#getToolOutput(java.lang.String, + * java.lang.Long, java.lang.Long) */ public ToolOutput getToolOutput(String name, Long toolSessionId, Long learnerId) { return null; @@ -594,7 +602,8 @@ /** * (non-Javadoc) * - * @see org.lamsfoundation.lams.tool.ToolSessionManager# uploadFileToContent(Long,FormFile ) + * @see org.lamsfoundation.lams.tool.ToolSessionManager# + * uploadFileToContent(Long,FormFile ) */ public InstructionFiles uploadFileToContent(Long contentID, FormFile uploadFile, String fileType) throws SubmitFilesException { @@ -616,7 +625,8 @@ /** * (non-Javadoc) * - * @see org.lamsfoundation.lams.tool.ToolSessionManager# uploadFileToSession(Long,FormFile,String,Long ) + * @see org.lamsfoundation.lams.tool.ToolSessionManager# + * uploadFileToSession(Long,FormFile,String,Long ) */ public void uploadFileToSession(Long sessionID, FormFile uploadFile, String fileDescription, Integer userID) throws SubmitFilesException { @@ -708,8 +718,9 @@ } /** - * This method save SubmissionDetails list into a map container: key is user id, value is a list container, which - * contains all FileDetailsDTO object belong to this user. + * This method save SubmissionDetails list into a map container: key is user + * id, value is a list container, which contains all + * FileDetailsDTO object belong to this user. */ public SortedMap getFilesUploadedBySession(Long sessionID, Locale currentLocale) { List list = submissionDetailsDAO.getSubmissionDetailsBySession(sessionID); @@ -831,6 +842,17 @@ notificationMessageParameters); } } + + // pushing outputs to gradebook + List users = getUsersBySession(sessionID); + + if (users != null) { + for (SubmitUser user : users) { + // send marks to gradebook where applicable + sendMarksToGradebook(user, sessionID); + } + } + return true; } @@ -840,6 +862,37 @@ submitUserDAO.saveOrUpdateUser(learner); } + /** + * Sends marks to gradebook + * + * @param user + * @param toolSessionID + */ + @SuppressWarnings("unchecked") + public void sendMarksToGradebook(SubmitUser user, Long toolSessionID) { + submissionDetailsDAO.getSubmissionDetailsBySession(toolSessionID); + List detailsList = (List) submissionDetailsDAO.getBySessionAndLearner( + toolSessionID, user.getUserID()); + if (detailsList != null) { + Float totalMark = null; + for (SubmissionDetails details : detailsList) { + SubmitFilesReport report = details.getReport(); + if (report != null) { + if (totalMark == null) { + totalMark = details.getReport().getMarks(); + } else if (report.getMarks() != null) { + totalMark += report.getMarks(); + } + } + + } + if (totalMark != null) { + Double mark = new Double(totalMark); + gradebookService.updateActivityMark(mark, null, user.getUserID(), toolSessionID, false); + } + } + } + /* * (non-Javadoc) * @@ -930,7 +983,10 @@ submitFilesContentDAO.saveOrUpdate(toolContentObj); } - /** Set the description, throws away the title value as this is not supported in 2.0 */ + /** + * Set the description, throws away the title value as this is not supported + * in 2.0 + */ public void setReflectiveData(Long toolContentId, String title, String description) throws ToolException, DataMissingException { @@ -993,9 +1049,9 @@ return submitUserDAO.getContentUser(contentId, userID); } - /******************************************************************************************************************* + /*************************************************************************** * Property Injection Methods - ******************************************************************************************************************/ + **************************************************************************/ /** * @param submitFilesContentDAO @@ -1066,13 +1122,13 @@ public void setLearnerService(ILearnerService learnerService) { this.learnerService = learnerService; } - + public IRepositoryService getRepositoryService() { - return repositoryService; + return repositoryService; } public void setRepositoryService(IRepositoryService repositoryService) { - this.repositoryService = repositoryService; + this.repositoryService = repositoryService; } public ILamsToolService getToolService() { @@ -1134,4 +1190,8 @@ public void setLessonService(ILessonService lessonService) { this.lessonService = lessonService; } + + public void setGradebookService(IGradebookService gradebookService) { + this.gradebookService = gradebookService; + } } \ No newline at end of file Index: lams_tool_sbmt/src/java/org/lamsfoundation/lams/tool/sbmt/submitFilesApplicationContext.xml =================================================================== diff -u -r126d84999e520648cb187e465cb4aaa3baad222e -racc8d2acf5b6b0002e0c8129947040a779ab4077 --- lams_tool_sbmt/src/java/org/lamsfoundation/lams/tool/sbmt/submitFilesApplicationContext.xml (.../submitFilesApplicationContext.xml) (revision 126d84999e520648cb187e465cb4aaa3baad222e) +++ lams_tool_sbmt/src/java/org/lamsfoundation/lams/tool/sbmt/submitFilesApplicationContext.xml (.../submitFilesApplicationContext.xml) (revision acc8d2acf5b6b0002e0c8129947040a779ab4077) @@ -57,6 +57,7 @@ + Index: lams_tool_scribe/conf/xdoclet/web-settings.xml =================================================================== diff -u -r126d84999e520648cb187e465cb4aaa3baad222e -racc8d2acf5b6b0002e0c8129947040a779ab4077 --- lams_tool_scribe/conf/xdoclet/web-settings.xml (.../web-settings.xml) (revision 126d84999e520648cb187e465cb4aaa3baad222e) +++ lams_tool_scribe/conf/xdoclet/web-settings.xml (.../web-settings.xml) (revision acc8d2acf5b6b0002e0c8129947040a779ab4077) @@ -5,13 +5,17 @@ org.lamsfoundation.lams.tool.scribe.ApplicationResources + + contextClass + org.jboss.spring.factory.VFSXmlWebApplicationContext + contextConfigLocation classpath:/org/lamsfoundation/lams/tool/scribe/dbupdates/autopatchContext.xml locatorFactorySelector - classpath*:/org/lamsfoundation/lams/**/beanRefContext.xml + classpath:/org/lamsfoundation/lams/beanRefContext.xml parentContextKey Index: lams_tool_spreadsheet/.classpath =================================================================== diff -u -r5057c367b97644eaa7d4946bb4b35c39627b7a81 -racc8d2acf5b6b0002e0c8129947040a779ab4077 --- lams_tool_spreadsheet/.classpath (.../.classpath) (revision 5057c367b97644eaa7d4946bb4b35c39627b7a81) +++ lams_tool_spreadsheet/.classpath (.../.classpath) (revision acc8d2acf5b6b0002e0c8129947040a779ab4077) @@ -4,12 +4,15 @@ - - - + + + + + + - + Index: lams_tool_spreadsheet/web/WEB-INF/web.xml =================================================================== diff -u -r126d84999e520648cb187e465cb4aaa3baad222e -racc8d2acf5b6b0002e0c8129947040a779ab4077 --- lams_tool_spreadsheet/web/WEB-INF/web.xml (.../web.xml) (revision 126d84999e520648cb187e465cb4aaa3baad222e) +++ lams_tool_spreadsheet/web/WEB-INF/web.xml (.../web.xml) (revision acc8d2acf5b6b0002e0c8129947040a779ab4077) @@ -9,13 +9,17 @@ javax.servlet.jsp.jstl.fmt.localizationContext org.lamsfoundation.lams.tool.spreadsheet.ApplicationResources + + contextClass + org.jboss.spring.factory.VFSXmlWebApplicationContext + contextConfigLocation classpath:/org/lamsfoundation/lams/tool/spreadsheet/dbupdates/autopatchContext.xml locatorFactorySelector - classpath*:/org/lamsfoundation/lams/**/beanRefContext.xml + classpath:/org/lamsfoundation/lams/beanRefContext.xml parentContextKey Index: lams_tool_survey/web/WEB-INF/web.xml =================================================================== diff -u -r126d84999e520648cb187e465cb4aaa3baad222e -racc8d2acf5b6b0002e0c8129947040a779ab4077 --- lams_tool_survey/web/WEB-INF/web.xml (.../web.xml) (revision 126d84999e520648cb187e465cb4aaa3baad222e) +++ lams_tool_survey/web/WEB-INF/web.xml (.../web.xml) (revision acc8d2acf5b6b0002e0c8129947040a779ab4077) @@ -9,13 +9,17 @@ javax.servlet.jsp.jstl.fmt.localizationContext org.lamsfoundation.lams.tool.survey.ApplicationResources + + contextClass + org.jboss.spring.factory.VFSXmlWebApplicationContext + contextConfigLocation classpath:/org/lamsfoundation/lams/tool/survey/dbupdates/autopatchContext.xml locatorFactorySelector - classpath*:/org/lamsfoundation/lams/**/beanRefContext.xml + classpath:/org/lamsfoundation/lams/beanRefContext.xml parentContextKey Index: lams_tool_survey/web/pages/authoring/addCondition.jsp =================================================================== diff -u -r7b79396263b36a933d66390fb9ab12821956d59d -racc8d2acf5b6b0002e0c8129947040a779ab4077 --- lams_tool_survey/web/pages/authoring/addCondition.jsp (.../addCondition.jsp) (revision 7b79396263b36a933d66390fb9ab12821956d59d) +++ lams_tool_survey/web/pages/authoring/addCondition.jsp (.../addCondition.jsp) (revision acc8d2acf5b6b0002e0c8129947040a779ab4077) @@ -38,9 +38,9 @@ - - Index: lams_tool_task/web/WEB-INF/web.xml =================================================================== diff -u -r126d84999e520648cb187e465cb4aaa3baad222e -racc8d2acf5b6b0002e0c8129947040a779ab4077 --- lams_tool_task/web/WEB-INF/web.xml (.../web.xml) (revision 126d84999e520648cb187e465cb4aaa3baad222e) +++ lams_tool_task/web/WEB-INF/web.xml (.../web.xml) (revision acc8d2acf5b6b0002e0c8129947040a779ab4077) @@ -9,13 +9,17 @@ javax.servlet.jsp.jstl.fmt.localizationContext org.lamsfoundation.lams.tool.taskList.ApplicationResources + + contextClass + org.jboss.spring.factory.VFSXmlWebApplicationContext + contextConfigLocation classpath:/org/lamsfoundation/lams/tool/taskList/dbupdates/autopatchContext.xml locatorFactorySelector - classpath*:/org/lamsfoundation/lams/**/beanRefContext.xml + classpath:/org/lamsfoundation/lams/beanRefContext.xml parentContextKey Index: lams_tool_videorecorder/conf/xdoclet/web-settings.xml =================================================================== diff -u -r126d84999e520648cb187e465cb4aaa3baad222e -racc8d2acf5b6b0002e0c8129947040a779ab4077 --- lams_tool_videorecorder/conf/xdoclet/web-settings.xml (.../web-settings.xml) (revision 126d84999e520648cb187e465cb4aaa3baad222e) +++ lams_tool_videorecorder/conf/xdoclet/web-settings.xml (.../web-settings.xml) (revision acc8d2acf5b6b0002e0c8129947040a779ab4077) @@ -5,13 +5,17 @@ org.lamsfoundation.lams.tool.videoRecorder.ApplicationResources + + contextClass + org.jboss.spring.factory.VFSXmlWebApplicationContext + contextConfigLocation classpath:/org/lamsfoundation/lams/tool/videoRecorder/dbupdates/autopatchContext.xml locatorFactorySelector - classpath*:/org/lamsfoundation/lams/**/beanRefContext.xml + classpath:/org/lamsfoundation/lams/beanRefContext.xml parentContextKey Fisheye: Tag acc8d2acf5b6b0002e0c8129947040a779ab4077 refers to a dead (removed) revision in file `lams_tool_videorecorder/src/java/org/lamsfoundation/lams/tool/videoRecorder/dbupdates/patch20080929_updateFrom21.sql'. Fisheye: No comparison available. Pass `N' to diff? Index: lams_tool_videorecorder/src/java/org/lamsfoundation/lams/tool/videoRecorder/dto/VideoRecorderRecordingDTO.java =================================================================== diff -u -rf0bef7d11b4f82936c417e6e55c25fe9bfdb9a82 -racc8d2acf5b6b0002e0c8129947040a779ab4077 --- lams_tool_videorecorder/src/java/org/lamsfoundation/lams/tool/videoRecorder/dto/VideoRecorderRecordingDTO.java (.../VideoRecorderRecordingDTO.java) (revision f0bef7d11b4f82936c417e6e55c25fe9bfdb9a82) +++ lams_tool_videorecorder/src/java/org/lamsfoundation/lams/tool/videoRecorder/dto/VideoRecorderRecordingDTO.java (.../VideoRecorderRecordingDTO.java) (revision acc8d2acf5b6b0002e0c8129947040a779ab4077) @@ -70,9 +70,9 @@ public String filename; - public Set ratings; + public Set ratings; - public Set comments; + public Set comments; /* Constructors */ public VideoRecorderRecordingDTO(){} @@ -206,19 +206,19 @@ this.filename = filename; } - public Set getComments() { + public Set getComments() { return this.comments; } - public void setComments(Set comments) { + public void setComments(Set comments) { this.comments = comments; } - public Set getRatings() { + public Set getRatings() { return this.ratings; } - public void setRatings(Set ratings) { + public void setRatings(Set ratings) { this.ratings = ratings; } } Index: lams_tool_videorecorder/src/java/org/lamsfoundation/lams/tool/videoRecorder/dto/VideoRecorderSessionDTO.java =================================================================== diff -u -rf0bef7d11b4f82936c417e6e55c25fe9bfdb9a82 -racc8d2acf5b6b0002e0c8129947040a779ab4077 --- lams_tool_videorecorder/src/java/org/lamsfoundation/lams/tool/videoRecorder/dto/VideoRecorderSessionDTO.java (.../VideoRecorderSessionDTO.java) (revision f0bef7d11b4f82936c417e6e55c25fe9bfdb9a82) +++ lams_tool_videorecorder/src/java/org/lamsfoundation/lams/tool/videoRecorder/dto/VideoRecorderSessionDTO.java (.../VideoRecorderSessionDTO.java) (revision acc8d2acf5b6b0002e0c8129947040a779ab4077) @@ -46,6 +46,8 @@ int numberOfFinishedLearners; + Long monitoringUid; + public VideoRecorderSessionDTO(VideoRecorderSession session) { this.sessionID = session.getSessionId(); this.sessionName = session.getSessionName(); @@ -124,4 +126,12 @@ public void setNumberOfFinishedLearners(int numberOfFinishedLearners) { this.numberOfFinishedLearners = numberOfFinishedLearners; } + + public void setMonitoringUid(Long uid) { + this.monitoringUid = uid; + } + + public Long getMonitoringUid() { + return this.monitoringUid; + } } Index: lams_tool_videorecorder/src/java/org/lamsfoundation/lams/tool/videoRecorder/model/VideoRecorderRecording.java =================================================================== diff -u -rf0bef7d11b4f82936c417e6e55c25fe9bfdb9a82 -racc8d2acf5b6b0002e0c8129947040a779ab4077 --- lams_tool_videorecorder/src/java/org/lamsfoundation/lams/tool/videoRecorder/model/VideoRecorderRecording.java (.../VideoRecorderRecording.java) (revision f0bef7d11b4f82936c417e6e55c25fe9bfdb9a82) +++ lams_tool_videorecorder/src/java/org/lamsfoundation/lams/tool/videoRecorder/model/VideoRecorderRecording.java (.../VideoRecorderRecording.java) (revision acc8d2acf5b6b0002e0c8129947040a779ab4077) @@ -105,7 +105,7 @@ this.description = recording.description; this.rating = recording.rating; this.isLocal = recording.isLocal; - this.isJustSound = false; + this.isJustSound = recording.isJustSound; this.ratings = null; this.comments = null; this.filename = recording.filename; Index: lams_tool_videorecorder/src/java/org/lamsfoundation/lams/tool/videoRecorder/service/IVideoRecorderService.java =================================================================== diff -u -r61df3f3f473a3619f93c63ceb879ae36438020e8 -racc8d2acf5b6b0002e0c8129947040a779ab4077 --- lams_tool_videorecorder/src/java/org/lamsfoundation/lams/tool/videoRecorder/service/IVideoRecorderService.java (.../IVideoRecorderService.java) (revision 61df3f3f473a3619f93c63ceb879ae36438020e8) +++ lams_tool_videorecorder/src/java/org/lamsfoundation/lams/tool/videoRecorder/service/IVideoRecorderService.java (.../IVideoRecorderService.java) (revision acc8d2acf5b6b0002e0c8129947040a779ab4077) @@ -273,16 +273,6 @@ */ void updateEntry(Long uid, String entry); - /** - * Creates an unique name for a ChatCondition. It consists of the tool output definition name and a unique positive - * integer number. - * - * @param existingConditions - * existing conditions; required to check if a condition with the same name does not exist. - * @return unique ChatCondition name - */ - String createConditionName(Collection existingConditions); - void releaseConditionsFromCache(VideoRecorder videoRecorder); void deleteCondition(VideoRecorderCondition condition); @@ -298,4 +288,6 @@ public String getLanguageXMLForFCK(); public String getMessage(String key); + + public boolean isGroupedActivity(long toolContentID); } Index: lams_tool_videorecorder/src/java/org/lamsfoundation/lams/tool/videoRecorder/service/VideoRecorderOutputFactory.java =================================================================== diff -u -r61df3f3f473a3619f93c63ceb879ae36438020e8 -racc8d2acf5b6b0002e0c8129947040a779ab4077 --- lams_tool_videorecorder/src/java/org/lamsfoundation/lams/tool/videoRecorder/service/VideoRecorderOutputFactory.java (.../VideoRecorderOutputFactory.java) (revision 61df3f3f473a3619f93c63ceb879ae36438020e8) +++ lams_tool_videorecorder/src/java/org/lamsfoundation/lams/tool/videoRecorder/service/VideoRecorderOutputFactory.java (.../VideoRecorderOutputFactory.java) (revision acc8d2acf5b6b0002e0c8129947040a779ab4077) @@ -23,27 +23,20 @@ /* $Id$ */ package org.lamsfoundation.lams.tool.videoRecorder.service; -import java.util.ArrayList; import java.util.List; -import java.util.Set; import java.util.SortedMap; import java.util.TreeMap; -import org.lamsfoundation.lams.learningdesign.BranchCondition; -import org.lamsfoundation.lams.notebook.model.NotebookEntry; import org.lamsfoundation.lams.tool.OutputFactory; import org.lamsfoundation.lams.tool.ToolOutput; import org.lamsfoundation.lams.tool.ToolOutputDefinition; import org.lamsfoundation.lams.tool.exception.ToolException; -import org.lamsfoundation.lams.tool.videoRecorder.model.VideoRecorder; -import org.lamsfoundation.lams.tool.videoRecorder.model.VideoRecorderCondition; -import org.lamsfoundation.lams.tool.videoRecorder.model.VideoRecorderUser; import org.lamsfoundation.lams.tool.videoRecorder.util.VideoRecorderConstants; /** * Output factory for VideoRecorder tool. Currently it provides only one type of output - the entry that user provided. * - * @author Marcin Cieslak + * @author Paul Georges */ public class VideoRecorderOutputFactory extends OutputFactory { @@ -54,20 +47,6 @@ public SortedMap getToolOutputDefinitions(Object toolContentObject) throws ToolException { SortedMap definitionMap = new TreeMap(); - if (toolContentObject != null) { - ToolOutputDefinition videoRecorderEntryDefinition = buildStringOutputDefinition(VideoRecorderConstants.TEXT_SEARCH_DEFINITION_NAME); - VideoRecorder videoRecorder = (VideoRecorder) toolContentObject; - // adding all existing conditions - videoRecorderEntryDefinition.setDefaultConditions(new ArrayList(videoRecorder.getConditions())); - // if no conditions were created in the tool instance, a default condition is added; - if (videoRecorderEntryDefinition.getDefaultConditions().isEmpty()) { - VideoRecorderCondition defaultCondition = createDefaultComplexCondition(videoRecorder); - videoRecorder.getConditions().add(defaultCondition); - videoRecorderEntryDefinition.getDefaultConditions().add(defaultCondition); - } - videoRecorderEntryDefinition.setShowConditionNameOnly(true); - definitionMap.put(VideoRecorderConstants.TEXT_SEARCH_DEFINITION_NAME, videoRecorderEntryDefinition); - } ToolOutputDefinition numberOfRecordingsDefinition = buildRangeDefinition(VideoRecorderConstants.NB_RECORDINGS_DEFINITION_NAME, new Long(0), null); definitionMap.put(VideoRecorderConstants.NB_RECORDINGS_DEFINITION_NAME, numberOfRecordingsDefinition); @@ -89,41 +68,6 @@ Long toolSessionId, Long learnerId) { TreeMap outputs = new TreeMap(); - // cached tool output for all text search conditions - ToolOutput videoRecorderEntryOutput = null; - if (names == null) { - // output will be set for all the existing conditions - VideoRecorder videoRecorder = videoRecorderService.getSessionBySessionId(toolSessionId).getVideoRecorder(); - Set conditions = videoRecorder.getConditions(); - for (VideoRecorderCondition condition : conditions) { - String name = condition.getName(); - if (isTextSearchConditionName(name) && videoRecorderEntryOutput != null) { - outputs.put(name, videoRecorderEntryOutput); - } else { - ToolOutput output = getToolOutput(name, videoRecorderService, toolSessionId, learnerId); - if (output != null) { - outputs.put(name, output); - if (isTextSearchConditionName(name)) { - videoRecorderEntryOutput = output; - } - } - } - } - } else { - for (String name : names) { - if (isTextSearchConditionName(name) && videoRecorderEntryOutput != null) { - outputs.put(name, videoRecorderEntryOutput); - } else { - ToolOutput output = getToolOutput(name, videoRecorderService, toolSessionId, learnerId); - if (output != null) { - outputs.put(name, output); - if (isTextSearchConditionName(name)) { - videoRecorderEntryOutput = output; - } - } - } - } - } if (names == null || names.contains(VideoRecorderConstants.NB_RECORDINGS_DEFINITION_NAME)) { outputs.put(VideoRecorderConstants.NB_RECORDINGS_DEFINITION_NAME, getNbRecordings(videoRecorderService, learnerId, toolSessionId)); @@ -143,17 +87,7 @@ public ToolOutput getToolOutput(String name, IVideoRecorderService videoRecorderService, Long toolSessionId, Long learnerId) { ToolOutput toolOutput = null; - if (isTextSearchConditionName(name)) { - // entry is loaded from DB - VideoRecorder videoRecorder = videoRecorderService.getSessionBySessionId(toolSessionId).getVideoRecorder(); - - VideoRecorderUser user = videoRecorderService.getUserByUserIdAndSessionId(learnerId, toolSessionId); - NotebookEntry entry = videoRecorderService.getEntry(user.getEntryUID()); - - String value = entry == null ? null : entry.getEntry(); - - toolOutput = new ToolOutput(name, getI18NText(VideoRecorderConstants.TEXT_SEARCH_DEFINITION_NAME, true), value); - }else if (name != null && name.equals(VideoRecorderConstants.NB_RECORDINGS_DEFINITION_NAME)) { + if (name != null && name.equals(VideoRecorderConstants.NB_RECORDINGS_DEFINITION_NAME)) { toolOutput = getNbRecordings(videoRecorderService, learnerId, toolSessionId); }else if (name != null && name.equals(VideoRecorderConstants.NB_COMMENTS_DEFINITION_NAME)) { toolOutput = getNbComments(videoRecorderService, learnerId, toolSessionId); @@ -163,34 +97,6 @@ return toolOutput; } - - @Override - protected String[] splitConditionName(String conditionName) { - return super.splitConditionName(conditionName); - } - - protected String buildConditionName(String uniquePart) { - return super.buildConditionName(VideoRecorderConstants.TEXT_SEARCH_DEFINITION_NAME, uniquePart); - } - - private boolean isTextSearchConditionName(String name) { - return name != null && name.startsWith(VideoRecorderConstants.TEXT_SEARCH_DEFINITION_NAME); - } - - /** - * Creates a default condition so teachers know how to use complex conditions for this tool. - * - * @param videoRecorder - * content of the tool - * @return default videoRecorder condition - */ - protected VideoRecorderCondition createDefaultComplexCondition(VideoRecorder videoRecorder) { - String name = buildConditionName(VideoRecorderConstants.TEXT_SEARCH_DEFINITION_NAME, videoRecorder.getToolContentId() - .toString()); - // Default condition checks if the text contains word "LAMS" - return new VideoRecorderCondition(null, null, 1, name, getI18NText( - VideoRecorderConstants.TEXT_SEARCH_DEFAULT_CONDITION_DISPLAY_NAME_KEY, false), "LAMS", null, null, null); - } private ToolOutput getNbRecordings(IVideoRecorderService videoRecorderService, Long learnerId, Long toolSessionId) { Long nb = videoRecorderService.getNbRecordings(learnerId, toolSessionId); Index: lams_tool_videorecorder/src/java/org/lamsfoundation/lams/tool/videoRecorder/service/VideoRecorderService.java =================================================================== diff -u -rf0bef7d11b4f82936c417e6e55c25fe9bfdb9a82 -racc8d2acf5b6b0002e0c8129947040a779ab4077 --- lams_tool_videorecorder/src/java/org/lamsfoundation/lams/tool/videoRecorder/service/VideoRecorderService.java (.../VideoRecorderService.java) (revision f0bef7d11b4f82936c417e6e55c25fe9bfdb9a82) +++ lams_tool_videorecorder/src/java/org/lamsfoundation/lams/tool/videoRecorder/service/VideoRecorderService.java (.../VideoRecorderService.java) (revision acc8d2acf5b6b0002e0c8129947040a779ab4077) @@ -291,9 +291,15 @@ videoRecorder.setVideoRecorderSessions(null); VideoRecorderRecording authorRecording = (VideoRecorderRecording)getFirstRecordingByToolContentId(toolContentId).clone(); - authorRecording.setToolContentId(null); - authorRecording.setComments(null); - authorRecording.setRatings(null); + if(authorRecording != null) { + authorRecording = (VideoRecorderRecording) authorRecording.clone(); + + authorRecording.setToolContentId(null); + authorRecording.setComments(null); + authorRecording.setRatings(null); + + } + videoRecorder.setAuthorRecording(authorRecording); Set atts = videoRecorder.getVideoRecorderAttachments(); @@ -333,8 +339,11 @@ // reset it to new toolContentId videoRecorder.setToolContentId(toolContentId); - videoRecorder.getAuthorRecording().setToolContentId(toolContentId); - + + if(recording != null) { + videoRecorder.getAuthorRecording().setToolContentId(toolContentId); + } + videoRecorderDAO.saveOrUpdate(videoRecorder); if(recording != null){ @@ -395,8 +404,7 @@ throw new VideoRecorderException(error); } if (defaultContent.getConditions().isEmpty()) { - defaultContent.getConditions() - .add(getVideoRecorderOutputFactory().createDefaultComplexCondition(defaultContent)); + // needed? } return defaultContent; } @@ -785,23 +793,6 @@ this.repositoryService = repositoryService; } - /** - * {@inheritDoc} - */ - public String createConditionName(Collection existingConditions) { - String uniqueNumber = null; - do { - uniqueNumber = String.valueOf(Math.abs(generator.nextInt())); - for (VideoRecorderCondition condition : existingConditions) { - String[] splitedName = getVideoRecorderOutputFactory().splitConditionName(condition.getName()); - if (uniqueNumber.equals(splitedName[1])) { - uniqueNumber = null; - } - } - } while (uniqueNumber == null); - return getVideoRecorderOutputFactory().buildConditionName(uniqueNumber); - } - public void releaseConditionsFromCache(VideoRecorder videoRecorder) { if (videoRecorder.getConditions() != null) { for (VideoRecorderCondition condition : videoRecorder.getConditions()) { @@ -827,6 +818,10 @@ public Long getNbRatings(Long userID, Long sessionId) { return videoRecorderRatingDAO.getNbRatings(userID, sessionId); } + + public boolean isGroupedActivity(long toolContentID) { + return toolService.isGroupedActivity(toolContentID); + } /** * @return String of xml with all needed language elements @@ -897,6 +892,8 @@ languageCollection.add(new String("videorecorder.tooltip.rate.recording")); languageCollection.add(new String("videorecorder.tooltip.already.rated")); languageCollection.add(new String("videorecorder.disabled")); + languageCollection.add(new String("videorecorder.camera.not.available")); + languageCollection.add(new String("videorecorder.mic.not.available")); String languageOutput = ""; @@ -942,6 +939,8 @@ languageCollection.add(new String("videorecorder.tooltip.start.recording.next")); languageCollection.add(new String("videorecorder.tooltip.stop.recording")); languageCollection.add(new String("videorecorder.disabled")); + languageCollection.add(new String("videorecorder.camera.not.available")); + languageCollection.add(new String("videorecorder.mic.not.available")); String languageOutput = ""; Fisheye: Tag acc8d2acf5b6b0002e0c8129947040a779ab4077 refers to a dead (removed) revision in file `lams_tool_videorecorder/src/java/org/lamsfoundation/lams/tool/videoRecorder/web/actions/AuthoringVideoRecorderConditionAction.java'. Fisheye: No comparison available. Pass `N' to diff? Index: lams_tool_videorecorder/src/java/org/lamsfoundation/lams/tool/videoRecorder/web/actions/MonitoringAction.java =================================================================== diff -u -r42aa5319fbd33938828764c43dd0ab1ca80e2416 -racc8d2acf5b6b0002e0c8129947040a779ab4077 --- lams_tool_videorecorder/src/java/org/lamsfoundation/lams/tool/videoRecorder/web/actions/MonitoringAction.java (.../MonitoringAction.java) (revision 42aa5319fbd33938828764c43dd0ab1ca80e2416) +++ lams_tool_videorecorder/src/java/org/lamsfoundation/lams/tool/videoRecorder/web/actions/MonitoringAction.java (.../MonitoringAction.java) (revision acc8d2acf5b6b0002e0c8129947040a779ab4077) @@ -26,6 +26,7 @@ import java.sql.Array; import java.util.Set; +import java.util.Iterator; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; @@ -42,6 +43,7 @@ import org.lamsfoundation.lams.tool.videoRecorder.dto.VideoRecorderUserDTO; import org.lamsfoundation.lams.tool.videoRecorder.model.VideoRecorder; import org.lamsfoundation.lams.tool.videoRecorder.model.VideoRecorderUser; +import org.lamsfoundation.lams.tool.videoRecorder.model.VideoRecorderSession; import org.lamsfoundation.lams.tool.videoRecorder.service.IVideoRecorderService; import org.lamsfoundation.lams.tool.videoRecorder.service.VideoRecorderServiceProxy; import org.lamsfoundation.lams.tool.videoRecorder.web.forms.AuthoringForm; @@ -59,12 +61,14 @@ * @author * @version * - * @struts.action path="/monitoring" parameter="dispatch" scope="request" + * @struts.action path="/monitoring" parameter="method" scope="request" * name="monitoringForm" validate="false" * * @struts.action-forward name="success" path="tiles:/monitoring/main" * @struts.action-forward name="videoRecorder_display" * path="tiles:/monitoring/videoRecorder_display" + * @struts.action-forward name="videoRecorder_openInstance" + * path="/pages/monitoring/videoRecorderOpenInstance.jsp" * */ public class MonitoringAction extends LamsDispatchAction { @@ -77,7 +81,7 @@ public ActionForward unspecified(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) { - + setupService(); // get httpsession @@ -101,43 +105,28 @@ VideoRecorderDTO videoRecorderDT0 = new VideoRecorderDTO(videoRecorder); - // get first session - Set sessions = videoRecorderDT0.getSessionDTOs(); - Object[] sessionsArray = sessions.toArray(); - VideoRecorderSessionDTO firstSession = (VideoRecorderSessionDTO)sessionsArray[0]; - - // get toolSessionId - Long toolSessionID = firstSession.getSessionID(); + // get sessions in order to get first session + Set sessions = videoRecorder.getVideoRecorderSessions(); + //videoRecorderDT0.getSessionDTOs(); - // stupid shit to convert to Long - long primLongUserId = user.getUserID(); - Long longUserId = primLongUserId; + for (Iterator sessIter = sessions.iterator(); sessIter.hasNext();) { + VideoRecorderSession session = (VideoRecorderSession) sessIter.next(); + + VideoRecorderSessionDTO sessionDTO = new VideoRecorderSessionDTO(session); + videoRecorderDT0.getSessionDTOs().add(sessionDTO); - // get user - VideoRecorderUser videoRecorderUser = videoRecorderService.getUserByUserIdAndSessionId(longUserId, toolSessionID); - + } + Long currentTab = WebUtil.readLongParam(request, AttributeNames.PARAM_CURRENT_TAB,true); videoRecorderDT0.setCurrentTab(currentTab); - request.setAttribute("contentEditable", true); - request.setAttribute("mode", "author"); - request.setAttribute("userId", videoRecorderUser.getUid()); - request.setAttribute("toolSessionId", toolSessionID); - request.setAttribute("toolContentId", toolContentID); request.setAttribute("videoRecorderDTO", videoRecorderDT0); - request.setAttribute("contentFolderID", contentFolderID); + request.setAttribute(AttributeNames.PARAM_CONTENT_FOLDER_ID, contentFolderID); - // set language xml - request.setAttribute("languageXML", videoRecorderService.getLanguageXML()); - // set red5 server url - String red5ServerUrl = Configuration.get(ConfigurationKeys.RED5_SERVER_URL); - request.setAttribute("red5ServerUrl", red5ServerUrl); + boolean isGroupedActivity = videoRecorderService.isGroupedActivity(toolContentID); + request.setAttribute("isGroupedActivity", isGroupedActivity); - // set LAMS server url - String serverUrl = Configuration.get(ConfigurationKeys.SERVER_URL); - request.setAttribute("serverUrl", serverUrl); - return mapping.findForward("success"); } @@ -147,7 +136,7 @@ setupService(); Long uid = new Long(WebUtil.readLongParam(request, "userUID")); - + VideoRecorderUser user = videoRecorderService.getUserByUID(uid); NotebookEntry entry = videoRecorderService.getEntry(user.getEntryUID()); @@ -158,6 +147,65 @@ return mapping.findForward("videoRecorder_display"); } + public ActionForward openVideoRecorderInstance(ActionMapping mapping, ActionForm form, + HttpServletRequest request, HttpServletResponse response) { + + setupService(); + + // get httpsession + HttpSession ss = SessionManager.getSession(); + + // get LAMS user + UserDTO user = (UserDTO)ss.getAttribute(AttributeNames.USER); + + Long toolContentID = new Long(WebUtil.readLongParam(request, + AttributeNames.PARAM_TOOL_CONTENT_ID)); + + String contentFolderID = WebUtil.readStrParam(request, + AttributeNames.PARAM_CONTENT_FOLDER_ID); + + Long sessionId = new Long(WebUtil.readLongParam(request, AttributeNames.PARAM_TOOL_SESSION_ID)); + + VideoRecorder videoRecorder = videoRecorderService + .getVideoRecorderByContentId(toolContentID); + + if (videoRecorder == null) { + // TODO error page. + } + + VideoRecorderDTO videoRecorderDT0 = new VideoRecorderDTO(videoRecorder); + VideoRecorderSession session = (VideoRecorderSession) videoRecorderService.getSessionBySessionId(sessionId); + + // check Monitor user is part of the session + VideoRecorderUser videoRecorderUser = videoRecorderService.getUserByUserIdAndSessionId(new Long(user.getUserID()), sessionId); + + if(videoRecorderUser == null){ + // create new Monitoring user for Session + videoRecorderUser = videoRecorderService.createVideoRecorderUser(user, session); + } + + request.setAttribute("contentEditable", true); + request.setAttribute("mode", "author"); + + request.setAttribute("videoRecorderDTO", videoRecorderDT0); + request.setAttribute(AttributeNames.PARAM_TOOL_SESSION_ID, sessionId); + request.setAttribute("monitoringUid", videoRecorderUser.getUid()); + request.setAttribute("contentFolderID", contentFolderID); + + // set language xml + request.setAttribute("languageXML", videoRecorderService.getLanguageXML()); + + // set red5 server url + String red5ServerUrl = Configuration.get(ConfigurationKeys.RED5_SERVER_URL); + request.setAttribute("red5ServerUrl", red5ServerUrl); + + // set LAMS server url + String serverUrl = Configuration.get(ConfigurationKeys.SERVER_URL); + request.setAttribute("serverUrl", serverUrl); + + return mapping.findForward("videoRecorder_openInstance"); + } + /** * set up videoRecorderService */ Index: lams_tool_videorecorder/web/WEB-INF/struts/struts-config.xml =================================================================== diff -u -r3d081de4a45da632ee6029251318fac795d41813 -racc8d2acf5b6b0002e0c8129947040a779ab4077 --- lams_tool_videorecorder/web/WEB-INF/struts/struts-config.xml (.../struts-config.xml) (revision 3d081de4a45da632ee6029251318fac795d41813) +++ lams_tool_videorecorder/web/WEB-INF/struts/struts-config.xml (.../struts-config.xml) (revision acc8d2acf5b6b0002e0c8129947040a779ab4077) @@ -18,16 +18,16 @@ type="org.lamsfoundation.lams.tool.videoRecorder.web.forms.VideoRecorderConditionForm" /> @@ -46,11 +46,29 @@ + + + - - - @@ -116,10 +116,15 @@ path="tiles:/monitoring/videoRecorder_display" redirect="false" /> + - + Index: lams_tool_videorecorder/web/WEB-INF/web.xml =================================================================== diff -u -r0732f5d12802da95cf69e474b30630653924abc5 -racc8d2acf5b6b0002e0c8129947040a779ab4077 --- lams_tool_videorecorder/web/WEB-INF/web.xml (.../web.xml) (revision 0732f5d12802da95cf69e474b30630653924abc5) +++ lams_tool_videorecorder/web/WEB-INF/web.xml (.../web.xml) (revision acc8d2acf5b6b0002e0c8129947040a779ab4077) @@ -10,16 +10,16 @@ contextConfigLocation - - classpath:/org/lamsfoundation/lams/applicationContext.xml - classpath:/org/lamsfoundation/lams/lesson/lessonApplicationContext.xml - classpath:/org/lamsfoundation/lams/toolApplicationContext.xml - classpath:/org/lamsfoundation/lams/learning/learningApplicationContext.xml - classpath:/org/lamsfoundation/lams/contentrepository/applicationContext.xml - classpath:/org/lamsfoundation/lams/tool/videoRecorder/videoRecorderApplicationContext.xml - classpath:/org/lamsfoundation/lams/tool/videoRecorder/dbupdates/autopatchContext.xml - + classpath:/org/lamsfoundation/lams/tool/videoRecorder/dbupdates/autopatchContext.xml + + locatorFactorySelector + classpath*:/org/lamsfoundation/lams/**/beanRefContext.xml + + + parentContextKey + context.central + SystemSessionFilter @@ -34,7 +34,7 @@ sessionFactoryBeanName - videoRecorderSessionFactory + coreSessionFactory Index: lams_tool_videorecorder/web/common/header.jsp =================================================================== diff -u -r3d081de4a45da632ee6029251318fac795d41813 -racc8d2acf5b6b0002e0c8129947040a779ab4077 --- lams_tool_videorecorder/web/common/header.jsp (.../header.jsp) (revision 3d081de4a45da632ee6029251318fac795d41813) +++ lams_tool_videorecorder/web/common/header.jsp (.../header.jsp) (revision acc8d2acf5b6b0002e0c8129947040a779ab4077) @@ -11,7 +11,7 @@ <fmt:message key="activity.title" /> - + Index: lams_tool_videorecorder/web/common/learnerheader.jsp =================================================================== diff -u -r3d081de4a45da632ee6029251318fac795d41813 -racc8d2acf5b6b0002e0c8129947040a779ab4077 --- lams_tool_videorecorder/web/common/learnerheader.jsp (.../learnerheader.jsp) (revision 3d081de4a45da632ee6029251318fac795d41813) +++ lams_tool_videorecorder/web/common/learnerheader.jsp (.../learnerheader.jsp) (revision acc8d2acf5b6b0002e0c8129947040a779ab4077) @@ -11,7 +11,7 @@ <fmt:message key="activity.title" /> - + Index: lams_tool_videorecorder/web/includes/flash/VideoRecorder.swf =================================================================== diff -u -rf0bef7d11b4f82936c417e6e55c25fe9bfdb9a82 -racc8d2acf5b6b0002e0c8129947040a779ab4077 Binary files differ Index: lams_tool_videorecorder/web/pages/authoring/basic.jsp =================================================================== diff -u -rf0bef7d11b4f82936c417e6e55c25fe9bfdb9a82 -racc8d2acf5b6b0002e0c8129947040a779ab4077 --- lams_tool_videorecorder/web/pages/authoring/basic.jsp (.../basic.jsp) (revision f0bef7d11b4f82936c417e6e55c25fe9bfdb9a82) +++ lams_tool_videorecorder/web/pages/authoring/basic.jsp (.../basic.jsp) (revision acc8d2acf5b6b0002e0c8129947040a779ab4077) @@ -40,12 +40,13 @@ var requiredMinorVersion = 0; // Minor version of Flash required var requiredRevision = 124; + var requiredRevisionIE = 159; // Version check for the Flash Player that has the ability to start Player Product Install (6.0r65) var hasProductInstall = DetectFlashVer(6, 0, 65); // Version check based upon the values defined in globals - var hasRequestedVersion = DetectFlashVer(requiredMajorVersion, requiredMinorVersion, requiredRevision); + var hasRequestedVersion = (isIE == true) ? DetectFlashVer(requiredMajorVersion, requiredMinorVersion, requiredRevisionIE) : DetectFlashVer(requiredMajorVersion, requiredMinorVersion, requiredRevision); if ( hasProductInstall && !hasRequestedVersion ) { // DO NOT MODIFY THE FOLLOWING FOUR LINES Index: lams_tool_videorecorder/web/pages/export/exportPortfolio.jsp =================================================================== diff -u -rf0bef7d11b4f82936c417e6e55c25fe9bfdb9a82 -racc8d2acf5b6b0002e0c8129947040a779ab4077 --- lams_tool_videorecorder/web/pages/export/exportPortfolio.jsp (.../exportPortfolio.jsp) (revision f0bef7d11b4f82936c417e6e55c25fe9bfdb9a82) +++ lams_tool_videorecorder/web/pages/export/exportPortfolio.jsp (.../exportPortfolio.jsp) (revision acc8d2acf5b6b0002e0c8129947040a779ab4077) @@ -29,10 +29,19 @@
    - -

    - -

    + + + + + + +
    +

    + +

    +
    + +

    Index: lams_tool_videorecorder/web/pages/learning/videoRecorder.jsp =================================================================== diff -u -r2f21856ec2ab85b47c93cfcc3fa2c8769be65077 -racc8d2acf5b6b0002e0c8129947040a779ab4077 --- lams_tool_videorecorder/web/pages/learning/videoRecorder.jsp (.../videoRecorder.jsp) (revision 2f21856ec2ab85b47c93cfcc3fa2c8769be65077) +++ lams_tool_videorecorder/web/pages/learning/videoRecorder.jsp (.../videoRecorder.jsp) (revision acc8d2acf5b6b0002e0c8129947040a779ab4077) @@ -25,6 +25,7 @@ var requiredMinorVersion = 0; // Minor version of Flash required var requiredRevision = 124; + var requiredRevisionIE = 159; var mode = "${mode}"; @@ -95,7 +96,7 @@ var hasProductInstall = DetectFlashVer(6, 0, 65); // Version check based upon the values defined in globals - var hasRequestedVersion = DetectFlashVer(requiredMajorVersion, requiredMinorVersion, requiredRevision); + var hasRequestedVersion = (isIE == true) ? DetectFlashVer(requiredMajorVersion, requiredMinorVersion, requiredRevisionIE) : DetectFlashVer(requiredMajorVersion, requiredMinorVersion, requiredRevision); if ( hasProductInstall && !hasRequestedVersion ) { // DO NOT MODIFY THE FOLLOWING FOUR LINES Index: lams_tool_videorecorder/web/pages/monitoring/summary.jsp =================================================================== diff -u -rf0bef7d11b4f82936c417e6e55c25fe9bfdb9a82 -racc8d2acf5b6b0002e0c8129947040a779ab4077 --- lams_tool_videorecorder/web/pages/monitoring/summary.jsp (.../summary.jsp) (revision f0bef7d11b4f82936c417e6e55c25fe9bfdb9a82) +++ lams_tool_videorecorder/web/pages/monitoring/summary.jsp (.../summary.jsp) (revision acc8d2acf5b6b0002e0c8129947040a779ab4077) @@ -2,19 +2,42 @@ <%@ page import="org.lamsfoundation.lams.util.ConfigurationKeys" %> <%@ include file="/common/taglibs.jsp"%> + - -

    @@ -168,101 +191,45 @@

    -
    - - -
    + + +

    + +

    +
    + + + + + + + + + + + +
    +

    + ${session.sessionName} +

    +
    + + /monitoring.do?method=openVideoRecorderInstance&toolContentID=&toolSessionID=&contentFolderID= + + + + + + + + + +
    +
    +
    +
    Index: lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/dao/hibernate/VoteUsrAttemptDAO.java =================================================================== diff -u -r2ed86809be97c2553630665e20d6cc21b57c531c -racc8d2acf5b6b0002e0c8129947040a779ab4077 --- lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/dao/hibernate/VoteUsrAttemptDAO.java (.../VoteUsrAttemptDAO.java) (revision 2ed86809be97c2553630665e20d6cc21b57c531c) +++ lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/dao/hibernate/VoteUsrAttemptDAO.java (.../VoteUsrAttemptDAO.java) (revision acc8d2acf5b6b0002e0c8129947040a779ab4077) @@ -41,8 +41,7 @@ /** * @author Ozgur Demirtas repaired by lfoxton *

    - * Hibernate implementation for database access to VoteUsrAttemptDAO for - * the voting tool. + * Hibernate implementation for database access to VoteUsrAttemptDAO for the voting tool. *

    */ public class VoteUsrAttemptDAO extends HibernateDaoSupport implements IVoteUsrAttemptDAO { @@ -70,20 +69,19 @@ // lfoxton about below: // No! Very Bad programmer!!! Go to your room and think about what you did! - //private static final String LOAD_ALL_ENTRIES = "from voteUsrAttempt in class VoteUsrAttempt"; + // private static final String LOAD_ALL_ENTRIES = "from voteUsrAttempt in class VoteUsrAttempt"; private static final String LOAD_DISTINCT_USER_ENTRIES = "select distinct voteUsrAttempt.queUsrId from VoteUsrAttempt voteUsrAttempt"; private static final String COUNT_ATTEMPTS_BY_CONTENT_ID = "select count(*) from VoteUsrAttempt att, VoteQueUsr user, VoteSession ses where " + "att.voteQueUsr=user and user.voteSession=ses and " + "ses.voteContentId=:voteContentId"; - + private static final String LOAD_ENTRIES_BY_SESSION_ID = "select att from VoteUsrAttempt att, VoteQueUsr user, VoteSession ses where " + "att.voteQueUsr=user and user.voteSession=ses and ses.uid=:voteSessionUid"; - + private static final String COUNT_ENTRIES_BY_SESSION_ID = "select count(*) from VoteUsrAttempt att, VoteQueUsr user, VoteSession ses where " + "att.voteQueUsr=user and user.voteSession=ses and ses.uid=:voteSessionUid"; - public VoteUsrAttempt getVoteUserAttemptByUID(Long uid) { return (VoteUsrAttempt) this.getHibernateTemplate().get(VoteUsrAttempt.class, uid); } @@ -107,20 +105,21 @@ public List getAttemptsForUser(final Long queUsrId) { HibernateTemplate templ = this.getHibernateTemplate(); - List list = getSession().createQuery(LOAD_ATTEMPT_FOR_USER).setLong("queUsrId", queUsrId.longValue()).list(); + List list = getSession().createQuery(VoteUsrAttemptDAO.LOAD_ATTEMPT_FOR_USER).setLong("queUsrId", + queUsrId.longValue()).list(); return list; } public int getUserEnteredVotesCountForContent(final Long voteContentUid) { - List result = getSession().createQuery(COUNT_ATTEMPTS_BY_CONTENT_ID).setLong("voteContentId", voteContentUid) - .list(); - Integer resultInt = (result.get(0) != null) ? (Integer) result.get(0) : new Integer(0); - return resultInt.intValue(); + List result = getSession().createQuery(VoteUsrAttemptDAO.COUNT_ATTEMPTS_BY_CONTENT_ID).setLong("voteContentId", + voteContentUid).list(); + Long resultLong = result.get(0) != null ? (Long) result.get(0) : new Long(0); + return resultLong.intValue(); } public Set getUserEntries() { HibernateTemplate templ = this.getHibernateTemplate(); - List list = getSession().createQuery(LOAD_USER_ENTRIES).list(); + List list = getSession().createQuery(VoteUsrAttemptDAO.LOAD_USER_ENTRIES).list(); Set set = new HashSet(); @@ -129,32 +128,34 @@ Iterator listIterator = list.iterator(); while (listIterator.hasNext()) { String entry = (String) listIterator.next(); - logger.debug("entry: " + entry); - if ((entry != null) && (entry.length() > 0)) + VoteUsrAttemptDAO.logger.debug("entry: " + entry); + if (entry != null && entry.length() > 0) { userEntries.add(entry); + } } } return userEntries; } public List getSessionUserEntries(final Long voteSessionUid) { - - return getSession().createQuery(LOAD_ENTRIES_BY_SESSION_ID).setLong("voteSessionUid", voteSessionUid).list(); + + return getSession().createQuery(VoteUsrAttemptDAO.LOAD_ENTRIES_BY_SESSION_ID).setLong("voteSessionUid", + voteSessionUid).list(); } public Set getSessionUserEntriesSet(final Long voteSessionUid) { - List list = (List)getSessionUserEntries(voteSessionUid); + List list = getSessionUserEntries(voteSessionUid); Set sessionUserEntries = new HashSet(); - for (VoteUsrAttempt att : list) - { + for (VoteUsrAttempt att : list) { sessionUserEntries.add(att); } return sessionUserEntries; } public int getUserRecordsEntryCount(final String userEntry) { HibernateTemplate templ = this.getHibernateTemplate(); - List list = getSession().createQuery(LOAD_DISTINCT_USER_ENTRY_RECORDS).setString("userEntry", userEntry).list(); + List list = getSession().createQuery(VoteUsrAttemptDAO.LOAD_DISTINCT_USER_ENTRY_RECORDS).setString("userEntry", + userEntry).list(); if (list != null && list.size() > 0) { return list.size(); @@ -166,18 +167,19 @@ public int getSessionUserRecordsEntryCount(final String userEntry, final Long voteSessionUid, IVoteService voteService) { HibernateTemplate templ = this.getHibernateTemplate(); - List list = getSession().createQuery(LOAD_DISTINCT_USER_ENTRY_RECORDS).setString("userEntry", userEntry).list(); + List list = getSession().createQuery(VoteUsrAttemptDAO.LOAD_DISTINCT_USER_ENTRY_RECORDS).setString("userEntry", + userEntry).list(); int entryCount = 0; if (list != null && list.size() > 0) { Iterator listIterator = list.iterator(); while (listIterator.hasNext()) { Long userId = (Long) listIterator.next(); - logger.debug("userId: " + userId); - logger.debug("voteService: " + voteService); + VoteUsrAttemptDAO.logger.debug("userId: " + userId); + VoteUsrAttemptDAO.logger.debug("voteService: " + voteService); VoteQueUsr voteQueUsr = voteService.getVoteUserByUID(userId); - logger.debug("voteQueUsr: " + voteQueUsr); + VoteUsrAttemptDAO.logger.debug("voteQueUsr: " + voteQueUsr); if (voteQueUsr.getVoteSession().getUid().toString().equals(voteSessionUid.toString())) { ++entryCount; @@ -189,7 +191,8 @@ public void removeAttemptsForUser(final Long queUsrId) { HibernateTemplate templ = this.getHibernateTemplate(); - List list = getSession().createQuery(LOAD_ATTEMPT_FOR_USER).setLong("queUsrId", queUsrId.longValue()).list(); + List list = getSession().createQuery(VoteUsrAttemptDAO.LOAD_ATTEMPT_FOR_USER).setLong("queUsrId", + queUsrId.longValue()).list(); if (list != null && list.size() > 0) { Iterator listIterator = list.iterator(); @@ -223,8 +226,8 @@ public int getAttemptsForQuestionContent(final Long voteQueContentId) { HibernateTemplate templ = this.getHibernateTemplate(); - List list = getSession().createQuery(LOAD_ATTEMPT_FOR_QUESTION_CONTENT).setLong("voteQueContentId", - voteQueContentId.longValue()).list(); + List list = getSession().createQuery(VoteUsrAttemptDAO.LOAD_ATTEMPT_FOR_QUESTION_CONTENT).setLong( + "voteQueContentId", voteQueContentId.longValue()).list(); if (list != null && list.size() > 0) { return list.size(); @@ -235,8 +238,8 @@ public int getStandardAttemptsForQuestionContentAndSessionUid(final Long voteQueContentId, final Long voteSessionUid) { HibernateTemplate templ = this.getHibernateTemplate(); - List list = getSession().createQuery(LOAD_ATTEMPT_FOR_QUESTION_CONTENT).setLong("voteQueContentId", - voteQueContentId.longValue()).list(); + List list = getSession().createQuery(VoteUsrAttemptDAO.LOAD_ATTEMPT_FOR_QUESTION_CONTENT).setLong( + "voteQueContentId", voteQueContentId.longValue()).list(); List userEntries = new ArrayList(); if (list != null && list.size() > 0) { @@ -255,8 +258,8 @@ public List getStandardAttemptUsersForQuestionContentAndSessionUid(final Long voteQueContentId, final Long voteSessionUid) { HibernateTemplate templ = this.getHibernateTemplate(); - List list = getSession().createQuery(LOAD_ATTEMPT_FOR_QUESTION_CONTENT).setLong("voteQueContentId", - voteQueContentId.longValue()).list(); + List list = getSession().createQuery(VoteUsrAttemptDAO.LOAD_ATTEMPT_FOR_QUESTION_CONTENT).setLong( + "voteQueContentId", voteQueContentId.longValue()).list(); List userEntries = new ArrayList(); if (list != null && list.size() > 0) { @@ -274,19 +277,21 @@ public boolean isVoteVisibleForSession(final String userEntry, final Long voteSessionUid) { HibernateTemplate templ = this.getHibernateTemplate(); - List list = getSession().createQuery(LOAD_USER_ENTRY_RECORDS).setString("userEntry", userEntry).list(); + List list = getSession().createQuery(VoteUsrAttemptDAO.LOAD_USER_ENTRY_RECORDS).setString("userEntry", + userEntry).list(); List sessionUserEntries = new ArrayList(); if (list != null && list.size() > 0) { Iterator listIterator = list.iterator(); while (listIterator.hasNext()) { VoteUsrAttempt attempt = (VoteUsrAttempt) listIterator.next(); - logger.debug("attempt: " + attempt); + VoteUsrAttemptDAO.logger.debug("attempt: " + attempt); if (attempt.getVoteQueUsr().getVoteSession().getUid().toString().equals(voteSessionUid.toString())) { boolean isVoteVisible = attempt.isVisible(); - logger.debug("isVoteVisible: " + isVoteVisible); - if (isVoteVisible == false) + VoteUsrAttemptDAO.logger.debug("isVoteVisible: " + isVoteVisible); + if (isVoteVisible == false) { return false; + } } } } @@ -296,8 +301,8 @@ public int getStandardAttemptsForQuestionContentAndContentUid(final Long voteQueContentId, final Long voteContentUid) { HibernateTemplate templ = this.getHibernateTemplate(); - List list = getSession().createQuery(LOAD_ATTEMPT_FOR_QUESTION_CONTENT).setLong("voteQueContentId", - voteQueContentId.longValue()).list(); + List list = getSession().createQuery(VoteUsrAttemptDAO.LOAD_ATTEMPT_FOR_QUESTION_CONTENT).setLong( + "voteQueContentId", voteQueContentId.longValue()).list(); List userEntries = new ArrayList(); if (list != null && list.size() > 0) { @@ -317,23 +322,24 @@ public List getAttemptsForUserAndQuestionContent(final Long queUsrId, final Long voteQueContentId) { HibernateTemplate templ = this.getHibernateTemplate(); - List list = getSession().createQuery(LOAD_ATTEMPT_FOR_USER_AND_QUESTION_CONTENT).setLong("queUsrId", - queUsrId.longValue()).setLong("voteQueContentId", voteQueContentId.longValue()).list(); + List list = getSession().createQuery(VoteUsrAttemptDAO.LOAD_ATTEMPT_FOR_USER_AND_QUESTION_CONTENT).setLong( + "queUsrId", queUsrId.longValue()).setLong("voteQueContentId", voteQueContentId.longValue()).list(); return list; } public VoteUsrAttempt getAttemptsForUserAndQuestionContentAndSession(final Long queUsrId, final Long voteQueContentId, final Long voteSessionId) { HibernateTemplate templ = this.getHibernateTemplate(); - List list = getSession().createQuery(LOAD_ATTEMPT_FOR_USER_AND_QUESTION_CONTENT_AND_SESSION).setLong( - "queUsrId", queUsrId.longValue()).setLong("voteQueContentId", voteQueContentId.longValue()).list(); + List list = getSession().createQuery(VoteUsrAttemptDAO.LOAD_ATTEMPT_FOR_USER_AND_QUESTION_CONTENT_AND_SESSION) + .setLong("queUsrId", queUsrId.longValue()).setLong("voteQueContentId", voteQueContentId.longValue()) + .list(); if (list != null && list.size() > 0) { Iterator listIterator = list.iterator(); while (listIterator.hasNext()) { VoteUsrAttempt attempt = (VoteUsrAttempt) listIterator.next(); - logger.debug("attempt: " + attempt); + VoteUsrAttemptDAO.logger.debug("attempt: " + attempt); if (attempt.getVoteQueUsr().getVoteSession().getUid().toString().equals(voteSessionId.toString())) { return attempt; } @@ -343,61 +349,63 @@ } public Set getAttemptsForUserAndSession(final Long queUsrId, final Long voteSessionId) { - logger.debug("starting getAttemptsForUserAndSession"); - logger.debug("queUsrId: " + queUsrId); - logger.debug("voteSessionId: " + voteSessionId); + VoteUsrAttemptDAO.logger.debug("starting getAttemptsForUserAndSession"); + VoteUsrAttemptDAO.logger.debug("queUsrId: " + queUsrId); + VoteUsrAttemptDAO.logger.debug("voteSessionId: " + voteSessionId); HibernateTemplate templ = this.getHibernateTemplate(); - List list = getSession().createQuery(LOAD_ATTEMPT_FOR_USER_AND_SESSION).setLong("queUsrId", + List list = getSession().createQuery(VoteUsrAttemptDAO.LOAD_ATTEMPT_FOR_USER_AND_SESSION).setLong("queUsrId", queUsrId.longValue()).list(); - logger.debug("list: " + list); + VoteUsrAttemptDAO.logger.debug("list: " + list); Set userEntries = new HashSet(); if (list != null && list.size() > 0) { Iterator listIterator = list.iterator(); while (listIterator.hasNext()) { VoteUsrAttempt attempt = (VoteUsrAttempt) listIterator.next(); - logger.debug("attempt: " + attempt); + VoteUsrAttemptDAO.logger.debug("attempt: " + attempt); if (attempt.getVoteQueUsr().getVoteSession().getUid().toString().equals(voteSessionId.toString())) { if (!attempt.getVoteQueContentId().toString().equals("1")) { - logger.debug("adding attempt question : " + attempt.getVoteQueContent().getQuestion()); + VoteUsrAttemptDAO.logger.debug("adding attempt question : " + + attempt.getVoteQueContent().getQuestion()); userEntries.add(attempt.getVoteQueContent().getQuestion()); } } } } - logger.debug("returning userEntries: " + userEntries); + VoteUsrAttemptDAO.logger.debug("returning userEntries: " + userEntries); return userEntries; } public Set getAttemptsForUserAndSessionUseOpenAnswer(final Long queUsrId, final Long voteSessionId) { - logger.debug("starting getAttemptsForUserAndSession"); - logger.debug("queUsrId: " + queUsrId); - logger.debug("voteSessionId: " + voteSessionId); + VoteUsrAttemptDAO.logger.debug("starting getAttemptsForUserAndSession"); + VoteUsrAttemptDAO.logger.debug("queUsrId: " + queUsrId); + VoteUsrAttemptDAO.logger.debug("voteSessionId: " + voteSessionId); HibernateTemplate templ = this.getHibernateTemplate(); - List list = getSession().createQuery(LOAD_ATTEMPT_FOR_USER_AND_SESSION).setLong("queUsrId", + List list = getSession().createQuery(VoteUsrAttemptDAO.LOAD_ATTEMPT_FOR_USER_AND_SESSION).setLong("queUsrId", queUsrId.longValue()).list(); - logger.debug("list: " + list); + VoteUsrAttemptDAO.logger.debug("list: " + list); String openAnswer = ""; Set userEntries = new HashSet(); if (list != null && list.size() > 0) { Iterator listIterator = list.iterator(); while (listIterator.hasNext()) { VoteUsrAttempt attempt = (VoteUsrAttempt) listIterator.next(); - logger.debug("attempt: " + attempt); + VoteUsrAttemptDAO.logger.debug("attempt: " + attempt); if (attempt.getVoteQueUsr().getVoteSession().getUid().toString().equals(voteSessionId.toString())) { if (!attempt.getVoteQueContentId().toString().equals("1")) { - logger.debug("adding attempt question : " + attempt.getVoteQueContent().getQuestion()); + VoteUsrAttemptDAO.logger.debug("adding attempt question : " + + attempt.getVoteQueContent().getQuestion()); userEntries.add(attempt.getVoteQueContent().getQuestion()); } else { - logger.debug("this is a user entered vote: " + attempt.getUserEntry()); + VoteUsrAttemptDAO.logger.debug("this is a user entered vote: " + attempt.getUserEntry()); if (attempt.getUserEntry().length() > 0) { openAnswer = attempt.getUserEntry(); - logger.debug("adding openAnswer to userEntries: "); + VoteUsrAttemptDAO.logger.debug("adding openAnswer to userEntries: "); userEntries.add(openAnswer); } @@ -407,14 +415,14 @@ } } - logger.debug("final userEntries : " + userEntries); + VoteUsrAttemptDAO.logger.debug("final userEntries : " + userEntries); return userEntries; } public List getAttemptsListForUserAndQuestionContent(final Long queUsrId, final Long voteQueContentId) { HibernateTemplate templ = this.getHibernateTemplate(); - List list = getSession().createQuery(LOAD_ATTEMPT_FOR_USER_AND_QUESTION_CONTENT).setLong("queUsrId", - queUsrId.longValue()).setLong("voteQueContentId", voteQueContentId.longValue()).list(); + List list = getSession().createQuery(VoteUsrAttemptDAO.LOAD_ATTEMPT_FOR_USER_AND_QUESTION_CONTENT).setLong( + "queUsrId", queUsrId.longValue()).setLong("voteQueContentId", voteQueContentId.longValue()).list(); return list; } @@ -424,27 +432,29 @@ public List getAttemptForQueContent(final Long queUsrId, final Long voteQueContentId) { HibernateTemplate templ = this.getHibernateTemplate(); - List list = getSession().createQuery(LOAD_ATTEMPT_FOR_QUE_CONTENT).setLong("queUsrId", queUsrId.longValue()) - .setLong("voteQueContentId", voteQueContentId.longValue()).list(); + List list = getSession().createQuery(VoteUsrAttemptDAO.LOAD_ATTEMPT_FOR_QUE_CONTENT).setLong("queUsrId", + queUsrId.longValue()).setLong("voteQueContentId", voteQueContentId.longValue()).list(); return list; } public List getUserRecords(final String userEntry) { HibernateTemplate templ = this.getHibernateTemplate(); - List list = getSession().createQuery(LOAD_USER_ENTRY_RECORDS).setString("userEntry", userEntry).list(); + List list = getSession().createQuery(VoteUsrAttemptDAO.LOAD_USER_ENTRY_RECORDS).setString("userEntry", + userEntry).list(); return list; } public List getUserEnteredVotesForSession(final String userEntry, final Long voteSessionUid) { HibernateTemplate templ = this.getHibernateTemplate(); - List list = getSession().createQuery(LOAD_USER_ENTRY_RECORDS).setString("userEntry", userEntry).list(); + List list = getSession().createQuery(VoteUsrAttemptDAO.LOAD_USER_ENTRY_RECORDS).setString("userEntry", + userEntry).list(); List sessionUserEntries = new ArrayList(); if (list != null && list.size() > 0) { Iterator listIterator = list.iterator(); while (listIterator.hasNext()) { VoteUsrAttempt attempt = (VoteUsrAttempt) listIterator.next(); - logger.debug("attempt: " + attempt); + VoteUsrAttemptDAO.logger.debug("attempt: " + attempt); if (attempt.getVoteQueUsr().getVoteSession().getUid().toString().equals(voteSessionUid.toString())) { sessionUserEntries.add(attempt.getUserEntry()); } @@ -453,25 +463,23 @@ return sessionUserEntries; } - public int getSessionEntriesCount(final Long voteSessionUid) { - List result = getSession().createQuery(COUNT_ENTRIES_BY_SESSION_ID).setLong("voteSessionUid", voteSessionUid) - .list(); - logger.debug("getSessionEntriesCount: " + result); - Integer resultInt = (result.get(0) != null) ? (Integer) result.get(0) : new Integer(0); - return resultInt.intValue(); + List result = getSession().createQuery(VoteUsrAttemptDAO.COUNT_ENTRIES_BY_SESSION_ID).setLong("voteSessionUid", + voteSessionUid).list(); + VoteUsrAttemptDAO.logger.debug("getSessionEntriesCount: " + result); + Long resultLong = result.get(0) != null ? (Long) result.get(0) : new Long(0); + return resultLong.intValue(); } public int getCompletedSessionEntriesCount(final Long voteSessionUid) { - List list = (List)getSessionUserEntries(voteSessionUid); + List list = getSessionUserEntries(voteSessionUid); int completedSessionCount = 0; - for(VoteUsrAttempt att : list) - { + for (VoteUsrAttempt att : list) { String sessionStatus = att.getVoteQueUsr().getVoteSession().getSessionStatus(); - logger.debug("this is a completed session: " + sessionStatus); - ++completedSessionCount; + VoteUsrAttemptDAO.logger.debug("this is a completed session: " + sessionStatus); + ++completedSessionCount; } - logger.debug("getCompletedSessionEntriesCount" + completedSessionCount); + VoteUsrAttemptDAO.logger.debug("getCompletedSessionEntriesCount" + completedSessionCount); return completedSessionCount; } Index: lams_tool_vote/web/WEB-INF/web.xml =================================================================== diff -u -r126d84999e520648cb187e465cb4aaa3baad222e -racc8d2acf5b6b0002e0c8129947040a779ab4077 --- lams_tool_vote/web/WEB-INF/web.xml (.../web.xml) (revision 126d84999e520648cb187e465cb4aaa3baad222e) +++ lams_tool_vote/web/WEB-INF/web.xml (.../web.xml) (revision acc8d2acf5b6b0002e0c8129947040a779ab4077) @@ -26,13 +26,17 @@ org.lamsfoundation.lams.tool.vote.ApplicationResources
    + + contextClass + org.jboss.spring.factory.VFSXmlWebApplicationContext + contextConfigLocation classpath:/org/lamsfoundation/lams/tool/vote/dbupdates/autopatchContext.xml locatorFactorySelector - classpath*:/org/lamsfoundation/lams/**/beanRefContext.xml + classpath:/org/lamsfoundation/lams/beanRefContext.xml parentContextKey Index: lams_tool_wiki/conf/xdoclet/web-settings.xml =================================================================== diff -u -r126d84999e520648cb187e465cb4aaa3baad222e -racc8d2acf5b6b0002e0c8129947040a779ab4077 --- lams_tool_wiki/conf/xdoclet/web-settings.xml (.../web-settings.xml) (revision 126d84999e520648cb187e465cb4aaa3baad222e) +++ lams_tool_wiki/conf/xdoclet/web-settings.xml (.../web-settings.xml) (revision acc8d2acf5b6b0002e0c8129947040a779ab4077) @@ -5,13 +5,17 @@ org.lamsfoundation.lams.tool.wiki.ApplicationResources + + contextClass + org.jboss.spring.factory.VFSXmlWebApplicationContext + contextConfigLocation classpath:/org/lamsfoundation/lams/tool/wiki/dbupdates/autopatchContext.xml locatorFactorySelector - classpath*:/org/lamsfoundation/lams/**/beanRefContext.xml + classpath:/org/lamsfoundation/lams/beanRefContext.xml parentContextKey Index: lams_tool_wiki/db/sql/create_lams_tool_wiki.sql =================================================================== diff -u -re3b4354d83bbeff0b953d1fce2bc3be6323c0b50 -racc8d2acf5b6b0002e0c8129947040a779ab4077 --- lams_tool_wiki/db/sql/create_lams_tool_wiki.sql (.../create_lams_tool_wiki.sql) (revision e3b4354d83bbeff0b953d1fce2bc3be6323c0b50) +++ lams_tool_wiki/db/sql/create_lams_tool_wiki.sql (.../create_lams_tool_wiki.sql) (revision acc8d2acf5b6b0002e0c8129947040a779ab4077) @@ -20,7 +20,7 @@ added_by bigint, wiki_session_uid bigint, primary key (uid), - unique key UK9406D87760B3B03B (wiki_uid, title, wiki_session_uid) + unique key wiki_unique_key (wiki_uid, title, wiki_session_uid) )TYPE=InnoDB; create table tl_lawiki10_wiki_page_content (uid bigint not null auto_increment, wiki_page_uid bigint, body text, editor bigint, edit_date datetime, version bigint, primary key (uid))TYPE=InnoDB; @@ -32,10 +32,10 @@ alter table tl_lawiki10_session add index FKF01D63C2A3FF7EC0 (wiki_main_page_uid), add constraint FKF01D63C2A3FF7EC0 foreign key (wiki_main_page_uid) references tl_lawiki10_wiki_page (uid); alter table tl_lawiki10_user add index FKED5D7A1FD8004954 (wiki_session_uid), add constraint FKED5D7A1FD8004954 foreign key (wiki_session_uid) references tl_lawiki10_session (uid); alter table tl_lawiki10_wiki add index FKED5E3E04A3FF7EC0 (wiki_main_page_uid), add constraint FKED5E3E04A3FF7EC0 foreign key (wiki_main_page_uid) references tl_lawiki10_wiki_page (uid); -alter table tl_lawiki10_wiki_page add index FK961AFFEAD8004954 (wiki_session_uid), add constraint FK961AFFEAD8004954 foreign key (wiki_session_uid) references tl_lawiki10_session (uid); -alter table tl_lawiki10_wiki_page add index FK961AFFEA60B3B03B (wiki_uid), add constraint FK961AFFEA60B3B03B foreign key (wiki_uid) references tl_lawiki10_wiki (uid); -alter table tl_lawiki10_wiki_page add index FK961AFFEA36CBA7DB (added_by), add constraint FK961AFFEA36CBA7DB foreign key (added_by) references tl_lawiki10_user (uid); -alter table tl_lawiki10_wiki_page add index FK961AFFEAE48332B4 (wiki_current_content), add constraint FK961AFFEAE48332B4 foreign key (wiki_current_content) references tl_lawiki10_wiki_page_content (uid); +alter table tl_lawiki10_wiki_page add index wiki_page_index_1 (wiki_session_uid), add constraint wiki_page_fk_1 foreign key (wiki_session_uid) references tl_lawiki10_session (uid); +alter table tl_lawiki10_wiki_page add index wiki_page_index_2 (wiki_uid), add constraint wiki_page_fk_2 foreign key (wiki_uid) references tl_lawiki10_wiki (uid); +alter table tl_lawiki10_wiki_page add index wiki_page_index_3 (added_by), add constraint wiki_page_fk_3 foreign key (added_by) references tl_lawiki10_user (uid); +alter table tl_lawiki10_wiki_page add index wiki_page_index_4 (wiki_current_content), add constraint wiki_page_fk_4 foreign key (wiki_current_content) references tl_lawiki10_wiki_page_content (uid); alter table tl_lawiki10_wiki_page_content add index FK528051242D44CCF8 (wiki_page_uid), add constraint FK528051242D44CCF8 foreign key (wiki_page_uid) references tl_lawiki10_wiki_page (uid); alter table tl_lawiki10_wiki_page_content add index FK528051243233D952 (editor), add constraint FK528051243233D952 foreign key (editor) references tl_lawiki10_user (uid); Index: lams_tool_wiki/web/pages/wiki/compare.jsp =================================================================== diff -u -r40fb72d3289330a49552817cf29d032ba4e203a1 -racc8d2acf5b6b0002e0c8129947040a779ab4077 --- lams_tool_wiki/web/pages/wiki/compare.jsp (.../compare.jsp) (revision 40fb72d3289330a49552817cf29d032ba4e203a1) +++ lams_tool_wiki/web/pages/wiki/compare.jsp (.../compare.jsp) (revision acc8d2acf5b6b0002e0c8129947040a779ab4077) @@ -1,5 +1,4 @@ <%@ include file="/common/taglibs.jsp"%> - @@ -13,9 +12,6 @@ <div id="page"> <body class="stripes"> - <div id="header"> - </div> - <div id="content" style="margin-right:75px;"> <h1> ${compareTitle} Index: lams_tool_wiki/web/pages/wiki/viewWiki.jsp =================================================================== diff -u -r40fb72d3289330a49552817cf29d032ba4e203a1 -racc8d2acf5b6b0002e0c8129947040a779ab4077 --- lams_tool_wiki/web/pages/wiki/viewWiki.jsp (.../viewWiki.jsp) (revision 40fb72d3289330a49552817cf29d032ba4e203a1) +++ lams_tool_wiki/web/pages/wiki/viewWiki.jsp (.../viewWiki.jsp) (revision acc8d2acf5b6b0002e0c8129947040a779ab4077) @@ -1,5 +1,4 @@ <%@ include file="/common/taglibs.jsp"%> - <lams:html> <lams:head> @@ -14,10 +13,7 @@ <div id="page"> <body class="stripes"> - <div id="header"> - </div> - - <div id="content" style="margin-right:75px;"> + <div id="content" style="margin-right:75px;"> <h1> ${currentWikiPage.title} </h1> Index: lams_www/conf/lams/news.html =================================================================== diff -u -r22bdf7f0b191850069a940d462bc563f5809343f -racc8d2acf5b6b0002e0c8129947040a779ab4077 --- lams_www/conf/lams/news.html (.../news.html) (revision 22bdf7f0b191850069a940d462bc563f5809343f) +++ lams_www/conf/lams/news.html (.../news.html) (revision acc8d2acf5b6b0002e0c8129947040a779ab4077) @@ -1,17 +1,25 @@ <h2>Latest News & Updates</h2> -<h3>Welcome to LAMS 2.2!</h3> -<div style="margin: 7px 0px 0px 3px;">This new release has lots of <a title="LAMS 2.2 Feature List" target="_new" href="http://wiki.lamsfoundation.org/display/lams/LAMS+2.2+Feature+List">new features and improvements</a> including <a target="_blank" href="http://wiki.lamsfoundation.org/display/lams/LAMS+2.2+Feature+List#LAMS2.2FeatureList-NewFeatures">Text-based Branching</a>, so teachers can create branching conditions based on text output from tools.</div> +<h3>Welcome to LAMS 2.3!</h3> +<div style="margin: 7px 0px 0px 3px;"> + This release has lots of <a href=http://wiki.lamsfoundation.org/display/lams/LAMS+2.3+Feature+List target=_blank title="LAMS 2.3 Feature List">new features and improvements</a> including a significant performance improvement. You can now run a LAMS server on small portable devices such as <a href=http://wiki.lamsfoundation.org/display/lams/Mobile+Devices target=_blank title="LAMS on Mobile Devices">Netbooks or Intel Classmates.</a> +</div> -<div style="margin: 7px 0px 0px 3px;">LAMS 2.2 includes improvements like <a href="http://wiki.lamsfoundation.org/display/lamsdocs/lagrp11" target="_new">Learner's selection for groups</a>, <a href="http://wiki.lamsfoundation.org/display/lamsdocs/lagat11" target="_new">Opening gates based on conditions</a> so learners can select which group they want to take part of, teachers can add learning outcomes to their sequences using the new <a href="http://wiki.lamsfoundation.org/display/lamsdocs/Competence+Editor" target="_new">Learning Outcomes/Competencies editor</a>, get informed when certain events occur with <a href="http://wiki.lamsfoundation.org/display/lams/LAMS+2.2+Feature+List#LAMS2.2FeatureList-NewFeatures" target="_new">Email Notifications</a>, find out who is doing a lesson at the same time with <a href="http://wiki.lamsfoundation.org/display/lamsdocs/Presence" target="_new">Presence</a>, use external LMS/VLE tools within LAMS via the <a href="http://wiki.lamsfoundation.org/display/lams/Tool+Adapters" target="_new">External tool wrappers</a>, and a lot more. </div> +<div style="margin: 7px 0px 0px 3px;"> + LAMS 2.3 includes new features such as <a href=http://wiki.lamsfoundation.org/display/lamsdocs/Support+Activities target=_blank title="LAMS Support Activities">Support Activities</a> which can be part of a learning design while outside the flow of the sequence of activities, <a href=http://wiki.lamsfoundation.org/display/lams/Instant+Messaging target=_blank title="LAMS Instant Messaging">Instant Messaging</a> allowing teachers and learners to communicate while they are working on a LAMS lesson, <a href=http://wiki.lamsfoundation.org/display/lamsdocs/FCKEditor+Equation+Editor+Plugin id=m-hz target=_blank title="LaTeX Equation Plugin">LaTeX Equation Plugin</a> so that mathematical equations and symbols can be used, Learner <a href=http://wiki.lamsfoundation.org/display/lamsdocs/Time+Graphs id=x7j6 target=_blank title="progress graphs and charts">progress graphs and charts</a> , a <a href=http://wiki.lamsfoundation.org/display/lamsdocs/Gradebook id=a2wt target=_blank title=Gradebook>Gradebook</a> which can record learners' results across an entire course, and a lot more. +</div> -<div style="margin: 7px 0px 0px 3px;">There are <strong>four new tools</strong> in LAMS 2.2: a -<a href="http://wiki.lamsfoundation.org/display/lamsdocs/lawiki10" target="_new">wiki</a> to create collaborative documents, a -<a href="http://wiki.lamsfoundation.org/display/lamsdocs/ladaco10" target="_new">data collection</a> tool, a -<a href="http://wiki.lamsfoundation.org/display/lamsdocs/lagmap10" target="_new">Google Maps</a> tool, and an -<a href="http://wiki.lamsfoundation.org/display/lamsdocs/lasprd10" target="_new">online spreadsheet</a> tool. There is also optional integration with -<a href="http://dimdim.com" target="_new">Dimdim</a> for -<a href="http://wiki.lamsfoundation.org/display/lamsdocs/laddim10" target="_new">whiteboard, desktop sharing, audio-video conferencing</a> (it might require a fee).</div> +<div style="margin: 7px 0px 0px 3px;"> + There are <strong>five new tools</strong> in LAMS 2.3: <a href=http://wiki.lamsfoundation.org/display/lamsdocs/lapixl10 id=vwk3 target=_blank title=Pixlr>Pixlr</a> is an online photoshop-like activity; the <a href=http://wiki.lamsfoundation.org/display/lamsdocs/lamind10 id=kl2j target=_blank title="Mindmap activity">Mindmap activity</a> is a brainstorming tool in which learners can create their own mindmaps and create collaborative mindmaps with others; the <a href=http://wiki.lamsfoundation.org/display/lamsdocs/laimag10 id=va9- target=_blank title="Image Gallery">Image Gallery</a> allows Learners to add, rate and comment on pictures; a <a href=http://wiki.lamsfoundation.org/display/lamsdocs/lavidr10 id=lr9q target=_blank title="Video Recorder">Video Recorder</a> tool that enables Authors to add video and audio to a forum; and a full <a href=http://wiki.lamsfoundation.org/display/lamsdocs/laasse10 id=kmn1 target=_blank title="Assessment Tool">Assessment Tool</a> to create tests and exams in LAMS. +</div> -<div style="margin: 7px 0px 0px 3px;">We recommend you to join the <a title="LAMS Community" target="_new" href="http://lamscommunity.org">LAMS Community</a> where teachers and developers share their experiences of using LAMS, including a <a title="LAMS Sequence Repository" target="_blank" href="http://lamscommunity.org/lamscentral">large repository of LAMS sequences</a> shared from all around the world - a great place to start for good teaching ideas!</div> -<div style="margin: 7px 0px 0px 3px;">You can provide feedback on LAMS <a target="_new" href="http://lamscommunity.org/dotlrn/clubs/technicalcommunity/forums/forum-view?forum_id=4930">here</a>, and view the <a title="LAMS Roadmap" target="_new" href="http://wiki.lamsfoundation.org/display/lams/Roadmap">LAMS Roadmap</a> for upcoming features.</div> -<div style="margin: 7px 0px 0px 3px;">LAMS is translated to <a target="_new" href="http://lamscommunity.org/i18n">27 languages</a> by more than 55 volunteers. Want to <a target="_new" href="http://lamscommunity.org/i18n">help out</a>?</div> +<div style="margin: 7px 0px 0px 3px;"> + We recommend you join the <a href=http://lamscommunity.org target=_blank />LAMS Community</a> where teachers and developers share their experiences of using LAMS, including a <a href=http://lamscommunity.org/lamscentral target=_blank>large repository of LAMS sequences</a> that can be shared throughout the world - a great place to start for good teaching ideas! +</div> + +<div style="margin: 7px 0px 0px 3px;"> + You can provide feedback on LAMS <a href=http://lamscommunity.org/dotlrn/clubs/technicalcommunity/forums/forum-view?forum_id=4930 target=_blank title="LAMS Forum">here</a>, and view the <a href=http://wiki.lamsfoundation.org/display/lams/Roadmap#Roadmap-LAMSv2.4 target=_blank title="LAMS 2.4 Roadmap">LAMS Roadmap</a> for upcoming features. +</div> + +<div style="margin: 7px 0px 0px 3px;"> + LAMS has now been translated into <a href=http://lamscommunity.org/i18n target=_blank title="Internationalisation">28 languages</a> by more than 55 volunteers. Want to <a href=http://lamscommunity.org/i18n target=_blank title=http://lamscommunity.org/i18n>help out</a>? +</div>