001: /**********************************************************************************
002: * $URL$
003: * $Id$
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.shared.api.grading;
021:
022: import java.util.List;
023: import java.util.Map; //import java.util.HashMap;
024:
025: import org.sakaiproject.tool.assessment.data.ifc.assessment.PublishedAssessmentIfc;
026: import org.sakaiproject.tool.assessment.data.ifc.grading.AssessmentGradingIfc;
027: import org.sakaiproject.tool.assessment.data.ifc.grading.ItemGradingIfc;
028: import org.sakaiproject.tool.assessment.data.ifc.grading.MediaIfc;
029:
030: /**
031: * The GradingServiceAPI declares a shared interface to get grading information.
032: * @author Ed Smiley <esmiley@stanford.edu>
033: */
034: public interface GradingServiceAPI {
035: /**
036: * Get all scores for a published assessment from the back end.
037: * @return List of AssessmentGradingIfs
038: */
039: public List getTotalScores(String publishedId, String which);
040:
041: /**
042: * Get all submissions for a published assessment from the back end.
043: * @return List of AssessmentGradingIfs
044: */
045: public List getAllSubmissions(String publishedId);
046:
047: /**
048: * Save the total scores.
049: * @param data List of AssessmentGradingDataIfcs
050: */
051: public void saveTotalScores(List data, PublishedAssessmentIfc pub);
052:
053: /**
054: * Save the item scores.
055: * @param data List of itemGradingDataIfcs
056: */
057: //public void saveItemScores(List data, HashMap map, PublishedAssessmentIfc pub);
058: /**
059: * Get the score information for each item from the assessment score.
060: */
061: public Map getItemScores(Long publishedId, Long itemId, String which);
062:
063: /**
064: * Get the last set of ItemGradingIfc for a student per assessment
065: */
066: public Map getLastItemGrading(String publishedId, String agentId);
067:
068: /**
069: * Get the grading data for a given submission
070: */
071: public Map getStudentGradingData(String assessmentGradingId);
072:
073: /**
074: * Get the last submission for a student per assessment
075: */
076: public Map getSubmitData(String publishedId, String agentId,
077: Integer scoringoption);
078:
079: /**
080: * Get the text for the type.
081: * @param typeId
082: * @return
083: */
084: public String getTextForId(Long typeId);
085:
086: /**
087: * Store the grading data.
088: * @param data
089: */
090: //public void storeGrades(AssessmentGradingIfc data);
091: /**
092: * Get the count of published assessments.
093: * @param publishedAssessmentId
094: * @return
095: */
096: public int getSubmissionSizeOfPublishedAssessment(
097: String publishedAssessmentId);
098:
099: /**
100: *
101: * @return
102: */
103: public Map getSubmissionSizeOfAllPublishedAssessments();
104:
105: /**
106: *
107: * @param media
108: * @param mimeType
109: * @return
110: */
111: public Long saveMedia(byte[] media, String mimeType);
112:
113: /**
114: *
115: * @param mediaData
116: * @return
117: */
118: public Long saveMedia(MediaIfc mediaData);
119:
120: /**
121: *
122: * @param mediaId
123: * @return
124: */
125: public MediaIfc getMedia(String mediaId);
126:
127: /**
128: *
129: * @param itemGradingId
130: * @return
131: */
132: public List getMediaArray(String itemGradingId);
133:
134: /**
135: *
136: * @param i
137: * @return
138: */
139: public List getMediaArray(ItemGradingIfc i);
140:
141: /**
142: *
143: * @param publishedItemId
144: * @param agentId
145: * @return
146: */
147: public ItemGradingIfc getLastItemGradingByAgent(
148: String publishedItemId, String agentId);
149:
150: /**
151: *
152: * @param assessmentGradingId
153: * @param publishedItemId
154: * @return
155: */
156: public ItemGradingIfc getItemGrading(String assessmentGradingId,
157: String publishedItemId);
158:
159: /**
160: * Load assessment grading information.
161: * @param assessmentGradingId
162: * @return
163: */
164: public AssessmentGradingIfc load(String assessmentGradingId);
165:
166: /**
167: * Get the grading data for the last submission of this agent.
168: * @param publishedAssessmentId
169: * @param agentIdString
170: * @return
171: */
172: public AssessmentGradingIfc getLastAssessmentGradingByAgentId(
173: String publishedAssessmentId, String agentIdString);
174:
175: /**
176: * Save item grading information.
177: * @param item
178: */
179: public void saveItemGrading(ItemGradingIfc item);
180:
181: /**
182: *
183: * @param assessment
184: */
185: public void saveOrUpdateAssessmentGrading(
186: AssessmentGradingIfc assessment);
187:
188: }
|