Index: contributions/modules/quiz/long_answer.install
--- contributions/modules/quiz/long_answer.install Base (1.1.2.1)
+++ contributions/modules/quiz/long_answer.install Locally Modified (Based On 1.1.2.1)
@@ -35,26 +35,70 @@
   // Properties for a question nodes go in here:
   $schema['quiz_long_answer_node_properties'] = array(
     'fields' => array(
-      'nid' => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE),
-      'vid' => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE),
-      'maximum_score' => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'dafault' => 1),
+      'nid' => array(
+        'type' => 'int',
+        'unsigned' => TRUE,
+        'not null' => TRUE,
     ),
+      'vid' => array(
+        'type' => 'int',
+        'unsigned' => TRUE,
+        'not null' => TRUE,
+      ),
+      'maximum_score' => array(
+        'type' => 'int',
+        'unsigned' => TRUE,
+        'not null' => TRUE,
+        'default' => 1,
+      ),
+    ),
     'primary key' => array('nid', 'vid'),
   );
   
   // User answers go in here.
   $schema['quiz_long_answer_user_answers'] = array(
     'fields' => array(
-      'answer_id' => array('type' => 'serial', 'unsigned' => TRUE, 'not null' => TRUE),
-      'question_nid' => array( 'type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE),
-      'question_vid' => array( 'type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE),
-      'result_id' => array( 'type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE),
-      'score' => array( 'type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 0),
-      'is_evaluated' => array('type' => 'int', 'unsigned' => TRUE, 'size' => 'tiny', 'default' => 0, 'not null' => TRUE),
-      'answer' => array('type' => 'text'),
+      'answer_id' => array(
+        'type' => 'serial',
+        'unsigned' => TRUE,
+        'not null' => TRUE,
     ),
+      'question_nid' => array(
+        'type' => 'int',
+        'unsigned' => TRUE,
+        'not null' => TRUE,
+      ),
+      'question_vid' => array(
+        'type' => 'int',
+        'unsigned' => TRUE,
+        'not null' => TRUE,
+      ),
+      'result_id' => array(
+        'type' => 'int',
+        'unsigned' => TRUE,
+        'not null' => TRUE,
+      ),
+      'score' => array(
+        'type' => 'int',
+        'unsigned' => TRUE,
+        'not null' => TRUE,
+        'default' => 0,
+      ),
+      'is_evaluated' => array(
+        'type' => 'int',
+        'unsigned' => TRUE,
+        'size' => 'tiny',
+        'default' => 0,
+        'not null' => TRUE,
+      ),
+      'answer' => array(
+        'type' => 'text'
+      ),
+    ),
     'primary key' => array('answer_id'),
-    'key' => array('result_id', 'question_nid', 'question_vid'),
\ No newline at end of file
+    'unique keys' => array(
+      'ids' => array('result_id', 'question_nid', 'question_vid'),
+    ),
\ No newline at end of file
   );
   
   return $schema;
Index: contributions/modules/quiz/multichoice.install
--- contributions/modules/quiz/multichoice.install Base (1.6.4.1)
+++ contributions/modules/quiz/multichoice.install Locally Modified (Based On 1.6.4.1)
@@ -36,11 +36,27 @@
   // Create the quiz node user answers multichoice table.
   $schema['quiz_multichoice_user_answers'] = array(
     'fields' => array(
-      'question_nid' => array( 'type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE),
-      'question_vid' => array( 'type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE),
-      'result_id' => array( 'type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE),
-      'answer_id' => array( 'type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE),
+      'question_nid' => array(
+        'type' => 'int',
+        'unsigned' => TRUE,
+        'not null' => TRUE,
     ),
+      'question_vid' => array(
+        'type' => 'int',
+        'unsigned' => TRUE,
+        'not null' => TRUE,
+      ),
+      'result_id' => array(
+        'type' => 'int',
+        'unsigned' => TRUE,
+        'not null' => TRUE,
+      ),
+      'answer_id' => array(
+        'type' => 'int',
+        'unsigned' => TRUE,
+        'not null' => TRUE,
+      ),
+    ),
     'primary key' => array(
       'result_id', 'question_nid', 'question_vid', 'answer_id',
     ),
@@ -52,15 +68,40 @@
   // Create the quiz node answers multichoice table.
   $schema['quiz_multichoice_answers'] = array(
     'fields' => array(
-      'answer_id' => array('type' => 'serial', 'unsigned' => TRUE, 'not null' => TRUE),
-      'nid' => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE),
-      'vid' => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE),
+      'answer_id' => array(
+        'type' => 'serial',
+        'unsigned' => TRUE,
+        'not null' => TRUE,
+      ),
+      'nid' => array(
+        'type' => 'int',
+        'unsigned' => TRUE,
+        'not null' => TRUE,
+      ),
+      'vid' => array(
+        'type' => 'int',
+        'unsigned' => TRUE,
+        'not null' => TRUE,
+      ),
       //'answer' => array( 'type' => 'varchar', 'length' => 255, 'not null' => TRUE),
-      'answer' => array('type' => 'text'),
-      'feedback' => array('type' => 'text', 'length' => 65535),
-      'result_option' => array( 'type' => 'int', 'unsigned' => TRUE, 'default' => 0),
-	'is_correct' => array('type' => 'int', 'size' => 'tiny', 'unsigned' => TRUE, 'default' => 0),
+      'answer' => array(
+        'type' => 'text'
     ),
+      'feedback' => array(
+        'type' => 'text',
+      ),
+      'result_option' => array(
+        'type' => 'int',
+        'unsigned' => TRUE,
+        'default' => 0,
+      ),
+	'is_correct' => array(
+        'type' => 'int',
+        'size' => 'tiny',
+        'unsigned' => TRUE,
+        'default' => 0,
+      ),
+    ),
\ No newline at end of file
     'primary key' => array(
       'answer_id',
     ),
Index: contributions/modules/quiz/quiz.install
--- contributions/modules/quiz/quiz.install Base (1.22.2.3)
+++ contributions/modules/quiz/quiz.install Locally Modified (Based On 1.22.2.3)
@@ -46,31 +46,111 @@
 * Implementation of hook_schema().
 */
 function quiz_schema() {
+  $schema = array();
   /**
    * Connect all the quiz specific properties to the correct version of a quiz.
    */
   // Create the quiz node properties table
   $schema['quiz_node_properties'] = array(
     'fields' => array(
-      'property_id' => array('type' => 'serial', 'unsigned' => TRUE, 'not null' => TRUE),
-      'vid' => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE),
-      'nid' => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE),
-      'aid' => array('type' => 'varchar', 'length' => 255, 'not null' => TRUE),
-      'number_of_random_questions' => array('type' => 'int', 'size' => 'tiny', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 0),
-      'pass_rate' => array('type' => 'int', 'size' => 'tiny', 'unsigned' => TRUE, 'not null' => TRUE),
-      'summary_pass' => array('type' => 'text', 'length' => 65535),
-      'summary_default' => array('type' => 'text', 'length' => 65535),
-      'shuffle' => array('type' => 'int', 'size' => 'tiny', 'unsigned' => TRUE, 'not null' => TRUE),
-      'backwards_navigation' => array('type' => 'int', 'size' => 'tiny', 'unsigned' => TRUE, 'not null' => TRUE),
-      'feedback_time' => array('type' => 'int', 'size' => 'tiny', 'unsigned' => TRUE, 'not null' => TRUE),
-      'quiz_open' => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 0),
-      'quiz_close' => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 0),
-      'takes' => array('type' => 'int', 'size' => 'tiny', 'unsigned' => TRUE, 'not null' => TRUE),
-      'time_limit' => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 0),
-      'quiz_always' => array('type' => 'int', 'size' => 'tiny', 'not null' => TRUE, 'default' => 0),
-      'tid' => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 0),
+      'property_id' => array(
+        'type' => 'serial',
+        'unsigned' => TRUE,
+        'not null' => TRUE,
     ),
+      'vid' => array(
+        'type' => 'int',
+        'unsigned' => TRUE,
+        'not null' => TRUE,
+      ),
+      'nid' => array(
+        'type' => 'int',
+        'unsigned' => TRUE,
+        'not null' => TRUE,
+      ),
+      'aid' => array(
+        'type' => 'varchar',
+        'length' => 255,
+        'not null' => TRUE,
+      ),
+      'number_of_random_questions' => array(
+        'type' => 'int',
+        'size' => 'tiny',
+        'unsigned' => TRUE,
+        'not null' => TRUE,
+        'default' => 0,
+      ),
+      'pass_rate' => array(
+        'type' => 'int',
+        'size' => 'tiny',
+        'unsigned' => TRUE,
+        'not null' => TRUE,
+      ),
+      'summary_pass' => array(
+        'type' => 'text',
+      ),
+      'summary_default' => array(
+        'type' => 'text',
+      ),
+      'shuffle' => array(
+        'type' => 'int',
+        'size' => 'tiny',
+        'unsigned' => TRUE,
+        'not null' => TRUE,
+      ),
+      'backwards_navigation' => array(
+        'type' => 'int',
+        'size' => 'tiny',
+        'unsigned' => TRUE,
+        'not null' => TRUE,
+      ),
+      'feedback_time' => array(
+        'type' => 'int',
+        'size' => 'tiny',
+        'unsigned' => TRUE,
+        'not null' => TRUE,
+      ),
+      'quiz_open' => array(
+        'type' => 'int',
+        'unsigned' => TRUE,
+        'not null' => TRUE,
+        'default' => 0,
+      ),
+      'quiz_close' => array(
+        'type' => 'int',
+        'unsigned' => TRUE,
+        'not null' => TRUE,
+        'default' => 0,
+      ),
+      'takes' => array(
+        'type' => 'int',
+        'size' => 'tiny',
+        'unsigned' => TRUE,
+        'not null' => TRUE,
+      ),
+      'time_limit' => array(
+        'type' => 'int',
+        'unsigned' => TRUE,
+        'not null' => TRUE,
+        'default' => 0,
+      ),
+      'quiz_always' => array(
+        'type' => 'int',
+        'size' => 'tiny',
+        'not null' => TRUE,
+        'default' => 0
+      ),
+      'tid' => array(
+        'type' => 'int',
+        'unsigned' => TRUE,
+        'not null' => TRUE,
+        'default' => 0,
+      ),
+    ),
     'primary key' => array('property_id'),
+    'unique keys' => array(
+      'node_ids' => array('vid', 'nid'),
+    )
   );
 
   /*
@@ -86,12 +166,34 @@
   // Create the quiz node relationship table
   $schema['quiz_node_relationship'] = array(
     'fields' => array(
-      'parent_nid' => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE),
-      'parent_vid' => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE),
-      'child_nid' => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE),
-      'child_vid' => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE),
-      'question_status' => array('type' => 'int', 'size' => 'tiny', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 1),
+      'parent_nid' => array(
+        'type' => 'int',
+        'unsigned' => TRUE,
+        'not null' => TRUE,
     ),
+      'parent_vid' => array(
+        'type' => 'int',
+        'unsigned' => TRUE,
+        'not null' => TRUE,
+      ),
+      'child_nid' => array(
+        'type' => 'int',
+        'unsigned' => TRUE,
+        'not null' => TRUE,
+      ),
+      'child_vid' => array(
+        'type' => 'int',
+        'unsigned' => TRUE,
+        'not null' => TRUE,
+      ),
+      'question_status' => array(
+        'type' => 'int',
+        'size' => 'tiny',
+        'unsigned' => TRUE,
+        'not null' => TRUE,
+        'default' => 1,
+      ),
+    ),
     'primary key' => array('parent_nid', 'parent_vid', 'child_nid', 'child_vid'),
   );
 
@@ -102,9 +204,23 @@
   // XXX: This should be considered deprecated, as it is highly specific to multichoice.
   $schema['quiz_node_question_properties'] = array(
     'fields' => array(
-      'nid' => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE),
-      'vid' => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE),
-      'number_of_answers' => array('type' => 'int', 'size' => 'tiny', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 1),
+      'nid' => array(
+        'type' => 'int',
+        'unsigned' => TRUE,
+        'not null' => TRUE,
+      ),
+      'vid' => array(
+        'type' => 'int',
+        'unsigned' => TRUE,
+        'not null' => TRUE,
+      ),
+      'number_of_answers' => array(
+        'type' => 'int',
+        'size' => 'tiny',
+        'unsigned' => TRUE,
+        'not null' => TRUE,
+        'default' => 1,
+      ),
       //'multianswer' => array('type' => 'int', 'size' =>'tiny', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 0),
     ),
   );
@@ -115,16 +231,56 @@
   // Create the quiz node results table
   $schema['quiz_node_results'] = array(
     'fields' => array(
-      'result_id' => array('type' => 'serial', 'size' => 'normal', 'unsigned' => TRUE, 'not null' => TRUE),
-      'nid' => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE),
-      'vid' => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE),
-      'uid' => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE),
-      'time_start' => array('type' => 'int', 'unsigned' => TRUE, 'default' => 0),
-      'time_end' => array('type' => 'int', 'unsigned' => TRUE, 'default' => 0),
-      'released' => array('type' => 'int', 'unsigned' => TRUE, 'default' => 0),
-      'score' => array('type' => 'int', 'size' => 'tiny', 'not null' => TRUE, 'default' => 0),
+      'result_id' => array(
+        'type' => 'serial',
+        'size' => 'normal',
+        'unsigned' => TRUE,
+        'not null' => TRUE,
     ),
+      'nid' => array(
+        'type' => 'int',
+        'unsigned' => TRUE,
+        'not null' => TRUE,
+      ),
+      'vid' => array(
+        'type' => 'int',
+        'unsigned' => TRUE,
+        'not null' => TRUE,
+      ),
+      'uid' => array(
+        'type' => 'int',
+        'unsigned' => TRUE,
+        'not null' => TRUE,
+      ),
+      'time_start' => array(
+        'type' => 'int',
+        'unsigned' => TRUE,
+        'default' => 0,
+      ),
+      'time_end' => array(
+        'type' => 'int',
+        'unsigned' => TRUE,
+        'default' => 0,
+      ),
+      'released' => array(
+        'type' => 'int',
+        'unsigned' => TRUE,
+        'default' => 0,
+      ),
+      'score' => array(
+        'type' => 'int',
+        'size' => 'tiny',
+        'not null' => TRUE,
+        'default' => 0,
+      ),
+    ),
     'primary key' => array('result_id'),
+    'unique keys' => array(
+      'user_results' => array('uid', 'vid', 'nid'),
+    ),
+    'indexes' => array(
+      'uid' => array('uid'),
+    ),
   );
 
   /**
@@ -132,14 +288,48 @@
    */
   $schema['quiz_node_results_answers'] = array(
     'fields' => array(
-      'result_id' => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE),
-      'question_nid' => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE),
-      'question_vid' => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE),
-      'is_correct' => array('type' => 'int', 'size' => 'tiny', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 0),
-      'is_skipped' => array('type' => 'int', 'size' => 'tiny', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 0),
-      'points_awarded' => array('type' => 'int', 'size' => 'tiny', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 0),
-      'answer_timestamp' => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE),
+      'result_id' => array(
+        'type' => 'int',
+        'unsigned' => TRUE,
+        'not null' => TRUE,
     ),
+      'question_nid' => array(
+        'type' => 'int',
+        'unsigned' => TRUE,
+        'not null' => TRUE,
+      ),
+      'question_vid' => array(
+        'type' => 'int',
+        'unsigned' => TRUE,
+        'not null' => TRUE,
+      ),
+      'is_correct' => array(
+        'type' => 'int',
+        'size' => 'tiny',
+        'unsigned' => TRUE,
+        'not null' => TRUE,
+        'default' => 0,
+      ),
+      'is_skipped' => array(
+        'type' => 'int',
+        'size' => 'tiny',
+        'unsigned' => TRUE,
+        'not null' => TRUE,
+        'default' => 0
+      ),
+      'points_awarded' => array(
+        'type' => 'int',
+        'size' => 'tiny',
+        'unsigned' => TRUE,
+        'not null' => TRUE,
+        'default' => 0,
+      ),
+      'answer_timestamp' => array(
+        'type' => 'int',
+        'unsigned' => TRUE,
+        'not null' => TRUE,
+      ),
+    ),
     'primary key' => array('result_id', 'question_nid', 'question_vid')
   );
 
