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.questionpool;
021:
022: import java.util.List;
023: import java.util.Map;
024:
025: import org.sakaiproject.tool.assessment.data.ifc.questionpool.QuestionPoolDataIfc;
026: import org.sakaiproject.tool.assessment.data.model.Tree;
027:
028: /**
029: * The QuestionPoolServiceAPI declares a shared interface to control question
030: * pool information.
031: * @author Ed Smiley <esmiley@stanford.edu>
032: */
033: public interface QuestionPoolServiceAPI {
034: /**
035: * Get all pools from the back end.
036: */
037: public List getAllPools(String agentId);
038:
039: /**
040: * Get basic info for pools(just id and title) for displaying in pulldown .
041: */
042: public List getBasicInfoOfAllPools(String agentId);
043:
044: /**
045: * Get a particular pool from the backend, with all questions.
046: */
047: public QuestionPoolDataIfc getPool(Long poolId, String agentId);
048:
049: /**
050: * Get a list of pools that have a specific Agent
051: */
052: public List getPoolIdsByItem(String itemId);
053:
054: public boolean hasItem(String itemId, Long poolId);
055:
056: /**
057: * Get pool id's by agent.
058: */
059: public List getPoolIdsByAgent(String agentId);
060:
061: /**
062: * Get a list of pools that have a specific parent
063: */
064: public List getSubPools(Long poolId);
065:
066: /**
067: * Get the size of a subpool.
068: */
069: public int getSubPoolSize(Long poolId);
070:
071: /**
072: * Checks to see if a pool has subpools
073: */
074: public boolean hasSubPools(Long poolId);
075:
076: /**
077: * Get all items sorted by orderby
078: */
079: public List getAllItemsSorted(Long poolId, String orderBy,
080: String ascending);
081:
082: /**
083: * Get all scores for a published assessment from the back end.
084: */
085: public List getAllItems(Long poolId);
086:
087: /**
088: * Save a question to a pool.
089: */
090: public void addItemToPool(String itemId, Long poolId);
091:
092: /**
093: * Move a question to a pool.
094: */
095: public void moveItemToPool(String itemId, Long sourceId, Long destId);
096:
097: /**
098: * Is a pool a descendant of the other?
099: */
100: public boolean isDescendantOf(Long poolA, Long poolB, String agentId);
101:
102: /**
103: * Move a subpool to a pool.
104: */
105: public void movePool(String agentId, Long sourceId, Long destId);
106:
107: /**
108: * Delete a pool
109: */
110: public void deletePool(Long poolId, String agentId, Tree tree);
111:
112: /**
113: * removes a Question from the question pool. This does not *delete* the question itself
114: */
115: public void removeQuestionFromPool(String questionId, Long poolId);
116:
117: /**
118: * Copy a subpool to a pool.
119: */
120: public void copyPool(Tree tree, String agentId, Long sourceId,
121: Long destId, String prependString1, String prependString2);
122:
123: /**
124: * Save a question pool.
125: */
126: public QuestionPoolDataIfc savePool(QuestionPoolDataIfc pool);
127:
128: public Map getQuestionPoolItemMap();
129:
130: }
|