diff options
Diffstat (limited to 'docs')
-rw-r--r-- | docs/source/api.rst | 26 | ||||
-rw-r--r-- | docs/source/conf.py | 1 | ||||
-rw-r--r-- | docs/source/index.rst | 27 |
3 files changed, 46 insertions, 8 deletions
diff --git a/docs/source/api.rst b/docs/source/api.rst new file mode 100644 index 0000000..61469f9 --- /dev/null +++ b/docs/source/api.rst @@ -0,0 +1,26 @@ +.. _api: + +Running as an API +================= + +*Smarker* can be hosted on a server and accessed through an API. A valid docker-compose +file is in the ``API/`` directory. Since the API docker container accesses the host docker +daemon, you must pass set the host location of the ``.uploads/`` directory as the ``$UPLOADS_DIR`` +environment variable. + +.. autofunction:: app.helloworld + +.. autofunction:: app.mark + +An example CURL request could be: + +.. code-block:: bash + + curl -X POST -H "Content-Type: multipart/form-data" \ + -F "zip=@../100301654.zip" \ + -F "key=2g_yU7n1SqTODGQmpuViIAwbdbownmVDpjUl9NKkRqz" \ + -F "assessment=example" \ + -F "filedep1=@../../dependency.txt" \ + -F "dependency.txt=/dependency.txt" \ + "localhost:6970/api/mark" + diff --git a/docs/source/conf.py b/docs/source/conf.py index 5dd644b..a168856 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -13,6 +13,7 @@ import os import sys sys.path.insert(0, os.path.abspath(os.path.join("..", "..", "Smarker"))) +sys.path.insert(0, os.path.abspath(os.path.join("..", "..", "API"))) sys.path.insert(0, os.path.abspath(os.path.join("..", "..", "ExampleAssessments"))) # print(os.listdir(os.path.abspath(os.path.join("..", "..", "Smarker")))) diff --git a/docs/source/index.rst b/docs/source/index.rst index f2d7426..80fefaf 100644 --- a/docs/source/index.rst +++ b/docs/source/index.rst @@ -11,6 +11,9 @@ Setting up * Add an assessment yaml- :ref:`assessmentyaml`. * Enroll students: ``python3 Smarker/assessments.py -s 123456789,Eden,Attenborough,E.Attenborough@uea.ac.uk`` +*Smarker* can be used inside docker, see :ref:`docker` (recommended for sandboxing client code) +and through an API- see :ref:`api`. + ``smarker.py`` usage ******************** @@ -37,20 +40,28 @@ Also see :ref:`assessments` .. toctree:: :maxdepth: 2 + :caption: Setting up: + + quickstart.rst + configfile.rst + +.. toctree:: + :maxdepth: 3 + :caption: Docker: + + docker.rst + assessmentyaml.rst + api.rst + +.. toctree:: + :maxdepth: 3 :caption: Modules: reflect.rst database.rst assessments.rst + api.rst -.. toctree:: - :maxdepth: 2 - :caption: Other Pages: - - quickstart.rst - configfile.rst - docker.rst - assessmentyaml.rst Indices and tables ================== |