@@ -149,14 +339,41 @@
   // Create the quiz node result options table
   $schema['quiz_node_result_options'] = array(
     'fields' => array(
-      'option_id' => array('type' => 'serial', 'size' => 'normal', 'unsigned' => TRUE, 'not null' => TRUE),
-      'nid' => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE),
-      'vid' => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE),
-      'option_name' => array('type' => 'varchar', 'length' => 255, 'not null' => TRUE),
-      'option_summary' => array('type' => 'text', 'length' => 65535),
-      'option_start' => array('type' => 'int', 'unsigned' => TRUE, 'default' => 0),
-      'option_end' => array('type' => 'int', 'unsigned' => TRUE, 'default' => 0),
+      'option_id' => array(
+        'type' => 'serial',
+        'size' => 'normal',
+        'unsigned' => TRUE,
+        'not null' => TRUE,
     ),
+      'nid' => array(
+        'type' => 'int',
+        'unsigned' => TRUE,
+        'not null' => TRUE,
+      ),
+      'vid' => array(
+        'type' => 'int',
+        'unsigned' => TRUE,
+        'not null' => TRUE,
+      ),
+      'option_name' => array(
+        'type' => 'varchar',
+        'length' => 255,
+        'not null' => TRUE,
+      ),
+      'option_summary' => array(
+        'type' => 'text',
+      ),
+      'option_start' => array(
+        'type' => 'int',
+        'unsigned' => TRUE,
+        'default' => 0,
+      ),
+      'option_end' => array(
+        'type' => 'int',
+        'unsigned' => TRUE,
+        'default' => 0,
+      ),
+    ),
     'primary key' => array('option_id')
   );
   return $schema;
Index: contributions/modules/quiz/quiz.module
--- contributions/modules/quiz/quiz.module Base (1.137.2.18)
+++ contributions/modules/quiz/quiz.module Locally Modified (Based On 1.137.2.18)
@@ -70,7 +70,8 @@
  */
 function quiz_views_api() {
   return array(
-    'api' => '2.0',
+    'api' => 2,
+    //'path' => drupal_get_path('module', 'quiz') . '/includes/views',
   );
 }
 
