diff -rupN pickem-1.x new/pickem.inc pickem/pickem.inc
--- pickem-1.x new/pickem.inc	2012-08-21 16:51:58.000000000 -0700
+++ pickem/pickem.inc	2012-08-21 18:13:53.281171600 -0700
@@ -482,7 +482,7 @@ function get_picks($filter = array('leag
     $sql_where = ' WHERE '. implode(' and ', $sql_where_list);
   }
 
-  $query = 'SELECT g.gid, g.wid, g.h_score, g.v_score, g.v_id, g.h_id, p.uid, p.winnerpick_id, p.pick_v_score, p.pick_h_score, p.pick_v_score, p.pick_h_score, g.gamestart, w.wk_points from {pickem_users} u inner join {pickem_picks} p on u.lid=p.lid and u.uid=p.uid inner join {pickem_games} g on p.gid = g.gid  inner join {pickem_weeks} w on w.wid=g.wid inner join {pickem_leagues} l on l.gsid=w.gsid and l.lid=u.lid '. $sql_where .' ORDER BY g.wid, g.gamestart, g.gid';
+  $query = 'SELECT g.gid, g.wid, g.h_score, g.v_score, g.v_id, g.h_id, p.uid, p.winnerpick_id, p.pick_v_score, p.pick_h_score, p.pick_v_score, p.pick_h_score, p.confidence, g.gamestart, w.wk_points from {pickem_users} u inner join {pickem_picks} p on u.lid=p.lid and u.uid=p.uid inner join {pickem_games} g on p.gid = g.gid  inner join {pickem_weeks} w on w.wid=g.wid inner join {pickem_leagues} l on l.gsid=w.gsid and l.lid=u.lid '. $sql_where .' ORDER BY g.wid, g.gamestart, g.gid';
   $result = db_query($query);
 
   $picks = array();
@@ -507,9 +507,25 @@ function set_pick($user_id, $league, $pi
       return FALSE;
     }
   }
