Common subdirectories: cvs20061101/images and dev/images
diff -up cvs20061101/multichoice.module dev/multichoice.module
--- cvs20061101/multichoice.module	2006-11-10 06:50:34.000000000 +0100
+++ dev/multichoice.module	2006-11-11 04:29:01.000000000 +0100
@@ -317,7 +317,9 @@ function multichoice_render_question($no
   // Create form
   $form['tries'] = array(
     '#type' => $type,
-    '#options' => $options,
+    '#options' => array_merge(
+      array( -1 => t(check_plain(variable_get('quiz_question_unanswer_text', "no answer"))), ), 
+      $options),
     '#default_value' => -1,
   );
   $form['submit'] = array(
diff -up cvs20061101/quiz.install dev/quiz.install
--- cvs20061101/quiz.install	2006-11-10 06:08:43.000000000 +0100
+++ dev/quiz.install	2006-11-11 04:41:32.000000000 +0100
@@ -163,4 +163,7 @@ function quiz_uninstall() {
   variable_del('quiz_default_close');
   variable_del('quiz_use_passfail');
   variable_del('quiz_default_pass_rate');
+  variable_del('quiz_question_unanswer_text');
+  variable_del('quiz_default_answer_scoring');
+  variable_del('quiz_default_answer_displaying');
 }
diff -up cvs20061101/quiz.module dev/quiz.module
--- cvs20061101/quiz.module	2006-11-01 02:04:35.000000000 +0100
+++ dev/quiz.module	2006-11-11 04:50:14.000000000 +0100
@@ -247,10 +247,10 @@ function quiz_form(&$node) {
     '#collapsed' => FALSE,
   );
   if(variable_get('quiz_use_passfail', 1)){
-  	// New nodes get the default. Otherwise they get 0. (ignore pass / fail feedback)
-  	if(!$node->nid){
+    // New nodes get the default. Otherwise they get 0. (ignore pass / fail feedback)
+    if(!$node->nid){
       $node->pass_rate = variable_get('quiz_default_pass_rate', 75);
-  	}
+    }
     $form['summaryoptions']['pass_rate'] = array(
       '#type' => 'textfield',
       '#title' => t('Pass rate for %quiz %', array('%quiz' => $quiz_name)),
@@ -297,7 +297,7 @@ function _quiz_form_prepare_date($time =
   // If we are previewing, $time will be an array so just pass it through
   $time_array = array();
   if(is_array($time)){
-  	$time_array = $time;
+    $time_array = $time;
   } 
   // otherwise build the array from the timestamp
   elseif(is_numeric($time)){
@@ -633,14 +633,14 @@ function quiz_take_quiz() {
 
       // Check for answer submission
       if ($_POST['op'] == t('Submit')) {
-      	if(!isset($_POST['edit']['tries'])) {
-      	  drupal_set_message('You must select an answer before you can progress to the next question!', 'error');
-      	}
-      	else {
-    		  $former_question = node_load(array('nid' => array_shift($_SESSION['quiz_'.$quiz->nid]['quiz_questions'])));
-    		  $result = module_invoke($former_question->type, 'evaluate_question', $former_question->nid);
-    		  db_query("REPLACE {quiz_question_results} VALUES(%d, %d, '%s')", $_SESSION['quiz_'.$quiz->nid]['rid'], $former_question->nid, serialize($result));   		  
-    		}
+        if(!isset($_POST['edit']['tries'])) {
+          drupal_set_message('You must select an answer before you can progress to the next question!', 'error');
+        }
+        else {
+          $former_question = node_load(array('nid' => array_shift($_SESSION['quiz_'.$quiz->nid]['quiz_questions'])));
+          $result = module_invoke($former_question->type, 'evaluate_question', $former_question->nid);
+          db_query("REPLACE {quiz_question_results} VALUES(%d, %d, '%s')", $_SESSION['quiz_'.$quiz->nid]['rid'], $former_question->nid, serialize($result)); 
+        }
       }
 
       // If this quiz is in progress, load the next questions
@@ -711,8 +711,8 @@ function _quiz_get_summary_text($quiz, $
   } 
   // If the student did not pass or we are not using pass / fail
   else {
-  	// If we are coming from the admin view page 
-  	// only show a summary if we are using pass / fail.
+    // If we are coming from the admin view page 
+    // only show a summary if we are using pass / fail.
     if (arg(3) == 'view') {
       if ($node->pass_rate > 0){
         $summary = t('The student failed this quiz.');
@@ -742,7 +742,7 @@ function quiz_start_actions($uid, $nid) 
 
   // make sure this is available
   if(!$quiz->quiz_always == 1){
-  	// compare current gm time to open and close dates (which should still be in gm time)
+    // compare current gm time to open and close dates (which should still be in gm time)
     if(gmmktime() >= $quiz->quiz_close || gmmktime() < $quiz->quiz_open){
       drupal_set_message(t('This %quiz is not currently available.', array('%quiz' => $quiz_name)), 'status');
       if(!user_access('create quiz')){
@@ -823,7 +823,7 @@ function quiz_calculate_score($rid) {
                      FROM {quiz_question_results} qqr, {node} n
                      WHERE qqr.result_rid = %d AND n.nid = qqr.question_nid", $rid);
   while($r = db_fetch_array($result)) {
-  	$question_count++;
+    $question_count++;
     $r['answer'] = unserialize($r['answer']);
     $s = module_invoke($r['type'], 'calculate_result', $r['answer']['answers'], $r['answer']['tried']);
     $num_correct += $s;
@@ -1354,34 +1354,74 @@ function quiz_update_questions($question
  * Implementation of hook_settings()
  */
 function quiz_settings(){
-  $quiz_name = check_plain(variable_get('quiz_name', 'quiz'));
   $form = array();
-  // option to globally turn off pass / fail form elements
-  $form['quiz_default_close'] = array (
+
+  $quiz_name = check_plain(variable_get('quiz_name', 'quiz'));
+  $form['global'] = array(
+    '#type' => 'fieldset',
+    '#title' => $quiz_name,
+    '#collapsible' => TRUE,
+    '#collapsed' => FALSE,
+  );
+  // option to globally set quizzes display name
+  $form['global']['quiz_name'] = array (
+    '#type' => 'textfield',
+    '#title' => t('Assessment name'),
+    '#default_value' => $quiz_name,
+    '#description' => t('How do you want to refer to quizzes accross the site (for example: quiz, test, assessment).  This will affect display text but will not affect menu paths.'), 
+    '#required' => TRUE,
+  );
+  // option to globally set quiz availability days
+  $form['global']['quiz_default_close'] = array (
     '#type' => 'textfield',
     '#title' => t('Default number of days before a quiz is closed'),
     '#default_value' => variable_get('quiz_default_close', 30),
     '#description' => t('Supply a number of days to calculate the default close date for new quizzes.'), 
   );  
-  $form['quiz_use_passfail'] = array(
+  // option to globally turn off pass / fail form elements
+  $form['global']['quiz_use_passfail'] = array(
     '#type' => 'checkbox',
     '#title' => t('Display pass / fail options in the quiz form'),
     '#default_value' => variable_get('quiz_use_passfail', 1),
     '#description' => t('Check this to display the pass / fail options in the quiz form. You can still choose to ignore pass / fail options on a quiz by quiz basis if this is checked, but if you want to prohibit other quiz module creators from using these options, unchecked this option.'), 
   );
-  $form['quiz_default_pass_rate'] = array (
+  // option to globally set pass / fail boundary
+  $form['global']['quiz_default_pass_rate'] = array (
     '#type' => 'textfield',
     '#title' => t('Default percentage needed to pass a quiz'),
     '#default_value' => variable_get('quiz_default_pass_rate', 75),
     '#description' => t('Supply a number between 1 and 100 to set as the default percentage correct needed to pass a quiz. Set to 0 if you want to ignore pass / fail summary information by default.'), 
   );
-  $form['quiz_name'] = array (
+
+  $form['question'] = array(
+    '#type' => 'fieldset',
+    '#title' => t('questions'),
+    '#collapsible' => TRUE,
+    '#collapsed' => FALSE,
+  );
+  // option to globally set "no answer" / "skip question" text
+  $form['question']['quiz_question_unanswer_text'] = array (
     '#type' => 'textfield',
-    '#title' => t('Assessment name'),
-    '#default_value' => $quiz_name,
-    '#description' => t('How do you want to refer to quizzes accross the site (for example: quiz, test, assessment).  This will affect display text but will not affect menu paths.'), 
+    '#title' => t('No Answer text'),
+    '#default_value' => check_plain(variable_get('quiz_question_unanswer_text', 'skip this question')),
+    '#description' => t('What text should be provided as answer in order to skip a question?'), 
     '#required' => TRUE,
   );
+  // option to set the default scoring type
+  $form['question']['quiz_default_answer_scoring'] = array (
+    '#type' => 'checkbox',
+    '#title' => t('User defined scoring'),
+    '#default_value' => variable_get('quiz_default_answer_scoring', 0),
+    '#description' => t('Check this to use personalized scores by default in question forms. Uncheck to use simplier automatic scoring.') .t('This can be changed by quiz questions authors on a question basis.'),
+  );
+  // option to set the default interface (not to confused with theme)
+  $form['question']['quiz_default_answer_displaying'] = array (
+    '#type' => 'checkbox',
+    '#title' => t('Alternative (and often restrictive) displaying'),
+    '#default_value' => variable_get('quiz_default_answer_displaying', 0),
+    '#description' => t('Check this to use non-default question/answers display if available, let uncheck otherwhise.') .t('This can be changed by quiz questions authors on a question basis.'),
+  );
+
   return $form;
 }
 
@@ -1457,7 +1497,7 @@ function _quiz_get_results($nid = '', $u
 function quiz_user_results() {
   $result = db_fetch_object(db_query('SELECT q.nid FROM {quiz} q, {quiz_result} qr WHERE qr.quiz_nid = q.nid AND qr.rid = %d', arg(2)));
   if($result->nid){
-  	$quiz = node_load($result->nid);
+    $quiz = node_load($result->nid);
     $questions = _quiz_get_answers(arg(2));
     $score = quiz_calculate_score(arg(2));
     $summary = _quiz_get_summary_text($quiz, $score);
@@ -1474,7 +1514,7 @@ function quiz_user_results() {
 function quiz_admin_results() {
   $result = db_fetch_object(db_query('SELECT quiz.nid FROM quiz, quiz_result WHERE quiz_result.quiz_nid = quiz.nid AND quiz_result.rid = %d', arg(2)));
   if($result->nid){
-  	$quiz = node_load($result->nid);
+    $quiz = node_load($result->nid);
     $questions = _quiz_get_answers(arg(2));
     $score = quiz_calculate_score(arg(2));
     $summary = _quiz_get_summary_text($quiz, $score);
@@ -1734,7 +1774,7 @@ function theme_quiz_progress($question_n
  */
 function theme_quiz_take_question($quiz, $question_node){
 
-  //Calculation for quiz progress bar 		  
+  //Calculation for quiz progress bar  
   $number_of_questions = quiz_get_number_of_questions($quiz->nid);
   $question_number = $number_of_questions - count($_SESSION['quiz_'.$quiz->nid]['quiz_questions']);
 
