GravityView  1.19.4
The best, easiest way to display Gravity Forms entries on your website.
quiz.php
Go to the documentation of this file.
1 <?php
2 /**
3  * Display Gravity Forms Quiz output
4  *
5  * @package GravityView
6  * @subpackage GravityView/templates/fields
7  */
8 
10 
11 $field = $gravityview_view->getCurrentField();
12 
13 // If there's no grade, don't continue
14 if( gv_empty( $field['value'] ) ) {
15  return;
16 }
17 
18 if( ! class_exists('GFQuiz') ) {
19  do_action('gravityview_log_error', __FILE__ . ': GFQuiz class does not exist.' );
20  return;
21 }
22 
23 // Get the setting for show/hide explanation
24 $show_answer = rgars( $field, 'field_settings/quiz_show_explanation' );
25 
26 // Update the quiz field so GF generates the output properly
27 $field['field']->gquizShowAnswerExplanation = ! empty( $show_answer );
28 
29 // Generate the output
30 echo GFQuiz::get_instance()->display_quiz_on_entry_detail( $field['value'], $field['field'], $field['entry'], $field['form'] );
gv_empty($value, $zero_is_empty=true, $allow_string_booleans=true)
Is the value empty?
$field
Definition: quiz.php:11
if(gv_empty($field['value'])) if(!class_exists('GFQuiz')) $show_answer
Definition: quiz.php:24
static getInstance($passed_post=NULL)
$gravityview_view
Definition: quiz.php:9