Skip to content

Instantly share code, notes, and snippets.

@diogenesjup
Created July 10, 2019 16:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save diogenesjup/2009acba5854a8122e8fe4799e82055c to your computer and use it in GitHub Desktop.
Save diogenesjup/2009acba5854a8122e8fe4799e82055c to your computer and use it in GitHub Desktop.
<?php
if($question_data["user_answer_entry"][0] !="" && $question_data["question_right_answer"][0] != $question_data["user_answer_entry"][0]):
$feedback = get_post_meta( $question_data["ID"], '_answer_feedback', true );
// Check if the custom field has a value.
if ( ! empty( $feedback ) ) {
?>
<div class="alert alert-warning" role="alert" style="font-size: 14px;max-width: 70%;padding: 7px;line-height: 20px;">
<?php echo "<b>Atenção:</b> ", $feedback; ?>
</div>
<?php
}
endif;
if($question_data["user_answer_entry"][0] !="" && $question_data["question_right_answer"][0] == $question_data["user_answer_entry"][0]):
?>
<div class="alert alert-success" role="alert" style="font-size: 14px;max-width: 70%;padding: 7px;line-height: 20px;">
<?php echo "<b>Parabéns:</b> Você assinalou a alternativa correta."; ?>
</div>
<?php endif; ?>
<hr>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment