GravityView  1.19.4
The best, easiest way to display Gravity Forms entries on your website.
class-gravityview-field-gquiz_score.php
Go to the documentation of this file.
1 <?php
2 /**
3  * @file class-gravityview-field-gquiz_score.php
4  * @package GravityView
5  * @subpackage includes\fields
6  */
7 
9 
10  var $name = 'quiz_score';
11 
12  var $group = 'advanced';
13 
14  public function __construct() {
15  $this->label = esc_html__( 'Quiz Score', 'gravityview' );
16  parent::__construct();
17  }
18 
19  function field_options( $field_options, $template_id, $field_id, $context, $input_type ) {
20 
21  if( 'edit' === $context ) {
22  return $field_options;
23  }
24 
25  $new_fields = array(
26  'quiz_use_max_score' => array(
27  'type' => 'checkbox',
28  'label' => __( 'Show Max Score?', 'gravityview' ),
29  'desc' => __('Display score as the a fraction: "[score]/[max score]". If unchecked, will display score.', 'gravityview'),
30  'value' => true,
31  'merge_tags' => false,
32  ),
33  );
34 
35  return $new_fields + $field_options;
36  }
37 
38 }
39 
Modify field settings by extending this class.
field_options($field_options, $template_id, $field_id, $context, $input_type)
$field_id
Definition: time.php:17