You are here

function _quiz_results_mr_get_hover in Quiz 8.4

Same name and namespace in other branches
  1. 6.4 quiz.admin.inc \_quiz_results_mr_get_hover()
  2. 7 quiz.admin.inc \_quiz_results_mr_get_hover()
  3. 7.4 quiz.admin.inc \_quiz_results_mr_get_hover()

Returns links to be placed on the quiz results browser.

The links will be made visible when the user hovers over them.

Parameters

$quiz: The quiz node

$rid: Result id

Return value

Html string with links.

1 call to _quiz_results_mr_get_hover()
quiz_results_manage_results_form in ./quiz.admin.inc
Form for searching after and manipulating results for a quiz

File

./quiz.admin.inc, line 2070
Administrator interface for Quiz module.

Code

function _quiz_results_mr_get_hover($quiz, $rid) {
  $to_return = array(
    l(t('view'), 'node/' . $quiz
      ->id() . '/results/' . $rid),
  );
  if (user_access('delete any quiz results') || user_access('delete results for own quiz')) {
    $to_return[] = l(t('delete'), 'admin/quiz/reports/results/' . $quiz
      ->id(), array(
      'query' => array(
        'del' => $rid,
      ),
      'attributes' => array(
        'class' => 'hover-del',
        'id' => $quiz
          ->id() . '-' . $rid . '-del',
      ),
    ));
  }
  return implode(' | ', $to_return);
}