-
-  // Pick the winner type league.
-  if (isset($pick['pick'])) {
+
+    // Pick the winner with confidence points type league.
+  if ($league->scoring_engine->features['with_confidence'] == 1) {
+ 
+    db_merge('pickem_picks')
+      ->key(array(
+        'gid' => $pick['gid'],
+        'uid' => $user_id,
+        'lid' => $league->lid,
+      ))
+      ->fields(array(
+        'winnerpick_id' => $pick['pick'] == '' ? NULL : $pick['pick'],
+        'picktime' => time(),
+		'confidence' => $pick['confidence'] == '' ? NULL : $pick['confidence'],
+      ))
+      ->execute();
+  }
+   // Pick the winner type league.
+  else if (isset($pick['pick'])) { 
 
     db_merge('pickem_picks')
       ->key(array(
@@ -553,7 +569,9 @@ function get_scoring_engine($league) {
     case PICKEM_TYPE_SPREAD:
       return new pickem_scoring_point_spread();
     case PICKEM_TYPE_SCORE_DIFF:
-      return new pickem_scoring_score_diff();
+      return new pickem_scoring_score_diff();
+    case PICKEM_TYPE_CONFIDENCE:
+      return new pickem_scoring_confidence();
   }
 }
 
@@ -624,13 +642,13 @@ function get_user_totals($league=NULL, $
       if ($week_id == 0) {
         // All picked games.
         // Will be missing entries if they didn't pick.
-        $query = "select g.gid, g.wid, g.h_score, g.v_score, g.v_id, g.v_spread, g.h_id, g.h_spread, p.uid, p.winnerpick_id, p.pick_v_score, p.pick_h_score, g.gamestart, w.wk_points from {pickem_picks} p inner join {pickem_games} g on p.gid = g.gid inner join {pickem_weeks} w on w.wid = g.wid where p.lid=:lid and w.first_gamestart < :now_time order by g.wid, g.gamestart, g.gid";
+        $query = "select g.gid, g.wid, g.h_score, g.v_score, g.v_id, g.v_spread, g.h_id, g.h_spread, p.uid, p.winnerpick_id, p.pick_v_score, p.pick_h_score, p.confidence, g.gamestart, w.wk_points from {pickem_picks} p inner join {pickem_games} g on p.gid = g.gid inner join {pickem_weeks} w on w.wid = g.wid where p.lid=:lid and w.first_gamestart < :now_time order by g.wid, g.gamestart, g.gid";
         $result = db_query($query, array(':lid' => $league->lid, ':now_time' => time()));
       }
       else {
         // All games for a certain week.
         // Will be missing entries if they didn't pick.
-        $query = "select g.gid, g.wid, g.h_score, g.v_score, g.v_id, g.v_spread, g.h_id, g.h_spread, p.uid, p.winnerpick_id, p.pick_v_score, p.pick_h_score, g.gamestart, w.wk_points from {pickem_picks} p inner join {pickem_games} g on p.gid = g.gid inner join {pickem_weeks} w on w.wid = g.wid where p.lid=:lid and w.wid=:wid order by g.wid, g.gamestart, g.gid";
+        $query = "select g.gid, g.wid, g.h_score, g.v_score, g.v_id, g.v_spread, g.h_id, g.h_spread, p.uid, p.winnerpick_id, p.pick_v_score, p.pick_h_score, p.confidence, g.gamestart, w.wk_points from {pickem_picks} p inner join {pickem_games} g on p.gid = g.gid inner join {pickem_weeks} w on w.wid = g.wid where p.lid=:lid and w.wid=:wid order by g.wid, g.gamestart, g.gid";
         $result = db_query($query, array(':lid' => $league->lid, ':wid' => $week_id));
       }
 
@@ -1108,6 +1126,24 @@ function build_picks_week_form($form, &$
       $h_team_label .= '&nbsp;&nbsp;' . ($game->h_spread>0?'+'.$game->h_spread:$game->h_spread);
     }
 
+	// Add single confidence level box
+	if ($league->scoring_engine->features['with_confidence'] == 1) {
+      $form['games'][$gid]['confidence'] = array(
+        '#type' => 'textfield',
+        '#size' => 4,
+        '#default_value' => isset($picks[$gid][$account->uid]->confidence) ? $picks[$gid][$account->uid]->confidence : '',
+        '#field_suffix' => '',
+        '#prefix' => '<div class="pickem-team-score-diff-' . variable_get('pickem_prefer_long_team_names', 0) . '">'
+      );
+	  
+	  // Disable the input boxes depending on league pick_lock setting.
+      if (($league->pick_lock == PICKEM_PICK_LOCK_WEEK && $week->week_started == 1) ||
+          ($league->pick_lock == PICKEM_PICK_LOCK_GAME && $game->game_started == 1)) {
+        $form['games'][$gid]['confidence']['#attributes']['readonly'] = 'readonly';
+        $form['games'][$gid]['confidence']['#attributes']['disabled'] = 'disabled';
+		}
+	}
+
 
     // Add the pick score boxes.
     if ($league->scoring_engine->features['pick_score'] == 1 ||
diff -rupN pickem-1.x new/pickem.info pickem/pickem.info
--- pickem-1.x new/pickem.info	2012-08-21 16:51:58.000000000 -0700
+++ pickem/pickem.info	2012-08-21 17:24:33.864419400 -0700
@@ -11,5 +11,6 @@ files[] = scoring/pickem.scoring.win.los
 files[] = scoring/pickem.scoring.point.spread.inc
 files[] = scoring/pickem.scoring.score.diff.inc
 files[] = pickem_google_chart_tools.inc
+files[] = scoring/pickem.scoring.confidence.inc
 
 configure = admin/pickem
diff -rupN pickem-1.x new/pickem.module pickem/pickem.module
--- pickem-1.x new/pickem.module	2012-08-21 16:51:58.000000000 -0700
+++ pickem/pickem.module	2012-08-21 17:24:56.505325700 -0700
@@ -22,8 +22,9 @@ define('PICKEM_TYPE_WIN_LOSS', 0);
 define('PICKEM_TYPE_SPREAD', 1);
 define('PICKEM_TYPE_SCORE_DIFF', 2);
 define('PICKEM_TYPE_WIN_LOSS_TIEBREAK', 3);
+define('PICKEM_TYPE_CONFIDENCE', 4);
 // Keep a count so we can load all of them.
-define('PICKEM_SCORING_ENGINE_COUNT', 4);
+define('PICKEM_SCORING_ENGINE_COUNT', 5);
 
 // Include utility functions.
 require_once 'pickem.inc';
diff -rupN pickem-1.x new/pickem.mypicks.page.inc pickem/pickem.mypicks.page.inc
--- pickem-1.x new/pickem.mypicks.page.inc	2012-08-21 16:51:58.000000000 -0700
+++ pickem/pickem.mypicks.page.inc	2012-08-21 17:32:12.213597400 -0700
@@ -87,6 +87,9 @@ function theme_mypicks_week_form($variab
 
   $header = array();
   $header[] = t('Matchup');
+  if ($league->scoring_engine->features['with_confidence'] == 1) {
+	$header[] = t('Confidence');
+  }
   $header[] = t('Status');
   $header[] = t('Time(%pickem-timezone)', array('%pickem-timezone' => $timezone));
 
@@ -109,6 +112,16 @@ function theme_mypicks_week_form($variab
       $cols[] = drupal_render($form['games'][$gid]['pick_v_score']) . drupal_render($form['games'][$gid]['pick_h_score']);
     }
 
+	// Render confidence boxen
+	if ($league->scoring_engine->features['with_confidence'] == 1) {
+		// If the confidence value is not valid, turn it red
+		if($form['games'][$gid]['confidence']['#default_value'] == '') {
+			$cols[] = array('data'=>drupal_render($form['games'][$gid]['confidence']), 'class'=>'no-pick');
+		} else {
+			$cols[] = array('data'=>drupal_render($form['games'][$gid]['confidence']));
+		}
+	}
+
     $cols[] = drupal_render($form['games'][$gid]['pick_status']);
 
     $cols[] = drupal_render($form['games'][$gid]['gamestart']);
@@ -145,17 +158,41 @@ function mypicks_week_form_submit($form,
 
   foreach ($save_for_these_leagues as $l) {
     // Only save for league using the same scoring system.
-    $success = FALSE;
+    $success = TRUE;
     if ($l->scoring_type == $league->scoring_type) {
+	  $confValues = array();
       foreach ($form_state['values']['games'] as $gid => $pick) {
         $pick['gid'] = $gid;
-        if (set_pick($user->uid, $l, $pick, 'user') == TRUE) {
-          $success = TRUE;
+        if (set_pick($user->uid, $l, $pick, 'user') != TRUE) {
+          $success = FALSE;
         }
       }
+      //Checking confidence values
+		
+	  if (($league->scoring_engine->features['with_confidence'] == 1)) {
+		// Change the confidence value to NULL if the confidence value is out of range
+		if($pick['confidence'] < 1 || $pick['confidence'] > count($form_state['values']['games'])) {
+			$pick['confidence'] = NULL;
+			$success = FALSE;
+		} else {
+			// Each confidence value can only be used once.  Change to NULL any duplicates
+			foreach( $confValues as $testVal ) {
+				if($testVal == $pick['confidence']) {
+					$pick['confidence'] = NULL;
+					$success = FALSE;
+				}
+			}
+			array_push($confValues, $pick['confidence']);
+		}
+	  }
+
+
       if ($success) {
         drupal_set_message(t('The picks have been saved for league <i>%league</i>.', array('%league' => $l->name)));
-      }
+      } else {
+	    drupal_set_message(t('Picks were not fully saved.  Check for errors below'), 'error');
+	  }
+
     }
   }
 
diff -rupN pickem-1.x new/pickem.pick.summary.page.inc pickem/pickem.pick.summary.page.inc
--- pickem-1.x new/pickem.pick.summary.page.inc	2012-08-21 16:51:58.000000000 -0700
+++ pickem/pickem.pick.summary.page.inc	2012-08-21 17:52:29.413845400 -0700
@@ -114,8 +114,9 @@ function pick_summary_page($league, $wee
 
         if ( !isset($tot['weeks'][$week->wid]['games'][$gid]) ) {
           $user_form['picks'][$gid]['points'] = 0;
-        }
-        else {
+        } else if ( $picks[$gid][$uid]->confidence ) {
+		  $user_form['picks'][$gid]['points'] = $picks[$gid][$uid]->confidence;
+		} else {
           $user_form['picks'][$gid]['points'] = $tot['weeks'][$week->wid]['games'][$gid];
         }
       }
@@ -182,11 +183,16 @@ function theme_pick_summary($variables)
     foreach (element_children($theme_data['games']) as $gid) {
       if ( $i >= $page * $items_per_page && $i < ($page+1) * $items_per_page ) {
         $class = '';
+		// Turn the boxes red or green.  Green if you made a pick and picked correctly or the game tied.
+		// Red if you didn't make a pick or got it wrong.
         if ( $theme_data['games'][$gid]['winner'] == 0 ) {
           $class = 'not-played';
-        } elseif ( $theme_data['users'][$key]['picks'][$gid]['points'] > 0 ) {
+        } elseif ( $theme_data['users'][$key]['picks'][$gid]['picked'] != -1 &&
+	            ($theme_data['games'][$gid]['winner'] == $theme_data['users'][$key]['picks'][$gid]['picked'] ||
+               $theme_data['games'][$gid]['winner'] == -1 ) ) {
           $class = 'win';
-        } elseif ( $theme_data['users'][$key]['picks'][$gid]['points'] == 0 ) {
+        } elseif ( $theme_data['users'][$key]['picks'][$gid]['picked'] != $theme_data['games'][$gid]['winner'] ||
+		            $theme_data['users'][$key]['picks'][$gid]['picked'] == -1) {
           $class = 'loss';
         }
 
diff -rupN pickem-1.x new/scoring/pickem.scoring.confidence.inc pickem/scoring/pickem.scoring.confidence.inc
--- pickem-1.x new/scoring/pickem.scoring.confidence.inc	1969-12-31 16:00:00.000000000 -0800
+++ pickem/scoring/pickem.scoring.confidence.inc	2012-08-19 11:12:57.039758600 -0700
@@ -0,0 +1,86 @@
+<?php
+/**
+ * @file
+ *
+ * Provides the object definitions used by the confidence scoring engine.
+ */
+
+/**
+ * Definition for confidence scoring engine.
+ */
+class pickem_scoring_confidence implements pickem_scoring_engine_interface {
+
+  // Properties
+  private $props = array();
+
+  // Magic overload method.
+  public function __get($name) {
+    if (array_key_exists($name, $this->props)) {
+      return $this->props[$name];
+    }
+    trigger_error('Undefined property via __get(): ' . $name, E_USER_NOTICE);
+    return NULL;
+  }
+
+  // Constructor
+  public function __construct() {
+    $this->props = array(
+      'key' => PICKEM_TYPE_CONFIDENCE,
+      'name' => t('Pick the winner with a confidence score'),
+      'description' => t('Simply pick the winner of each game and assign a confidence point value.  Assign each game below a value starting at 1 and ending with the number of games that week.  Each number must be used once and only once.  Give a 1 to the game you are least confident about and the maximum value to the game you expect to be a blowout.  If you win the game, you get the points.'),
+      'features' => array('pick'=>1, 'pick_score'=>0, 'with_spread'=>0, 'with_last_weekly_score'=>0, 'with_confidence'=>1),
+    );
+  }
+
+  /**
+   * Calculate user totals for this scoring system.
+   *
+   * @param $totals
+   *   A deep array to store user totals (from get_user_totals() in pickem.inc)
+   * @param $row
+   *   A row object consisting of game and pick data (from get_user_totals() in pickem.inc)
+   * @return
+   *   NULL
+   */
+  function update_totals(&$totals=FALSE, &$game=FALSE) {
+	
+    if (isset($game->h_score) && isset($game->v_score)) {
+      $totals[$game->uid]['weeks'][$game->wid]['games'][$game->gid] = 0;
+
+      // They didn't pick, although there shouldn't be a record in the database then.
+      if (empty($game->winnerpick_id)) {
+        return;
+      }
+
+      // They picked the home winner.
+      else if ($game->h_score > $game->v_score && $game->winnerpick_id == $game->h_id) {
+		
+        $totals[$game->uid]['weeks'][$game->wid]['games'][$game->gid] = $game->confidence;
+        $totals[$game->uid]['weeks'][$game->wid]['total'] += $game->confidence;
+        $totals[$game->uid]['total'] += $game->confidence;
+      }
+
+      // They picked the visitor winner.
+      else if ($game->v_score > $game->h_score && $game->winnerpick_id == $game->v_id) {
+        $totals[$game->uid]['weeks'][$game->wid]['games'][$game->gid] = $game->confidence;
+        $totals[$game->uid]['weeks'][$game->wid]['total'] += $game->confidence;
+        $totals[$game->uid]['total'] += $game->confidence;
+      }
+
+      // Tie
+      else if ($game->v_score == $game->h_score && $game->h_score <> "") {
+        $totals[$game->uid]['weeks'][$game->wid]['games'][$game->gid] = $game->confidence;
+        $totals[$game->uid]['weeks'][$game->wid]['total'] += $game->confidence;
+        $totals[$game->uid]['total'] += $game->confidence;
+      }
+    }
+  }
+
+  function update_totals_final(&$totals=FALSE) {
+
+  }
+
+}
+
+
+
diff -rupN pickem-1.x new/scoring/pickem.scoring.point.spread.inc pickem/scoring/pickem.scoring.point.spread.inc
--- pickem-1.x new/scoring/pickem.scoring.point.spread.inc	2012-08-21 16:51:58.000000000 -0700
+++ pickem/scoring/pickem.scoring.point.spread.inc	2012-08-21 17:33:40.210130200 -0700
@@ -28,7 +28,7 @@ class pickem_scoring_point_spread implem
       'key' => PICKEM_TYPE_SPREAD,
       'name' => t('Pick the winner with point spread'),
       'description' => t('Pick the winner of each game based on point spread.'),
-      'features' => array('pick'=>1, 'pick_score'=>0, 'with_spread'=>1, 'with_last_weekly_score'=>0),
+      'features' => array('pick'=>1, 'pick_score'=>0, 'with_spread'=>1, 'with_last_weekly_score'=>0, 'with_confidence'=>0),
     );
   }
 
diff -rupN pickem-1.x new/scoring/pickem.scoring.score.diff.inc pickem/scoring/pickem.scoring.score.diff.inc
--- pickem-1.x new/scoring/pickem.scoring.score.diff.inc	2012-08-21 16:51:58.000000000 -0700
+++ pickem/scoring/pickem.scoring.score.diff.inc	2012-08-21 17:33:50.154429400 -0700
@@ -28,7 +28,7 @@ class pickem_scoring_score_diff implemen
       'key' => PICKEM_TYPE_SCORE_DIFF,
       'name' => t('Score differential'),
       'description' => t('Pick the score of each game and get points for correct score differential and winner.'),
-      'features' => array('pick'=>0, 'pick_score'=>1, 'with_spread'=>0, 'with_last_weekly_score'=>0),
+      'features' => array('pick'=>0, 'pick_score'=>1, 'with_spread'=>0, 'with_last_weekly_score'=>0, 'with_confidence'=>0),
     );
   }
 
diff -rupN pickem-1.x new/scoring/pickem.scoring.win.loss.inc pickem/scoring/pickem.scoring.win.loss.inc
--- pickem-1.x new/scoring/pickem.scoring.win.loss.inc	2012-08-21 16:51:58.000000000 -0700
+++ pickem/scoring/pickem.scoring.win.loss.inc	2012-08-21 17:33:58.806871000 -0700
@@ -28,7 +28,7 @@ class pickem_scoring_win_loss implements
       'key' => PICKEM_TYPE_WIN_LOSS,
       'name' => t('Pick the winner'),
       'description' => t('Simply pick the winner of each game.'),
-      'features' => array('pick'=>1, 'pick_score'=>0, 'with_spread'=>0, 'with_last_weekly_score'=>0),
+      'features' => array('pick'=>1, 'pick_score'=>0, 'with_spread'=>0, 'with_last_weekly_score'=>0, 'with_confidence'=>0),
     );
   }
 
diff -rupN pickem-1.x new/scoring/pickem.scoring.win.loss.tiebreak.inc pickem/scoring/pickem.scoring.win.loss.tiebreak.inc
--- pickem-1.x new/scoring/pickem.scoring.win.loss.tiebreak.inc	2012-08-21 16:51:58.000000000 -0700
+++ pickem/scoring/pickem.scoring.win.loss.tiebreak.inc	2012-08-21 17:34:09.612408600 -0700
@@ -28,7 +28,7 @@ class pickem_scoring_win_loss_tiebreak i
       'key' => PICKEM_TYPE_WIN_LOSS_TIEBREAK,
       'name' => t('Pick the winner with tie-breaker'),
       'description' => t('Pick the winner of each game and pick the score for the last game to break weekly ties.'),
-      'features' => array('pick'=>1, 'pick_score'=>0, 'with_spread'=>0, 'with_last_weekly_score'=>1),
+      'features' => array('pick'=>1, 'pick_score'=>0, 'with_spread'=>0, 'with_last_weekly_score'=>1, 'with_confidence'=>0),
     );
   }
 
