From 3b2bf0a0e2cb74224df118be4345ac7e2eabe51b Mon Sep 17 00:00:00 2001 From: james Date: Tue, 15 Mar 2011 00:08:59 +0000 Subject: [PATCH] Oops, fix off-by-one in safetyquestion report editor fields --- admin/reports_students.inc.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/admin/reports_students.inc.php b/admin/reports_students.inc.php index 7156cc3..30cf3a3 100644 --- a/admin/reports_students.inc.php +++ b/admin/reports_students.inc.php @@ -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; - - }