Index: uts.pages.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/uts/uts.pages.inc,v
retrieving revision 1.33
diff -u -r1.33 uts.pages.inc
--- uts.pages.inc	13 Oct 2008 01:27:35 -0000	1.33
+++ uts.pages.inc	27 Dec 2008 04:51:51 -0000
@@ -304,7 +304,7 @@
 
 /**
  * Dashboard displayed on admin/uts as the main landing page. If no studies
- * displays instructional video(s) otherwise summary view.
+ * displays instructional video(s), otherwise summary view.
  *
  * @return string HTML output.
  */
@@ -312,23 +312,101 @@
   drupal_add_css(drupal_get_path('module', 'uts') . '/uts.css', 'module');
   $studies = uts_studies_load();
 
-  $output = '';
+  $out = '';
   if (empty($studies)) {
-    $output .= t('<p>Running a usability test will give you valuable data to improve your application.
+    $out .= t('<p>Running a usability test will give you valuable data to improve your application.
                   Getting feedback from real people using your module is the best feedback you can get.
                   The usability testing suite allows you to easily collect exactly that data!</p>');
-    $output .= '<div class="uts-dashboard">';
-    $output .= l(t('Create study'), 'admin/uts/studies/add', array('attributes' => array('id' => 'uts-create-study')));
-    $output .= '<h3 id="uts-learn">' . t('Learn about UTS, watch a video.') . '</h3>';
-    $output .= '<embed src="http://blip.tv/play/AaXwG4mSHQ" type="application/x-shockwave-flash" width="640" height="510" allowscriptaccess="always" allowfullscreen="true"></embed>';
-    $output .= '</div>';
+    $out .= '<div class="uts-dashboard">';
+    $out .= l(t('Create study'), 'admin/uts/studies/add', array('attributes' => array('id' => 'uts-create-study')));
+    $out .= '<h3 id="uts-learn">' . t('Learn about UTS, watch a video.') . '</h3>';
+    $out .= '<embed src="http://blip.tv/play/AaXwG4mSHQ" type="application/x-shockwave-flash" width="640" height="510" allowscriptaccess="always" allowfullscreen="true"></embed>';
+    $out .= '</div>';
   }
   else {
-    // TODO #307518.
-    $output .= 'TODO: http://drupal.org/node/307518';
+    $out .= '<div id="uts-dashboard-summary">';
+    $out .= uts_dashboard_studies($studies);
+    $out .= '</div>';
+    $out .= '<div id="uts-dashboard-sidebar">';
+    $out .= l(t('Create study'), 'admin/uts/studies/add', array('attributes' => array('id' => 'uts-create-study')));
+
+    // Get list
+//    $out .= menu_tree();
+    $out .= '</div>';
   }
 
-  return $output;
+  return $out;
+}
+
+function uts_dashboard_studies($studies) {
+  $header = array(t('Name'), t('Participants'), t('Task progress'));
+  $rows = array();
+
+  // Cycle through studies to generate summary table.
+  foreach ($studies as $study) {
+    list($completed_overal, $completed, $session_count) = uts_dashboard_studies_completion_results($study);
+
+    // Generate
+    $row = array();
+    $row[] = l($study->title, 'node/' . $study->nid);
+    $row[] = t('@count / @required', array('@count' => $session_count, '@required' => $study->participant_count));
+
+    $row[] = theme('uts_progress', $completed_overal, $session_count);
+
+    $rows[] = $row;
+  }
+
+  return theme('table', $header, $rows);
+}
+
+function uts_dashboard_studies_completion_results($study) {
+  $sessions = uts_session_load_all($study->nid);
+
+  // Get the number of sessions that completed each task.
+  $tasks = uts_tasks_load($study->nid);
+
+  // Initialize all completion results to 0.
+  $completed_overal = 0; // Overall task completion results.
+  foreach ($tasks as $task) {
+    $completed[$task->nid] = 0;
+  }
+
+  // Collect task complete data based on the related sessions.
+  foreach ($sessions as $session_id) {
+    $session = uts_session_load($session_id);
+
+    if ($session->complete) {
+      // Session completed all tasks.
+      $completed_overal++;
+
+      foreach ($tasks as $task) {
+        $completed[$task->nid]++;
+      }
+    }
+    else {
+      // See how far the session has progressed.
+      foreach ($tasks as $task) {
+        if ($session->current_task != $task->nid) {
+          // Made it past this task.
+          $completed[$task->nid]++;
+        }
+        else {
+          break;
+        }
+      }
+    }
+  }
+
+  return array($completed_overal, $completed, count($sessions));
+}
+
+function theme_uts_progress($progress, $total) {
+  $part = round(($progress / $total) * 100);
+  $whole = 100 - $part;
+  return '<div id="uts-dashboard-progess">' .
+           '<div id="uts-dashboard-progess-part" style="width: ' . $part . 'px;"></div>' .
+           '<div id="uts-dashboard-progess-whole" style="width: ' . $whole . 'px;"></div>' .
+         '</div>';
 }
 
 /**
Index: uts.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/uts/uts.module,v
retrieving revision 1.47
diff -u -r1.47 uts.module
--- uts.module	13 Oct 2008 01:27:35 -0000	1.47
+++ uts.module	27 Dec 2008 04:51:51 -0000
@@ -521,6 +521,9 @@
     ),
     'uts_participate_start_form_data_collection' => array(
       'arguments' => array('form' => NULL)
+    ),
+    'uts_progress' => array(
+      'arguments' => array('progress' => 0, 'total' => 100)
     )
   );
 }
Index: uts.css
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/uts/uts.css,v
retrieving revision 1.1
diff -u -r1.1 uts.css
--- uts.css	13 Oct 2008 01:27:35 -0000	1.1
+++ uts.css	27 Dec 2008 04:51:50 -0000
@@ -14,3 +14,32 @@
 h3#uts-learn {
   margin-top: 20px;
 }
+
+/* Dashboard studies
+ *******************/
+div#uts-dashboard-sidebar {
+	width: 180px;
+	float: right;
+}
+
+div#uts-dashboard-summary {
+  float: left;
+}
+
+div#uts-dashboard-progess {
+  border: 2px solid #FFFFFF;
+  height: 10px;
+}
+
+div#uts-dashboard-progess-part, div#uts-dashboard-progess-whole {
+	float: left;
+  height: 10px;
+}
+
+div#uts-dashboard-progess-part {
+  background-color: #92f86e;
+}
+
+div#uts-dashboard-progess-whole {
+  background-color: #f36161;
+}
\ No newline at end of file
