Created
September 15, 2022 19:32
-
-
Save KristaButler/687da07ebc6512b9985d8bc3462510cf to your computer and use it in GitHub Desktop.
Use QuickLatex in MemberPress Quizzes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//You must include [latexpage] at the beginning of each question (inside the input box in the quiz builder) | |
//in order for the parser to work properly. | |
add_filter('mepr_view_get_string_/quizzes/questions/essay', 'mpcs_run_quicklatex', 10, 2); | |
add_filter('mepr_view_get_string_/quizzes/questions/multiple-answer', 'mpcs_run_quicklatex', 10, 2); | |
add_filter('mepr_view_get_string_/quizzes/questions/multiple-choice', 'mpcs_run_quicklatex', 10, 2); | |
add_filter('mepr_view_get_string_/quizzes/questions/short-answer', 'mpcs_run_quicklatex', 10, 2); | |
add_filter('mepr_view_get_string_/quizzes/questions/true-false', 'mpcs_run_quicklatex', 10, 2); | |
function mpcs_run_quicklatex($view, $vars) { | |
if (function_exists('quicklatex_parser')) { | |
$view = quicklatex_parser($view); | |
} | |
return $view; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment