How to theme "My Results" (quiz module) tab that´s inside the user´s profile? I´m using quiz module in Drupal 7, and need to theme the output in &quot;My Results&quot; (wich is a tab in the user profile page).
Here´s the module´s function :
// THEME FUNCTIONS

/**
 * Theme the user results page.
 *
 * @param $results
 *  An array of quiz information.
 * @return
 *  Themed html.
 *
 * @ingroup themeable
 */
function theme_quiz_get_user_results($variables) {
  $results = $variables['results'];
  $rows = array();

  while (list($key, $result) = each($results)) {
    $interval = _quiz_format_duration($result['time_end'] - $result['time_start']);
    $passed = $result['score'] &gt;= $result['pass_rate'];
    $grade = $passed ? t('Passed') : t('Failed');
    $passed_class = $passed ? 'quiz-passed' : 'quiz-failed';
    if (!is_numeric($result['score'])) {
      $score = t('In progress');
    }
    elseif (!$result['is_evaluated']) {
      $score = t('Not evaluated');
    }
    else {
      if (!empty($result['pass_rate']) &amp;&amp; is_numeric($result['score'])) {
        $pre_score = '&lt;span class = &quot;' . $passed_class . '&quot;&gt;';
        $post_score = ' %&lt;br&gt;&lt;em&gt;' . $grade . '&lt;/em&gt;&lt;/span&gt;';
      }
      else {
        $post_score = ' %';
      }
      $score = $pre_score . $result['score'] . $post_score;
    }
    $rows[] = array(
      'title'       =&gt; l($result['title'], 'node/' . $result['nid']),
      'time_start'  =&gt; format_date($result['time_start'], 'short'),
      'time_end'    =&gt; ($result['time_end'] &gt; 0) ? format_date($result['time_end'], 'short') . '&lt;br /&gt;' . t('Duration :  @value', array('@value' =&gt; $interval)) : t('In Progress'),

      'score'       =&gt; $score,
      'evaluated'   =&gt; $result['is_evaluated'] ? t('Yes') : t('No'),
      'op'          =&gt; l(t('View answers'), 'user/quiz/' . $result['result_id'] . '/userresults'),
    );

  }

  if (empty($rows)) {
    return t('No @quiz results found.', array('@quiz' =&gt; QUIZ_NAME));
  }

  $header = array(
    t('@quiz Title', array('@quiz' =&gt; QUIZ_NAME)),
    t('Started'),
    t('Finished'),
    t('Score'),
    t('Evaluated'),
    t('Operation'),
  );

  $output = theme('table', array('header' =&gt; $header, 'rows' =&gt; $rows));
  $output .= '&lt;p&gt;&lt;em&gt;' . t('@quizzes that are not evaluated may have a different score and grade once evaluated.', array('@quizzes' =&gt; QUIZ_NAME)) . '&lt;/em&gt;&lt;/p&gt;';
  return $output;
}

Now, all I need is to theme the output, and maybe add some special header before the results.
I´ve tried this at my template.tpl.php file, without any success:
function mythemename_quiz_get_user_results($variables) {
print &quot;This is some information&quot;;
print &quot;&lt;div class=&quot;results&quot;&gt;&quot;;
print $variables;
print &quot;&lt;/div&gt;&quot;;
}

Now I know that print $variables; isn´t the way it should print an array, but the way to do this in Drupal 6 was this (I´ve took this code from an issue in Drupal´s forums):
function phptemplate_quiz_get_user_results($results) {
  // $results - An array of quiz results.
  // overriding statements  
  print_r($results);
}

The function´s name changed, but the process shouldn´t be similar?
Thanks for your help!
Copy and paste (and rename) the original theme function to your template.php file, than just change what you need. Remembering that $variables is an array. Use the dpm function of the devel module to look at what values are in $variables that you can use.