You are here

function quizfileupload_update_7001 in Quiz File Upload 7.5

Same name and namespace in other branches
  1. 7.4 quizfileupload.install \quizfileupload_update_7001()

Fixes the data structure for users with the original #2092275 patch.

File

./quizfileupload.install, line 118
The install file for installing the quizfileupload module.

Code

function quizfileupload_update_7001() {
  $instance = field_info_instance('node', 'quizfileupload_scoring', 'quizfileupload');
  if ($instance) {
    field_delete_instance($instance, TRUE);
  }
  if (db_field_exists('quiz_fileupload_user_answers', 'is_evaluated')) {
    $spec = array(
      'type' => 'int',
      'unsigned' => TRUE,
      'size' => 'tiny',
      'not null' => TRUE,
      'default' => 0,
    );
    db_change_field('quiz_fileupload_user_answers', 'is_evaluated', 'is_evaluated', $spec);
  }
  if (db_field_exists('quiz_fileupload_node_properties', 'type')) {
    $spec = array(
      'type' => 'int',
      'unsigned' => TRUE,
      'size' => 'tiny',
      'not null' => TRUE,
      'default' => 0,
    );
    db_change_field('quiz_fileupload_node_properties', 'type', 'correct_answer_evaluation', $spec);
  }
}