diff options
author | Alex AUVOLAT <alexis211@gmail.com> | 2013-08-10 17:15:22 +0200 |
---|---|---|
committer | Alex AUVOLAT <alexis211@gmail.com> | 2013-08-10 17:15:22 +0200 |
commit | 5435a0a45fdfa1bcceeb36f8531826ddc2bb3508 (patch) | |
tree | 6254e6f19ca78e394693ef22ea5393dcefc5468d /lib/study/brresults.php | |
parent | 2a748125c27c7f7c41a32a1dba14484c66dc351f (diff) | |
download | Bits-5435a0a45fdfa1bcceeb36f8531826ddc2bb3508.tar.gz Bits-5435a0a45fdfa1bcceeb36f8531826ddc2bb3508.zip |
Added possibility to add notes to studied batch items.
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'; } |