You are here

function _quiz_get_score_intervals in Quiz 6.4

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

Returns an array with sql where clauses correscponding to the options in the score filters.

Return value

$changed_timestamps array of timestamps and sql filters

See also

_quiz_questions_browser_form()

1 call to _quiz_get_score_intervals()
_quiz_results_mr_prepare_filter in ./quiz.admin.inc
Returns sql and parameters to be added in join, where and group clauses in the _quiz_results_mr_data_provider select statement

File

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

Code

function _quiz_get_score_intervals($quiz) {

  // Create datastructure to help create where clause in the sql for the changed filter...
  $scores = array(
    NULL,
    '>= qnp.pass_rate',
    '< qnp.pass_rate',
    '= 100',
    '> 90',
    '> 75',
    '> 50',
    '> 25',
    '< 90',
    '< 75',
    '< 50',
    '< 25',
  );
  foreach ($scores as $key => &$val) {
    if ($val == NULL) {
      continue;
    }
    $scores[$key] = ' AND score ' . $val;
  }
  return $scores;
}