Fisheye: Tag 5fd25049d526080b60f6753a3d4603fb18913202 refers to a dead (removed) revision in file `lams_tool_notebook/conf/language/ApplicationResources.properties'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 5fd25049d526080b60f6753a3d4603fb18913202 refers to a dead (removed) revision in file `lams_tool_notebook/conf/language/ApplicationResources_da_DK.properties'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 5fd25049d526080b60f6753a3d4603fb18913202 refers to a dead (removed) revision in file `lams_tool_notebook/conf/language/ApplicationResources_es_ES.properties'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 5fd25049d526080b60f6753a3d4603fb18913202 refers to a dead (removed) revision in file `lams_tool_notebook/conf/language/ApplicationResources_fr_FR.properties'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 5fd25049d526080b60f6753a3d4603fb18913202 refers to a dead (removed) revision in file `lams_tool_notebook/conf/language/ApplicationResources_it_IT.properties'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 5fd25049d526080b60f6753a3d4603fb18913202 refers to a dead (removed) revision in file `lams_tool_notebook/conf/language/ApplicationResources_pl_PL.properties'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 5fd25049d526080b60f6753a3d4603fb18913202 refers to a dead (removed) revision in file `lams_tool_notebook/conf/language/ApplicationResources_vi_VN.properties'. Fisheye: No comparison available. Pass `N' to diff? Index: lams_tool_notebook/conf/language/lams/ApplicationResources_en_AU.properties =================================================================== diff -u -red84afe5b317b35b156848df66a1a9332af0f4b1 -r5fd25049d526080b60f6753a3d4603fb18913202 --- lams_tool_notebook/conf/language/lams/ApplicationResources_en_AU.properties (.../ApplicationResources_en_AU.properties) (revision ed84afe5b317b35b156848df66a1a9332af0f4b1) +++ lams_tool_notebook/conf/language/lams/ApplicationResources_en_AU.properties (.../ApplicationResources_en_AU.properties) (revision 5fd25049d526080b60f6753a3d4603fb18913202) @@ -34,7 +34,7 @@ titleHeading.statistics =Statistics titleHeading.editActivity =Edit Activity titleHeading.exportPortfolio =Export Portfolio -heading.group =Group {0}: +heading.group =Group {0} heading.totalLearners =Number of Learners: heading.totalLearnersInGroup =Total Number of Learners in Group: heading.totalFinishedLearnersInGroup =Number of Finished Learners: @@ -107,5 +107,10 @@ output.desc.all.users.entries.definition.notebook =Each learners' entry in Notebook button.submit =Finish +label.user.name =Name +label.last.edited =Last edited +label.comment =Comment +label.learning.comment =Comment left by teacher: +label.group.summary =Summary #======= End labels: Exported 100 labels for en AU ===== Index: lams_tool_notebook/src/java/org/lamsfoundation/lams/tool/notebook/dao/INotebookSessionDAO.java =================================================================== diff -u -r08950e1090443c3423a3d1c587416a2fccd8bbdf -r5fd25049d526080b60f6753a3d4603fb18913202 --- lams_tool_notebook/src/java/org/lamsfoundation/lams/tool/notebook/dao/INotebookSessionDAO.java (.../INotebookSessionDAO.java) (revision 08950e1090443c3423a3d1c587416a2fccd8bbdf) +++ lams_tool_notebook/src/java/org/lamsfoundation/lams/tool/notebook/dao/INotebookSessionDAO.java (.../INotebookSessionDAO.java) (revision 5fd25049d526080b60f6753a3d4603fb18913202) @@ -24,18 +24,20 @@ package org.lamsfoundation.lams.tool.notebook.dao; +import java.util.List; + import org.lamsfoundation.lams.dao.IBaseDAO; import org.lamsfoundation.lams.tool.notebook.model.NotebookSession; /** - * DAO for accessing the NotebookSession objects - interface defining - * methods to be implemented by the Hibernate or other implementation. + * DAO for accessing the NotebookSession objects - interface defining methods to be implemented by the Hibernate or + * other implementation. */ -public interface INotebookSessionDAO extends IBaseDAO{ +public interface INotebookSessionDAO extends IBaseDAO { - void saveOrUpdate(NotebookSession session); + void saveOrUpdate(NotebookSession session); - NotebookSession getBySessionId(Long toolSessionId); + NotebookSession getBySessionId(Long toolSessionId); - void deleteBySessionID(Long toolSessionID); + void deleteBySessionID(Long toolSessionID); } Index: lams_tool_notebook/src/java/org/lamsfoundation/lams/tool/notebook/dao/hibernate/NotebookSessionDAO.java =================================================================== diff -u -r08950e1090443c3423a3d1c587416a2fccd8bbdf -r5fd25049d526080b60f6753a3d4603fb18913202 --- lams_tool_notebook/src/java/org/lamsfoundation/lams/tool/notebook/dao/hibernate/NotebookSessionDAO.java (.../NotebookSessionDAO.java) (revision 08950e1090443c3423a3d1c587416a2fccd8bbdf) +++ lams_tool_notebook/src/java/org/lamsfoundation/lams/tool/notebook/dao/hibernate/NotebookSessionDAO.java (.../NotebookSessionDAO.java) (revision 5fd25049d526080b60f6753a3d4603fb18913202) @@ -35,27 +35,28 @@ */ public class NotebookSessionDAO extends BaseDAO implements INotebookSessionDAO { - public static final String SQL_QUERY_FIND_BY_SESSION_ID = "from " - + NotebookSession.class.getName() + " where session_id=?"; + public static final String FIND_BY_SESSION_ID = "from " + NotebookSession.class.getName() + " where session_id=?"; - public void saveOrUpdate(NotebookSession session) { - this.getHibernateTemplate().saveOrUpdate(session); - this.getHibernateTemplate().flush(); - } + @Override + public void saveOrUpdate(NotebookSession session) { + this.getHibernateTemplate().saveOrUpdate(session); + this.getHibernateTemplate().flush(); + } - public NotebookSession getBySessionId(Long toolSessionId) { - List list = this.getHibernateTemplate().find( - SQL_QUERY_FIND_BY_SESSION_ID, toolSessionId); - if (list == null || list.isEmpty()) - return null; - return (NotebookSession) list.get(0); - } + @Override + public NotebookSession getBySessionId(Long toolSessionId) { + List list = this.getHibernateTemplate().find(FIND_BY_SESSION_ID, toolSessionId); + if (list == null || list.isEmpty()) + return null; + return (NotebookSession) list.get(0); + } - public void deleteBySessionID(Long toolSessionID) { - NotebookSession session = getBySessionId(toolSessionID); - if(session != null){ - this.getHibernateTemplate().delete(session); - this.getHibernateTemplate().flush(); - } + @Override + public void deleteBySessionID(Long toolSessionID) { + NotebookSession session = getBySessionId(toolSessionID); + if (session != null) { + this.getHibernateTemplate().delete(session); + this.getHibernateTemplate().flush(); } + } } Index: lams_tool_notebook/src/java/org/lamsfoundation/lams/tool/notebook/dbupdates/patch20140716.sql =================================================================== diff -u --- lams_tool_notebook/src/java/org/lamsfoundation/lams/tool/notebook/dbupdates/patch20140716.sql (revision 0) +++ lams_tool_notebook/src/java/org/lamsfoundation/lams/tool/notebook/dbupdates/patch20140716.sql (revision 5fd25049d526080b60f6753a3d4603fb18913202) @@ -0,0 +1,14 @@ +-- Turn off autocommit, so nothing is committed if there is an error +SET AUTOCOMMIT = 0; +SET FOREIGN_KEY_CHECKS=0; +----------------------Put all sql statements below here------------------------- + +-- LDEV-3193 Notebook monitor UI improvements +ALTER TABLE tl_lantbk11_user ADD COLUMN teachers_comment TEXT; + +----------------------Put all sql statements above here------------------------- + +-- If there were no errors, commit and restore autocommit to on +COMMIT; +SET AUTOCOMMIT = 1; +SET FOREIGN_KEY_CHECKS=1; \ No newline at end of file Index: lams_tool_notebook/src/java/org/lamsfoundation/lams/tool/notebook/dto/NotebookEntryDTO.java =================================================================== diff -u -r56af73875ad9b4f953d2951479e49dbc1f2715f9 -r5fd25049d526080b60f6753a3d4603fb18913202 --- lams_tool_notebook/src/java/org/lamsfoundation/lams/tool/notebook/dto/NotebookEntryDTO.java (.../NotebookEntryDTO.java) (revision 56af73875ad9b4f953d2951479e49dbc1f2715f9) +++ lams_tool_notebook/src/java/org/lamsfoundation/lams/tool/notebook/dto/NotebookEntryDTO.java (.../NotebookEntryDTO.java) (revision 5fd25049d526080b60f6753a3d4603fb18913202) @@ -2,55 +2,69 @@ import java.util.Date; +import org.apache.commons.lang.StringEscapeUtils; import org.lamsfoundation.lams.notebook.model.NotebookEntry; public class NotebookEntryDTO { - - private Long uid; - private String entry; - - private Date createDate; - - private Date lastModified; + private Long uid; - public NotebookEntryDTO(NotebookEntry entry) { - this.uid = entry.getUid(); - this.entry = entry.getEntry(); - this.createDate = entry.getCreateDate(); - this.lastModified = entry.getLastModified(); - } + private String entry; - public Date getCreateDate() { - return createDate; - } + private String entryEscaped; - public void setCreateDate(Date createDate) { - this.createDate = createDate; - } + private Date createDate; - public String getEntry() { - return entry; - } + private Date lastModified; - public void setEntry(String entry) { - this.entry = entry; + public NotebookEntryDTO(NotebookEntry entry) { + this.uid = entry.getUid(); + this.entry = entry.getEntry(); + if (this.entry != null) { + this.entryEscaped = StringEscapeUtils.escapeJavaScript(this.entry); } + this.createDate = entry.getCreateDate(); + this.lastModified = (entry.getLastModified() == null) ? entry.getCreateDate() : entry.getLastModified(); + } - public Date getLastModified() { - return lastModified; - } + public Date getCreateDate() { + return createDate; + } - public void setLastModified(Date lastModified) { - this.lastModified = lastModified; - } + public void setCreateDate(Date createDate) { + this.createDate = createDate; + } - public Long getUid() { - return uid; - } + public String getEntry() { + return entry; + } - public void setUid(Long uid) { - this.uid = uid; - } - + public void setEntry(String entry) { + this.entry = entry; + } + + public String getEntryEscaped() { + return entryEscaped; + } + + public void setEntryEscaped(String entryEscaped) { + this.entryEscaped = entryEscaped; + } + + public Date getLastModified() { + return lastModified; + } + + public void setLastModified(Date lastModified) { + this.lastModified = lastModified; + } + + public Long getUid() { + return uid; + } + + public void setUid(Long uid) { + this.uid = uid; + } + } Index: lams_tool_notebook/src/java/org/lamsfoundation/lams/tool/notebook/dto/NotebookUserDTO.java =================================================================== diff -u -rb0dcb38987a64f7df435ccf3e2beabe7ac54d8fb -r5fd25049d526080b60f6753a3d4603fb18913202 --- lams_tool_notebook/src/java/org/lamsfoundation/lams/tool/notebook/dto/NotebookUserDTO.java (.../NotebookUserDTO.java) (revision b0dcb38987a64f7df435ccf3e2beabe7ac54d8fb) +++ lams_tool_notebook/src/java/org/lamsfoundation/lams/tool/notebook/dto/NotebookUserDTO.java (.../NotebookUserDTO.java) (revision 5fd25049d526080b60f6753a3d4603fb18913202) @@ -25,107 +25,124 @@ package org.lamsfoundation.lams.tool.notebook.dto; +import org.apache.commons.lang.StringEscapeUtils; import org.lamsfoundation.lams.notebook.model.NotebookEntry; import org.lamsfoundation.lams.tool.notebook.model.NotebookUser; -public class NotebookUserDTO implements Comparable{ - - public Long uid; - - public String loginName; - - public String firstName; - - public String lastName; - - public boolean finishedActivity; - - public NotebookEntryDTO entryDTO; +public class NotebookUserDTO implements Comparable { - public Long entryUID; - - public NotebookUserDTO(NotebookUser user, NotebookEntry entry) { - this.uid = user.getUid(); - this.loginName = user.getLoginName(); - this.firstName = user.getFirstName(); - this.lastName = user.getLastName(); - this.finishedActivity = user.isFinishedActivity(); - this.entryUID = user.getEntryUID(); - this.entryDTO = new NotebookEntryDTO(entry); - } - - public NotebookUserDTO(NotebookUser user) { - this.uid = user.getUid(); - this.loginName = user.getLoginName(); - this.firstName = user.getFirstName(); - this.lastName = user.getLastName(); - this.finishedActivity = user.isFinishedActivity(); - this.entryUID = user.getEntryUID(); - } + private Long uid; - public int compareTo(Object o) { - int returnValue; - NotebookUserDTO toUser = (NotebookUserDTO)o; - returnValue = this.lastName.compareTo(toUser.lastName); - if (returnValue == 0) { - returnValue = this.uid.compareTo(toUser.uid); - } - return returnValue; - } + private String loginName; - public String getFirstName() { - return firstName; - } + private String firstName; - public void setFirstName(String firstName) { - this.firstName = firstName; - } + private String lastName; - public String getLastName() { - return lastName; - } + private boolean finishedActivity; - public void setLastName(String lastName) { - this.lastName = lastName; - } + private NotebookEntryDTO entryDTO; - public String getLoginName() { - return loginName; - } + private Long entryUID; - public void setLoginName(String loginName) { - this.loginName = loginName; - } + private String teachersComment; - public Long getUid() { - return uid; + public NotebookUserDTO(NotebookUser user, NotebookEntry entry) { + this.uid = user.getUid(); + this.loginName = user.getLoginName(); + this.firstName = user.getFirstName(); + this.lastName = user.getLastName(); + this.finishedActivity = user.isFinishedActivity(); + this.entryUID = user.getEntryUID(); + if (user.getTeachersComment() != null) { + this.teachersComment = StringEscapeUtils.escapeJavaScript(user.getTeachersComment()); } + this.entryDTO = new NotebookEntryDTO(entry); + } - public void setUid(Long uid) { - this.uid = uid; + public NotebookUserDTO(NotebookUser user) { + this.uid = user.getUid(); + this.loginName = user.getLoginName(); + this.firstName = user.getFirstName(); + this.lastName = user.getLastName(); + this.finishedActivity = user.isFinishedActivity(); + this.entryUID = user.getEntryUID(); + if (user.getTeachersComment() != null) { + this.teachersComment = StringEscapeUtils.escapeJavaScript(user.getTeachersComment()); } + } - public NotebookEntryDTO getEntryDTO() { - return entryDTO; + public int compareTo(Object o) { + int returnValue; + NotebookUserDTO toUser = (NotebookUserDTO) o; + returnValue = this.lastName.compareTo(toUser.lastName); + if (returnValue == 0) { + returnValue = this.uid.compareTo(toUser.uid); } + return returnValue; + } - public void setEntryDTO(NotebookEntryDTO entryDTO) { - this.entryDTO = entryDTO; - } + public String getFirstName() { + return firstName; + } - public Long getEntryUID() { - return entryUID; - } + public void setFirstName(String firstName) { + this.firstName = firstName; + } - public void setEntryUID(Long entryUID) { - this.entryUID = entryUID; - } + public String getLastName() { + return lastName; + } - public boolean isFinishedActivity() { - return finishedActivity; - } + public void setLastName(String lastName) { + this.lastName = lastName; + } - public void setFinishedActivity(boolean finishedActivity) { - this.finishedActivity = finishedActivity; - } + public String getLoginName() { + return loginName; + } + + public void setLoginName(String loginName) { + this.loginName = loginName; + } + + public Long getUid() { + return uid; + } + + public void setUid(Long uid) { + this.uid = uid; + } + + public NotebookEntryDTO getEntryDTO() { + return entryDTO; + } + + public void setEntryDTO(NotebookEntryDTO entryDTO) { + this.entryDTO = entryDTO; + } + + public Long getEntryUID() { + return entryUID; + } + + public void setEntryUID(Long entryUID) { + this.entryUID = entryUID; + } + + public String getTeachersComment() { + return teachersComment; + } + + public void setTeachersComment(String teachersComment) { + this.teachersComment = teachersComment; + } + + public boolean isFinishedActivity() { + return finishedActivity; + } + + public void setFinishedActivity(boolean finishedActivity) { + this.finishedActivity = finishedActivity; + } } Index: lams_tool_notebook/src/java/org/lamsfoundation/lams/tool/notebook/model/NotebookUser.java =================================================================== diff -u -rda54b82e5ef860fe9f8872b75f2b1718cfb7de32 -r5fd25049d526080b60f6753a3d4603fb18913202 --- lams_tool_notebook/src/java/org/lamsfoundation/lams/tool/notebook/model/NotebookUser.java (.../NotebookUser.java) (revision da54b82e5ef860fe9f8872b75f2b1718cfb7de32) +++ lams_tool_notebook/src/java/org/lamsfoundation/lams/tool/notebook/model/NotebookUser.java (.../NotebookUser.java) (revision 5fd25049d526080b60f6753a3d4603fb18913202) @@ -27,190 +27,195 @@ import org.lamsfoundation.lams.usermanagement.dto.UserDTO; /** + * Caches the user details. This allows the tool to be more efficient at displaying user names but means that when + * people's names change, they won't change in the "old" tool data. * - * Caches the user details. This allows the tool to be more efficient at - * displaying user names but means that when people's names change, they won't - * change in the "old" tool data. - * * @hibernate.class table="tl_lantbk11_user" */ - public class NotebookUser implements java.io.Serializable { - /** - * - */ - private static final long serialVersionUID = -3701664859818409197L; + private static final long serialVersionUID = -3701664859818409197L; - // Fields - private Long uid; + // Fields + private Long uid; - private Long userId; + private Long userId; - private String lastName; + private String lastName; - private String firstName; + private String firstName; - private String loginName; + private String loginName; - private NotebookSession notebookSession; - - private boolean finishedActivity; - - private Long entryUID; + private NotebookSession notebookSession; - // Constructors + private boolean finishedActivity; - /** default constructor */ - public NotebookUser() { - } + private Long entryUID; + + private String teachersComment; - public NotebookUser(UserDTO user, NotebookSession notebookSession) { - this.userId = new Long(user.getUserID().intValue()); - this.firstName = user.getFirstName(); - this.lastName = user.getLastName(); - this.loginName = user.getLogin(); - this.notebookSession = notebookSession; - this.finishedActivity = false; - } + // Constructors - /** full constructor */ - public NotebookUser(Long userId, String lastName, String firstName, - NotebookSession notebookSession) { - this.userId = userId; - this.lastName = lastName; - this.firstName = firstName; - this.notebookSession = notebookSession; - } + /** default constructor */ + public NotebookUser() { + } - // Property accessors - /** - * @hibernate.id generator-class="native" type="java.lang.Long" column="uid" - */ - public Long getUid() { - return this.uid; - } + public NotebookUser(UserDTO user, NotebookSession notebookSession) { + this.userId = new Long(user.getUserID().intValue()); + this.firstName = user.getFirstName(); + this.lastName = user.getLastName(); + this.loginName = user.getLogin(); + this.notebookSession = notebookSession; + this.finishedActivity = false; + } - public void setUid(Long uid) { - this.uid = uid; - } + /** full constructor */ + public NotebookUser(Long userId, String lastName, String firstName, NotebookSession notebookSession) { + this.userId = userId; + this.lastName = lastName; + this.firstName = firstName; + this.notebookSession = notebookSession; + } - /** - * @hibernate.property column="user_id" length="20" - * - */ - public Long getUserId() { - return this.userId; - } + // Property accessors + /** + * @hibernate.id generator-class="native" type="java.lang.Long" column="uid" + */ + public Long getUid() { + return this.uid; + } - public void setUserId(Long userId) { - this.userId = userId; - } - /** - * @hibernate.property column="last_name" length="255" - * - */ - public String getLastName() { - return this.lastName; - } + public void setUid(Long uid) { + this.uid = uid; + } - public void setLastName(String lastName) { - this.lastName = lastName; - } - - /** - * @hibernate.property column="login_name" length="255" - * - */ - public String getLoginName() { - return loginName; - } + /** + * @hibernate.property column="user_id" length="20" + * + */ + public Long getUserId() { + return this.userId; + } - public void setLoginName(String loginName) { - this.loginName = loginName; - } + public void setUserId(Long userId) { + this.userId = userId; + } - /** - * @hibernate.property column="first_name" length="255" - * - */ - public String getFirstName() { - return this.firstName; - } + /** + * @hibernate.property column="last_name" length="255" + * + */ + public String getLastName() { + return this.lastName; + } - public void setFirstName(String firstName) { - this.firstName = firstName; - } - - /** - * @hibernate.property column="finishedActivity" - */ - public boolean isFinishedActivity() { - return finishedActivity; - } + public void setLastName(String lastName) { + this.lastName = lastName; + } - public void setFinishedActivity(boolean finishedActivity) { - this.finishedActivity = finishedActivity; - } - - /** - * @hibernate.many-to-one not-null="true" - * @hibernate.column name="notebook_session_uid" - * - */ - public NotebookSession getNotebookSession() { - return this.notebookSession; - } + /** + * @hibernate.property column="login_name" length="255" + * + */ + public String getLoginName() { + return loginName; + } - public void setNotebookSession(NotebookSession notebookSession) { - this.notebookSession = notebookSession; - } + public void setLoginName(String loginName) { + this.loginName = loginName; + } - /** - * @hibernate.property column="entry_uid" - */ - public Long getEntryUID() { - return entryUID; - } + /** + * @hibernate.property column="first_name" length="255" + * + */ + public String getFirstName() { + return this.firstName; + } - public void setEntryUID(Long entryUID) { - this.entryUID = entryUID; - } - - /** - * toString - * - * @return String - */ - public String toString() { - StringBuffer buffer = new StringBuffer(); + public void setFirstName(String firstName) { + this.firstName = firstName; + } - buffer.append(getClass().getName()).append("@").append( - Integer.toHexString(hashCode())).append(" ["); - buffer.append("userId").append("='").append(getUserId()).append("' "); - buffer.append("]"); + /** + * @hibernate.property column="finishedActivity" + */ + public boolean isFinishedActivity() { + return finishedActivity; + } - return buffer.toString(); - } + public void setFinishedActivity(boolean finishedActivity) { + this.finishedActivity = finishedActivity; + } - public boolean equals(Object other) { - if ((this == other)) - return true; - if ((other == null)) - return false; - if (!(other instanceof NotebookUser)) - return false; - NotebookUser castOther = (NotebookUser) other; + /** + * @hibernate.many-to-one not-null="true" + * @hibernate.column name="notebook_session_uid" + * + */ + public NotebookSession getNotebookSession() { + return this.notebookSession; + } - return ((this.getUid() == castOther.getUid()) || (this.getUid() != null - && castOther.getUid() != null && this.getUid().equals( - castOther.getUid()))); - } + public void setNotebookSession(NotebookSession notebookSession) { + this.notebookSession = notebookSession; + } - public int hashCode() { - int result = 17; - result = 37 * result - + (getUid() == null ? 0 : this.getUid().hashCode()); - return result; - } + /** + * @hibernate.property column="entry_uid" + */ + public Long getEntryUID() { + return entryUID; + } + + public void setEntryUID(Long entryUID) { + this.entryUID = entryUID; + } + + /** + * @hibernate.property column="teachers_comment" length="65535" + * + */ + public String getTeachersComment() { + return teachersComment; + } + + public void setTeachersComment(String teachersComment) { + this.teachersComment = teachersComment; + } + + /** + * toString + * + * @return String + */ + public String toString() { + StringBuffer buffer = new StringBuffer(); + + buffer.append(getClass().getName()).append("@").append(Integer.toHexString(hashCode())).append(" ["); + buffer.append("userId").append("='").append(getUserId()).append("' "); + buffer.append("]"); + + return buffer.toString(); + } + + public boolean equals(Object other) { + if ((this == other)) + return true; + if ((other == null)) + return false; + if (!(other instanceof NotebookUser)) + return false; + NotebookUser castOther = (NotebookUser) other; + + return ((this.getUid() == castOther.getUid()) || (this.getUid() != null && castOther.getUid() != null && this + .getUid().equals(castOther.getUid()))); + } + + public int hashCode() { + int result = 17; + result = 37 * result + (getUid() == null ? 0 : this.getUid().hashCode()); + return result; + } } \ No newline at end of file Index: lams_tool_notebook/src/java/org/lamsfoundation/lams/tool/notebook/util/NotebookConstants.java =================================================================== diff -u -rbe07c35c372d904a65581d98660e73f3b13b69db -r5fd25049d526080b60f6753a3d4603fb18913202 --- lams_tool_notebook/src/java/org/lamsfoundation/lams/tool/notebook/util/NotebookConstants.java (.../NotebookConstants.java) (revision be07c35c372d904a65581d98660e73f3b13b69db) +++ lams_tool_notebook/src/java/org/lamsfoundation/lams/tool/notebook/util/NotebookConstants.java (.../NotebookConstants.java) (revision 5fd25049d526080b60f6753a3d4603fb18913202) @@ -51,6 +51,7 @@ public static final String ATTR_CONDITION_SET = "conditionList"; public static final String PARAM_ORDER_ID = "orderId"; + public static final String PARAM_USER_UID = "userUid"; public static final String ATTR_DELETED_CONDITION_LIST = "deletedConditionList"; public static final String USER_ENTRY_DEFINITION_NAME = "user.entry.output.definition.notebook"; public static final String USER_ENTRY_DEFAULT_CONDITION_DISPLAY_NAME_KEY = "user.entry.output.definition.notebook.default.condition"; Index: lams_tool_notebook/src/java/org/lamsfoundation/lams/tool/notebook/web/actions/MonitoringAction.java =================================================================== diff -u -rbe07c35c372d904a65581d98660e73f3b13b69db -r5fd25049d526080b60f6753a3d4603fb18913202 --- lams_tool_notebook/src/java/org/lamsfoundation/lams/tool/notebook/web/actions/MonitoringAction.java (.../MonitoringAction.java) (revision be07c35c372d904a65581d98660e73f3b13b69db) +++ lams_tool_notebook/src/java/org/lamsfoundation/lams/tool/notebook/web/actions/MonitoringAction.java (.../MonitoringAction.java) (revision 5fd25049d526080b60f6753a3d4603fb18913202) @@ -37,6 +37,8 @@ import org.apache.struts.action.ActionMapping; import org.lamsfoundation.lams.notebook.model.NotebookEntry; import org.lamsfoundation.lams.tool.notebook.dto.NotebookDTO; +import org.lamsfoundation.lams.tool.notebook.dto.NotebookEntryDTO; +import org.lamsfoundation.lams.tool.notebook.dto.NotebookSessionDTO; import org.lamsfoundation.lams.tool.notebook.dto.NotebookUserDTO; import org.lamsfoundation.lams.tool.notebook.model.Notebook; import org.lamsfoundation.lams.tool.notebook.model.NotebookUser; @@ -51,81 +53,89 @@ import org.lamsfoundation.lams.web.util.AttributeNames; /** - * @author - * @version + * @struts.action path="/monitoring" parameter="dispatch" scope="request" name="monitoringForm" validate="false" * - * @struts.action path="/monitoring" parameter="dispatch" scope="request" - * name="monitoringForm" validate="false" - * * @struts.action-forward name="success" path="tiles:/monitoring/main" - * @struts.action-forward name="notebookDisplay" path="tiles:/monitoring/notebookDisplay" - * */ public class MonitoringAction extends LamsDispatchAction { - private static Logger log = Logger.getLogger(MonitoringAction.class); + private static Logger log = Logger.getLogger(MonitoringAction.class); - public INotebookService notebookService; + public INotebookService notebookService; - public ActionForward unspecified(ActionMapping mapping, ActionForm form, - HttpServletRequest request, HttpServletResponse response) { + public ActionForward unspecified(ActionMapping mapping, ActionForm form, HttpServletRequest request, + HttpServletResponse response) { - setupService(); + setupService(); + Long toolContentID = new Long(WebUtil.readLongParam(request, AttributeNames.PARAM_TOOL_CONTENT_ID)); + String contentFolderID = WebUtil.readStrParam(request, AttributeNames.PARAM_CONTENT_FOLDER_ID); + request.setAttribute("contentFolderID", contentFolderID); - Long toolContentID = new Long(WebUtil.readLongParam(request, - AttributeNames.PARAM_TOOL_CONTENT_ID)); - - String contentFolderID = WebUtil.readStrParam(request, - AttributeNames.PARAM_CONTENT_FOLDER_ID); - - Notebook notebook = notebookService - .getNotebookByContentId(toolContentID); + Notebook notebook = notebookService.getNotebookByContentId(toolContentID); + if (notebook == null) { + // TODO error page. + } - if (notebook == null) { - // TODO error page. - } - - boolean isGroupedActivity = notebookService.isGroupedActivity(toolContentID); - - NotebookDTO notebookDT0 = new NotebookDTO(notebook); + boolean isGroupedActivity = notebookService.isGroupedActivity(toolContentID); + request.setAttribute("isGroupedActivity", isGroupedActivity); - Long currentTab = WebUtil.readLongParam(request, AttributeNames.PARAM_CURRENT_TAB,true); - notebookDT0.setCurrentTab(currentTab); + NotebookDTO notebookDTO = new NotebookDTO(notebook); + Long currentTab = WebUtil.readLongParam(request, AttributeNames.PARAM_CURRENT_TAB, true); + notebookDTO.setCurrentTab(currentTab); - request.setAttribute("notebookDTO", notebookDT0); - request.setAttribute("contentFolderID", contentFolderID); - request.setAttribute("isGroupedActivity", isGroupedActivity); - - Date submissionDeadline = notebook.getSubmissionDeadline(); - - if (submissionDeadline != null) { - HttpSession ss = SessionManager.getSession(); - UserDTO teacher = (UserDTO) ss.getAttribute(AttributeNames.USER); - TimeZone teacherTimeZone = teacher.getTimeZone(); - Date tzSubmissionDeadline = DateUtil.convertToTimeZoneFromDefault(teacherTimeZone, submissionDeadline); - request.setAttribute(NotebookConstants.ATTR_SUBMISSION_DEADLINE, tzSubmissionDeadline.getTime()); + // add the notebookEntry for each user in each session + for (NotebookSessionDTO session : notebookDTO.getSessionDTOs()) { + for (NotebookUserDTO user : session.getUserDTOs()) { + NotebookEntry entry = notebookService.getEntry(user.getEntryUID()); + if (entry != null) { + NotebookEntryDTO entryDTO = new NotebookEntryDTO(entry); + user.setEntryDTO(entryDTO); } - - return mapping.findForward("success"); + } } - public ActionForward showNotebook(ActionMapping mapping, ActionForm form, - HttpServletRequest request, HttpServletResponse response) { - - setupService(); - - Long uid = new Long(WebUtil.readLongParam(request, "userUID")); + request.setAttribute("notebookDTO", notebookDTO); - NotebookUser user = notebookService.getUserByUID(uid); - NotebookEntry entry = notebookService.getEntry(user.getEntryUID()); + Date submissionDeadline = notebook.getSubmissionDeadline(); + if (submissionDeadline != null) { + HttpSession ss = SessionManager.getSession(); + UserDTO teacher = (UserDTO) ss.getAttribute(AttributeNames.USER); + TimeZone teacherTimeZone = teacher.getTimeZone(); + Date tzSubmissionDeadline = DateUtil.convertToTimeZoneFromDefault(teacherTimeZone, submissionDeadline); + request.setAttribute(NotebookConstants.ATTR_SUBMISSION_DEADLINE, tzSubmissionDeadline.getTime()); + } - NotebookUserDTO userDTO = new NotebookUserDTO(user, entry); + return mapping.findForward("success"); + } - request.setAttribute("userDTO", userDTO); - - return mapping.findForward("notebookDisplay"); - } + /** + * Updates a user's mark or feedback for an entire lesson + * + * @param mapping + * @param form + * @param request + * @param response + * @return + * @throws Exception + */ + public ActionForward saveTeacherComment(ActionMapping mapping, ActionForm form, + HttpServletRequest request, HttpServletResponse response) throws Exception { + setupService(); + String teachersComment = WebUtil.readStrParam(request, "teachersComment"); + Long userUid = WebUtil.readLongParam(request, NotebookConstants.PARAM_USER_UID); + NotebookUser user = notebookService.getUserByUID(userUid); + + //check user had available notebook entry + if (user.getEntryUID() != null) { + Long toolSessionID = user.getNotebookSession().getSessionId(); + user.setTeachersComment(teachersComment); + notebookService.saveOrUpdateNotebookUser(user); + } + + return null; + } + /** * Set Submission Deadline * @@ -137,37 +147,34 @@ */ public ActionForward setSubmissionDeadline(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) { - - setupService(); - - Long contentID = WebUtil.readLongParam(request, AttributeNames.PARAM_TOOL_CONTENT_ID); - Notebook notebook = notebookService - .getNotebookByContentId(contentID); - - Long dateParameter = WebUtil.readLongParam(request, NotebookConstants.ATTR_SUBMISSION_DEADLINE, true); - Date tzSubmissionDeadline = null; - if (dateParameter != null) { - Date submissionDeadline = new Date(dateParameter); - HttpSession ss = SessionManager.getSession(); - org.lamsfoundation.lams.usermanagement.dto.UserDTO teacher = (org.lamsfoundation.lams.usermanagement.dto.UserDTO) ss.getAttribute(AttributeNames.USER); - TimeZone teacherTimeZone = teacher.getTimeZone(); - tzSubmissionDeadline = DateUtil.convertFromTimeZoneToDefault(teacherTimeZone, submissionDeadline); - } - notebook.setSubmissionDeadline(tzSubmissionDeadline); - notebookService.saveOrUpdateNotebook(notebook); - return null; + setupService(); + + Long contentID = WebUtil.readLongParam(request, AttributeNames.PARAM_TOOL_CONTENT_ID); + + Notebook notebook = notebookService.getNotebookByContentId(contentID); + + Long dateParameter = WebUtil.readLongParam(request, NotebookConstants.ATTR_SUBMISSION_DEADLINE, true); + Date tzSubmissionDeadline = null; + if (dateParameter != null) { + Date submissionDeadline = new Date(dateParameter); + HttpSession ss = SessionManager.getSession(); + org.lamsfoundation.lams.usermanagement.dto.UserDTO teacher = (org.lamsfoundation.lams.usermanagement.dto.UserDTO) ss + .getAttribute(AttributeNames.USER); + TimeZone teacherTimeZone = teacher.getTimeZone(); + tzSubmissionDeadline = DateUtil.convertFromTimeZoneToDefault(teacherTimeZone, submissionDeadline); + } + notebook.setSubmissionDeadline(tzSubmissionDeadline); + notebookService.saveOrUpdateNotebook(notebook); + return null; } - - - - /** - * set up notebookService - */ - private void setupService() { - if (notebookService == null) { - notebookService = NotebookServiceProxy.getNotebookService(this - .getServlet().getServletContext()); - } + + /** + * set up notebookService + */ + private void setupService() { + if (notebookService == null) { + notebookService = NotebookServiceProxy.getNotebookService(this.getServlet().getServletContext()); } + } } Index: lams_tool_notebook/src/java/org/lamsfoundation/lams/tool/notebook/web/servlets/ExportServlet.java =================================================================== diff -u -rbe07c35c372d904a65581d98660e73f3b13b69db -r5fd25049d526080b60f6753a3d4603fb18913202 --- lams_tool_notebook/src/java/org/lamsfoundation/lams/tool/notebook/web/servlets/ExportServlet.java (.../ExportServlet.java) (revision be07c35c372d904a65581d98660e73f3b13b69db) +++ lams_tool_notebook/src/java/org/lamsfoundation/lams/tool/notebook/web/servlets/ExportServlet.java (.../ExportServlet.java) (revision 5fd25049d526080b60f6753a3d4603fb18913202) @@ -151,7 +151,6 @@ NotebookDTO notebookDTO = new NotebookDTO(notebook); // add the notebookEntry for each user in each session - for (NotebookSessionDTO session : notebookDTO.getSessionDTOs()) { for (NotebookUserDTO user : session.getUserDTOs()) { NotebookEntry entry = notebookService.getEntry(user.getEntryUID()); Index: lams_tool_notebook/web/WEB-INF/tiles-defs.xml =================================================================== diff -u -rbe07c35c372d904a65581d98660e73f3b13b69db -r5fd25049d526080b60f6753a3d4603fb18913202 --- lams_tool_notebook/web/WEB-INF/tiles-defs.xml (.../tiles-defs.xml) (revision be07c35c372d904a65581d98660e73f3b13b69db) +++ lams_tool_notebook/web/WEB-INF/tiles-defs.xml (.../tiles-defs.xml) (revision 5fd25049d526080b60f6753a3d4603fb18913202) @@ -82,11 +82,6 @@ - - - - - Index: lams_tool_notebook/web/common/taglibs.jsp =================================================================== diff -u -r8179037dc958585c054547eb7de9be14c6aed233 -r5fd25049d526080b60f6753a3d4603fb18913202 --- lams_tool_notebook/web/common/taglibs.jsp (.../taglibs.jsp) (revision 8179037dc958585c054547eb7de9be14c6aed233) +++ lams_tool_notebook/web/common/taglibs.jsp (.../taglibs.jsp) (revision 5fd25049d526080b60f6753a3d4603fb18913202) @@ -2,6 +2,7 @@ <%@ taglib uri="tags-bean" prefix="bean"%> <%@ taglib uri="tags-logic" prefix="logic"%> +<%@ taglib uri="tags-function" prefix="fn" %> <%@ taglib uri="tags-tiles" prefix="tiles"%> <%@ taglib uri="tags-html" prefix="html"%> <%@ taglib uri="tags-core" prefix="c"%> Index: lams_tool_notebook/web/pages/monitoring/advanceOptions.jsp =================================================================== diff -u --- lams_tool_notebook/web/pages/monitoring/advanceOptions.jsp (revision 0) +++ lams_tool_notebook/web/pages/monitoring/advanceOptions.jsp (revision 5fd25049d526080b60f6753a3d4603fb18913202) @@ -0,0 +1,48 @@ +<%@ include file="/common/taglibs.jsp"%> +

