sk.stuba.fiit.foo07.genex.dao
Interface QuestionDao

All Known Implementing Classes:
QuestionDaoDerby

public interface QuestionDao

Author:
_mizu_

Method Summary
 void addQuestion(java.lang.Integer categoryID, Question toAdd)
           
 void addQuestions(java.lang.Integer categoryID, java.util.ArrayList<Question> toAdd)
           
 void copyQuestion(int questionID, java.lang.Integer toCategoryID)
           
 void createQuestion(Question toCreate)
           
 void deleteQuestion(Question toDelete)
           
 void deleteQuestionFromCategory(Question toDelete, Category from)
           
 void deleteQuestions(java.util.ArrayList<Question> toDelete)
           
 Question getQuestionByID(java.lang.Integer questionID)
           
 int getQuestionCount(java.lang.Integer categoryID)
          Returns number of questions in given category.
 java.util.ArrayList<Question> getQuestionsByCategoryID(java.lang.Integer categoryID)
           
 java.util.ArrayList<Question> getQuestionsByIDs(java.util.ArrayList<java.lang.Integer> questionIDs)
           
 java.util.ArrayList<Question> getQuestionsByTestID(java.lang.Integer testID)
           
 java.util.ArrayList<java.lang.Integer> getQuestionsForTestGenerator(java.util.ArrayList<java.lang.Integer> questionCategoryIDs, java.util.ArrayList<java.lang.Integer> keywordIDs, java.util.ArrayList<java.lang.Integer> questionTypeIDs, boolean containsPictures, java.lang.Integer difficulty)
          This method returns set of questions that meets the constraints defined by input parameters
 void moveQuestion(Question q, java.lang.Integer fromCategoryID, java.lang.Integer toCategoryID)
          Moves question between two categories
 void updateQuestion(java.lang.Integer questionID, Question toUpdate)
           
 

Method Detail

getQuestionByID

Question getQuestionByID(java.lang.Integer questionID)
                         throws java.sql.SQLException
Throws:
java.sql.SQLException

getQuestionsByIDs

java.util.ArrayList<Question> getQuestionsByIDs(java.util.ArrayList<java.lang.Integer> questionIDs)
                                                throws java.sql.SQLException
Throws:
java.sql.SQLException

getQuestionsByCategoryID

java.util.ArrayList<Question> getQuestionsByCategoryID(java.lang.Integer categoryID)
                                                       throws java.sql.SQLException
Throws:
java.sql.SQLException

getQuestionsByTestID

java.util.ArrayList<Question> getQuestionsByTestID(java.lang.Integer testID)
                                                   throws java.sql.SQLException
Throws:
java.sql.SQLException

addQuestion

void addQuestion(java.lang.Integer categoryID,
                 Question toAdd)
                 throws java.sql.SQLException
Throws:
java.sql.SQLException

createQuestion

void createQuestion(Question toCreate)
                    throws java.sql.SQLException
Throws:
java.sql.SQLException

addQuestions

void addQuestions(java.lang.Integer categoryID,
                  java.util.ArrayList<Question> toAdd)
                  throws java.sql.SQLException
Throws:
java.sql.SQLException

updateQuestion

void updateQuestion(java.lang.Integer questionID,
                    Question toUpdate)
                    throws java.sql.SQLException
Throws:
java.sql.SQLException

deleteQuestion

void deleteQuestion(Question toDelete)
                    throws QuestionInTestException,
                           java.sql.SQLException
Throws:
QuestionInTestException
java.sql.SQLException

deleteQuestions

void deleteQuestions(java.util.ArrayList<Question> toDelete)
                     throws QuestionInTestException,
                            java.sql.SQLException
Throws:
QuestionInTestException
java.sql.SQLException

deleteQuestionFromCategory

void deleteQuestionFromCategory(Question toDelete,
                                Category from)
                                throws java.sql.SQLException
Throws:
java.sql.SQLException

moveQuestion

void moveQuestion(Question q,
                  java.lang.Integer fromCategoryID,
                  java.lang.Integer toCategoryID)
                  throws java.sql.SQLException
Moves question between two categories

Parameters:
fromCategoryID -
toCategoryID -
Throws:
java.sql.SQLException

copyQuestion

void copyQuestion(int questionID,
                  java.lang.Integer toCategoryID)
                  throws java.sql.SQLException
Throws:
java.sql.SQLException

getQuestionsForTestGenerator

java.util.ArrayList<java.lang.Integer> getQuestionsForTestGenerator(java.util.ArrayList<java.lang.Integer> questionCategoryIDs,
                                                                    java.util.ArrayList<java.lang.Integer> keywordIDs,
                                                                    java.util.ArrayList<java.lang.Integer> questionTypeIDs,
                                                                    boolean containsPictures,
                                                                    java.lang.Integer difficulty)
                                                                    throws java.sql.SQLException
This method returns set of questions that meets the constraints defined by input parameters

Parameters:
questionCategoryIDs - List of question category IDs for the test
keywordIDs - List of question keyword IDs for the test
questionTypeIDs - List of question type IDs for the test
containsPictures - If false the test must not contain questions with pictures
difficulty -
Returns:
Throws:
java.sql.SQLException

getQuestionCount

int getQuestionCount(java.lang.Integer categoryID)
                     throws java.sql.SQLException
Returns number of questions in given category.

Parameters:
categoryID -
Returns:
Throws:
java.sql.SQLException


Copyright © 2008 Faculty of Informatics and Information Technologies, STU Bratislava. All Rights Reserved.