I need an API for taking tests and storing tests. Mongo, redis, and other technologies can wait. When I get to the point of saving test results, I will need Mongo. Probably for test purposes will just have a non-sharded mongo.
Kivy is already setup. This will get the basic API going which involves MySQL, and python API for kivy to use, and the programs kivy makes. We redo the kivy installation steps in the virtual environment for another Linux user account.
- virtualenv --no-site-packages kivyinstall
- . kivyinstall/bin/activate
- mkdir Kivy
- cd Kivy
- pip install Cython==0.21.2
- pip install kivy
- pip install git+https://github.com/kivy/buildozer.git@master
- pip install git+https://github.com/kivy/plyer.git@master
- pip install -U pygments docutils
- ln -s ~/kivyinstall/share/kivy-examples kivy-examples
- rm /usr/bin/kivy # as root
- ln -s /home/test/kivyinstall/bin/python /usr/bin/kivy # as root
- # bulldozr already installed
- buildozer init
- buildozer android debug deploy run
- git clone git://github.com/kivy/python-for-android
- cd python-for-android/
- ./distribute.sh -m "pil openssl kivy"
- Ran into an error. seomthing with the wrong version of bulldozer.
- Ha to rebuild bulldozer as root, remove the builddozer spec file in the normal account, reinit bulldozer
- Will try this again... takes a while to compile everything
- This no longer works, redoing python for andriod from the readme file
- pip install git+https://github.com/kivy/python-for-android.git
- python-for-android recipes # test
- python-for-android or p4a are the executables
- pip install jnius
Now making the program....
Learning is first:- http://kivy.org/docs/tutorials/firstwidget.html
- http://kivy.org/docs/tutorials-index.html
- https://www.quora.com/What-is-a-good-resource-to-learn-Kivy
- http://kivy.org/docs/gettingstarted/intro.html
- http://kivy.org/docs/gettingstarted/examples.html
Stuff to use:
- http://kivy.org/docs/api-kivy.uix.textinput.html
- Inputting an answer.
- http://kivy.org/docs/api-kivy.uix.togglebutton.html
- For selecting which answer is correct.
- http://kivy.org/docs/api-kivy.uix.scrollview.html
- http://kivy.org/docs/api-kivy.uix.tabbedpanel.html
- one window for account
- one for selecting test
- one for taking test
- one for making test
- http://kivy.org/docs/api-kivy.clock.html -- timed tests
- http://kivy.org/docs/api-kivy.core.camera.html -- cusotmize account
I have to do the stuff below. First thing, I have to download docs:
- Download docs and install on local laptop: DONE
- python
- apache
- kivy documentation
- https://github.com/kivy/kivy/blob/master/doc/README.md
- apt-get install python-sphinx
- pip install sphinxcontrib-blockdiag sphinxcontrib-seqdiag
- pip install sphinxcontrib-actdiag sphinxcontrib-nwdiag
- download: https://github.com/kivy/kivy/archive/master.zip
- unzip kivy-master.zip
- apt-get install Cython
- cd kivy-master
- make html --- this failed damn it, skipping. have\ pdf version.
Understand:
- Widget: http://kivy.org/docs/api-kivy.uix.widget.html
- Everything is a widget.
- Layouts: http://kivy.org/docs/gettingstarted/layouts.html
- Objects:
- http://kivy.org/docs/api-kivy.html
- Focus on the kivy.uix.* modules. Those are the objects, like buttons.
- Bubble: http://kivy.org/docs/api-kivy.uix.bubble.html
- Button: http://kivy.org/docs/api-kivy.uix.button.html
- Action Bar: http://kivy.org/docs/api-kivy.uix.actionbar.html
- To me this is a slicker way of making the top bar.
- anchor lauout: http://kivy.org/docs/api-kivy.uix.anchorlayout.html
- Useful for positioning basic stuff.
- box layout:http://kivy.org/docs/api-kivy.uix.boxlayout.html
- Useful for adding buttons.
- Checkbox: http://kivy.org/docs/api-kivy.uix.checkbox.html
- Useful for choosing one answer.
- Drop down list: http://kivy.org/docs/api-kivy.uix.widget.html
- Probably the default for the top bar.
- Image: http://kivy.org/docs/api-kivy.uix.image.html
- not immediately useful, but for later.
- popup: http://kivy.org/docs/api-kivy.uix.image.html
- Messages to popup. Can be buttons.
- screens: http://kivy.org/docs/api-kivy.uix.screenmanager.html
- Have 4 screen initially, for different purposes, and they don't die. You should switch between them.
- When looking at examples, do this:
- Download exmaples
- cd kivy-examples/demo/showcase
- kivy main.py
- Look at the root source code. This example is the one example to get you started. There are lots of other good examples, but this one is great.
- Make API
- http://kivy.org/docs/api-index.html
- Login API
- Connection to MySQL database
- add session
- add cookie
- Connect to mongo to save results
DOING