001: /**********************************************************************************
002: * $URL: https://source.sakaiproject.org/svn/sam/trunk/component/src/java/org/sakaiproject/tool/assessment/facade/AssessmentGradingFacade.java $
003: * $Id: AssessmentGradingFacade.java 9273 2006-05-10 22:34:28Z daisyf@stanford.edu $
004: ***********************************************************************************
005: *
006: * Copyright (c) 2004, 2005, 2006 The Sakai Foundation.
007: *
008: * Licensed under the Educational Community License, Version 1.0 (the"License");
009: * you may not use this file except in compliance with the License.
010: * You may obtain a copy of the License at
011: *
012: * http://www.opensource.org/licenses/ecl1.php
013: *
014: * Unless required by applicable law or agreed to in writing, software
015: * distributed under the License is distributed on an "AS IS" BASIS,
016: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
017: * See the License for the specific language governing permissions and
018: * limitations under the License.
019: *
020: **********************************************************************************/package org.sakaiproject.tool.assessment.facade;
021:
022: import java.util.Date;
023: import java.util.Set;
024:
025: import org.sakaiproject.tool.assessment.data.dao.grading.AssessmentGradingData; //import org.sakaiproject.tool.assessment.data.ifc.assessment.PublishedAssessmentIfc;
026: import org.sakaiproject.tool.assessment.data.ifc.grading.AssessmentGradingIfc;
027:
028: /**
029: * Wrapper for AssessmentGradingData.
030: *
031: */
032:
033: public class AssessmentGradingFacade implements AssessmentGradingIfc
034: // need to implement org.osid.assessment.ItemTaken in the future
035: // - daisyf 10/11/04
036: {
037:
038: /**
039: *
040: */
041: private static final long serialVersionUID = 5715276464051399008L;
042: private Long assessmentGradingId;
043: private String agentId;
044: private Date submittedDate;
045: private Boolean isLate;
046: private Boolean forGrade;
047: private Float totalAutoScore;
048: private Float totalOverrideScore;
049: private Float finalScore; // final total score
050: private String comments;
051: private Integer status;
052: private String gradedBy;
053: private Date gradedDate;
054: private Set itemGradingSet;
055: // use the following properties to keep track of time taken for completing an assessment
056: private Date attemptDate; // the time stamp when user take the assessment whether
057: // it is the 1st or subsequent attempts
058: private Integer timeElapsed; // the elapsed time accumulated in second
059: private int totalSubmitted;
060: private Long publishedAssessmentId;
061: private String publishedAssessmentTitle;
062:
063: public AssessmentGradingFacade() {
064: }
065:
066: public AssessmentGradingFacade(AssessmentGradingData data) {
067: this .assessmentGradingId = data.getAssessmentGradingId();
068: this .agentId = data.getAgentId();
069: this .publishedAssessmentId = data.getPublishedAssessmentId();
070: this .publishedAssessmentTitle = data
071: .getPublishedAssessmentTitle();
072: this .submittedDate = data.getSubmittedDate();
073: this .isLate = data.getIsLate();
074: this .forGrade = data.getForGrade();
075: this .totalAutoScore = data.getTotalAutoScore();
076: this .totalOverrideScore = data.getTotalOverrideScore();
077: this .finalScore = data.getFinalScore();
078: this .comments = data.getComments();
079: this .status = data.getStatus();
080: this .gradedBy = data.getGradedBy();
081: this .gradedDate = data.getGradedDate();
082: this .itemGradingSet = data.getItemGradingSet();
083: this .attemptDate = data.getAttemptDate();
084: this .timeElapsed = data.getTimeElapsed();
085: }
086:
087: public Long getAssessmentGradingId() {
088: return assessmentGradingId;
089: }
090:
091: public void setAssessmentGradingId(Long assessmentGradingId) {
092: this .assessmentGradingId = assessmentGradingId;
093: }
094:
095: public Long getPublishedAssessmentId() {
096: return publishedAssessmentId;
097: }
098:
099: public void setPublishedAssessmentId(Long publishedAssessmentId) {
100: this .publishedAssessmentId = publishedAssessmentId;
101: }
102:
103: public String getAgentId() {
104: return agentId;
105: }
106:
107: public void setAgentId(String agentId) {
108: this .agentId = agentId;
109: }
110:
111: public Date getSubmittedDate() {
112: return submittedDate;
113: }
114:
115: public void setSubmittedDate(Date submittedDate) {
116: this .submittedDate = submittedDate;
117: }
118:
119: public Boolean getIsLate() {
120: return isLate;
121: }
122:
123: public void setIsLate(Boolean isLate) {
124: this .isLate = isLate;
125: }
126:
127: public Boolean getForGrade() {
128: return forGrade;
129: }
130:
131: public void setForGrade(Boolean forGrade) {
132: this .forGrade = forGrade;
133: }
134:
135: public Float getTotalAutoScore() {
136:
137: /*
138: // Round to the nearest 1/10th.
139: if (totalAutoScore != null)
140: {
141: float alignment = totalAutoScore.floatValue();
142: int tmp = Math.round(alignment * 10.0f);
143: alignment = (float)tmp / 10.0f;
144: totalAutoScore = new Float(alignment);
145: }
146: */
147: return totalAutoScore;
148: }
149:
150: public void setTotalAutoScore(Float totalAutoScore) {
151: this .totalAutoScore = totalAutoScore;
152: }
153:
154: public Float getTotalOverrideScore() {
155:
156: /*
157: // Round to the nearest 1/10th.
158: if (totalOverrideScore != null)
159: {
160: float alignment = totalOverrideScore.floatValue();
161: int tmp = Math.round(alignment * 10.0f);
162: alignment = (float)tmp / 10.0f;
163: totalOverrideScore = new Float(alignment);
164: }
165: */
166: return totalOverrideScore;
167: }
168:
169: public void setTotalOverrideScore(Float totalOverrideScore) {
170: this .totalOverrideScore = totalOverrideScore;
171: }
172:
173: public Float getFinalScore() {
174:
175: /*
176: // Round to the nearest 1/10th.
177: if ( finalScore != null)
178: {
179: float alignment = finalScore.floatValue();
180: int tmp = Math.round(alignment * 10.0f);
181: alignment = (float)tmp / 10.0f;
182: finalScore = new Float(alignment);
183: }
184: */
185:
186: return finalScore;
187: }
188:
189: public void setFinalScore(Float finalScore) {
190: this .finalScore = finalScore;
191: }
192:
193: public String getComments() {
194: return comments;
195: }
196:
197: public void setComments(String comments) {
198: this .comments = comments;
199: }
200:
201: public String getGradedBy() {
202: return gradedBy;
203: }
204:
205: public void setGradedBy(String gradedBy) {
206: this .gradedBy = gradedBy;
207: }
208:
209: public Date getGradedDate() {
210: return gradedDate;
211: }
212:
213: public void setGradedDate(Date gradedDate) {
214: this .gradedDate = gradedDate;
215: }
216:
217: /**
218: * In some cases, students are allowed to submit multiple assessment
219: * for grading. However, the grader has the choice to select one to
220: * represent how well the student does overall. status = 1 means
221: * this submitted assessment is selected.
222: */
223: public Integer getStatus() {
224: return status;
225: }
226:
227: public void setStatus(Integer status) {
228: this .status = status;
229: }
230:
231: public Set getItemGradingSet() {
232: return itemGradingSet;
233: }
234:
235: public void setItemGradingSet(Set itemGradingSet) {
236: this .itemGradingSet = itemGradingSet;
237: }
238:
239: public Date getAttemptDate() {
240: return attemptDate;
241: }
242:
243: public void setAttemptDate(Date attemptDate) {
244: this .attemptDate = attemptDate;
245: }
246:
247: public Integer getTimeElapsed() {
248: return timeElapsed;
249: }
250:
251: public void setTimeElapsed(Integer timeElapsed) {
252: this .timeElapsed = timeElapsed;
253: }
254:
255: public String getPublishedAssessmentTitle() {
256: return publishedAssessmentTitle;
257: }
258:
259: public void setPublishedAssessmentTitle(
260: String publishedAssessmentTitle) {
261: this .publishedAssessmentTitle = publishedAssessmentTitle;
262: }
263:
264: public int getTotalSubmitted() {
265: return totalSubmitted;
266: }
267:
268: public void setTotalSubmitted(int totalSubmitted) {
269: this.totalSubmitted = totalSubmitted;
270: }
271:
272: }
|