Index: lams_tool_task/conf/language/lams/ApplicationResources.properties =================================================================== diff -u -r182743b20b3ea04f99193cdce3a176f04d055641 -ra370ee2f7fe049337ac7b342e0218bdde3f3ee68 --- lams_tool_task/conf/language/lams/ApplicationResources.properties (.../ApplicationResources.properties) (revision 182743b20b3ea04f99193cdce3a176f04d055641) +++ lams_tool_task/conf/language/lams/ApplicationResources.properties (.../ApplicationResources.properties) (revision a370ee2f7fe049337ac7b342e0218bdde3f3ee68) @@ -85,6 +85,7 @@ label.learning.suggest.new.task =Suggest a new task label.learning.comment.or.instruction =Description label.learning.required.tasks =* - required tasks +label.learning.wait.for.monitor.verification =To finish wait for monitor verification label.preview.upload.file =Upload file label.preview.upload.button =Upload label.preview.filelist =File list @@ -110,7 +111,25 @@ label.monitoring.edit.activity.cancel =Cancel label.monitoring.edit.activity.update =Update label.monitoring.edit.activity.edit =Edit +label.monitoring.summary.overall.summary =Overall Summary +label.monitoring.summary.user =User +label.monitoring.summary.complete.activity =Complete Activity? +label.monitoring.tasksummary.task.summary =Task Summary +label.monitoring.tasksummary.task.required.to.finish =this task is required to finish this activity +label.monitoring.tasksummary.parent.activity =Parent activity +label.monitoring.tasksummary.comments.files.enabled =Comments/files enabled +label.monitoring.tasksummary.user =User +label.monitoring.tasksummary.completed =Completed +label.monitoring.tasksummary.time.and.date =Time and Date +label.monitoring.tasksummary.comments.files =Comments/Files +label.monitoring.tasksummary. = +label.monitoring.tasksummary. = +label.monitoring.tasksummary. = +label.monitoring.tasksummary. = +label.monitoring.tasksummary. = message.monitoring.edit.activity.not.editable =This Activity is no longer editable +message.monitoring.summary.no.session =No Session Available +message.monitoring.summary.no.resource.for.group =No resource available for this group. export.label.resource =Resource export.label.no.learning.object =No offline package available export.title =Export portfolio of Task List @@ -131,14 +150,12 @@ button.upload =Upload button.add =Add button.cancel =Cancel -message.monitoring.summary.no.session =No Session Available label.show =Show label.hide =Hide label.save =Save label.cancel =Cancel define.later.message =Please wait for the teacher to complete the contents of this activity. run.offline.message =This activity is not being done on the computer. Please see your instructor for details. -message.monitoring.summary.no.resource.for.group =No resource available for this group. button.try.again =Try again open.in.new.window =Open URL in pop-up button.edit =Edit Index: lams_tool_task/conf/xdoclet/struts-actions.xml =================================================================== diff -u -r182743b20b3ea04f99193cdce3a176f04d055641 -ra370ee2f7fe049337ac7b342e0218bdde3f3ee68 --- lams_tool_task/conf/xdoclet/struts-actions.xml (.../struts-actions.xml) (revision 182743b20b3ea04f99193cdce3a176f04d055641) +++ lams_tool_task/conf/xdoclet/struts-actions.xml (.../struts-actions.xml) (revision a370ee2f7fe049337ac7b342e0218bdde3f3ee68) @@ -208,23 +208,23 @@ - - + parameter="summaryTask" > + + + + + - - - - - + @@ -829,7 +829,7 @@
- + @@ -891,6 +891,12 @@ + + + + + + Index: lams_tool_task/db/sql/create_lams_tool_taskList.sql =================================================================== diff -u -r182743b20b3ea04f99193cdce3a176f04d055641 -ra370ee2f7fe049337ac7b342e0218bdde3f3ee68 --- lams_tool_task/db/sql/create_lams_tool_taskList.sql (.../create_lams_tool_taskList.sql) (revision 182743b20b3ea04f99193cdce3a176f04d055641) +++ lams_tool_task/db/sql/create_lams_tool_taskList.sql (.../create_lams_tool_taskList.sql) (revision a370ee2f7fe049337ac7b342e0218bdde3f3ee68) @@ -104,6 +104,7 @@ session_finished smallint, session_uid bigint, taskList_uid bigint, + is_verified_by_monitor tinyint, primary key (uid) ); alter table tl_latask10_attachment add index FK_NEW_174079138_1E7009430E79035 (taskList_uid), add constraint FK_NEW_174079138_1E7009430E79035 foreign key (taskList_uid) references tl_latask10_taskList (uid); Index: lams_tool_task/db/sql/table-schema.sql =================================================================== diff -u -r182743b20b3ea04f99193cdce3a176f04d055641 -ra370ee2f7fe049337ac7b342e0218bdde3f3ee68 --- lams_tool_task/db/sql/table-schema.sql (.../table-schema.sql) (revision 182743b20b3ea04f99193cdce3a176f04d055641) +++ lams_tool_task/db/sql/table-schema.sql (.../table-schema.sql) (revision a370ee2f7fe049337ac7b342e0218bdde3f3ee68) @@ -29,7 +29,8 @@ create table tl_latask10_session (uid bigint not null auto_increment, session_end_date datetime, session_start_date datetime, status integer, taskList_uid bigint, session_id bigint, session_name varchar(250), primary key (uid)); create table tl_latask10_taskList (uid bigint not null auto_increment, create_date datetime, update_date datetime, create_by bigint, title varchar(255), run_offline bit, instructions text, online_instructions text, offline_instructions text, content_in_use bit, define_later bit, content_id bigint unique, lock_when_finished bit, allow_contribute_tasks bit, is_monitor_verification_required bit, is_sequential_order bit, reflect_instructions varchar(255), reflect_on_activity bit, primary key (uid)); create table tl_latask10_taskList_item (uid bigint not null auto_increment, description varchar(255), init_item varchar(255), organization_xml text, title varchar(255), create_by bigint, create_date datetime, create_by_author bit, sequence_id integer, is_required bit, is_comments_allowed bit, show_comments_to_all bit, is_child_task bit, parent_task_name varchar(255), taskList_uid bigint, session_uid bigint, primary key (uid)); -create table tl_latask10_user (uid bigint not null auto_increment, user_id bigint, last_name varchar(255), first_name varchar(255), login_name varchar(255), session_uid bigint, taskList_uid bigint, session_finished bit, primary key (uid)); +create table tl_latask10_user (uid bigint not null auto_increment, user_id bigint, last_name varchar(255), first_name varchar(255), login_name varchar(255), session_uid bigint, taskList_uid bigint, session_finished bit, is_verified_by_monitor bit, primary key (uid)); + alter table tl_latask10_attachment add index FK281134C2994F51CE (taskList_uid), add constraint FK281134C2994F51CE foreign key (taskList_uid) references tl_latask10_taskList (uid); alter table tl_latask10_item_log add index FK6CFEC3773324488D (taskList_item_uid), add constraint FK6CFEC3773324488D foreign key (taskList_item_uid) references tl_latask10_taskList_item (uid); alter table tl_latask10_item_log add index FK6CFEC377B20A10E1 (user_uid), add constraint FK6CFEC377B20A10E1 foreign key (user_uid) references tl_latask10_user (uid); Index: lams_tool_task/src/java/org/lamsfoundation/lams/tool/taskList/TaskListConstants.java =================================================================== diff -u -r182743b20b3ea04f99193cdce3a176f04d055641 -ra370ee2f7fe049337ac7b342e0218bdde3f3ee68 --- lams_tool_task/src/java/org/lamsfoundation/lams/tool/taskList/TaskListConstants.java (.../TaskListConstants.java) (revision 182743b20b3ea04f99193cdce3a176f04d055641) +++ lams_tool_task/src/java/org/lamsfoundation/lams/tool/taskList/TaskListConstants.java (.../TaskListConstants.java) (revision a370ee2f7fe049337ac7b342e0218bdde3f3ee68) @@ -62,6 +62,7 @@ public static final String ATTR_RESOURCE_ITEM_UID = "itemUid"; public static final String ATTR_NEXT_ACTIVITY_URL = "nextActivityUrl"; public static final String ATTR_SUMMARY = "summary"; + public static final String ATTR_TASK_SUMMARY = "taskSummary"; public static final String ATTR_EXPORT_DTO_LIST = "exportDTOList"; public static final String ATTR_USER_LIST = "userList"; public static final String ATTR_FINISH_LOCK = "finishedLock"; @@ -71,6 +72,7 @@ public static final String ATTR_FILE_TYPE_FLAG = "fileTypeFlag"; public static final String ATTR_TITLE = "title"; public static final String ATTR_USER_FINISHED = "userFinished"; + public static final String ATTR_USER_VERIFIED_BY_MONITOR = "userVerifiedByMonitor"; public static final String ATTR_TASK_LIST_ITEM = "taskListItem"; public static final String ATTR_TASK_LIST_ITEM_TITLE = "taskListItemTitle"; public static final String ATTR_TASK_LIST_ITEM_DESCRIPTION = "taskListItemDescription"; @@ -89,6 +91,7 @@ public static final String ATTR_REFLECT_LIST = "reflectList"; public static final String ATTR_USER_UID = "userUid"; + public static final String ATTR_TASK_LIST_ITEM_UID = "taskListItemUid"; public static final String ATTR_USER_LOGIN = "userLogin"; } Index: lams_tool_task/src/java/org/lamsfoundation/lams/tool/taskList/dto/Summary.java =================================================================== diff -u -r182743b20b3ea04f99193cdce3a176f04d055641 -ra370ee2f7fe049337ac7b342e0218bdde3f3ee68 --- lams_tool_task/src/java/org/lamsfoundation/lams/tool/taskList/dto/Summary.java (.../Summary.java) (revision 182743b20b3ea04f99193cdce3a176f04d055641) +++ lams_tool_task/src/java/org/lamsfoundation/lams/tool/taskList/dto/Summary.java (.../Summary.java) (revision a370ee2f7fe049337ac7b342e0218bdde3f3ee68) @@ -55,6 +55,7 @@ private List taskListItems; private boolean[][] completeMap; + private int[] visitNumbers; public Summary(){} @@ -66,10 +67,11 @@ * @param item * @param isInitGroup */ - public Summary(List taskListItems, List userNames, boolean[][] completeMap, boolean isMonitorVerificationRequired){ + public Summary(List taskListItems, List userNames, boolean[][] completeMap, int[] visitNumbers, boolean isMonitorVerificationRequired){ this.userNames = userNames; this.taskListItems = taskListItems; this.completeMap = completeMap; + this.visitNumbers = visitNumbers; this.isMonitorVerificationRequired = isMonitorVerificationRequired; } @@ -94,6 +96,13 @@ this.completeMap = completeMap; } + public int[] getVisitNumbers() { + return visitNumbers; + } + public void setVisitNumbers(int[] visitNumbers) { + this.visitNumbers = visitNumbers; + } + public boolean isMonitorVerificationRequired() { return isMonitorVerificationRequired; } Index: lams_tool_task/src/java/org/lamsfoundation/lams/tool/taskList/dto/TaskSummary.java =================================================================== diff -u --- lams_tool_task/src/java/org/lamsfoundation/lams/tool/taskList/dto/TaskSummary.java (revision 0) +++ lams_tool_task/src/java/org/lamsfoundation/lams/tool/taskList/dto/TaskSummary.java (revision a370ee2f7fe049337ac7b342e0218bdde3f3ee68) @@ -0,0 +1,69 @@ +/**************************************************************** + * 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 + * **************************************************************** + */ + +/* $Id$ */ +package org.lamsfoundation.lams.tool.taskList.dto; + +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +import org.lamsfoundation.lams.tool.taskList.model.TaskListItem; +import org.lamsfoundation.lams.tool.taskList.model.TaskListUser; + +/** + * DTO object intented to be used in a task summary page (monitoring). Contains + * TaskLIstItem's overall information and list of + * TaskSummaryItem with more detailed information specific for each user. + * + * @author Andrey Balan + */ +public class TaskSummary { + + private TaskListItem taskListItem; + + private TaskSummaryItem[] taskSummaryItems; + + public TaskSummary(TaskListItem taskListItem, TaskSummaryItem[] taskSummaryItems) { + this.taskListItem = taskListItem; + + this.taskSummaryItems = taskSummaryItems; + } + + // ********************************************************** + // Get/Set methods + // ********************************************************** + + public TaskListItem getTaskListItem() { + return taskListItem; + } + public void setTaskListItem(TaskListItem taskListItem) { + this.taskListItem = taskListItem; + } + + public TaskSummaryItem[] getTaskSummaryItems() { + return taskSummaryItems; + } + + +} + \ No newline at end of file Index: lams_tool_task/src/java/org/lamsfoundation/lams/tool/taskList/dto/TaskSummaryItem.java =================================================================== diff -u --- lams_tool_task/src/java/org/lamsfoundation/lams/tool/taskList/dto/TaskSummaryItem.java (revision 0) +++ lams_tool_task/src/java/org/lamsfoundation/lams/tool/taskList/dto/TaskSummaryItem.java (revision a370ee2f7fe049337ac7b342e0218bdde3f3ee68) @@ -0,0 +1,88 @@ +/**************************************************************** + * 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 + * **************************************************************** + */ + +/* $Id$ */ +package org.lamsfoundation.lams.tool.taskList.dto; + +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +import org.lamsfoundation.lams.tool.taskList.model.TaskListItemAttachment; +import org.lamsfoundation.lams.tool.taskList.model.TaskListItemComment; +import org.lamsfoundation.lams.tool.taskList.model.TaskListUser; + +/** + * DTO object which is used in a task summary page in monitoring. Contains + * partial information for TaskSummary object specific for + * current user and TaskLIstItem object. + * + * @author Andrey Balan + */ +public class TaskSummaryItem { + + private TaskListUser user; + private boolean completed; + private Date date; + + private List comments; + private List attachments; + + public TaskSummaryItem() { + comments = new ArrayList(); + attachments = new ArrayList(); + } + + // ********************************************************** + // Get/Set methods + // ********************************************************** + + public TaskListUser getUser() { + return user; + } + public void setUser(TaskListUser user) { + this.user = user; + } + + public boolean getCompleted() { + return completed; + } + public void setCompleted(boolean completed) { + this.completed = completed; + } + + public Date getDate() { + return date; + } + public void setDate(Date date) { + this.date = date; + } + + public List getComments() { + return comments; + } + public List getAttachments() { + return attachments; + } + +} + \ No newline at end of file Index: lams_tool_task/src/java/org/lamsfoundation/lams/tool/taskList/model/TaskListUser.java =================================================================== diff -u -r182743b20b3ea04f99193cdce3a176f04d055641 -ra370ee2f7fe049337ac7b342e0218bdde3f3ee68 --- lams_tool_task/src/java/org/lamsfoundation/lams/tool/taskList/model/TaskListUser.java (.../TaskListUser.java) (revision 182743b20b3ea04f99193cdce3a176f04d055641) +++ lams_tool_task/src/java/org/lamsfoundation/lams/tool/taskList/model/TaskListUser.java (.../TaskListUser.java) (revision a370ee2f7fe049337ac7b342e0218bdde3f3ee68) @@ -46,6 +46,7 @@ private String lastName; private String loginName; private boolean sessionFinished; + private boolean isVerifiedByMonitor; private TaskListSession session; private TaskList taskList; @@ -54,8 +55,6 @@ //the user access some reousrce item date time. Use in monitoring summary page private Date accessDate; - private boolean verified; - public TaskListUser(){ } public TaskListUser(UserDTO user, TaskListSession session){ @@ -218,11 +217,15 @@ this.accessDate = accessDate; } - public boolean getVerified() { - return verified; + /** + * @hibernate.property column="is_verified_by_monitor" + * @return + */ + public boolean isVerifiedByMonitor() { + return isVerifiedByMonitor; } - public void setVerified(boolean verified) { - this.verified = verified; + public void setVerifiedByMonitor(boolean isVerifiedByMonitor) { + this.isVerifiedByMonitor = isVerifiedByMonitor; } } Index: lams_tool_task/src/java/org/lamsfoundation/lams/tool/taskList/service/ITaskListService.java =================================================================== diff -u -r182743b20b3ea04f99193cdce3a176f04d055641 -ra370ee2f7fe049337ac7b342e0218bdde3f3ee68 --- lams_tool_task/src/java/org/lamsfoundation/lams/tool/taskList/service/ITaskListService.java (.../ITaskListService.java) (revision 182743b20b3ea04f99193cdce3a176f04d055641) +++ lams_tool_task/src/java/org/lamsfoundation/lams/tool/taskList/service/ITaskListService.java (.../ITaskListService.java) (revision a370ee2f7fe049337ac7b342e0218bdde3f3ee68) @@ -33,6 +33,7 @@ import org.lamsfoundation.lams.tool.taskList.dto.ExportDTO; import org.lamsfoundation.lams.tool.taskList.dto.ReflectDTO; import org.lamsfoundation.lams.tool.taskList.dto.Summary; +import org.lamsfoundation.lams.tool.taskList.dto.TaskSummary; import org.lamsfoundation.lams.tool.taskList.model.TaskList; import org.lamsfoundation.lams.tool.taskList.model.TaskListAttachment; import org.lamsfoundation.lams.tool.taskList.model.TaskListItem; @@ -180,11 +181,20 @@ TaskListItem getTaskListItemByUid(Long itemUid); /** - * Return monitoring summary list. The return value is list of taskList summaries for each groups. - * @param contentId + * Return monitoring summary for the specified TaskList. + * @param contentId specified TaskList uid * @return */ Summary getSummary(Long contentId); + + /** + * Return monitoring task summary for the specified TaskListItem. + * + * @param contentId toolContenId + * @param taskListItemUid specified TaskListItem uid + * @return + */ + TaskSummary getTaskSummary(Long contentId, Long taskListItemUid); List getUserListBySessionItem(Long sessionId, Long itemUid); Index: lams_tool_task/src/java/org/lamsfoundation/lams/tool/taskList/service/TaskListServiceImpl.java =================================================================== diff -u -r182743b20b3ea04f99193cdce3a176f04d055641 -ra370ee2f7fe049337ac7b342e0218bdde3f3ee68 --- lams_tool_task/src/java/org/lamsfoundation/lams/tool/taskList/service/TaskListServiceImpl.java (.../TaskListServiceImpl.java) (revision 182743b20b3ea04f99193cdce3a176f04d055641) +++ lams_tool_task/src/java/org/lamsfoundation/lams/tool/taskList/service/TaskListServiceImpl.java (.../TaskListServiceImpl.java) (revision a370ee2f7fe049337ac7b342e0218bdde3f3ee68) @@ -85,10 +85,13 @@ import org.lamsfoundation.lams.tool.taskList.dto.ExportDTO; import org.lamsfoundation.lams.tool.taskList.dto.ReflectDTO; import org.lamsfoundation.lams.tool.taskList.dto.Summary; +import org.lamsfoundation.lams.tool.taskList.dto.TaskSummary; +import org.lamsfoundation.lams.tool.taskList.dto.TaskSummaryItem; import org.lamsfoundation.lams.tool.taskList.model.TaskList; import org.lamsfoundation.lams.tool.taskList.model.TaskListAttachment; import org.lamsfoundation.lams.tool.taskList.model.TaskListItem; import org.lamsfoundation.lams.tool.taskList.model.TaskListItemAttachment; +import org.lamsfoundation.lams.tool.taskList.model.TaskListItemComment; import org.lamsfoundation.lams.tool.taskList.model.TaskListItemVisitLog; import org.lamsfoundation.lams.tool.taskList.model.TaskListSession; import org.lamsfoundation.lams.tool.taskList.model.TaskListUser; @@ -108,6 +111,10 @@ * @author Dapeng.Ni * */ +/** + * @author Administrator + * + */ public class TaskListServiceImpl implements ITaskListService,ToolContentManager, ToolSessionManager, ToolContentImport102Manager { static Logger log = Logger.getLogger(TaskListServiceImpl.class.getName()); private TaskListDAO taskListDao; @@ -493,22 +500,13 @@ return nextUrl; } -// public int checkMiniView(Long toolSessionId, Long userUid) { -// int miniView = taskListItemVisitDao.getUserViewLogCount(toolSessionId,userUid); -// TaskListSession session = taskListSessionDao.getSessionBySessionId(toolSessionId); -// if(session == null){ -// log.error("Failed get session by ID [" + toolSessionId + "]"); -// return 0; -// } -// int reqView = session.getTaskList().getMiniViewTaskListNumber(); -// -// return (reqView - miniView); -// } - public TaskListItem getTaskListItemByUid(Long itemUid) { return taskListItemDao.getByUid(itemUid); } + /** + * {@inheritDoc} + */ public Summary getSummary(Long contentId) { TaskList taskList = taskListDao.getByContentId(contentId); @@ -517,94 +515,101 @@ ArrayList userList = new ArrayList(); -// service.isUserInRole(userId, group.getOrganisationId(), Role.GROUP_ADMIN) -// userManagementService.getAllUsers(filteredOrgId) -// userManagementService.is -// taskListUserDao.getBySessionID(contentId); -// TaskListUser user = taskListUserDao.getUserByUserIDAndContentID(userId, contentId); -// users.add(user); - + //retrieve all the sessions associated with this taskList List sessionList = taskListSessionDao.getByContentId(contentId); + //create the list containing all taskListItems + //create the user list of all whom were started this task for(TaskListSession session:sessionList) { Set newItems = session.getTaskListItems(); for(TaskListItem item : newItems) { if (!itemList.contains(item)) itemList.add(item); } -// userList.addAll(taskListUserDao.getBySessionID(session.getSessionId())); List newUsers = taskListUserDao.getBySessionID(session.getSessionId()); for(TaskListUser user : newUsers) { if (!userList.contains(user)) userList.add(user); } } + //Fill up the copmletion table boolean[][] complete = new boolean[userList.size()][itemList.size()]; + //Fill up the array of visitNumbers + int[] visitNumbers = new int[itemList.size()]; for (int i = 0; i < userList.size(); i++) { + TaskListUser user = userList.get(i); + for (int j = 0; j < itemList.size(); j++) { - - TaskListUser user = userList.get(i); TaskListItem item = itemList.get(j); + //retreiving TaskListItemVisitLog for current taskList and user TaskListItemVisitLog visitLog = taskListItemVisitDao.getTaskListItemLog(item.getUid(), user.getUserId()); if (visitLog !=null) { complete[i][j] = visitLog.isComplete(); + if (visitLog.isComplete()) visitNumbers[j]++; } else { complete[i][j] = false; } } } - Summary summary = new Summary(itemList, userList, complete, taskList.isMonitorVerificationRequired()); + Summary summary = new Summary(itemList, userList, complete, visitNumbers, taskList.isMonitorVerificationRequired()); return summary; } -// public List> getSummary(Long contentId) { -// List> groupList = new ArrayList>(); -// List group = new ArrayList(); -// -// //get all item which is accessed by user -// Map visitCountMap = taskListItemVisitDao.getSummary(contentId); -// -// TaskList taskList = taskListDao.getByContentId(contentId); -// Set resItemList = taskList.getTaskListItems(); -// -// //get all sessions in a taskList and retrieve all taskList items under this session -// //plus initial taskList items by author creating (resItemList) -// List sessionList = taskListSessionDao.getByContentId(contentId); -// for(TaskListSession session:sessionList){ -// //one new group for one session. -// group = new ArrayList(); -// //firstly, put all initial taskList item into this group. -// for(TaskListItem item:resItemList){ -// Summary sum = new Summary(session.getSessionId(),session.getSessionName(),item); -// //set viewNumber according visit log -// if(visitCountMap.containsKey(item.getUid())) -// sum.setViewNumber(visitCountMap.get(item.getUid()).intValue()); -// group.add(sum); -// } -// //get this session's all taskList items -// Set sessItemList =session.getTaskListItems(); -// for(TaskListItem item : sessItemList){ -// //to skip all item create by author -// if(!item.isCreateByAuthor()){ -// Summary sum = new Summary(session.getSessionId(),session.getSessionName(),item); -// //set viewNumber according visit log -// if(visitCountMap.containsKey(item.getUid())) -// sum.setViewNumber(visitCountMap.get(item.getUid()).intValue()); -// group.add(sum); -// } -// } -// //so far no any item available, so just put session name info to Summary -// if(group.size() == 0) -// group.add(new Summary(session.getSessionId(),session.getSessionName(),null)); -// groupList.add(group); -// } -// -// return groupList; -// return null; -// -// } + /** + * {@inheritDoc} + */ + public TaskSummary getTaskSummary(Long contentId, Long taskListItemUid) { + + TaskListItem taskListItem = taskListItemDao.getByUid(taskListItemUid); + + ArrayList userList = new ArrayList(); + + List sessionList = taskListSessionDao.getByContentId(contentId); + //create the user list of all whom were started this task + for(TaskListSession session:sessionList) { + List newUsers = taskListUserDao.getBySessionID(session.getSessionId()); + for(TaskListUser user : newUsers) { + if (!userList.contains(user)) userList.add(user); + } + } + + TaskSummaryItem[] taskSummaryItems = new TaskSummaryItem[userList.size()]; + for (int i = 0; i < userList.size(); i++) { + TaskListUser user = userList.get(i); + taskSummaryItems[i] = new TaskSummaryItem(); + taskSummaryItems[i].setUser(user); + + TaskListItemVisitLog visitLog = taskListItemVisitDao.getTaskListItemLog(taskListItem.getUid(), user.getUserId()); + //If TaskListItemVisitLog exists then fill up taskSummaryItem otherwise put false in a completed field + if (visitLog !=null) { + taskSummaryItems[i].setCompleted(visitLog.isComplete()); + if (visitLog.isComplete()) taskSummaryItems[i].setDate(visitLog.getAccessDate()); + + //fill up with comments and attachments made by this user + Set itemComments = taskListItem.getComments(); + for(TaskListItemComment comment : itemComments) { + if (user.equals(comment.getCreateBy())) taskSummaryItems[i].getComments().add(comment); + } + + Set itemAttachments = taskListItem.getUploadedFileList(); + for(TaskListItemAttachment attachment : itemAttachments) { + if (user.equals(attachment.getCreateBy())) taskSummaryItems[i].getAttachments().add(attachment); + } + + } else { + taskSummaryItems[i].setCompleted(false); + } + } + + TaskSummary taskSummary = new TaskSummary(taskListItem, taskSummaryItems); + return taskSummary; + } + + /** + * {@inheritDoc} + */ public Map> getReflectList(Long contentId){ Map> map = new HashMap>(); Index: lams_tool_task/src/java/org/lamsfoundation/lams/tool/taskList/web/action/LearningAction.java =================================================================== diff -u -r182743b20b3ea04f99193cdce3a176f04d055641 -ra370ee2f7fe049337ac7b342e0218bdde3f3ee68 --- lams_tool_task/src/java/org/lamsfoundation/lams/tool/taskList/web/action/LearningAction.java (.../LearningAction.java) (revision 182743b20b3ea04f99193cdce3a176f04d055641) +++ lams_tool_task/src/java/org/lamsfoundation/lams/tool/taskList/web/action/LearningAction.java (.../LearningAction.java) (revision a370ee2f7fe049337ac7b342e0218bdde3f3ee68) @@ -184,6 +184,7 @@ // sessionMap.put(TaskListConstants.ATTR_RESOURCE_INSTRUCTION,taskList.getInstructions()); sessionMap.put(TaskListConstants.ATTR_FINISH_LOCK,lock); sessionMap.put(TaskListConstants.ATTR_USER_FINISHED, taskListUser !=null && taskListUser.isSessionFinished()); + sessionMap.put(TaskListConstants.ATTR_USER_VERIFIED_BY_MONITOR, taskListUser.isVerifiedByMonitor()); sessionMap.put(AttributeNames.PARAM_TOOL_SESSION_ID,sessionId); sessionMap.put(AttributeNames.ATTR_MODE,mode); Index: lams_tool_task/src/java/org/lamsfoundation/lams/tool/taskList/web/action/MonitoringAction.java =================================================================== diff -u -r182743b20b3ea04f99193cdce3a176f04d055641 -ra370ee2f7fe049337ac7b342e0218bdde3f3ee68 --- lams_tool_task/src/java/org/lamsfoundation/lams/tool/taskList/web/action/MonitoringAction.java (.../MonitoringAction.java) (revision 182743b20b3ea04f99193cdce3a176f04d055641) +++ lams_tool_task/src/java/org/lamsfoundation/lams/tool/taskList/web/action/MonitoringAction.java (.../MonitoringAction.java) (revision a370ee2f7fe049337ac7b342e0218bdde3f3ee68) @@ -40,11 +40,13 @@ import org.apache.struts.action.ActionForm; import org.apache.struts.action.ActionForward; import org.apache.struts.action.ActionMapping; +import org.apache.struts.action.ActionRedirect; import org.lamsfoundation.lams.notebook.model.NotebookEntry; import org.lamsfoundation.lams.notebook.service.CoreNotebookConstants; import org.lamsfoundation.lams.tool.taskList.TaskListConstants; import org.lamsfoundation.lams.tool.taskList.dto.ReflectDTO; import org.lamsfoundation.lams.tool.taskList.dto.Summary; +import org.lamsfoundation.lams.tool.taskList.dto.TaskSummary; import org.lamsfoundation.lams.tool.taskList.model.TaskList; import org.lamsfoundation.lams.tool.taskList.model.TaskListItem; import org.lamsfoundation.lams.tool.taskList.model.TaskListSession; @@ -68,26 +70,26 @@ return summary(mapping, form, request, response); } - if(param.equals("verifyUser")){ - return verifyUser(mapping, form, request, response); + if (param.equals("summaryTask")) { + return summaryTask(mapping, form, request, response); } + + if(param.equals("setVerifiedByMonitor")){ + return setVerifiedByMonitor(mapping, form, request, response); + } if (param.equals("listuser")) { return listuser(mapping, form, request, response); } - if (param.equals("viewReflection")) { - return viewReflection(mapping, form, request, response); - } - return mapping.findForward(TaskListConstants.ERROR); } private ActionForward summary(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) { ITaskListService service = getTaskListService(); Long contentId = WebUtil.readLongParam(request, AttributeNames.PARAM_TOOL_CONTENT_ID); - request.setAttribute(AttributeNames.PARAM_TOOL_SESSION_ID,contentId); + request.setAttribute(AttributeNames.PARAM_TOOL_CONTENT_ID, contentId); //initial Session Map SessionMap sessionMap = new SessionMap(); @@ -99,36 +101,55 @@ TaskList taskList = service.getTaskListByContentId(contentId); taskList.toDTO(); - Map >relectList = service.getReflectList(contentId); Summary summary = service.getSummary(contentId); //cache into sessionMap sessionMap.put(TaskListConstants.ATTR_SUMMARY, summary); sessionMap.put(TaskListConstants.PAGE_EDITABLE, taskList.isContentInUse()); sessionMap.put(TaskListConstants.ATTR_RESOURCE, taskList); sessionMap.put(TaskListConstants.ATTR_TOOL_CONTENT_ID, contentId); - sessionMap.put(TaskListConstants.ATTR_REFLECT_LIST, relectList); return mapping.findForward(TaskListConstants.SUCCESS); } + private ActionForward summaryTask(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) { + ITaskListService service = getTaskListService(); + + Long contentId = WebUtil.readLongParam(request, AttributeNames.PARAM_TOOL_CONTENT_ID); + Long taskListItemId = WebUtil.readLongParam(request, TaskListConstants.ATTR_TASK_LIST_ITEM_UID); +// request.setAttribute(TaskListConstants.ATTR_TASK_LIST_ITEM_UID, contentId); + + TaskSummary taskSummary = service.getTaskSummary(contentId, taskListItemId); + request.setAttribute(TaskListConstants.ATTR_TASK_SUMMARY, taskSummary); + request.setAttribute("taskSummary", taskSummary); + + return mapping.findForward(TaskListConstants.SUCCESS); + } + /** * Mark taskList item as complete status. + * * @param mapping * @param form * @param request * @param response * @return */ - private ActionForward verifyUser(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) { + private ActionForward setVerifiedByMonitor(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) { Long uid = WebUtil.readLongParam(request, TaskListConstants.ATTR_USER_UID); - Long sessionID = WebUtil.readLongParam(request, AttributeNames.PARAM_TOOL_SESSION_ID); - ITaskListService service = getTaskListService(); TaskListUser user = service.getUser(uid); + user.setVerifiedByMonitor(true); + service.createUser(user); + + Long contentId = WebUtil.readLongParam(request, AttributeNames.PARAM_TOOL_CONTENT_ID); + String contentFolderID = WebUtil.readStrParam(request, AttributeNames.PARAM_CONTENT_FOLDER_ID); - return mapping.findForward(TaskListConstants.SUCCESS); + ActionRedirect redirect = new ActionRedirect(mapping.findForwardConfig(TaskListConstants.SUCCESS)); + redirect.addParameter(AttributeNames.PARAM_TOOL_CONTENT_ID, contentId); + redirect.addParameter(AttributeNames.PARAM_CONTENT_FOLDER_ID, contentFolderID); + return redirect; } private ActionForward listuser(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) { @@ -143,31 +164,6 @@ request.setAttribute(TaskListConstants.ATTR_USER_LIST, list); return mapping.findForward(TaskListConstants.SUCCESS); } - - private ActionForward viewReflection(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) { - - Long uid = WebUtil.readLongParam(request, TaskListConstants.ATTR_USER_UID); - Long sessionID = WebUtil.readLongParam(request, AttributeNames.PARAM_TOOL_SESSION_ID); - - ITaskListService service = getTaskListService(); - TaskListUser user = service.getUser(uid); - NotebookEntry notebookEntry = service.getEntry(sessionID, CoreNotebookConstants.NOTEBOOK_TOOL, TaskListConstants.TOOL_SIGNATURE, user.getUserId().intValue()); - - TaskListSession session = service.getTaskListSessionBySessionId(sessionID); - - ReflectDTO refDTO = new ReflectDTO(user); - if(notebookEntry == null){ - refDTO.setFinishReflection(false); - refDTO.setReflect(null); - }else{ - refDTO.setFinishReflection(true); - refDTO.setReflect(notebookEntry.getEntry()); - } - refDTO.setReflectInstrctions(session.getTaskList().getReflectInstructions()); - - request.setAttribute("userDTO", refDTO); - return mapping.findForward("success"); - } // ************************************************************************************* // Private method Index: lams_tool_task/web/pages/learning/learning.jsp =================================================================== diff -u -r182743b20b3ea04f99193cdce3a176f04d055641 -ra370ee2f7fe049337ac7b342e0218bdde3f3ee68 --- lams_tool_task/web/pages/learning/learning.jsp (.../learning.jsp) (revision 182743b20b3ea04f99193cdce3a176f04d055641) +++ lams_tool_task/web/pages/learning/learning.jsp (.../learning.jsp) (revision a370ee2f7fe049337ac7b342e0218bdde3f3ee68) @@ -222,10 +222,14 @@
+ + + + - + @@ -239,6 +243,9 @@
+ + + Index: lams_tool_task/web/pages/monitoring/statistic.jsp =================================================================== diff -u -r182743b20b3ea04f99193cdce3a176f04d055641 -ra370ee2f7fe049337ac7b342e0218bdde3f3ee68 --- lams_tool_task/web/pages/monitoring/statistic.jsp (.../statistic.jsp) (revision 182743b20b3ea04f99193cdce3a176f04d055641) +++ lams_tool_task/web/pages/monitoring/statistic.jsp (.../statistic.jsp) (revision a370ee2f7fe049337ac7b342e0218bdde3f3ee68) @@ -1,71 +1,51 @@ <%@ include file="/common/taglibs.jsp"%> - +
- +
- - - - <%-- display group name on first row--%> - -
- - - - - - - - - - - - - - - - - - - - - + + <%-- display group name on first row--%> + + + + + + + + + + + + + + + + + + + + +
- ${item.sessionName} - - -
- - - - - -
-
- -
-
- ${item.itemTitle} - - - ${item.username} - - - - - - - - ${item.viewNumber} - - - 0 - - -
+ + + + + +
+
+ +
+
+ ${item.title} + + ${item.createBy.loginName} + + ${summary.visitNumbers[status.index]} +
Index: lams_tool_task/web/pages/monitoring/summary.jsp =================================================================== diff -u -r182743b20b3ea04f99193cdce3a176f04d055641 -ra370ee2f7fe049337ac7b342e0218bdde3f3ee68 --- lams_tool_task/web/pages/monitoring/summary.jsp (.../summary.jsp) (revision 182743b20b3ea04f99193cdce3a176f04d055641) +++ lams_tool_task/web/pages/monitoring/summary.jsp (.../summary.jsp) (revision a370ee2f7fe049337ac7b342e0218bdde3f3ee68) @@ -3,13 +3,13 @@