GravityView  2.17
The best, easiest way to display Gravity Forms entries on your website.
class-gravityview-field-quiz.php
Go to the documentation of this file.
1 <?php
2 /**
3  * @file class-gravityview-field-gquiz.php
4  * @package GravityView
5  * @subpackage includes\fields
6  */
7 
9 
10  var $name = 'quiz';
11 
12  var $group = 'advanced';
13 
14  var $icon = 'dashicons-forms';
15 
16  public function __construct() {
17  $this->label = esc_html__( 'Quiz', 'gk-gravityview' );
18  parent::__construct();
19  }
20 
21  public function field_options( $field_options, $template_id, $field_id, $context, $input_type, $form_id ) {
22 
23  if( 'edit' === $context ) {
24  return $field_options;
25  }
26 
27  $new_fields = array(
28  'quiz_show_explanation' => array(
29  'type' => 'checkbox',
30  'label' => __( 'Show Answer Explanation?', 'gk-gravityview' ),
31  'desc' => __('If the field has an answer explanation, show it?', 'gk-gravityview'),
32  'value' => false,
33  'merge_tags' => false,
34  ),
35  );
36 
37  return $new_fields + $field_options;
38  }
39 
40 }
41 
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
new GravityView_Field_Quiz