You are here

function quiz_custom_action_form in Quiz 6.5

Same name and namespace in other branches
  1. 6.6 quiz.actions.inc \quiz_custom_action_form()
  2. 6.3 quiz.actions.inc \quiz_custom_action_form()
  3. 6.4 quiz.actions.inc \quiz_custom_action_form()
  4. 7 quiz.actions.inc \quiz_custom_action_form()
  5. 7.4 quiz.actions.inc \quiz_custom_action_form()

Form for configurable Drupal action. This form will be called when you choose the 'Make a new advanced action available' from the actions page in the admin. An example of utilizing this type of dynamics would be if you were giving away playing cards. You could create a custom function that would take an 'id' as a parameter to query the playing card database by. So you would have ONE function that could give away any playing card based on the parameter (id). So you create a new action and this form will come up. In your form you select the playing card to give away, then click save and your new action that gives away the playing card is created. Then you just select that new action from the dropdown when creating/editing the quiz.

Parameters

array $context:

Return value

$form

File

./quiz.actions.inc, line 74
Example Action Implementation.

Code

function quiz_custom_action_form($context) {

  /*
  $options = get_a_list_of_playing_cards();  //you would need to create an option list from a function
  $form['playing_card_id'] = array(
    '#title' => t('Playing Card'),
    '#type' => 'select',
    '#description' => t('Please select the playing card to give away.'),
    '#options' => $options,
    '#default_value' => isset($context['playing_card_id']) ? $context['playing_card_id'] : '',
  );
  $form['submit'] = array(
    '#type' => 'sumbit',
    '#value' => t('Submit')
  );
  */
  return $form;
}