GravityView  2.17
The best, easiest way to display Gravity Forms entries on your website.
gquiz_score.php
Go to the documentation of this file.
1 <?php
2 /**
3  * Display Gravity Forms Quiz value Pass/Fail
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'], false, false ) ) {
15  return;
16 }
17 
18 if( class_exists('GFQuiz') && $gravityview_view->getCurrentFieldSetting('quiz_use_max_score') ) {
19 
20  $max_score = GFQuiz::get_instance()->get_max_score( $gravityview_view->getForm() );
21 
22  printf( '%d/%d', $field['value'], $max_score );
23 
24 } else {
25 
26  echo $field['value'];
27 
28 }
static getInstance( $passed_post=NULL)
$field
Definition: gquiz_score.php:11
$gravityview_view
Definition: gquiz_score.php:9
gv_empty( $value, $zero_is_empty=true, $allow_string_booleans=true)
Is the value empty?