Created
September 8, 2015 03:22
-
-
Save NikV/769e46eeedb84170683c to your computer and use it in GitHub Desktop.
Example for how to use the gquiz_answer_indicator filter
This file contains hidden or 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
//advanced - more control | |
add_filter( 'gquiz_answer_indicator', 'gquiz_answer_indicator', 10, 7); | |
function gquiz_answer_indicator ($indicator_markup, $form, $field, $choice, $lead, $is_response_correct, $is_response_wrong){ | |
if ( $is_response_correct ) | |
$indicator_markup = ' (you got this one right!)'; | |
elseif ( $is_response_wrong ) { | |
if ( $field['inputType'] == 'checkbox' && rgar( $choice, 'gquizIsCorrect' ) ) | |
$indicator_markup = ' (you missed this one!)'; | |
else | |
$indicator_markup = ' (you got this one wrong!)'; | |
} elseif ( rgar( $choice, 'gquizIsCorrect' ) ){ | |
$indicator_markup = ' (this was the correct answer!)'; | |
} | |
return $indicator_markup; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This seems to be not working, because the indicator image is actually hardcoded in plugin JS.