1 package sk.stuba.fiit.foo07.genex.dao;
2
3 import java.sql.SQLException;
4 import java.util.ArrayList;
5
6 import sk.stuba.fiit.foo07.genex.beans.Category;
7 import sk.stuba.fiit.foo07.genex.beans.Question;
8 import sk.stuba.fiit.foo07.genex.exceptions.QuestionInTestException;
9
10
11
12
13
14
15 public interface QuestionDao {
16
17 public Question getQuestionByID(Integer questionID) throws SQLException;
18
19 public ArrayList<Question> getQuestionsByIDs(ArrayList<Integer> questionIDs)
20 throws SQLException;
21
22 public ArrayList<Question> getQuestionsByCategoryID(Integer categoryID)
23 throws SQLException;
24
25 public ArrayList<Question> getQuestionsByTestID(Integer testID)
26 throws SQLException;
27
28 public void addQuestion(Integer categoryID, Question toAdd)
29 throws SQLException;
30
31 public void createQuestion(Question toCreate) throws SQLException;
32
33 public void addQuestions(Integer categoryID, ArrayList<Question> toAdd)
34 throws SQLException;
35
36 public void updateQuestion(Integer questionID, Question toUpdate)
37 throws SQLException;
38
39 public void deleteQuestion(Question toDelete)
40 throws QuestionInTestException, SQLException;
41
42 public void deleteQuestions(ArrayList<Question> toDelete)
43 throws QuestionInTestException, SQLException;
44
45 public void deleteQuestionFromCategory(Question toDelete, Category from)
46 throws SQLException;
47
48
49
50
51
52
53
54 public void moveQuestion(Question q, Integer fromCategoryID,
55 Integer toCategoryID) throws SQLException;
56
57 public void copyQuestion(int questionID, Integer toCategoryID)
58 throws SQLException;
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76 public ArrayList<Integer> getQuestionsForTestGenerator(
77 ArrayList<Integer> questionCategoryIDs,
78 ArrayList<Integer> keywordIDs, ArrayList<Integer> questionTypeIDs,
79 boolean containsPictures, Integer difficulty) throws SQLException;
80
81
82
83
84
85
86
87 public int getQuestionCount(Integer categoryID) throws SQLException;
88 }