Index: lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/McSessionMarkDTO.java =================================================================== diff -u --- lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/McSessionMarkDTO.java (revision 0) +++ lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/McSessionMarkDTO.java (revision d802954e23b530b46c710e9816f710eab0156acf) @@ -0,0 +1,100 @@ +/*************************************************************************** + * 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 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 + * USA + * + * http://www.gnu.org/licenses/gpl.txt + * ***********************************************************************/ +/* $$Id$$ */ +package org.lamsfoundation.lams.tool.mc; + +import java.util.Map; + +import org.apache.commons.lang.builder.ToStringBuilder; + + +/** + *
DTO that hols session user marks + *
+ * + * @author Ozgur Demirtas + */ +public class McSessionMarkDTO implements Comparable +{ + private String sessionId; + private String sessionName; + private Map userMarks; + + public String toString() { + return new ToStringBuilder(this) + .append("Listing SessionMarkDTO: ") + .append("sessionId: ", sessionId) + .append("sessionName: ", sessionName) + .append("userMarks: ", userMarks) + .toString(); + } + + + public int compareTo(Object o) + { + McSessionMarkDTO mcSessionMarkDTO = (McSessionMarkDTO) o; + + if (mcSessionMarkDTO == null) + return 1; + else + return (int) (new Long(sessionId).longValue() - new Long(mcSessionMarkDTO.sessionId).longValue()); + } + + /** + * @return Returns the sessionId. + */ + public String getSessionId() { + return sessionId; + } + /** + * @param sessionId The sessionId to set. + */ + public void setSessionId(String sessionId) { + this.sessionId = sessionId; + } + + + /** + * @return Returns the sessionName. + */ + public String getSessionName() { + return sessionName; + } + /** + * @param sessionName The sessionName to set. + */ + public void setSessionName(String sessionName) { + this.sessionName = sessionName; + } + /** + * @return Returns the userMarks. + */ + public Map getUserMarks() { + return userMarks; + } + /** + * @param userMarks The userMarks to set. + */ + public void setUserMarks(Map userMarks) { + this.userMarks = userMarks; + } +} Index: lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/McUserMarkDTO.java =================================================================== diff -u --- lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/McUserMarkDTO.java (revision 0) +++ lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/McUserMarkDTO.java (revision d802954e23b530b46c710e9816f710eab0156acf) @@ -0,0 +1,128 @@ +/*************************************************************************** + * 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 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 + * USA + * + * http://www.gnu.org/licenses/gpl.txt + * ***********************************************************************/ +/* $$Id$$ */ +package org.lamsfoundation.lams.tool.mc; + +import java.util.LinkedList; + +import org.apache.commons.lang.builder.ToStringBuilder; + + +/** + *DTO that hols user marks + *
+ * + * @author Ozgur Demirtas + */ +public class McUserMarkDTO implements Comparable +{ + private String sessionId; + private String queUsrId; + private String userName; + private LinkedList marks; + private String totalMark; + + public String toString() { + return new ToStringBuilder(this) + .append("Listing UserMarkDTO:") + .append("sessionId", sessionId) + .append("queUsrId", queUsrId) + .append("userName", userName) + .append("marks", marks) + .append("totalMark", totalMark) + .toString(); + } + + + /** + * @return Returns the marks. + */ + public LinkedList getMarks() { + return marks; + } + /** + * @param marks The marks to set. + */ + public void setMarks(LinkedList marks) { + this.marks = marks; + } + /** + * @return Returns the queUsrId. + */ + public String getQueUsrId() { + return queUsrId; + } + /** + * @param queUsrId The queUsrId to set. + */ + public void setQueUsrId(String queUsrId) { + this.queUsrId = queUsrId; + } + /** + * @return Returns the userName. + */ + public String getUserName() { + return userName; + } + /** + * @param userName The userName to set. + */ + public void setUserName(String userName) { + this.userName = userName; + } + + public int compareTo(Object o) + { + McUserMarkDTO mcUserMarkDTO = (McUserMarkDTO) o; + + if (mcUserMarkDTO == null) + return 1; + else + return (int) (new Long(queUsrId).longValue() - new Long(mcUserMarkDTO.queUsrId).longValue()); + } + + + /** + * @return Returns the sessionId. + */ + public String getSessionId() { + return sessionId; + } + /** + * @param sessionId The sessionId to set. + */ + public void setSessionId(String sessionId) { + this.sessionId = sessionId; + } + /** + * @return Returns the totalMark. + */ + public String getTotalMark() { + return totalMark; + } + /** + * @param totalMark The totalMark to set. + */ + public void setTotalMark(String totalMark) { + this.totalMark = totalMark; + } +}