Quizzes
instead.@Deprecated
public class QuizzesBuilder
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
Configuration |
getConfiguration()
Deprecated.
Gives the configuration.
|
static QuizzesBuilder |
getInstance()
Deprecated.
Get a QuizzesBuilder.
|
MathFilter |
getMathFilter()
Deprecated.
Gives a MathFilter object.
|
QuizzesService |
getQuizzesService()
Deprecated.
Gives a QuizzesService object.
|
QuizzesUIBuilder |
getQuizzesUIBuilder()
Deprecated.
|
java.lang.String |
getResourceUrl(java.lang.String name)
Deprecated.
Get the url of a static resource, to be linked from client-side.
|
QuestionRequest |
newEvalMultipleAnswersRequest(java.lang.String[] correctAnswers,
java.lang.String[] studentAnswers,
Question question,
QuestionInstance instance)
Deprecated.
Like
newEvalRequest(java.lang.String, java.lang.String, com.wiris.quizzes.api.Question, com.wiris.quizzes.api.QuestionInstance) but this method allows to compare several student's
answers with several correct answers. |
QuestionRequest |
newEvalRequest(java.lang.String correctAnswer,
java.lang.String studentAnswer,
Question question,
QuestionInstance instance)
Deprecated.
Creates a new QuestionRequest object suitable to send to the quizzes
service in order to evaluate a student answer against a correct answer.
|
QuestionRequest |
newFeedbackRequest(java.lang.String html,
Question question,
QuestionInstance instance)
Deprecated.
Create a QuestionRequest that evaluates the student answer(s) and gets the variables to be used in the feedback.
|
Question |
newQuestion()
Deprecated.
Creates a new empty
Question object. |
QuestionInstance |
newQuestionInstance()
Deprecated.
Use
newQuestionInstance(Question) instead. |
QuestionInstance |
newQuestionInstance(Question q)
Deprecated.
Creates a new
QuestionInstance object from the given
Question . |
QuestionRequest |
newVariablesRequest(java.lang.String html,
Question question,
QuestionInstance instance)
Deprecated.
Creates a new
QuestionRequest object suitable to send to the quizzes
service in order to get variable values generated from an algorithm. |
Question |
readQuestion(java.lang.String xml)
Deprecated.
Creates a new
Question object reading its contents from XML. |
QuestionInstance |
readQuestionInstance(java.lang.String xml)
Deprecated.
Creates a new
QuestionInstance object reading its contents from XML. |
public static QuizzesBuilder getInstance()
public QuestionInstance newQuestionInstance()
newQuestionInstance(Question)
instead.QuestionInstance
object. The random seed is
initialized to a random value.public QuestionInstance newQuestionInstance(Question q)
QuestionInstance
object from the given
Question
.
This function is preferred to the deprecated newQuestionInstance()
since it can properly configure the new QuestionInstance depending on the
Question. For instance, it computes the handwriting constraints if the
answer input field is a Handwriting MathType.q
- The question related to the new QuestionInstance. It may be null.public Question readQuestion(java.lang.String xml)
Question
object reading its contents from XML. It is the
inverse operation that the Serializable.serialize()
method of Question object.xml
- The XML definition of the Question
object. The root tag is
<question>.public QuestionInstance readQuestionInstance(java.lang.String xml)
QuestionInstance
object reading its contents from XML. It is
the inverse operation that the Serializable.serialize()
method of
QuestionInstance object.xml
- The XML definition of the QuestionInstance
object. The root tag
is <questionInstance>.public QuestionRequest newVariablesRequest(java.lang.String html, Question question, QuestionInstance instance)
QuestionRequest
object suitable to send to the quizzes
service in order to get variable values generated from an algorithm.html
- The text/html with placeholders for variables. It is used to
get the names of the variables to be requested. The placeholders are
variable names prefixed with the symbol #, and they may be inside MathML
formulas. If null the variablenames will be taken from the third parameter.
It is specially useful when one want to rebuild the variables from a given
QuestionInstance because the cache is not ready.question
- The question with the Wiris Cas session.instance
- The question instance with the random seed. If null it will be
a new one will be initialized with an unknown random seed.java.lang.Error
- if question is null.public QuestionRequest newEvalRequest(java.lang.String correctAnswer, java.lang.String studentAnswer, Question question, QuestionInstance instance)
correctAnswer
- The text or mathml correct answer. It may contain
variable placeholders provided that the QuestionInstance parameter contains
the required variables. If it is null, then the correct answer will
be taken from the question parameter.studentAnswer
- The text or mathml (idependently from correctAnswer)
student's answer. If it is null, then the student answer will be taken
from the instance parameter.question
- The question. It should contain the assertions and/or the
algorithm. If the question is null or does not contain any assertion, it
will be used the general syntactic assertion and the mathematically
equivalence assertion.instance
- The question instance, with the random seed. If it is null
a new random seed will be set.java.lang.Error
- If Question parameter is lazily parsed from XML within this
method and it is malformed XML or if correctAnswer or studentAnswer MathML
are malformed.public QuestionRequest newEvalMultipleAnswersRequest(java.lang.String[] correctAnswers, java.lang.String[] studentAnswers, Question question, QuestionInstance instance)
newEvalRequest(java.lang.String, java.lang.String, com.wiris.quizzes.api.Question, com.wiris.quizzes.api.QuestionInstance)
but this method allows to compare several student's
answers with several correct answers.
If no assertions are provided for a given answer or correct answer, the
pairing between correct answers and user answers will be done grouping
answers in equal sized sets. For example, if 4 correct answers {a, b, c, d}
and 2 user answers {x, y} are provided, it will be compared {a=x, b=x, c=y,
d=y}.correctAnswers
- Array of correct or teacher answers. If it is null,
then the correct answers are taken from the question parameter.studentAnswers
- Array of student answers. If it is null, then the
student answers are taken from the instance parameter.question
- The question. It should contain the assertions and/or the
algorithm. If the question is null or does not contain any assertion, then
the default comparison is done between the pairing explained above.instance
- The question instance, with the random seed. If it is null
a new random seed will be set.java.lang.Error
- If Question parameter is parsed (lazily) from XML within this
method and it is malformed XML or if correctAnswers or studentAnswers MathML
contain malformed semantics annotation.public QuestionRequest newFeedbackRequest(java.lang.String html, Question question, QuestionInstance instance)
newEvalRequest(null, null, question, instance)
newVariablesRequest(html, question, instance)
newEvalMultipleAnswersRequest(String[], String[], Question, QuestionInstance)
, the student and
teacher answers must already be respectively in Question
and QuestionInstance
objects.
This call sets the student answer(s) as algorithm parameter(s) and therefore it can be used to produce computed
feedback from student answers.html
- The text where to find the variable placeholders to be used.question
- The question definition.instance
- The question instance with student answers.newVariablesRequest(String, Question, QuestionInstance)
,
newEvalMultipleAnswersRequest(String[], String[], Question, QuestionInstance)
,
QuizzesConstants.OPTION_STUDENT_ANSWER_PARAMETER_NAME
public QuizzesService getQuizzesService()
public MathFilter getMathFilter()
public Configuration getConfiguration()
public QuizzesUIBuilder getQuizzesUIBuilder()
public java.lang.String getResourceUrl(java.lang.String name)
name
- The filename of the resource eg: wirisquizzes.css.Copyright © 2021 Maths for More S.L. All Rights Reserved.