GravityView  2.17
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  var $is_searchable = true;
15 
16  var $search_operators = array( 'is', 'isnot', 'greater_than', 'less_than' );
17 
18  var $icon = 'dashicons-forms';
19 
20  public function __construct() {
21  $this->label = esc_html__( 'Quiz Score', 'gk-gravityview' );
22  parent::__construct();
23  }
24 
25  public function field_options( $field_options, $template_id, $field_id, $context, $input_type, $form_id ) {
26 
27  if( 'edit' === $context ) {
28  return $field_options;
29  }
30 
31  $new_fields = array(
32  'quiz_use_max_score' => array(
33  'type' => 'checkbox',
34  'label' => __( 'Show Max Score?', 'gk-gravityview' ),
35  'desc' => __('Display score as the a fraction: "[score]/[max score]". If unchecked, will display score.', 'gk-gravityview'),
36  'value' => true,
37  'merge_tags' => false,
38  ),
39  );
40 
41  return $new_fields + $field_options;
42  }
43 
44 }
45 
Modify field settings by extending this class.
field_options( $field_options, $template_id, $field_id, $context, $input_type, $form_id)
if(empty( $created_by)) $form_id
if(false !==strpos( $value, '00:00')) $field_id
string $field_id ID of the field being displayed
Definition: time.php:22