Class DefaultQuestionResultService
- java.lang.Object
-
- org.silverpeas.core.questioncontainer.result.service.DefaultQuestionResultService
-
- All Implemented Interfaces:
QuestionResultService
@Service @Singleton public class DefaultQuestionResultService extends Object implements QuestionResultService
QuestionResultService Stateless service to manage access to question results.- Author:
- neysseri
- See Also:
QuestionResultService
-
-
Constructor Summary
Constructors Constructor Description DefaultQuestionResultService()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
deleteQuestionResultsToQuestion(ResourceReference questionPK)
Delete all results for a questionCollection<QuestionResult>
getQuestionResultToQuestion(ResourceReference questionPK)
Return all result to a given questionCollection<QuestionResult>
getQuestionResultToQuestionByParticipation(ResourceReference questionPK, int participationId)
Return all result to a given question for a given participationResults
getResultsOfQuestions(List<ResourceReference> pks)
QuestionResult
getUserAnswerToQuestion(String userId, ResourceReference questionPK, AnswerPK answerPK)
Return result for a question and an answer of a userCollection<QuestionResult>
getUserQuestionResultsToQuestion(String userId, ResourceReference questionPK)
Return all user result to a given questionCollection<QuestionResult>
getUserQuestionResultsToQuestionByParticipation(String userId, ResourceReference questionPK, int participationId)
Return all user result to a given question for a given participationCollection<String>
getUsersByAnswer(String answerId)
Return all users by a answervoid
setQuestionResultsToUser(Collection<QuestionResult> results)
Store responses given by a uservoid
setQuestionResultToUser(QuestionResult result)
Store response given by a user
-
-
-
Method Detail
-
setQuestionResultToUser
public void setQuestionResultToUser(QuestionResult result)
Description copied from interface:QuestionResultService
Store response given by a user- Specified by:
setQuestionResultToUser
in interfaceQuestionResultService
- Parameters:
result
- the QuestionResult
-
getQuestionResultToQuestion
public Collection<QuestionResult> getQuestionResultToQuestion(ResourceReference questionPK)
Description copied from interface:QuestionResultService
Return all result to a given question- Specified by:
getQuestionResultToQuestion
in interfaceQuestionResultService
- Parameters:
questionPK
- the Question id- Returns:
- a QuestionResult Collection
-
getUserQuestionResultsToQuestion
public Collection<QuestionResult> getUserQuestionResultsToQuestion(String userId, ResourceReference questionPK)
Description copied from interface:QuestionResultService
Return all user result to a given question- Specified by:
getUserQuestionResultsToQuestion
in interfaceQuestionResultService
- Parameters:
userId
- the user idquestionPK
- the Question id- Returns:
- a QuestionResult Collection
-
getUsersByAnswer
public Collection<String> getUsersByAnswer(String answerId)
Description copied from interface:QuestionResultService
Return all users by a answer- Specified by:
getUsersByAnswer
in interfaceQuestionResultService
- Parameters:
answerId
- the Answer id- Returns:
- a String Collection
-
deleteQuestionResultsToQuestion
public void deleteQuestionResultsToQuestion(ResourceReference questionPK)
Description copied from interface:QuestionResultService
Delete all results for a question- Specified by:
deleteQuestionResultsToQuestion
in interfaceQuestionResultService
- Parameters:
questionPK
- the question id
-
getQuestionResultToQuestionByParticipation
public Collection<QuestionResult> getQuestionResultToQuestionByParticipation(ResourceReference questionPK, int participationId)
Description copied from interface:QuestionResultService
Return all result to a given question for a given participation- Specified by:
getQuestionResultToQuestionByParticipation
in interfaceQuestionResultService
- Parameters:
questionPK
- the Question idparticipationId
- the number of the participation- Returns:
- a QuestionResult Collection
-
getUserQuestionResultsToQuestionByParticipation
public Collection<QuestionResult> getUserQuestionResultsToQuestionByParticipation(String userId, ResourceReference questionPK, int participationId)
Description copied from interface:QuestionResultService
Return all user result to a given question for a given participation- Specified by:
getUserQuestionResultsToQuestionByParticipation
in interfaceQuestionResultService
- Parameters:
userId
- the user idquestionPK
- the Question idparticipationId
- the number of the participation- Returns:
- a QuestionResult Collection
-
setQuestionResultsToUser
public void setQuestionResultsToUser(Collection<QuestionResult> results)
Description copied from interface:QuestionResultService
Store responses given by a user- Specified by:
setQuestionResultsToUser
in interfaceQuestionResultService
- Parameters:
results
- a Collection of QuestionResult
-
getUserAnswerToQuestion
public QuestionResult getUserAnswerToQuestion(String userId, ResourceReference questionPK, AnswerPK answerPK)
Description copied from interface:QuestionResultService
Return result for a question and an answer of a user- Specified by:
getUserAnswerToQuestion
in interfaceQuestionResultService
- Parameters:
userId
- the user idquestionPK
- the question idanswerPK
- the answer id
-
getResultsOfQuestions
public Results getResultsOfQuestions(List<ResourceReference> pks)
- Specified by:
getResultsOfQuestions
in interfaceQuestionResultService
-
-