From ec23188698a3ffca6141f053d930bea04e3f0c4b Mon Sep 17 00:00:00 2001 From: Graham Christensen Date: Sun, 11 Mar 2018 11:19:07 -0400 Subject: [PATCH] The log API grows new features.. --- log-api/index.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/log-api/index.php b/log-api/index.php index 8519c6c..d846f82 100644 --- a/log-api/index.php +++ b/log-api/index.php @@ -49,6 +49,14 @@ if ($handle = opendir($req)) { $d['attempts'][$attempt] = []; } $d['attempts'][$attempt]['metadata'] = $metadata; + } elseif (substr($entry, -strlen(".result.json"),strlen(".result.json")) == ".result.json") { + $metadata = json_decode(file_get_contents($req . '/' . $entry), JSON_OBJECT_AS_ARRAY); + $attempt = $metadata['attempt_id']; + if (!isset($d['attempts'][$attempt])) { + $d['attempts'][$attempt] = []; + } + $d['attempts'][$attempt]['result'] = $metadata; + } else { if (!isset($d['attempts'][$entry])) { $d['attempts'][$entry] = [];