Oops, fix off-by-one in safetyquestion report editor fields

This commit is contained in:
james 2011-03-15 00:08:59 +00:00
parent 41085e2c46
commit 3b2bf0a0e2

View File

@ -38,11 +38,13 @@ function reports_students_numstudents(&$report, $field, $text)
function report_student_safety_question(&$report, $field, $text) {
/* Field is 'question_x', users_id is passed in $text */
$q_ord = substr($field, 15);
/* Field is 'safetyquestion_x', registration_id is passed in $text */
$q_ord = intval(substr($field, 15));
$conferences_id = $report['conferences_id'];
$regid = $text;
//safetyquestions start counting 1-10, but when we LIMIT, we need to index on 0-9
$q_ord--;
$q=mysql_query("SELECT safetyquestions.question,
safety.answer
@ -53,8 +55,6 @@ function report_student_safety_question(&$report, $field, $text) {
$r=mysql_fetch_object($q);
return $r->answer;
}