There is issue in populating the select box for gender, it shows the default value as 'Female' on edit page due to the miss match in closing the options array. Attaching the updated code.
$form['candidate_gender'] = array (
'#type' => 'select',
'#title' => ('Gender'),
'#options' => array(
'Female' => t('Female'),
'male' => t('Male')
),
'#default_value' => (isset($record['gender']) && $_GET['num']) ? $record['gender']:'',
);
There is issue in populating the select box for gender, it shows the default value as 'Female' on edit page due to the miss match in closing the options array. Attaching the updated code.