diff options
Diffstat (limited to 'lib/study/brresults.php')
-rw-r--r-- | lib/study/brresults.php | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/study/brresults.php b/lib/study/brresults.php index b3e1068..9bbafac 100644 --- a/lib/study/brresults.php +++ b/lib/study/brresults.php @@ -19,8 +19,10 @@ if (!($info['studyid'] != 0)) { } if ($info["bsid"] == 0) { - sql("INSERT INTO batch_study(user, batch, last_review) VALUES(" . $user['id'] . ", $batchid, 0)"); + sql("INSERT INTO batch_study(user, batch, last_review, notes_json) ". + "VALUES(" . $user['id'] . ", $batchid, 0, '{}')"); $info['bsid'] = mysql_insert_id(); + $info['notes'] = '{}'; } if (isset($_POST['results']) && isset($_POST['score'])) { @@ -28,6 +30,9 @@ if (isset($_POST['results']) && isset($_POST['score'])) { "VALUES(" . $user['id'] . ", $batchid, '" . escs(esca($_POST['results'])) . "', " . intval($_POST['score']) . ", NOW())"); sql("UPDATE batch_study SET last_review = " . mysql_insert_id() . " WHERE id = " . $info['bsid']); echo 'Saved'; +} else if (isset($_POST['notes'])) { + sql("UPDATE batch_study SET notes_json = '" . escs(esca($_POST['notes'])) . "' WHERE id = " . $info['bsid']); + echo 'Saved'; } else { echo 'Error'; } |