Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mitodl/screenshot_xblock
https://github.com/mitodl/screenshot_xblock
Last synced: 6 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/mitodl/screenshot_xblock
- Owner: mitodl
- Created: 2015-06-25T13:40:33.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2024-04-16T21:00:38.000Z (8 months ago)
- Last Synced: 2024-04-17T01:15:34.602Z (8 months ago)
- Language: Python
- Size: 12.9 MB
- Stars: 0
- Watchers: 18
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Xblock screenshot api for edx-platform
##### Enable standalone xblock rendering
TO enable xblock rendering on edX platform you need to add below flag inside features list in lms.env.json
````
"ENABLE_RENDER_XBLOCK_API":true
````##### Installation
- Create virtual environment (i.e follow steps in http://docs.python-guide.org/en/latest/dev/virtualenvs/)
- Install requirments.txt
```
pip install -r requirments.txt
```
- Install phantom js
```
npm install
```
##### Running the Development Server
```
python take_screenshot.py
```
- Open url http://0.0.0.0:5000/ (In local environment)
- Add xblock url (i.e http://localhost:8000/api/xblock/v0/xblock/i4x://edX/DemoX/html/030e35c4756a4ddc8d40b95fbbfff4d4)
- Add your edX platform credentials
- Click ```Get screenshot``` and get screenshot at location output/screens/time_mili_sec.png##### Running the Development on heroku
- Follow below 2 links
https://devcenter.heroku.com/articles/getting-started-with-python#deploy-the-app
https://devcenter.heroku.com/articles/using-multiple-buildpacks-for-an-app*Note* you need 2 buildpacks i.e Nodejs and python
```
https://github.com/heroku/heroku-buildpack-python.git
https://github.com/heroku/heroku-buildpack-nodejs.git
```##### Testing
You can run tests by following command
```
python -m unittest test_take_screenshot
```
You can test coverage by following command
```
coverage run --source take_screenshot.py test_take_screenshot.py
coverage report -m take_screenshot.py
```