Package com.biodigital.humansdk
Class HKQuiz
java.lang.Object
com.biodigital.humansdk.HKQuiz
HKQuiz object represents metadata and display data for a BioDigital interactive quiz
Some content may contain a quiz and if so this class will provide an interface to the questions, answers, user responses, and scoring
-
Field Summary
FieldsModifier and TypeFieldDescriptionthe sdk will set this to true if the user is taking the quizthe current question idthe sdk will set this to true when the quiz has been completedthe sdk will set this when the quiz has been completedthe current set of available answer IDs to the current questionthe current questionthe last submission to a questionthe sdk will set this to true if the content contains a quizthe number of the question to end with, default is the quiz length use the set() function to update this setting with the systemthe sdk will set this when the quiz has been completedset this to true to block the user from taking a quiz use the set() function to update this setting with the system or use the .quizLock UI optionmap of question Ids to HKQuestion objectsthe sdk will set this when the quiz has been completedthe sdk will set this when the quiz has been completedset this to false to hide the quiz answer explanation use the set() function to update this setting with the systemset this to false to hide the quiz progress UI use the set() function to update this setting with the systemset this to false to hide the quiz submit button use the set() function to update this setting with the systemset this to false to hide the quiz summary use the set() function to update this setting with the systemthe number of the question to start with, default is 1 use the set() function to update this setting with the systemlist of user answer submissionsthe sdk will set this when the quiz has been completed -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
enter()
call this to enter a quiz if one is available in the contentvoid
exit()
call this to exit out of an active quizvoid
Move to the next questionvoid
Move to the previous questionvoid
reset()
Reset the quiz to original settingsvoid
set()
Update the Quiz state with the system.void
Send an answer to the Quiz system
-
Field Details
-
enabled
the sdk will set this to true if the content contains a quiz -
active
the sdk will set this to true if the user is taking the quiz -
locked
set this to true to block the user from taking a quiz use the set() function to update this setting with the system or use the .quizLock UI option -
startNumber
the number of the question to start with, default is 1 use the set() function to update this setting with the system -
endNumber
the number of the question to end with, default is the quiz length use the set() function to update this setting with the system -
showSummary
set this to false to hide the quiz summary use the set() function to update this setting with the system -
showExplanation
set this to false to hide the quiz answer explanation use the set() function to update this setting with the system -
showSubmit
set this to false to hide the quiz submit button use the set() function to update this setting with the system -
showProgress
set this to false to hide the quiz progress UI use the set() function to update this setting with the system -
questions
map of question Ids to HKQuestion objects -
submissions
list of user answer submissions -
activeQuestionId
the current question id -
currentAnswers
the current set of available answer IDs to the current question -
completed
the sdk will set this to true when the quiz has been completed -
score
the sdk will set this when the quiz has been completed -
total
the sdk will set this when the quiz has been completed -
scorableTotal
the sdk will set this when the quiz has been completed -
correctTotal
the sdk will set this when the quiz has been completed -
incorrectTotal
the sdk will set this when the quiz has been completed -
currentQuestion
the current question -
currentSubmission
the last submission to a question
-
-
Constructor Details
-
HKQuiz
public HKQuiz()
-
-
Method Details
-
enter
public void enter()call this to enter a quiz if one is available in the content -
exit
public void exit()call this to exit out of an active quiz -
submit
Send an answer to the Quiz system- Parameters:
questionId
- the ID of the questionanswerIds
- the IDs of the selected answers
-
nextQuestion
public void nextQuestion()Move to the next question -
previousQuestion
public void previousQuestion()Move to the previous question -
reset
public void reset()Reset the quiz to original settings -
set
public void set()Update the Quiz state with the system. Use this function to lock quizzes or otherwise change their behavior.
-