forked from science-ation/science-ation
Oops, fix off-by-one in safetyquestion report editor fields
This commit is contained in:
parent
41085e2c46
commit
3b2bf0a0e2
@ -38,11 +38,13 @@ function reports_students_numstudents(&$report, $field, $text)
|
|||||||
function report_student_safety_question(&$report, $field, $text) {
|
function report_student_safety_question(&$report, $field, $text) {
|
||||||
|
|
||||||
|
|
||||||
/* Field is 'question_x', users_id is passed in $text */
|
/* Field is 'safetyquestion_x', registration_id is passed in $text */
|
||||||
$q_ord = substr($field, 15);
|
$q_ord = intval(substr($field, 15));
|
||||||
$conferences_id = $report['conferences_id'];
|
$conferences_id = $report['conferences_id'];
|
||||||
$regid = $text;
|
$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,
|
$q=mysql_query("SELECT safetyquestions.question,
|
||||||
safety.answer
|
safety.answer
|
||||||
@ -53,8 +55,6 @@ function report_student_safety_question(&$report, $field, $text) {
|
|||||||
|
|
||||||
$r=mysql_fetch_object($q);
|
$r=mysql_fetch_object($q);
|
||||||
return $r->answer;
|
return $r->answer;
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user