Class HKQuiz

java.lang.Object
com.biodigital.humansdk.HKQuiz

public class HKQuiz extends Object
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 Details

    • enabled

      public Boolean enabled
      the sdk will set this to true if the content contains a quiz
    • active

      public Boolean active
      the sdk will set this to true if the user is taking the quiz
    • locked

      public Boolean 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

      public Integer startNumber
      the number of the question to start with, default is 1 use the set() function to update this setting with the system
    • endNumber

      public Integer 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

      public Boolean showSummary
      set this to false to hide the quiz summary use the set() function to update this setting with the system
    • showExplanation

      public Boolean showExplanation
      set this to false to hide the quiz answer explanation use the set() function to update this setting with the system
    • showSubmit

      public Boolean showSubmit
      set this to false to hide the quiz submit button use the set() function to update this setting with the system
    • showProgress

      public Boolean showProgress
      set this to false to hide the quiz progress UI use the set() function to update this setting with the system
    • questions

      public HashMap<String,HKQuizQuestion> questions
      map of question Ids to HKQuestion objects
    • submissions

      public ArrayList<HKQuizSubmission> submissions
      list of user answer submissions
    • activeQuestionId

      public String activeQuestionId
      the current question id
    • currentAnswers

      public ArrayList<String> currentAnswers
      the current set of available answer IDs to the current question
    • completed

      public Boolean completed
      the sdk will set this to true when the quiz has been completed
    • score

      public Double score
      the sdk will set this when the quiz has been completed
    • total

      public Double total
      the sdk will set this when the quiz has been completed
    • scorableTotal

      public Double scorableTotal
      the sdk will set this when the quiz has been completed
    • correctTotal

      public Double correctTotal
      the sdk will set this when the quiz has been completed
    • incorrectTotal

      public Double incorrectTotal
      the sdk will set this when the quiz has been completed
    • currentQuestion

      public HKQuizQuestion currentQuestion
      the current question
    • currentSubmission

      public HKQuizSubmission 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

      public void submit(String questionId, ArrayList<String> answerIds)
      Send an answer to the Quiz system
      Parameters:
      questionId - the ID of the question
      answerIds - 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.