|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sourceforge.pavlov.user.ChapterData
public final class ChapterData
Encapsulates a users responses to all questions in a chapter.
Chapter
,
BookData
,
QuestionData
Field Summary | |
---|---|
protected Vector<QuestionData> |
exclusion
QuestionData's we don't want to ask |
protected int |
exclusionSize
QuestionData's we don't want to ask |
Constructor Summary | |
---|---|
ChapterData()
Creates a ChapterData with title "Untitled" |
|
ChapterData(String title)
Creates a ChapterData with the given title |
Method Summary | |
---|---|
void |
addQuizData(QuizData quizData)
Adds the given QuizData object to this ChapterData's QuizCollection. |
void |
addRight(String id)
Adds a correct response to the named QuestionData at the current time. |
void |
addRight(String id,
Date when)
Adds a correct response to the named QuestionData at the given time. |
void |
addRight(String id,
long when)
Adds a correct response to the named QuestionData at the given time. |
void |
addWrong(String id)
Adds an incorrect response to the named QuestionData at the current time. |
void |
addWrong(String id,
Date when)
Adds an incorrect response to the named QuestionData at the given time. |
void |
addWrong(String id,
long whe)
Adds an incorrect response to the named QuestionData at the given time. |
void |
deleteQuestionID(String key)
Removes the QuestionData corresponding to the given ID. |
Collection |
getAllQuestionData()
Describe getAllQuestionData method here. |
ChapterStatistics |
getChapterStatistics()
Returns the ChapterStatistics for
this ChapterData. |
int |
getExclusionSize()
Returns the size of the exclusion vector. |
int |
getNumberOfQuestions()
Returns the number of questions in this chapter. |
QuestionData |
getQuestion()
Returns a QuestionData using the current strategy. |
QuestionData |
getQuestionData(String qid)
Returns the QuestionData for the question with the given ID or null if no such question exists. |
QuizCollection |
getQuizCollection()
Describe getQuizCollection method here. |
QuizCollectionData |
getQuizCollectionData()
Returns data for all quizzes the user has taken on this chapter. |
Vector |
getQuizPercentages()
Returns a vector of percentages for all the quizzes the user has taken on this chapter. |
QuizCollectionData |
getStatistics()
Deprecated. Misleading name. Use getQuizCollectionData() |
AbstractStrategy |
getStrategy()
Returns the current question selection strategy. |
String |
getTitle()
Returns the title of the Chapter this ChapterData refers to. |
void |
setExclusionSize(int newSize)
Sets the size of the exclusion vector. |
void |
setStrategy(AbstractStrategy strat)
Sets the question selection strategy and initializes it with the QuestionData for this chapter. |
void |
setTitle(String title)
Sets the title of the Chapter this ChapterData refers to. |
void |
toXML(Writer writer)
Converts this ChapterData to XML. |
void |
validate(AbstractChapter cp)
Loop through all the questions in the chapter, ensuring a QuestionData exists for each. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected Vector<QuestionData> exclusion
protected int exclusionSize
Constructor Detail |
---|
public ChapterData(String title)
_title
- a String
valuepublic ChapterData()
Method Detail |
---|
public void setTitle(String title)
t
- a String
valuepublic String getTitle()
String
valuepublic QuestionData getQuestionData(String qid)
qid
- a String
value
QuestionData
valuepublic void addRight(String id)
id
- a String
valuepublic void addWrong(String id)
id
- a String
valuepublic int getNumberOfQuestions()
int
valuepublic void addRight(String id, long when)
id
- a String
valuewhe
- a long
valuepublic void addWrong(String id, long whe)
id
- a String
valuewhe
- a long
valuepublic void addRight(String id, Date when)
id
- a String
valuewhen
- a Date
valuepublic void addWrong(String id, Date when)
id
- a String
valuewhen
- a Date
valuepublic void validate(AbstractChapter cp)
cp
- an AbstractChapter
valuepublic int getExclusionSize()
int
valuepublic void setExclusionSize(int newSize)
i
- an int
valuepublic QuestionData getQuestion()
QuestionData
valuepublic final AbstractStrategy getStrategy()
AbstractStrategy
valuepublic final void setStrategy(AbstractStrategy strat)
strat
- an AbstractStrategy
valuepublic ChapterStatistics getChapterStatistics()
ChapterStatistics
for
this ChapterData.
ChapterStatistics
valuepublic void deleteQuestionID(String key)
key
- a String
valuepublic void toXML(Writer writer) throws IOException
writer
- a java.io.Writer
value
IOException
- if an error occurspublic void addQuizData(QuizData quizData)
quizData
- a QuizData
value@Deprecated public QuizCollectionData getStatistics()
getStatistics
method here.
QuizCollectionData
valuepublic QuizCollectionData getQuizCollectionData()
QuizCollectionData
valuepublic Vector getQuizPercentages()
Vector
valuepublic QuizCollection getQuizCollection()
getQuizCollection
method here.
QuizCollection
valuepublic Collection getAllQuestionData()
getAllQuestionData
method here.
Collection
value
|
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |