001: /**********************************************************************************
002: * $URL: https://source.sakaiproject.org/svn/sam/trunk/component/src/java/org/sakaiproject/tool/assessment/shared/impl/grading/GradingSectionAwareServiceImpl.java $
003: * $Id: GradingSectionAwareServiceImpl.java 9277 2006-05-10 23:10:33Z daisyf@stanford.edu $
004: ***********************************************************************************
005: *
006: * Copyright (c) 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.impl.grading;
021:
022: import java.util.List;
023: import java.util.Map;
024:
025: import org.apache.commons.logging.Log;
026: import org.apache.commons.logging.LogFactory;
027:
028: import org.sakaiproject.tool.assessment.data.ifc.grading.AssessmentGradingIfc;
029: import org.sakaiproject.tool.assessment.data.ifc.grading.ItemGradingIfc;
030: import org.sakaiproject.tool.assessment.data.ifc.grading.MediaIfc;
031: import org.sakaiproject.tool.assessment.shared.api.grading.GradingSectionAwareServiceAPI;
032: import org.sakaiproject.tool.assessment.services.GradingService;
033: import org.sakaiproject.tool.assessment.services.GradingServiceException;
034: import java.util.ArrayList;
035: import org.sakaiproject.tool.assessment.data.dao.grading.ItemGradingData; //import org.sakaiproject.tool.assessment.integration.helper.integrated.SectionAwareServiceHelperImpl;
036: import org.sakaiproject.tool.assessment.integration.helper.ifc.SectionAwareServiceHelper;
037: import org.sakaiproject.tool.assessment.integration.context.IntegrationContextFactory;
038:
039: /**
040: *
041: * The GradingServiceAPI implements the shared interface to get grading information.
042: * @author Ed Smiley <esmiley@stanford.edu>
043: */
044:
045: public class GradingSectionAwareServiceImpl implements
046: GradingSectionAwareServiceAPI {
047: private static Log log = LogFactory
048: .getLog(GradingServiceImpl.class);
049: private static final SectionAwareServiceHelper helper = IntegrationContextFactory
050: .getInstance().getSectionAwareServiceHelper();
051:
052: // private static final SectionAwareServiceHelper helper= new SectionAwareServiceHelperImpl();
053:
054: public boolean isUserAbleToGrade(String siteId, String userUid) {
055: return helper.isUserAbleToGrade(siteId, userUid);
056: }
057:
058: public boolean isUserAbleToGradeAll(String siteId, String userUid) {
059: return helper.isUserAbleToGradeAll(siteId, userUid);
060: }
061:
062: public boolean isUserAbleToGradeSection(String sectionUid,
063: String userUid) {
064: return helper.isUserAbleToGradeSection(sectionUid, userUid);
065: }
066:
067: public boolean isUserAbleToEdit(String Uid, String userUid) {
068: return helper.isUserAbleToEdit(Uid, userUid);
069: }
070:
071: public boolean isUserGradable(String Uid, String userUid) {
072: return helper.isUserGradable(Uid, userUid);
073: }
074:
075: /**
076: * @return
077: * an EnrollmentRecord list for each student that the current user
078: * is allowed to grade.
079: */
080: public List getAvailableEnrollments(String Uid, String userUid) {
081: return helper.getAvailableEnrollments(Uid, userUid);
082: }
083:
084: /**
085: * @return
086: * a CourseSection list for each group that the current user
087: * belongs to.
088: */
089: public List getAvailableSections(String Uid, String userUid) {
090: return helper.getAvailableSections(Uid, userUid);
091: }
092:
093: /**
094: * The section enrollment list will not be returned unless the user
095: * has access to it.
096: *
097: * @return
098: * an EnrollmentRecord list for all the students in the given group.
099: */
100: public List getSectionEnrollments(String Uid, String sectionUid,
101: String userUid) {
102: return helper.getSectionEnrollments(Uid, sectionUid, userUid);
103: }
104:
105: /**
106: * @param searchString
107: * a substring search for student name or display UID; the exact rules are
108: * up to the implementation
109: *
110: * @param optionalSectionUid
111: * null if the search should be made across all sections
112: *
113: * @return
114: * an EnrollmentRecord list for all matching available students.
115: */
116: public List findMatchingEnrollments(String Uid,
117: String searchString, String optionalSectionUid,
118: String userUid) {
119: return helper.findMatchingEnrollments(Uid, searchString,
120: optionalSectionUid, userUid);
121: }
122:
123: /**
124: * @param sectionId
125: *
126: * @param studentId
127: *
128: * @return
129: * whether a student belongs to a section
130: */
131: public boolean isSectionMemberInRoleStudent(String sectionId,
132: String studentId) {
133: return helper
134: .isSectionMemberInRoleStudent(sectionId, studentId);
135: }
136:
137: }
|