001: /**********************************************************************************
002: *
003: * $Id: AbstractGradeRecord.java 20001 2006-12-22 19:41:33Z ray@media.berkeley.edu $
004: *
005: ***********************************************************************************
006: *
007: * Copyright (c) 2005 The Regents of the University of California, The MIT Corporation
008: *
009: * Licensed under the Educational Community License, Version 1.0 (the "License");
010: * you may not use this file except in compliance with the License.
011: * You may obtain a copy of the License at
012: *
013: * http://www.opensource.org/licenses/ecl1.php
014: *
015: * Unless required by applicable law or agreed to in writing, software
016: * distributed under the License is distributed on an "AS IS" BASIS,
017: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
018: * See the License for the specific language governing permissions and
019: * limitations under the License.
020: *
021: **********************************************************************************/package org.sakaiproject.tool.gradebook;
022:
023: import java.io.Serializable;
024: import java.util.Date;
025:
026: import org.apache.commons.lang.builder.ToStringBuilder;
027:
028: /**
029: * AbstractGradeRecord is the abstract base class for Grade Records, which are
030: * records of instructors (or the application, in the case of autocalculated
031: * gradebooks) assigning a grade to a student for a particular GradableObject.
032: *
033: * @author <a href="mailto:jholtzman@berkeley.edu">Josh Holtzman</a>
034: */
035: public abstract class AbstractGradeRecord implements Serializable {
036: protected Long id;
037: protected int version;
038: protected String studentId;
039: protected String graderId;
040: protected GradableObject gradableObject;
041: protected Date dateRecorded;
042:
043: public abstract Double getGradeAsPercentage();
044:
045: /**
046: * @return Whether this is a course grade record
047: */
048: public abstract boolean isCourseGradeRecord();
049:
050: /**
051: * @return Returns the pointsEarned
052: */
053: public abstract Double getPointsEarned();
054:
055: /**
056: * @return Returns the dateRecorded.
057: */
058: public Date getDateRecorded() {
059: return dateRecorded;
060: }
061:
062: /**
063: * @param dateRecorded The dateRecorded to set.
064: */
065: public void setDateRecorded(Date dateRecorded) {
066: this .dateRecorded = dateRecorded;
067: }
068:
069: /**
070: * @return Returns the gradableObject.
071: */
072: public GradableObject getGradableObject() {
073: return gradableObject;
074: }
075:
076: /**
077: * @param gradableObject The gradableObject to set.
078: */
079: public void setGradableObject(GradableObject gradableObject) {
080: this .gradableObject = gradableObject;
081: }
082:
083: /**
084: * @return Returns the id.
085: */
086: public Long getId() {
087: return id;
088: }
089:
090: /**
091: * @param id The id to set.
092: */
093: public void setId(Long id) {
094: this .id = id;
095: }
096:
097: /**
098: * @return Returns the version.
099: */
100: public int getVersion() {
101: return version;
102: }
103:
104: /**
105: * @param version The version to set.
106: */
107: public void setVersion(int version) {
108: this .version = version;
109: }
110:
111: /**
112: * @return Returns the graderId.
113: */
114: public String getGraderId() {
115: return graderId;
116: }
117:
118: /**
119: * @param graderId The graderId to set.
120: */
121: public void setGraderId(String graderId) {
122: this .graderId = graderId;
123: }
124:
125: /**
126: * @return Returns the studentId.
127: */
128: public String getStudentId() {
129: return studentId;
130: }
131:
132: /**
133: * @param studentId The studentId to set.
134: */
135: public void setStudentId(String studentId) {
136: this .studentId = studentId;
137: }
138:
139: public String toString() {
140: return new ToStringBuilder(this ).append("id", id).append(
141: "studentId", studentId).append("graderId", graderId)
142: .toString();
143: }
144:
145: }
|