Code Monkey home page Code Monkey logo

qbank-lite's Introduction

Build StatusCoverage Status

Running

QBank runs by default with https on port 8080, with

python main.py

You can pass a different port into the arguments:

python main.py 8888

Bundling for distribution

pyinstaller main.spec

When bundled, qbank runs by default on port 8080. To change this, you need to modify the code in main.py and manually inject sys.argv[1] = <new port #> before app.run().

Running with Docker

To run this application with Docker, use the docker branch. This is because the deployed code does not use Docker. This means that the source code paths inside of a Docker container will not match the source code path outside of the container...so the master branch uses non-Docker paths to not break our deployed versions.

The docker images built with this repository use the filesystem to store data, in an unplatform-type scenario. If you want to run against MongoDB, you have to modify the image / Dockerfile / docker-compose files for that configuration.

You can find the public docker images at clixtech/qbank. To build it locally, install Docker for your OS, v17+. Then run from the project root directory.

docker build -t <image name> .

Once you have an image, you can run the code:

docker run -p 8080:8080 <image name>

And in your browser, navigate to https://localhost:8080/version to verify that the qbank service is running. There is no data as part of the image, so you will see no banks, assessments, etc.

For development purposes, where your live code edits will reflect in the browser, you can run with docker-compose:

Run this once, initially, and whenever the requirements.txt or test_requirements.txt files change:

docker-compose build

To start qbank, you can then run:

docker-compose up

And in your browser, navigate to https://localhost:8080/version to verify that the qbank service is running.

qbank-lite's People

Contributors

coleshaw avatar pwilkins avatar

Watchers

 avatar Brandon Muramatsu avatar James Cloos avatar  avatar

qbank-lite's Issues

Response form for MC not able to add choice?

[Thu Mar 09 03:01:55.930275 2017] [:error] [pid 25947:tid 140430433150720] [remote 108.7.196.29:20617]   File "/var/www/webapps/qbank-lite/utilities.py", line 142, in wrapper
[Thu Mar 09 03:01:55.930284 2017] [:error] [pid 25947:tid 140430433150720] [remote 108.7.196.29:20617]     results = func(self, *args)
[Thu Mar 09 03:01:55.930286 2017] [:error] [pid 25947:tid 140430433150720] [remote 108.7.196.29:20617]   File "/var/www/webapps/qbank-lite/assessment/assessment.py", line 1971, in POST
[Thu Mar 09 03:01:55.930288 2017] [:error] [pid 25947:tid 140430433150720] [remote 108.7.196.29:20617]     update_form = autils.update_response_form(local_data_map, response_form)
[Thu Mar 09 03:01:55.930291 2017] [:error] [pid 25947:tid 140430433150720] [remote 108.7.196.29:20617]   File "/var/www/webapps/qbank-lite/assessment/assessment_utilities.py", line 1532, in update_response_form
[Thu Mar 09 03:01:55.930293 2017] [:error] [pid 25947:tid 140430433150720] [remote 108.7.196.29:20617]     form.add_choice_id(choice)
[Thu Mar 09 03:01:55.930295 2017] [:error] [pid 25947:tid 140430433150720] [remote 108.7.196.29:20617]   File "/var/www/webapps/qbank-lite/dlkit/mongo/osid/markers.py", line 163, in __getattr__
[Thu Mar 09 03:01:55.930297 2017] [:error] [pid 25947:tid 140430433150720] [remote 108.7.196.29:20617]     raise AttributeError()
[Thu Mar 09 03:01:55.930300 2017] [:error] [pid 25947:tid 140430433150720] [remote 108.7.196.29:20617] AttributeError

Cannot add question to an existing item

If you create an item without a question, the update-item RESTful endpoint doesn't handle that case:

    mote 174.52.243.208:16465]   File "/var/www/webapps/qbank-lite/assessment.py"    , line 1317, in PUT
434 [Mon Feb 13 20:38:11.562854 2017] [:error] [pid 4246:tid 139660660987648] [re    mote 174.52.243.208:16465]     existing_question = updated_item.get_question(    )
435 [Mon Feb 13 20:38:11.562857 2017] [:error] [pid 4246:tid 139660660987648] [re    mote 174.52.243.208:16465]   File "/var/www/webapps/qbank-lite/records/fbw_dl    kit_adapters/multi_choice_questions/randomized_questions.py", line 107, in ge    t_question
436 [Mon Feb 13 20:38:11.562859 2017] [:error] [pid 4246:tid 139660660987648] [re    mote 174.52.243.208:16465]     proxy=self.my_osid_object._proxy)
437 [Mon Feb 13 20:38:11.562862 2017] [:error] [pid 4246:tid 139660660987648] [re    mote 174.52.243.208:16465]   File "/var/www/webapps/qbank-lite/dlkit/mongo/as    sessment/objects.py", line 77, in __init__
438 [Mon Feb 13 20:38:11.562864 2017] [:error] [pid 4246:tid 139660660987648] [re    mote 174.52.243.208:16465]     osid_objects.OsidObject.__init__(self, object_    name='QUESTION', **kwargs)
439 [Mon Feb 13 20:38:11.562866 2017] [:error] [pid 4246:tid 139660660987648] [re    mote 174.52.243.208:16465]   File "/var/www/webapps/qbank-lite/dlkit/mongo/os    id/objects.py", line 116, in __init__
440 [Mon Feb 13 20:38:11.562868 2017] [:error] [pid 4246:tid 139660660987648] [re    mote 174.52.243.208:16465]     self._load_records(osid_object_map['recordType    Ids'])
441 [Mon Feb 13 20:38:11.562871 2017] [:error] [pid 4246:tid 139660660987648] [re    mote 174.52.243.208:16465] TypeError: 'NoneType' object has no attribute '__g    etitem__'

Pyinstaller doesn't find imports

Pyinstaller can't find its hidden imports:

$ pyinstaller.exe main.spec
233 INFO: PyInstaller: 3.2
233 INFO: Python: 2.7.12
233 INFO: Platform: Windows-10-10.0.14393
233 INFO: UPX is not available.
233 INFO: Extending PYTHONPATH with paths
['C:\\Users\\pwilkins\\projects',
 'C:\\Users\\cjshaw\\Documents\\Projects\\CLIx\\qbank-lite']
233 INFO: checking Analysis
250 INFO: Building because hiddenimports changed
250 INFO: Initializing module dependency graph...
250 INFO: Initializing module graph hooks...
265 INFO: Analyzing hidden import '_cffi_backend'
265 INFO: Analyzing hidden import 'six'
327 INFO: Analyzing hidden import 'sympy'
3327 INFO: Processing pre-safe import module hook   _xmlplus
3452 INFO: Processing pre-find module path hook   distutils
3500 INFO: distutils: retargeting to non-venv dir 'C:\\Python27\\Lib\\distutils'
15123 INFO: Analyzing hidden import 'dlkit'
15139 ERROR: Hidden import 'dlkit' not found
15139 INFO: Analyzing hidden import 'dlkit.filesystem_adapter'
15139 ERROR: Hidden import 'dlkit.filesystem_adapter' not found
15139 INFO: Analyzing hidden import 'dlkit.filesystem_adapter.osid.managers'
and so on... 

@cjshawMIT

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.