net.sourceforge.pavlov.controllers
Class QuizController

java.lang.Object
  extended by net.sourceforge.sillyview.Widget
      extended by net.sourceforge.pavlov.controllers.QuizController
All Implemented Interfaces:
QuestionChangedListener

public final class QuizController
extends Widget
implements QuestionChangedListener

QuizController is a controller that presents the user with questions and gives various sorts of feedback.

Since:
1.1

Field Summary
static String ANSWER_A
          Token used to communicate with velocity model.
static String ANSWER_B
          Token used to communicate with velocity model.
static String ANSWER_C
          Token used to communicate with velocity model.
static String ANSWER_D
          Token used to communicate with velocity model.
static String ANSWER_EVENT
          Token used to communicate with velocity model.
static String ANSWER_MODE
          Token used to communicate with velocity model.
static String BOOK_NAME
          Token used to communicate with velocity model.
static String CHAPTER_NAME
          Token used to communicate with velocity model.
protected  int fileLocations
          Description of the Field
static String HREF_A
          Token used to communicate with velocity model.
static String HREF_B
          Token used to communicate with velocity model.
static String HREF_C
          Token used to communicate with velocity model.
static String HREF_D
          Token used to communicate with velocity model.
static int LOCAL_FILES
          Description of the Field
static String QUESTION_IMAGE
          Token used to communicate with velocity model.
static String QUESTION_TEXT
          Token used to communicate with velocity model.
protected  Quiz quiz
          Describe variable quiz here.
static int REMOTE_FILES
          Description of the Field
static String RIGHT
          Token used to communicate with velocity model.
protected  QuestionHistory s1
          Description of the Field
protected  QuizStatus s2
          Description of the Field
protected  ChapterCoverage s3
          Description of the Field
static String URL_PREFIX
          Token used to communicate with velocity model.
static String WRONG
          Token used to communicate with velocity model.
 
Fields inherited from class net.sourceforge.sillyview.Widget
view
 
Constructor Summary
QuizController(Quiz q, WidgetView v)
          Creates a new QuizFrame instance.
 
Method Summary
protected  String getCorrectString(Question ques, AnswerAtom at)
          Gets the correctString attribute of the QuizController object
 URL getFileURL(File f)
          Gets the fileURL attribute of the QuizController object
 Quiz getQuiz()
          Get the Quiz value.
 String getURLPrefix()
          Gets the uRLPrefix attribute of the QuizController object
 void questionChanged(Question q, QuestionData qd)
          Description of the Method
 void setFileLocations(int i)
          Sets the fileLocations attribute of the QuizController object
 void setQuiz(Quiz newQuiz)
          Set the Quiz value.
 void setTemplate(String tmp, File baseDir)
          Sets the template attribute of the QuizController object
 
Methods inherited from class net.sourceforge.sillyview.Widget
getView, setView
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ANSWER_EVENT

public static final String ANSWER_EVENT
Token used to communicate with velocity model.

See Also:
Constant Field Values

ANSWER_MODE

public static final String ANSWER_MODE
Token used to communicate with velocity model.

See Also:
Constant Field Values

RIGHT

public static final String RIGHT
Token used to communicate with velocity model.

See Also:
Constant Field Values

WRONG

public static final String WRONG
Token used to communicate with velocity model.

See Also:
Constant Field Values

BOOK_NAME

public static final String BOOK_NAME
Token used to communicate with velocity model.

See Also:
Constant Field Values

CHAPTER_NAME

public static final String CHAPTER_NAME
Token used to communicate with velocity model.

See Also:
Constant Field Values

QUESTION_TEXT

public static final String QUESTION_TEXT
Token used to communicate with velocity model.

See Also:
Constant Field Values

QUESTION_IMAGE

public static final String QUESTION_IMAGE
Token used to communicate with velocity model.

See Also:
Constant Field Values

ANSWER_A

public static final String ANSWER_A
Token used to communicate with velocity model.

See Also:
Constant Field Values

ANSWER_B

public static final String ANSWER_B
Token used to communicate with velocity model.

See Also:
Constant Field Values

ANSWER_C

public static final String ANSWER_C
Token used to communicate with velocity model.

See Also:
Constant Field Values

ANSWER_D

public static final String ANSWER_D
Token used to communicate with velocity model.

See Also:
Constant Field Values

HREF_A

public static final String HREF_A
Token used to communicate with velocity model.

See Also:
Constant Field Values

HREF_B

public static final String HREF_B
Token used to communicate with velocity model.

See Also:
Constant Field Values

HREF_C

public static final String HREF_C
Token used to communicate with velocity model.

See Also:
Constant Field Values

HREF_D

public static final String HREF_D
Token used to communicate with velocity model.

See Also:
Constant Field Values

URL_PREFIX

public static final String URL_PREFIX
Token used to communicate with velocity model.

See Also:
Constant Field Values

LOCAL_FILES

public static final int LOCAL_FILES
Description of the Field

See Also:
Constant Field Values

REMOTE_FILES

public static final int REMOTE_FILES
Description of the Field

See Also:
Constant Field Values

fileLocations

protected int fileLocations
Description of the Field


s1

protected QuestionHistory s1
Description of the Field


s2

protected QuizStatus s2
Description of the Field


s3

protected ChapterCoverage s3
Description of the Field


quiz

protected Quiz quiz
Describe variable quiz here.

Constructor Detail

QuizController

public QuizController(Quiz q,
                      WidgetView v)
Creates a new QuizFrame instance.

Parameters:
q - a Quiz value
v - a WidgetView value
Method Detail

setQuiz

public void setQuiz(Quiz newQuiz)
Set the Quiz value.

Parameters:
newQuiz - The new Quiz value.

getQuiz

public Quiz getQuiz()
Get the Quiz value.

Returns:
the Quiz value.

questionChanged

public void questionChanged(Question q,
                            QuestionData qd)
Description of the Method

Specified by:
questionChanged in interface QuestionChangedListener
Parameters:
q - Description of the Parameter
qd - Description of the Parameter

setTemplate

public void setTemplate(String tmp,
                        File baseDir)
Sets the template attribute of the QuizController object

Parameters:
tmp - The new template value
baseDir - The new template value

getCorrectString

protected String getCorrectString(Question ques,
                                  AnswerAtom at)
Gets the correctString attribute of the QuizController object

Parameters:
ques - Description of the Parameter
at - Description of the Parameter
Returns:
The correctString value

setFileLocations

public void setFileLocations(int i)
Sets the fileLocations attribute of the QuizController object

Parameters:
i - The new fileLocations value

getURLPrefix

public String getURLPrefix()
Gets the uRLPrefix attribute of the QuizController object

Returns:
The uRLPrefix value

getFileURL

public URL getFileURL(File f)
Gets the fileURL attribute of the QuizController object

Parameters:
f - Description of the Parameter
Returns:
The fileURL value