You are here

function theme_short_answer_view_unscored in Quiz 8.4

Same name and namespace in other branches
  1. 6.6 question_types/short_answer/short_answer.admin.inc \theme_short_answer_view_unscored()
  2. 6.3 question_types/short_answer/short_answer.admin.inc \theme_short_answer_view_unscored()
  3. 6.4 question_types/short_answer/theme/short_answer.theme.inc \theme_short_answer_view_unscored()
  4. 6.5 question_types/short_answer/short_answer.admin.inc \theme_short_answer_view_unscored()
  5. 7.6 question_types/short_answer/theme/short_answer.theme.inc \theme_short_answer_view_unscored()
  6. 7 question_types/short_answer/theme/short_answer.theme.inc \theme_short_answer_view_unscored()
  7. 7.4 question_types/short_answer/theme/short_answer.theme.inc \theme_short_answer_view_unscored()

Theme the list of unscored short answer questions.

Parameters

$unscored: An array of objects with information about the unscored questions

1 theme call to theme_short_answer_view_unscored()
short_answer_view_unscored in question_types/short_answer/short_answer.admin.inc
Generate a view of all unscored short_answer questions.

File

question_types/short_answer/short_answer.theme.inc, line 14
Theme functions for short_answer.

Code

function theme_short_answer_view_unscored($variables) {
  $unscored = $variables['unscored'];
  $output = '';
  $header = array(
    t('Question'),
    t('Time Finished'),
    t('Action'),
  );
  $rows = array();
  foreach ($unscored as $item) {
    if ($item->time_end > 0) {
      $rows[] = array(
        $item->title,
        date('Y-m-d H:i', $item->time_end),
        l(t('score this response'), 'admin/config/quiz/score-short-answer/' . $item->question_vid . '/' . $item->result_id),
      );
    }
  }
  if (!empty($rows)) {
    $output .= theme('table', array(
      'header' => $header,
      'rows' => $rows,
    ));
  }
  else {
    $output .= t('There are no unscored essays.');
  }
  return $output;
}