org.sakaiproject.tool.assessment.shared.impl.questionpool
Class QuestionPoolServiceImpl

java.lang.Object
  extended byorg.sakaiproject.tool.assessment.shared.impl.questionpool.QuestionPoolServiceImpl
All Implemented Interfaces:
QuestionPoolServiceAPI

public class QuestionPoolServiceImpl
extends Object
implements QuestionPoolServiceAPI

The QuestionPoolServiceAPI declares a shared interface to control question pool information.

Author:
Ed Smiley

Constructor Summary
QuestionPoolServiceImpl()
          Creates a new QuestionPoolServiceImpl object.
 
Method Summary
 void addItemToPool(String itemId, Long poolId)
          Save a question to a pool.
 void copyPool(Tree tree, String agentId, Long sourceId, Long destId)
          Copy a subpool to a pool.
 void deletePool(Long poolId, String agentId, Tree tree)
          Delete a pool
 List getAllItems(Long poolId)
          Get all scores for a published assessment from the back end.
 List getAllItemsSorted(Long poolId, String orderBy)
          Get all items sorted by orderby
 List getAllPools(String agentId)
          Get all pools from the back end.
 List getBasicInfoOfAllPools(String agentId)
          Get basic info for pools(just id and title) for displaying in pulldown .
 QuestionPoolDataIfc getPool(Long poolId, String agentId)
          Get a particular pool from the backend, with all questions.
 List getPoolIdsByAgent(String agentId)
          Get pool id's by agent.
 List getPoolIdsByItem(String itemId)
          Get a list of pools that have a specific Agent
 Map getQuestionPoolItemMap()
           
 List getSubPools(Long poolId)
          Get a list of pools that have a specific parent
 int getSubPoolSize(Long poolId)
          Get the size of a subpool.
 boolean hasItem(String itemId, Long poolId)
           
 boolean hasSubPools(Long poolId)
          Checks to see if a pool has subpools
 boolean isDescendantOf(Long poolA, Long poolB, String agentId)
          Is a pool a descendant of the other?
 void moveItemToPool(String itemId, Long sourceId, Long destId)
          Move a question to a pool.
 void movePool(String agentId, Long sourceId, Long destId)
          Move a subpool to a pool.
 void removeQuestionFromPool(String questionId, Long poolId)
          removes a Question from the question pool.
 QuestionPoolDataIfc savePool(QuestionPoolDataIfc pool)
          Save a question pool.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

QuestionPoolServiceImpl

public QuestionPoolServiceImpl()
Creates a new QuestionPoolServiceImpl object.

Method Detail

getAllPools

public List getAllPools(String agentId)
Get all pools from the back end.

Specified by:
getAllPools in interface QuestionPoolServiceAPI

getBasicInfoOfAllPools

public List getBasicInfoOfAllPools(String agentId)
Get basic info for pools(just id and title) for displaying in pulldown .

Specified by:
getBasicInfoOfAllPools in interface QuestionPoolServiceAPI

getPool

public QuestionPoolDataIfc getPool(Long poolId,
                                   String agentId)
Get a particular pool from the backend, with all questions.

Specified by:
getPool in interface QuestionPoolServiceAPI

getPoolIdsByItem

public List getPoolIdsByItem(String itemId)
Get a list of pools that have a specific Agent

Specified by:
getPoolIdsByItem in interface QuestionPoolServiceAPI

hasItem

public boolean hasItem(String itemId,
                       Long poolId)
Specified by:
hasItem in interface QuestionPoolServiceAPI

getPoolIdsByAgent

public List getPoolIdsByAgent(String agentId)
Get pool id's by agent.

Specified by:
getPoolIdsByAgent in interface QuestionPoolServiceAPI

getSubPools

public List getSubPools(Long poolId)
Get a list of pools that have a specific parent

Specified by:
getSubPools in interface QuestionPoolServiceAPI

getSubPoolSize

public int getSubPoolSize(Long poolId)
Get the size of a subpool.

Specified by:
getSubPoolSize in interface QuestionPoolServiceAPI

hasSubPools

public boolean hasSubPools(Long poolId)
Checks to see if a pool has subpools

Specified by:
hasSubPools in interface QuestionPoolServiceAPI

getAllItemsSorted

public List getAllItemsSorted(Long poolId,
                              String orderBy)
Get all items sorted by orderby

Specified by:
getAllItemsSorted in interface QuestionPoolServiceAPI

getAllItems

public List getAllItems(Long poolId)
Get all scores for a published assessment from the back end.

Specified by:
getAllItems in interface QuestionPoolServiceAPI

addItemToPool

public void addItemToPool(String itemId,
                          Long poolId)
Save a question to a pool.

Specified by:
addItemToPool in interface QuestionPoolServiceAPI

moveItemToPool

public void moveItemToPool(String itemId,
                           Long sourceId,
                           Long destId)
Move a question to a pool.

Specified by:
moveItemToPool in interface QuestionPoolServiceAPI

isDescendantOf

public boolean isDescendantOf(Long poolA,
                              Long poolB,
                              String agentId)
Is a pool a descendant of the other?

Specified by:
isDescendantOf in interface QuestionPoolServiceAPI

movePool

public void movePool(String agentId,
                     Long sourceId,
                     Long destId)
Move a subpool to a pool.

Specified by:
movePool in interface QuestionPoolServiceAPI

deletePool

public void deletePool(Long poolId,
                       String agentId,
                       Tree tree)
Delete a pool

Specified by:
deletePool in interface QuestionPoolServiceAPI

removeQuestionFromPool

public void removeQuestionFromPool(String questionId,
                                   Long poolId)
removes a Question from the question pool. This does not *delete* the question itself

Specified by:
removeQuestionFromPool in interface QuestionPoolServiceAPI

copyPool

public void copyPool(Tree tree,
                     String agentId,
                     Long sourceId,
                     Long destId)
Copy a subpool to a pool.

Specified by:
copyPool in interface QuestionPoolServiceAPI

savePool

public QuestionPoolDataIfc savePool(QuestionPoolDataIfc pool)
Save a question pool.

Specified by:
savePool in interface QuestionPoolServiceAPI

getQuestionPoolItemMap

public Map getQuestionPoolItemMap()
Specified by:
getQuestionPoolItemMap in interface QuestionPoolServiceAPI