Viewing 0 reply threads
  • Author
    Posts
    • #7439
      andersonorui
      Participant

      Hi,

      I am creating a quiz and I need to use the “same” radio button in the answers, so I can set the correct answer.

      This is the code I am using:

      piklist('field', array(
          'type'      => 'group',
          'field'     => 'answer',
          'label'     => 'Answers',
          'add_more'  => true,
          'fields' => array(
              array(
                  'type' => 'radio',
                  'columns' => 2,
                  'choices' => array(
                      'true'  => 'Correct'
                  )
              ),
              array(
                  'type' => 'select',
                  'field' => 'answer_format',
                  'columns' => 2,
                  'choices' => array(
                      'text'  => 'Text',
                      'file'  => 'Image',
                      'url'   => 'Video'
                  )
              ),
              array(
                  'type'          => 'text',
                  'field'         => 'answer_text',
                  'columns'       => 6,
                  'conditions'    => array(
                      array(
                          'field'     => 'answer:answer_format',
                          'value'     => 'text'
                      )
                  )
              ),
              array(
                  'type'          => 'file',
                  'field'         => 'answer_file',
                  'columns'       => 6,
                  'conditions'    => array(
                      array(
                          'field'     => 'answer:answer_format',
                          'value'     => 'file'
                      )
                  )
              ),
              array(
                  'type'          => 'url',
                  'field'         => 'answer_url',
                  'columns'       => 6,
                  'conditions'    => array(
                      array(
                          'field'     => 'answer:answer_format',
                          'value'     => 'url'
                      )
                  )
              )
          )
      ));
      Attachments:
      You must be logged in to view attached files.
Viewing 0 reply threads
  • You must be logged in to reply to this topic.