| 1 |
<?php |
<?php |
| 2 |
// $Id:$ |
// $Id: randomizer.module,v 1.3 2006/06/21 20:44:08 deekayen Exp $ |
| 3 |
|
|
| 4 |
/** |
/** |
| 5 |
* @file |
* @file |
| 6 |
* Generate a set of random numbers |
* Generate a set of pseudo-random numbers |
| 7 |
* |
* |
| 8 |
* @author David Norman <deekayen at: deekayen (dot) net> |
* @author David Kent Norman |
| 9 |
* @link http://deekayen.net/ |
* @link http://deekayen.net/ |
| 10 |
* @link http://drupal.org/node/66575 |
* @link http://drupal.org/node/66575 |
| 11 |
* @todo markers, alternate rand generators (rand vs mt_rand), seeding, excel export, randomize form input |
* @todo markers, alternate rand generators (rand vs mt_rand), seeding, excel export, randomize form input |
| 27 |
case 'admin/help#randomizer': |
case 'admin/help#randomizer': |
| 28 |
return t('<p>This module is designed to assist researchers and students who want an easy way to perform random sampling or assign participants to experimental conditions.</p>'); |
return t('<p>This module is designed to assist researchers and students who want an easy way to perform random sampling or assign participants to experimental conditions.</p>'); |
| 29 |
break; |
break; |
|
case 'admin/modules#description': |
|
|
return t('Generate a random set of numbers.'); |
|
|
break; |
|
| 30 |
case 'admin/settings/randomizer': |
case 'admin/settings/randomizer': |
| 31 |
return t('Set default values for the public form.'); |
return t('Set default values for the public form.'); |
| 32 |
break; |
break; |
| 94 |
'callback' => 'randomizer_page', |
'callback' => 'randomizer_page', |
| 95 |
'access' => user_access('access randomizer'), |
'access' => user_access('access randomizer'), |
| 96 |
'type' => MENU_SUGGESTED_ITEM); |
'type' => MENU_SUGGESTED_ITEM); |
| 97 |
|
$items[] = array( |
| 98 |
|
'path' => 'admin/settings/randomizer', |
| 99 |
|
'title' => t('Randomizer'), |
| 100 |
|
'description' => t('Set bounds for list generation.'), |
| 101 |
|
'callback' => 'drupal_get_form', |
| 102 |
|
'callback arguments' => 'randomizer_admin_settings', |
| 103 |
|
'access' => user_access('administer site configuration'), |
| 104 |
|
'type' => MENU_NORMAL_ITEM |
| 105 |
|
); |
| 106 |
} |
} |
| 107 |
return $items; |
return $items; |
| 108 |
} |
} |
| 215 |
* |
* |
| 216 |
* @return array |
* @return array |
| 217 |
*/ |
*/ |
| 218 |
function randomizer_settings() { |
function randomizer_admin_settings() { |
| 219 |
$form = array(); |
$form = array(); |
| 220 |
$form['randomizer_max_sets'] = array( |
$form['randomizer_max_sets'] = array( |
| 221 |
'#type' => 'textfield', |
'#type' => 'textfield', |
| 232 |
'#title' => t('Maximum numbers per set users may generate') |
'#title' => t('Maximum numbers per set users may generate') |
| 233 |
); |
); |
| 234 |
$form = array_merge($form, randomizer_form()); |
$form = array_merge($form, randomizer_form()); |
| 235 |
return $form; |
return system_settings_form($form); |
| 236 |
} |
} |
| 237 |
|
|
| 238 |
/** |
/** |