LD_QuizPro

LD_QuizPro

LearnDash QuizPro class


Description #


Source #

File: includes/quiz/ld-quiz-pro.php


Methods #

  • __construct — LD_QuizPro constructor
  • certificate_details — Echoes the HTML with inline javascript that contains the JSON representation of the certificate details and continue link details
  • certificate_link — Returns the certificate link appended to input HTML content if the Post ID is set, else it only returns the input HTML content
  • checkAnswers — Check answers for submitted quiz
  • datapos — Returns a MD5 checksum on a concatenated string comprised of user id, question id, and pos
  • datapos_array — Returns an array of MD5 Checksums on a concatenated string comprised of user id, question id, and i, where the array size is count and i is incremented from 0 for each array element
  • debug — Outputs the debugging message to the error log file
  • edit_process — Routes to the WpProQuiz_Controller_Quiz controller to output the add or edit page for quizes if not autosaving, post id is set, and the current user has permissions to add or edit quizes. If there is an available template to load, wordpress redirects to the proper URL.
  • edithtml — Returns the HTML of the add or edit page for the current quiz. If advanced quizes are disabled, it returns an empty string.
  • get_description — Returns the HTML representation of the quiz description
  • get_ld_quiz_id — Returns the Quiz ID when submitting the Pro Quiz ID
  • get_quiz_list — Returns an array of quizes in the string format of "$quiz_id - $quiz_name"
  • ld_adv_quiz_pro_ajax — Submit quiz and echo JSON representation of the checked quiz answers
  • learndash_quiz_content
  • quiz_attempt_has_ungraded_question — Checks a users submitted quiz attempt to see if that quiz has graded questions and if all of them have been graded
  • quiz_edit_redirect — Redirect from the Advanced Quiz edit or add link to the Quiz edit or add link
  • quiz_has_graded_question — Does the list of questions for this quiz have a graded question in it Dataset used is not the quizdata saved to user meta, but follows the Question Model of WpProQuiz
  • set_quiz_status_meta — This function runs when a quiz is started and is used to set the quiz start timestamp
  • showModalWindow
  • showQuizContent — Echoes quiz content
  • wp_pro_quiz_completed — This function runs when a quiz is completed, and does the action 'wp_pro_quiz_completed_quiz'