public interface EmbeddedAnswersEditor extends AuthoringField
AuthoringFieldType.EMBEDDED_ANSWERS_EDITOR
Usage:
- Create a single instance of this object and give it the HTML editor's
document. Use QuizzesComponentBuilder
to build the instance.
- Use newEmbeddedAuthoringField to create new answer fields.
- This class automatically handles cut, paste, drop and key events that could
change the number or the order of embedded answers in text. For other events
in the HTML editor that could alter the answers, call analyzeHTML after the
edition happens.Modifier and Type | Method and Description |
---|---|
void |
analyzeHTML()
Analyze the content of the root element searching for changes in embedded
authoring (answer) fields.
|
java.lang.String |
filterHTML(java.lang.String questionText,
EmbeddedAnswersEditorMode mode)
Make the necessary transformations to HTML before it can be use to be
edited in authoring (teacher) stage, or to be rendered in delivery
(student) or review stages.
|
java.lang.Object |
newEmbeddedAuthoringElement()
Create a new HTML element to be inserted in the text as a placeholder for
an embedded answer.
|
void |
setEditableElement(java.lang.Object element)
Set the editable Document or element.
|
getFieldType, setConfiguration, setFieldType, showAnswerFieldInlineEditor, showAnswerFieldPlainText, showAnswerFieldPopupEditor, showAuxiliarCas, showAuxiliarCasReplaceEditor, showAuxiliarTextInput, showAuxiliaryCas, showAuxiliaryCasReplaceEditor, showAuxiliaryTextInput, showCorrectAnswer, showCorrectAnswerTab, showGradingCriteria, showGradingFunction, showGraphicSyntax, showPreviewTab, showValidationTab, showVariablesDefinition, showVariablesTab
addQuizzesFieldListener, getValue, setReadOnly, setValue
getElement
void analyzeHTML()
java.lang.String filterHTML(java.lang.String questionText, EmbeddedAnswersEditorMode mode)
QuizzesComponentBuilder.replaceFields(com.wiris.quizzes.api.Question, com.wiris.quizzes.api.QuestionInstance, java.lang.Object)
method and by this object.
filterHTML(questionText, EmbeddedAnswersEditorMode.AUTHORING)
before setting the question text to the text editor.filterHTML(questionText, EmbeddedAnswersEditorMode.DELIVERY)
after getting the question text to the text editor. Use the result to
persistently save the text.filterHTML(questionText, EmbeddedAnswersEditorMode.REVIEW)
before the HTML is rendered for teacher or student review.questionText
- the HTML string containing the question text with
embedded answers.mode
- The mode to be used.QuizzesComponentBuilder.replaceFields(com.wiris.quizzes.api.Question, com.wiris.quizzes.api.QuestionInstance, java.lang.Object)
java.lang.Object newEmbeddedAuthoringElement()
void setEditableElement(java.lang.Object element)
element
- The HTML element node (or Document node) root of editable
content.Copyright © 2021 Maths for More S.L. All Rights Reserved.