testtool.teacher_app.question_view
Class QuestionBank

java.lang.Object
  extended by testtool.teacher_app.question_view.QuestionBank

public abstract class QuestionBank
extends java.lang.Object

A QuestionBank consists of a collection of questions created by the user. The QuestionBank provides options to manage a single question as well as to manage the collection of questions shown.


Nested Class Summary
private  class QuestionBank.QuestionFilter
          The QuestionFilter class contains a collection of data fields that can be filled and applied by the professor in order to omit seeing certain questions in the QuestionBank.
private static class QuestionBank.SortFlag
          The flags used to sort the Question Bank columns.
 
Field Summary
private  java.util.Collection<Question> questions
          The collection of questions created by the user and stored in the database.
private  java.util.Collection<Question> shownQuestions
          A collection of questions viewable by the user.
 
Constructor Summary
QuestionBank()
           
 
Method Summary
(package private) abstract  void add(Question q)
          Add the given Question to the given QuestionBank.
abstract  void delete(Question q)
          Delete the given question from the given QuestionBank.
(package private) abstract  void edit(Question old_q, Question new_q)
          Change the given old Question to the given new question.
(package private) abstract  Question filterById(int ID)
          Find a question by unique id.
(package private) abstract  void preview(Question q)
          Preview the given question from the given QuestionBank.
abstract  void sort(QuestionBank.SortFlag flag)
          Sorts questions per column based on flags.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

questions

private java.util.Collection<Question> questions
The collection of questions created by the user and stored in the database.


shownQuestions

private java.util.Collection<Question> shownQuestions
A collection of questions viewable by the user. The user can view all available questions by clicking on the “Question” button from the Start menu. The QuestionBank may not show all available questions in the case of an advanced manual test generation.

Constructor Detail

QuestionBank

public QuestionBank()
Method Detail

add

abstract void add(Question q)
Add the given Question to the given QuestionBank. The ID of the given question must not be the same as a question already in the QuestionBank. The ID component is required.


delete

public abstract void delete(Question q)
Delete the given question from the given QuestionBank. The given question must already be in the input QuestionBank. Typically the user runs the Find Question by ID operation prior to Delete to locate an existing question to delete.


edit

abstract void edit(Question old_q,
                   Question new_q)
Change the given old Question to the given new question. The old and new questions must not be the same. The old question must already be in the input db. The new question must meet the same conditions as for the input to the Add Question operation. Typically the user runs the Find Question by ID operation prior to Change to locate an existing question to be changed. If the question ID is changed, then change all occurrences of the old id in the group db to the new id.


preview

abstract void preview(Question q)
Preview the given question from the given QuestionBank. The given question must already be in the input QuestionBank. Typically the user runs the Find Question by ID operation prior to Preview to locate an existing question to preview.


filterById

abstract Question filterById(int ID)
Find a question by unique id.


sort

public abstract void sort(QuestionBank.SortFlag flag)
Sorts questions per column based on flags.