change group fudge factor
This commit is contained in:
@@ -763,32 +763,16 @@ function booking_studygroups_calculate() {
|
||||
$i = 1;
|
||||
|
||||
//iterate over the attendee list
|
||||
while ( $it->valid() )
|
||||
{
|
||||
/*
|
||||
//go to the first unprocessed attendee
|
||||
while ($it->current()->processed == 1)
|
||||
{
|
||||
drupal_set_message(t('Person with id !id has already been processed earlier.', array('!id' => $it->key())));
|
||||
$it->next();
|
||||
//double check we didn't run out of people right here
|
||||
if (! $it->valid() )
|
||||
{
|
||||
drupal_set_message("Ran out of attendees to process.");
|
||||
break;
|
||||
}
|
||||
}
|
||||
*/
|
||||
while ($it->valid()) {
|
||||
//cycle the session counter if we already reached the end
|
||||
if ($i > $group->booking_num_group_sessions)
|
||||
$i = 1;
|
||||
|
||||
//get the current attendee element
|
||||
$current = $it->current();
|
||||
$current = $it->current();
|
||||
|
||||
//assign this attendee to this session if unprocessed so far
|
||||
if ($current->processed == 0)
|
||||
{
|
||||
if ($current->processed == 0) {
|
||||
//generate stats about this attendee
|
||||
$gender = $current->booking_gender == 'M' ? 'male' : 'female';
|
||||
$age = _booking_get_age_years($current->booking_dob);
|
||||
@@ -993,17 +977,15 @@ function booking_studygroups_update_form($node, &$form_state, $sid) {
|
||||
//calculate the ratios of males to females, and various age groups
|
||||
$statistics = _booking_generate_statistics($attendees);
|
||||
|
||||
if ($statistics['males'] == 0 || $statistics['females'] == 0 || $max_people == 0)
|
||||
{
|
||||
if ($statistics['males'] == 0 || $statistics['females'] == 0 || $max_people == 0) {
|
||||
$gender_ratio = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$gender_ratio = ($statistics['males'] / $statistics['females']) * ($max_people / 2);
|
||||
}
|
||||
|
||||
//really stretch the tolerances for placement by setting this to zero
|
||||
$fudge_factor = 0;
|
||||
$fudge_factor = 1;
|
||||
//store our final maximums as an array for easy access later
|
||||
$maximums = array(
|
||||
'male' => ceil($gender_ratio),
|
||||
|
Reference in New Issue
Block a user