public abstract class MCAbstractExerciseCard extends TextCard implements MCProblemConstants
Modifier and Type | Field and Description |
---|---|
static java.awt.Color |
BACKGROUND_COLOR |
static int |
MARGIN |
ANSWER_ASSERTION_SUBPATH, ANSWER_EXPLANATION_SUBPATH, ANSWER_FIELD_SUBPATH, ANSWER_PRECISION_SUBPATH, ANSWER_PREFIX, ANSWER_SOLUTION_SUBPATH, ANSWER_SUBPATH, AUTOCREATED_AFTER_NEW_DATA_PATH, CHECK_AS_FUNCTION_SUBPATH, CHECK_FUNC_FOR_ZERO_SUBPATH, CORRECTED_FLAG_PATH, CUSTOM_ANSWER_TYPE, DEFAULT_WORK_CYCLE_MODE, DEFAULT_WORK_CYCLE_MODE_PARAM, DEPENDENT_VARIABLE_NAME, EARLIER_ANSWER_SUBPATH, EDITED_FLAG_SUBPATH, FEEDBACK_WORK_CYCLE_MODE, FEEDBACK_WORK_CYCLE_MODE_PARAM, FUNCTION_ACTION_SUBPATH, FUNCTION_CALCULATE_ACTION, FUNCTION_CALCULATE_ACTION_NAME, FUNCTION_CONTENT_SUBPATH, FUNCTION_DERIVATIVE_ACTION, FUNCTION_DERIVATIVE_ACTION_NAME, FUNCTION_EXPAND_ACTION, FUNCTION_EXPAND_ACTION_NAME, FUNCTION_NORMALIZE_SUBPATH, FUNCTION_REPLACE_ACTION, FUNCTION_REPLACE_ACTION_NAME, FUNCTION_SUBSTITUTE_ACTION, FUNCTION_SUBSTITUTE_ACTION_NAME, FUNCTION_UNKNOWN_ACTION, INPUT_AS_FUNCTION_SUBPATH, LOCAL_WORK_CYCLE_MODE_PARAM, METHOD_NAME_SUBPATH, METHOD_PREFIX, MULTIPLE_ANSWER_TYPE, MULTIPLE_ANSWER_TYPE_NAME, PROBLEM_DEMO_TYPE, PROBLEM_EXERCISE_TYPE, PROBLEM_TRAINING_TYPE, QUESTION_PREFIX, QUESTION_SEQUENCE_END, QUESTION_SEQUENCE_PREFIX, QUESTION_SEQUENCE_SCORE_FACTOR, QUESTION_SEQUENCE_START, QUESTION_SEQUENCES_PREFIX, QUESTION_TASK_SUBPATH, QUESTION_TYPE_SUBPATH, QUESTIONS_SELECTION_PREFIX, SCORE_SUBPATH, SOLUTION_COMPUTE, SOLUTION_COMPUTE_TYPE_NAME, SOLUTION_FALSE, SOLUTION_FALSE_TYPE_NAME, SOLUTION_NONE, SOLUTION_NONE_TYPE_NAME, SOLUTION_TRUE, SOLUTION_TRUE_TYPE_NAME, SOLUTION_UNKNOWN, SUBSTITUTE_IDENTIFIER_NAME, SUBSTITUTE_WITH_NAME, SUBTASK_CORRECT_SUBPATH, SUBTASK_TRIES_SUBPATH, TEXT_ANSWER_PREFIX, TEXT_ANSWER_TYPE, TEXT_ANSWER_TYPE_NAME, UNIQUE_ANSWER_TYPE, UNIQUE_ANSWER_TYPE_NAME, UNKNOWN_ANSWER_TYPE, VARIABLE_FIELD_SUBPATH, VARIABLE_POOL_INDEX_SUBPATH, VARIABLE_POOL_NAME_PREFIX_SUBPATH, VARIABLE_POOL_SUBPATH, VARIABLE_PRECISION_SUBPATH, VARIABLE_SUBPATH, WORK_CYCLE_MODE_PATH, YESNO_ANSWER_TYPE, YESNO_ANSWER_TYPE_NAME
APPLET_ID_PARAM, COMMON_PROBLEM_PATH, CORRECTOR_CLASS_PARAM, CORRECTOR_FILE_PARAM, COURSE_ID_PARAM, CURRENT_SUBTASK_PATH, DIMENSION_PATH, EXERCISE_DEFAULT_TYPE, EXERCISE_DEFAULT_TYPE_NAME, EXERCISE_MC_TYPE, EXERCISE_MC_TYPE_NAME, EXERCISE_TEXT_TYPE, EXERCISE_TEXT_TYPE_NAME, EXERCISE_TYPE_PATH, FIELD_PATH, GENERIC_USER_ANSWER_PATH, HOMEWORK_EDITABLE_PARAM, HOMEWORK_MODE_PARAM, HOMEWORK_STANDALONE_PARAM, INPUT_DATASHEET_PARAM, JSQ_SUBTASK_PREFIX, LOCAL_DEBUG_MODE, LOCAL_PREVIEW_MODE, OUTPUT_DATASHEET_PARAM, PATH_SEPARATOR, PROBLEM_ID_PARAM, PROBLEM_REF_PARAM, PROGRESS_SUBPATH, Q_SUBTASK_PREFIX, REMOTE_JAPS_MODE, SAVE_ANSWERS_PATH_PARAM, SELECTION_PREFIX, SHOW_SAVING_SUCCESSFUL_DIALOG, SUBTASK_PATH, SUBTASK_PREFIX, URL_PREFIX_PARAM, USER_ANSWER_PATH, USER_MARKING_PATH, USER_META_ANSWER_PATH, USER_PROBLEM_PATH, USER_SCORE_PATH, WORKSHEET_ID_PARAM
CARD_TYPE_NOT_SET, DEMO_CARD, EXERCISE_CARD, TRAINING_CARD, USER_CARD
Modifier | Constructor and Description |
---|---|
protected |
MCAbstractExerciseCard(MathletContext mathlet,
MCAbstractExercise exercise)
Creates a new instance for the given mathlet context and exercise.
|
protected |
MCAbstractExerciseCard(MathletContext mathlet,
MCAbstractExercise exercise,
int cardType)
Creates a new instance for the given mathlet context, exercise and card
type.
|
Modifier and Type | Method and Description |
---|---|
protected void |
addAssertion(int questionNr,
java.awt.Component assertionComponent)
Adds the answer/assertion component for the specified question.
|
protected void |
addAssertion(int questionNr,
java.lang.String assertionText)
Adds the answer/assertion text for the specified question.
|
protected boolean |
checkAnswers()
Checks if the answers for all questions are completely filled in.
|
void |
clearSubtask()
Resets all answers of this exercise card.
|
boolean |
collectAnswers()
Collect all answers and stores them into a datasheet.
|
protected void |
collectAnswers(int questionNr)
Collects the answers for the given question.
|
void |
createObjects()
Initializes this card's objects.
|
protected MCQuestionUIIF |
createQuestion(int questionNr)
Creates and adds the task and answers for the given question to the GUI.
|
protected void |
createQuestions(MCQuestionUIIF[] panels)
Creates and adds the task and answers for every question to the GUI.
|
protected MCAbstractExercise |
getExercise()
Returns the worker instance.
|
protected MathletContext |
getMathlet()
Return the mathlet context instance for this card.
|
ControlPanel |
getMCContentPane()
Returns the control panel for this MC applet.
|
protected boolean[] |
getProgress()
Returns the progress for all questions where a
true value
indicates that a question was completely edited. |
protected int |
getQuestionCount()
Returns the total number of questions.
|
MCQuestionUIIF |
getQuestionPanel(int questionNr)
Returns the question panel for the specified question.
|
protected void |
increaseNumberOfTries(int questionNr)
Increases and writes the number of tries for the given question
into the answer sheet.
|
protected void |
initQuestion(int questionNr)
Initializes the task and all answers/assertions for the specified
question.
|
protected boolean |
isAutocreatedAfterNewData()
Returns whether the
autocreated_after_new_data flag was
set to true . |
protected boolean |
isExerciseCorrected()
Returns whether this exercise was already corrected.
|
protected abstract boolean |
isExerciseEditable()
Returns whether this exercise card should be editable or not.
|
protected boolean |
isQuestionCorrect(int questionNr)
Returns whether the given question was answered correctly.
|
protected boolean |
isQuestionEditable(int questionNr)
Returns whether the given question should be editable.
|
protected void |
loadAnswer(int questionNr)
Loads the saved answer for the given question.
|
protected void |
loadAnswers()
Loads the saved answers and adjusts the necessary GUI elements.
|
void |
loadExerciseData()
Creates the questions and loads any ansers from previous sessions.
|
void |
reset()
Resets this card and all of its objects.
|
protected abstract void |
save()
Saves the exercise contents of this card.
|
protected void |
setTask(int questionNr,
java.awt.Component taskComponent)
Sets the task component for the specified question.
|
protected void |
setTask(int questionNr,
java.lang.String taskText)
Sets the task text for the specified question.
|
add, add, addControl, addControl, addControl, addControl, addText, addText, addText, addText, getContent, getControlPanel, insertHSpace, insertLineBreak, insertLineBreaks, insertTab, insertTabs, insertVSpace, setCenterAlignment, setLeftAlignment, setRightAlignment
addObjects, defineDependencies, dispose, getMessage, getMessage, getTitle, getType, selectElement, setTitle, setType
public static final java.awt.Color BACKGROUND_COLOR
public static final int MARGIN
protected MCAbstractExerciseCard(MathletContext mathlet, MCAbstractExercise exercise)
CardIF.USER_CARD
.mathlet
- a mathlet instanceexercise
- an exercise instancecardType
- the card typeCardIF.DEMO_CARD
,
CardIF.TRAINING_CARD
,
CardIF.EXERCISE_CARD
protected MCAbstractExerciseCard(MathletContext mathlet, MCAbstractExercise exercise, int cardType)
mathlet
- a mathlet instanceexercise
- an exercise instancecardType
- the card typeCardIF.DEMO_CARD
,
CardIF.TRAINING_CARD
,
CardIF.EXERCISE_CARD
,
CardIF.USER_CARD
public void loadExerciseData()
protected MathletContext getMathlet()
protected abstract void save()
protected abstract boolean isExerciseEditable()
protected boolean isExerciseCorrected()
protected boolean isQuestionEditable(int questionNr)
protected boolean isQuestionCorrect(int questionNr)
protected boolean isAutocreatedAfterNewData()
autocreated_after_new_data
flag was
set to true
.protected MCAbstractExercise getExercise()
public void createObjects()
BasicCard
createObjects
in class BasicCard
protected void createQuestions(MCQuestionUIIF[] panels)
initQuestion(int)
.protected MCQuestionUIIF createQuestion(int questionNr)
protected int getQuestionCount()
protected void initQuestion(int questionNr)
questionNr
- the question's numberpublic ControlPanel getMCContentPane()
public MCQuestionUIIF getQuestionPanel(int questionNr)
questionNr
- the question's numberMCQuestionUIIF
protected void setTask(int questionNr, java.awt.Component taskComponent)
questionNr
- the question's numberprotected void setTask(int questionNr, java.lang.String taskText)
questionNr
- the question's numberprotected void addAssertion(int questionNr, java.awt.Component assertionComponent)
questionNr
- the question's numberprotected void addAssertion(int questionNr, java.lang.String assertionText)
questionNr
- the question's numberpublic void reset()
BasicCard
protected void loadAnswers()
protected void loadAnswer(int questionNr)
public boolean collectAnswers()
BasicCard
true
.
Note:This method may not be called from inside all cards. Refer to the card's specification
for more information.collectAnswers
in class BasicCard
protected final void collectAnswers(int questionNr)
protected void increaseNumberOfTries(int questionNr)
protected boolean checkAnswers()
true
if all anwers are completed,
false
otherwise.
The default implementation always returns true
.protected boolean[] getProgress()
true
value
indicates that a question was completely edited.
The default implementation returns null
.null
.public void clearSubtask()
Further documentation and examples can be found under www.mathletfactory.de.