+ + + + + +

+
+ + \ No newline at end of file Fisheye: Tag 5fd25049d526080b60f6753a3d4603fb18913202 refers to a dead (removed) revision in file `lams_tool_notebook/web/pages/monitoring/notebookDisplay.jsp'. Fisheye: No comparison available. Pass `N' to diff? Index: lams_tool_notebook/web/pages/monitoring/statistics.jsp =================================================================== diff -u -r15e9d26c38d7f65fa9a6a465e068255e5d44cd11 -r5fd25049d526080b60f6753a3d4603fb18913202 --- lams_tool_notebook/web/pages/monitoring/statistics.jsp (.../statistics.jsp) (revision 15e9d26c38d7f65fa9a6a465e068255e5d44cd11) +++ lams_tool_notebook/web/pages/monitoring/statistics.jsp (.../statistics.jsp) (revision 5fd25049d526080b60f6753a3d4603fb18913202) @@ -1,7 +1,6 @@ <%@ include file="/common/taglibs.jsp"%> - - + Index: lams_tool_notebook/web/pages/monitoring/summary.jsp =================================================================== diff -u -r3bf4ee4aac914dfc772dd08ee28d0f6b555ee4fc -r5fd25049d526080b60f6753a3d4603fb18913202 --- lams_tool_notebook/web/pages/monitoring/summary.jsp (.../summary.jsp) (revision 3bf4ee4aac914dfc772dd08ee28d0f6b555ee4fc) +++ lams_tool_notebook/web/pages/monitoring/summary.jsp (.../summary.jsp) (revision 5fd25049d526080b60f6753a3d4603fb18913202) @@ -2,12 +2,33 @@ - - + + + - + + - +

+ +

-

-
- +
-

- + +
+ +
+
- - - -

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

+ ${sessionDto.sessionName} +

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

+ +
-<%@include file="daterestriction.jsp"%> +<%@include file="advanceOptions.jsp"%> - - - -

- ${session.sessionName} -

-
- - - - - - -
- - - ${session.numberOfLearners} -
- - - - - - - - - - - - - - - -
- - - -
- - - - - - - - - - - - - - -
-
+<%@include file="daterestriction.jsp"%>