summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPrabhu Ramachandran2015-10-09 11:58:57 +0530
committerPrabhu Ramachandran2015-10-09 11:58:57 +0530
commit38812e177e27c4229e68a6f40394e90a5ee76efd (patch)
tree4a1997b39f0bb5fd7bc82289ad46a5629f67f93b
parentebbf135af98720f1979cd28a9108817bac385ce7 (diff)
parentf39f8e1b2b487426a38d2c69372a1f58dcaeee79 (diff)
downloadonline_test-38812e177e27c4229e68a6f40394e90a5ee76efd.tar.gz
online_test-38812e177e27c4229e68a6f40394e90a5ee76efd.tar.bz2
online_test-38812e177e27c4229e68a6f40394e90a5ee76efd.zip
Merge pull request #59 from ankitjavalkar/clean-setup
Clean setup with fixtures that are loaded by default
-rw-r--r--MANIFEST.in1
-rw-r--r--README.md263
-rw-r--r--README_production.md189
-rw-r--r--setup.py6
-rw-r--r--yaksh/docs/sample_questions.py6
-rw-r--r--yaksh/fixtures/demo_fixtures.json1
-rw-r--r--yaksh/fixtures/initial_fixtures.json1
-rw-r--r--yaksh/scripts/cli.py (renamed from yaksh/scripts/yaksh.py)18
8 files changed, 245 insertions, 240 deletions
diff --git a/MANIFEST.in b/MANIFEST.in
index dbaf299..c9a162b 100644
--- a/MANIFEST.in
+++ b/MANIFEST.in
@@ -6,3 +6,4 @@ recursive-include yaksh/demo_templates *
recursive-include yaksh/management *
recursive-include yaksh/output *
recursive-include yaksh/fixtures *
+recursive-include yaksh/docs * \ No newline at end of file
diff --git a/README.md b/README.md
index 45c3e4f..b7c6fc4 100644
--- a/README.md
+++ b/README.md
@@ -2,6 +2,8 @@ Yaksh
========
[![Build Status](https://travis-ci.org/FOSSEE/online_test.svg?branch=master)](https://travis-ci.org/FOSSEE/online_test)
+This is a Quickstart guide to help users setup a trial instance. If you wish to deploy Yaksh in a production environment here is a [Production Deployment Guide] (https://github.com/FOSSEE/online_test/blob/master/README_production.md)
+
#### Introduction
This project provides an "exam" app that lets users take an online
@@ -29,249 +31,70 @@ Quick Start
#### Installation
1. Install the yaksh
+ - For latest stable release
- pip install yaksh
+ $ pip install yaksh
+
+ - For the development version
+
+ $ pip install git+https://github.com/FOSSEE/online_test.git
1. In the terminal run
- yaksh create_demo [-p PATH] project_name
- - ```project_name``` is the desired name of the django project
- - PATH is an optional argument to specify where the django project will be installed
+ yaksh create_demo [-p PATH] [project_name]
+ - ```project_name``` is the desired name of the django project.
+ - In case a ```project_name``` is not specified, the project is initialised with the name ```yaksh_demo```
+ - PATH is an optional flag to specify where the django project will be installed
- If PATH is not provided, the project is created in the current directory
1. The script does the following;
- 1. Creates a new django project called `projectname`
- 1. Creates a new demo database
- 1. Creates two users, test moderator and test examinee
- 1. Loads demo questions
- 1. Loads demo quiz
+ 1. Creates a new django project called `project_name`
+ 1. Creates a new demo database
+ 1. Creates two users, test moderator and test examinee
+ 1. Loads demo questions
+ 1. Loads demo quiz
1. Run:
- yaksh run_demo
+ $ yaksh run_demo
1. In a new terminal run:
- sudo yaksh run_code_server
+ $ sudo yaksh run_code_server
1. Open your browser and open the URL ```http://localhost:8000/exam```
1. Login as a teacher to edit the quiz or as a student to take the quiz
- Credentials:
- - Student - Username: student | Password: student
- - Teacher - Username: teacher | Password: teacher
-
-Production Deployment
-======================
-
-#### Pre-Requisite
-
- 1. Install dependencies using
- pip install -r requirements.txt
- 1. Install MySql Server
- 1. Install Python MySql support
- 1. Install Apache Server for deployment
-
-#### Configure MySql server
-
- 1. Create a database named ``yaksh`` by following the steps below
-
- $> mysql -u root -p
- mysql> create database yaksh
-
- 1. Add a user named ```yaksh_user``` and give access to it on the database ```yaksh``` by following the steps below
-
- 1. mysql> grant usage on yaksh.* to yaksh_user@localhost identified by 'mysecretpassword';
-
- 1. mysql> grant all privileges on yaksh.* to yaksh_user@localhost;
-
- 1. Add `DATABASE_PASSWORD = 'mysecretpassword'` and `DATABASE_USER = 'yaksh_user'` to online_test/settings.py
-
-To deploy this app follow the steps below:
-
- 1. Clone this repository and cd to the cloned repo.
- git clone https://github.com/FOSSEE/online_test.git
-
- 1. Run:
- python manage.py syncdb
-
- 1. Add questions by editing the "docs/sample_questions.py" or any other file in the same format and then run the following:
-
- python manage.py load_exam docs/sample_questions.py
-
- Note that you can supply multiple Python files as arguments and all of
- those will be added to the database.
-
- 1. First run the python server provided. This ensures that the code is executed in a safe environment. Do this like so:
-
- $ sudo python yaksh/code_server.py
-
- Put this in the background once it has started since this will not
- return back the prompt. It is important that the server be running
- *before* students start attempting the exam. Using sudo is
- necessary since the server is run as the user "nobody". This runs
- on the ports configured in the settings.py file in the variable
- "SERVER_PORTS". The "SERVER_TIMEOUT" also can be changed there.
- This is the maximum time allowed to execute the submitted code.
- Note that this will likely spawn multiple processes as "nobody"
- depending on the number of server ports specified.
-
- 1. The ```wsgi.py``` script should make it
- easy to deploy this using mod_wsgi. You will need to add a line of the form:
-
- WSGIScriptAlias / "/online_test/wsgi.py"
-
- to your apache.conf. For more details see the Django docs here:
-
- https://docs.djangoproject.com/en/1.6/howto/deployment/wsgi/
-
- 1. Go to http://desired_host_or_ip:desired_port/admin
-
- 1. Login with your credentials and look at the questions and modify if
- needed. Create a new Quiz, set the date and duration or
- activate/deactivate the quiz.
-
- 1. Now ask users to login at:
-
- http://host:port/exam
-
- And you should be all set.
-
- 1. Note that the directory "output" will contain directories, one for each
- user. Users can potentially write output into these that can be used
- for checking later.
-
- 1. As Moderator user you can visit http://host/exam/monitor to view
- results and user data interactively. You could also "grade" the
- papers manually if needed.
-
- 1. You may dump the results and user data using the results2csv and
- dump_user_data commands.
-
- 1. The file docs/sample_questions.py is a template that you can use for your own questions.
-
- 1. Sometimes you might be in the situation where you are not hosted as
- "host.org/exam/" but as "host.org/foo/exam/" for whatever reason. In
- this case edit "settings.py" and set the "URL_ROOT" to the root you
- have to serve at. In the above example for "host.org/foo/exam" set
- URL_ROOT='/foo'.
-
-Development Settings
-====================
-
-To install this app follow the steps below:
-
- 1. Clone this repository and cd to the cloned repo.
- ```git clone https://github.com/FOSSEE/online_test.git```
-
- 1. Run:
-
- python manage.py syncdb
-
- 1. Add questions by editing the "docs/sample_questions.py" or any other file in the same format and then run the following:
+ Credentials:
+ - Student - Username: student | Password: student
+ - Teacher - Username: teacher | Password: teacher
- python manage.py load_exam docs/sample_questions.py
+1. User can also login to the Default Django admin using;
+ - Admin - Username: admin | Password: admin
- Note that you can supply multiple Python files as arguments and all of
- those will be added to the database.
-
- 1. First run the python server provided. This ensures that the code is executed in a safe environment. Do this like so:
-
- $ sudo python yaksh/code_server.py
-
- Put this in the background once it has started since this will not
- return back the prompt. It is important that the server be running
- *before* students start attempting the exam. Using sudo is
- necessary since the server is run as the user "nobody". This runs
- on the ports configured in the settings.py file in the variable
- "SERVER_PORTS". The "SERVER_TIMEOUT" also can be changed there.
- This is the maximum time allowed to execute the submitted code.
- Note that this will likely spawn multiple processes as "nobody"
- depending on the number of server ports specified.
-
- 1. Now, Run:
-
- python manage.py runserver <desired_ip>:<desired_port>
-
- 1. Go to http://desired_host_or_ip:desired_port/admin
-
- 1. Login with your credentials and look at the questions and modify if
- needed. Create a new Quiz, set the date and duration or
- activate/deactivate the quiz.
-
- 1. Now ask users to login at:
-
- http://host:port/exam
-
- And you should be all set.
-
- 1. Note that the directory "output" will contain directories, one for each
- user. Users can potentially write output into these that can be used
- for checking later.
-
- 1. As admin user you can visit http://host/exam/monitor to view
- results and user data interactively. You could also "grade" the
- papers manually if needed.
-
- 1. You may dump the results and user data using the results2csv and
- dump_user_data commands.
-
- 1. The file docs/sample_questions.py is a template that you can use for your own questions.
-
- 1. Sometimes you might be in the situation where you are not hosted as
- "host.org/exam/" but as "host.org/foo/exam/" for whatever reason. In
- this case edit "settings.py" and set the "URL_ROOT" to the root you
- have to serve at. In the above example for "host.org/foo/exam" set
- URL_ROOT='/foo'.
-
-Additional commands available
-==============================
-
-We provide several convenient commands for you to use:
-
- - load_exam : load questions and a quiz from a python file. See
- docs/sample_questions.py
-
- - load_questions_xml : load questions from XML file, see
- docs/sample_questions.xml use of this is deprecated in favor of
- load_exam.
-
- - results2csv : Dump the quiz results into a CSV file for further
- processing.
-
- - dump_user_data : Dump out relevalt user data for either all users or
- specified users.
-
-For more information on these do this:
-
- $ python manage.py help [command]
-
-where [command] is one of the above.
-
-
-Inspiration
-===========
+History
+=======
At FOSSEE, Nishanth had implemented a nice django based app to
-test for multiple-choice questions. I was inspired by a
-programming contest that I saw at PyCon APAC 2011. Chris Boesch, who
+test for multiple-choice questions. Prabhu Ramachandran was inspired by a
+programming contest that he saw at PyCon APAC 2011. Chris Boesch, who
administered the contest, used a nice web application
[Singpath](http://singpath.com) that he had built on top of GAE that
basically checked your Python code, live. This made it fun and interesting.
-I wanted an implementation that was not tied to GAE and decided to write
-one myself and the result is the "exam" app. The idea being that I can
-use this to test students programming skills and not have to worry about
-grading their answers myself and I can do so on my machines.
+Prabhu wanted an implementation that was not tied to GAE and hence wrote
+the initial cut of what is now 'Yaksh'. The idea being that
+anyone can use this to test students programming skills and not have to worry
+about grading their answers manually and instead do so on their machines.
+The application has since been refactored and maintained by FOSSEE Developers.
Contact
=======
For further information and support you can contact
-* Forum Link
-* Email Address
+Python Team at FOSSEE: pythonsupport@fossee.in
License
=======
@@ -282,21 +105,7 @@ information is at the bottom of this file.
Authors
=======
-Main author: Prabhu Ramachandran
-
-I gratefully acknowledge help from the following:
-
- - Nishanth Amuluru originally from FOSSEE who wrote bulk of the
- login/registration code. He wrote an initial first cut of a quiz app
- which supported only simple questions which provided motivation for
- this app. The current codebase does not share too much from his
- implementation although there are plenty of similarities.
-
- - Harish Badrinath (FOSSEE) -- who provided a first cut of the bash
- related scripts.
-
- - Srikant Patnaik and Thomas Stephen Lee, who helped deploy and test
- the code.
+ [FOSSEE Developers] (https://github.com/FOSSEE/online_test/graphs/contributors)
-Copyright (c) 2011 Prabhu Ramachandran and FOSSEE (fossee.in)
+Copyright (c) 2011 FOSSEE (fossee.in)
diff --git a/README_production.md b/README_production.md
new file mode 100644
index 0000000..c693282
--- /dev/null
+++ b/README_production.md
@@ -0,0 +1,189 @@
+Production Deployment
+======================
+
+This README provides documentation to help deploy Yaksh in a production environment. If you wish to take Yaksh on a trial run, here is a [Quickstart Guide] (https://github.com/FOSSEE/online_test/blob/master/README.md)
+
+#### Pre-Requisite
+
+ 1. Ensure [pip](https://pip.pypa.io/en/latest/installing.html) is installed
+ 1. Install dependencies using
+ pip install -r requirements.txt
+ 1. Install MySql Server
+ 1. Install Python MySql support
+ 1. Install Apache Server for deployment
+
+#### Configure MySql server
+
+ 1. Create a database named ``yaksh`` by following the steps below
+
+ $> mysql -u root -p
+ mysql> create database yaksh
+
+ 1. Add a user named ```yaksh_user``` and give access to it on the database ```yaksh``` by following the steps below
+
+ 1. mysql> grant usage on yaksh.* to yaksh_user@localhost identified by 'mysecretpassword';
+
+ 1. mysql> grant all privileges on yaksh.* to yaksh_user@localhost;
+
+ 1. Add `DATABASE_PASSWORD = 'mysecretpassword'` and `DATABASE_USER = 'yaksh_user'` to online_test/settings.py
+
+To deploy this app follow the steps below:
+
+ 1. Clone this repository and cd to the cloned repo.
+ $ git clone https://github.com/FOSSEE/online_test.git
+
+ 1. Run:
+ python manage.py syncdb
+
+ 1. Add questions by editing the "docs/sample_questions.py" or any other file in the same format and then run the following:
+
+ python manage.py load_exam docs/sample_questions.py
+
+ Note that you can supply multiple Python files as arguments and all of
+ those will be added to the database.
+
+ 1. First run the python server provided. This ensures that the code is executed in a safe environment. Do this like so:
+
+ $ sudo python yaksh/code_server.py
+
+ Put this in the background once it has started since this will not
+ return back the prompt. It is important that the server be running
+ *before* students start attempting the exam. Using sudo is
+ necessary since the server is run as the user "nobody". This runs
+ on the ports configured in the settings.py file in the variable
+ "SERVER_PORTS". The "SERVER_TIMEOUT" also can be changed there.
+ This is the maximum time allowed to execute the submitted code.
+ Note that this will likely spawn multiple processes as "nobody"
+ depending on the number of server ports specified.
+
+ 1. The ```wsgi.py``` script should make it
+ easy to deploy this using mod_wsgi. You will need to add a line of the form:
+
+ WSGIScriptAlias / "/online_test/wsgi.py"
+
+ to your apache.conf. For more details see the Django docs here:
+
+ https://docs.djangoproject.com/en/1.6/howto/deployment/wsgi/
+
+ 1. Go to http://desired_host_or_ip:desired_port/admin
+
+ 1. Login with your credentials and look at the questions and modify if
+ needed. Create a new Quiz, set the date and duration or
+ activate/deactivate the quiz.
+
+ 1. Now ask users to login at:
+
+ http://host:port/exam
+
+ And you should be all set.
+
+ 1. Note that the directory "output" will contain directories, one for each
+ user. Users can potentially write output into these that can be used
+ for checking later.
+
+ 1. As Moderator user you can visit http://host/exam/monitor to view
+ results and user data interactively. You could also "grade" the
+ papers manually if needed.
+
+ 1. You may dump the results and user data using the results2csv and
+ dump_user_data commands.
+
+ 1. The file docs/sample_questions.py is a template that you can use for your own questions.
+
+ 1. Sometimes you might be in the situation where you are not hosted as
+ "host.org/exam/" but as "host.org/foo/exam/" for whatever reason. In
+ this case edit "settings.py" and set the "URL_ROOT" to the root you
+ have to serve at. In the above example for "host.org/foo/exam" set
+ URL_ROOT='/foo'.
+
+Development Settings
+====================
+
+To install this app follow the steps below:
+
+ 1. Clone this repository and cd to the cloned repo.
+ ```$ git clone https://github.com/FOSSEE/online_test.git```
+
+ 1. Run:
+
+ python manage.py syncdb
+
+ 1. Add questions by editing the "docs/sample_questions.py" or any other file in the same format and then run the following:
+
+ python manage.py load_exam docs/sample_questions.py
+
+ Note that you can supply multiple Python files as arguments and all of
+ those will be added to the database.
+
+ 1. First run the python server provided. This ensures that the code is executed in a safe environment. Do this like so:
+
+ $ sudo python yaksh/code_server.py
+
+ Put this in the background once it has started since this will not
+ return back the prompt. It is important that the server be running
+ *before* students start attempting the exam. Using sudo is
+ necessary since the server is run as the user "nobody". This runs
+ on the ports configured in the settings.py file in the variable
+ "SERVER_PORTS". The "SERVER_TIMEOUT" also can be changed there.
+ This is the maximum time allowed to execute the submitted code.
+ Note that this will likely spawn multiple processes as "nobody"
+ depending on the number of server ports specified.
+
+ 1. Now, Run:
+
+ python manage.py runserver <desired_ip>:<desired_port>
+
+ 1. Go to http://desired_host_or_ip:desired_port/admin
+
+ 1. Login with your credentials and look at the questions and modify if
+ needed. Create a new Quiz, set the date and duration or
+ activate/deactivate the quiz.
+
+ 1. Now ask users to login at:
+
+ http://host:port/exam
+
+ And you should be all set.
+
+ 1. Note that the directory "output" will contain directories, one for each
+ user. Users can potentially write output into these that can be used
+ for checking later.
+
+ 1. As admin user you can visit http://host/exam/monitor to view
+ results and user data interactively. You could also "grade" the
+ papers manually if needed.
+
+ 1. You may dump the results and user data using the results2csv and
+ dump_user_data commands.
+
+ 1. The file docs/sample_questions.py is a template that you can use for your own questions.
+
+ 1. Sometimes you might be in the situation where you are not hosted as
+ "host.org/exam/" but as "host.org/foo/exam/" for whatever reason. In
+ this case edit "settings.py" and set the "URL_ROOT" to the root you
+ have to serve at. In the above example for "host.org/foo/exam" set
+ URL_ROOT='/foo'.
+
+Additional commands available
+==============================
+
+We provide several convenient commands for you to use:
+
+ - load_exam : load questions and a quiz from a python file. See
+ docs/sample_questions.py
+
+ - load_questions_xml : load questions from XML file, see
+ docs/sample_questions.xml use of this is deprecated in favor of
+ load_exam.
+
+ - results2csv : Dump the quiz results into a CSV file for further
+ processing.
+
+ - dump_user_data : Dump out relevalt user data for either all users or
+ specified users.
+
+For more information on these do this:
+
+ $ python manage.py help [command]
+
+where [command] is one of the above.
diff --git a/setup.py b/setup.py
index 839607e..2cff24f 100644
--- a/setup.py
+++ b/setup.py
@@ -7,8 +7,8 @@ README = open(os.path.join(os.path.dirname(__file__), 'README.md')).read()
os.chdir(os.path.normpath(os.path.join(os.path.abspath(__file__), os.pardir)))
setup(
- name='django-exam',
- author='python team at IIT Bombay',
+ name='yaksh',
+ author='Python Team at FOSSEE, IIT Bombay',
author_email='python@fossee.in',
version='0.1',
packages=find_packages(),
@@ -16,7 +16,7 @@ setup(
license='BSD License',
entry_points = {
'console_scripts': [
- 'yaksh = yaksh.scripts.yaksh:main',
+ 'yaksh = yaksh.scripts.cli:main',
],
},
description='A django app to conduct online tests.',
diff --git a/yaksh/docs/sample_questions.py b/yaksh/docs/sample_questions.py
index 60f32cb..3f0c36e 100644
--- a/yaksh/docs/sample_questions.py
+++ b/yaksh/docs/sample_questions.py
@@ -78,7 +78,7 @@ None of the above
] #list of questions ends here
-quiz = Quiz(start_date=date.today(),
- duration=10,
- description='Basic Python Quiz 1'
+quiz = Quiz(duration=10,
+ description='Basic Python Quiz 1',
+ time_between_attempts=0
)
diff --git a/yaksh/fixtures/demo_fixtures.json b/yaksh/fixtures/demo_fixtures.json
new file mode 100644
index 0000000..517c2b2
--- /dev/null
+++ b/yaksh/fixtures/demo_fixtures.json
@@ -0,0 +1 @@
+[{"pk": 1, "model": "contenttypes.contenttype", "fields": {"model": "logentry", "name": "log entry", "app_label": "admin"}}, {"pk": 2, "model": "contenttypes.contenttype", "fields": {"model": "permission", "name": "permission", "app_label": "auth"}}, {"pk": 3, "model": "contenttypes.contenttype", "fields": {"model": "group", "name": "group", "app_label": "auth"}}, {"pk": 4, "model": "contenttypes.contenttype", "fields": {"model": "user", "name": "user", "app_label": "auth"}}, {"pk": 5, "model": "contenttypes.contenttype", "fields": {"model": "contenttype", "name": "content type", "app_label": "contenttypes"}}, {"pk": 6, "model": "contenttypes.contenttype", "fields": {"model": "session", "name": "session", "app_label": "sessions"}}, {"pk": 7, "model": "contenttypes.contenttype", "fields": {"model": "profile", "name": "profile", "app_label": "yaksh"}}, {"pk": 8, "model": "contenttypes.contenttype", "fields": {"model": "question", "name": "question", "app_label": "yaksh"}}, {"pk": 9, "model": "contenttypes.contenttype", "fields": {"model": "answer", "name": "answer", "app_label": "yaksh"}}, {"pk": 10, "model": "contenttypes.contenttype", "fields": {"model": "quiz", "name": "quiz", "app_label": "yaksh"}}, {"pk": 11, "model": "contenttypes.contenttype", "fields": {"model": "questionpaper", "name": "question paper", "app_label": "yaksh"}}, {"pk": 12, "model": "contenttypes.contenttype", "fields": {"model": "questionset", "name": "question set", "app_label": "yaksh"}}, {"pk": 13, "model": "contenttypes.contenttype", "fields": {"model": "answerpaper", "name": "answer paper", "app_label": "yaksh"}}, {"pk": 14, "model": "contenttypes.contenttype", "fields": {"model": "assignmentupload", "name": "assignment upload", "app_label": "yaksh"}}, {"pk": 15, "model": "contenttypes.contenttype", "fields": {"model": "testcase", "name": "test case", "app_label": "yaksh"}}, {"pk": 16, "model": "contenttypes.contenttype", "fields": {"model": "tag", "name": "Tag", "app_label": "taggit"}}, {"pk": 17, "model": "contenttypes.contenttype", "fields": {"model": "taggeditem", "name": "Tagged Item", "app_label": "taggit"}}, {"pk": "kib1c35u44b8wleb8nltl5rkqwcsyrhr", "model": "sessions.session", "fields": {"expire_date": "2015-10-22T06:05:31.984", "session_data": "YjY4Mjg0Yjg4ZGI3OTIxYjc5NTY5NmNkMTgyMTQ4MGRmOTViNDRmOTp7fQ=="}}, {"pk": 1, "model": "yaksh.question", "fields": {"ref_code_path": "", "description": "\nWrite a function called <code>fact</code> which takes a single integer argument\n(say <code>n</code>) and returns the factorial of the number. \nFor example:<br/>\n<code>fact(3) -> 6</code>\n", "language": "python", "summary": "Factorial", "snippet": "def fact(num):", "active": true, "points": 2.0, "test": "\nassert fact(0) == 1\nassert fact(5) == 120\n", "type": "code", "options": ""}}, {"pk": 2, "model": "yaksh.question", "fields": {"ref_code_path": "", "description": "Create a simple function called <code>sqr</code> which takes a single \nargument and returns the square of the argument. For example: <br/>\n<code>sqr(3) -> 9</code>.", "language": "python", "summary": "Simple function", "snippet": "def sqr(num):", "active": true, "points": 1.0, "test": "\nimport math\nassert sqr(3) == 9\nassert abs(sqr(math.sqrt(2)) - 2.0) < 1e-14 \n ", "type": "code", "options": ""}}, {"pk": 3, "model": "yaksh.question", "fields": {"ref_code_path": "", "description": "Write a shell script which takes two arguments on the\n command line and prints the sum of the two on the output.", "language": "bash", "summary": "Bash addition", "snippet": "#!/bin/bash", "active": true, "points": 2.0, "test": "docs/sample.sh\ndocs/sample.args\n", "type": "code", "options": ""}}, {"pk": 4, "model": "yaksh.question", "fields": {"ref_code_path": "", "description": "What is the largest integer value that can be represented\nin Python?", "language": "python", "summary": "Size of integer in Python", "snippet": "", "active": true, "points": 0.5, "test": "No Limit", "type": "mcq", "options": "No Limit\n2**32\n2**32 - 1\nNone of the above\n"}}, {"pk": 1, "model": "yaksh.quiz", "fields": {"start_date_time": "2015-10-08T05:54:38", "description": "Demo Quiz", "language": "python", "time_between_attempts": 0, "attempts_allowed": -1, "pass_criteria": 40.0, "active": true, "end_date_time": "2199-01-01T00:00:00", "duration": 20, "prerequisite": null}}, {"pk": 1, "model": "yaksh.questionpaper", "fields": {"shuffle_questions": false, "total_marks": 5.5, "fixed_questions": [1, 2, 3, 4], "random_questions": [], "quiz": 1}}, {"pk": 1, "model": "taggit.tag", "fields": {"name": "Python", "slug": "python"}}, {"pk": 2, "model": "taggit.tag", "fields": {"name": "function", "slug": "function"}}, {"pk": 3, "model": "taggit.tag", "fields": {"name": "factorial", "slug": "factorial"}}, {"pk": 4, "model": "taggit.tag", "fields": {"name": "", "slug": ""}}, {"pk": 5, "model": "taggit.tag", "fields": {"name": "mcq", "slug": "mcq"}}, {"pk": 1, "model": "taggit.taggeditem", "fields": {"tag": 1, "content_type": 8, "object_id": 1}}, {"pk": 2, "model": "taggit.taggeditem", "fields": {"tag": 2, "content_type": 8, "object_id": 1}}, {"pk": 3, "model": "taggit.taggeditem", "fields": {"tag": 3, "content_type": 8, "object_id": 1}}, {"pk": 4, "model": "taggit.taggeditem", "fields": {"tag": 1, "content_type": 8, "object_id": 2}}, {"pk": 5, "model": "taggit.taggeditem", "fields": {"tag": 2, "content_type": 8, "object_id": 2}}, {"pk": 6, "model": "taggit.taggeditem", "fields": {"tag": 4, "content_type": 8, "object_id": 3}}, {"pk": 7, "model": "taggit.taggeditem", "fields": {"tag": 5, "content_type": 8, "object_id": 4}}, {"pk": 1, "model": "auth.permission", "fields": {"codename": "add_logentry", "name": "Can add log entry", "content_type": 1}}, {"pk": 2, "model": "auth.permission", "fields": {"codename": "change_logentry", "name": "Can change log entry", "content_type": 1}}, {"pk": 3, "model": "auth.permission", "fields": {"codename": "delete_logentry", "name": "Can delete log entry", "content_type": 1}}, {"pk": 4, "model": "auth.permission", "fields": {"codename": "add_permission", "name": "Can add permission", "content_type": 2}}, {"pk": 5, "model": "auth.permission", "fields": {"codename": "change_permission", "name": "Can change permission", "content_type": 2}}, {"pk": 6, "model": "auth.permission", "fields": {"codename": "delete_permission", "name": "Can delete permission", "content_type": 2}}, {"pk": 7, "model": "auth.permission", "fields": {"codename": "add_group", "name": "Can add group", "content_type": 3}}, {"pk": 8, "model": "auth.permission", "fields": {"codename": "change_group", "name": "Can change group", "content_type": 3}}, {"pk": 9, "model": "auth.permission", "fields": {"codename": "delete_group", "name": "Can delete group", "content_type": 3}}, {"pk": 10, "model": "auth.permission", "fields": {"codename": "add_user", "name": "Can add user", "content_type": 4}}, {"pk": 11, "model": "auth.permission", "fields": {"codename": "change_user", "name": "Can change user", "content_type": 4}}, {"pk": 12, "model": "auth.permission", "fields": {"codename": "delete_user", "name": "Can delete user", "content_type": 4}}, {"pk": 13, "model": "auth.permission", "fields": {"codename": "add_contenttype", "name": "Can add content type", "content_type": 5}}, {"pk": 14, "model": "auth.permission", "fields": {"codename": "change_contenttype", "name": "Can change content type", "content_type": 5}}, {"pk": 15, "model": "auth.permission", "fields": {"codename": "delete_contenttype", "name": "Can delete content type", "content_type": 5}}, {"pk": 16, "model": "auth.permission", "fields": {"codename": "add_session", "name": "Can add session", "content_type": 6}}, {"pk": 17, "model": "auth.permission", "fields": {"codename": "change_session", "name": "Can change session", "content_type": 6}}, {"pk": 18, "model": "auth.permission", "fields": {"codename": "delete_session", "name": "Can delete session", "content_type": 6}}, {"pk": 19, "model": "auth.permission", "fields": {"codename": "add_profile", "name": "Can add profile", "content_type": 7}}, {"pk": 20, "model": "auth.permission", "fields": {"codename": "change_profile", "name": "Can change profile", "content_type": 7}}, {"pk": 21, "model": "auth.permission", "fields": {"codename": "delete_profile", "name": "Can delete profile", "content_type": 7}}, {"pk": 22, "model": "auth.permission", "fields": {"codename": "add_question", "name": "Can add question", "content_type": 8}}, {"pk": 23, "model": "auth.permission", "fields": {"codename": "change_question", "name": "Can change question", "content_type": 8}}, {"pk": 24, "model": "auth.permission", "fields": {"codename": "delete_question", "name": "Can delete question", "content_type": 8}}, {"pk": 25, "model": "auth.permission", "fields": {"codename": "add_answer", "name": "Can add answer", "content_type": 9}}, {"pk": 26, "model": "auth.permission", "fields": {"codename": "change_answer", "name": "Can change answer", "content_type": 9}}, {"pk": 27, "model": "auth.permission", "fields": {"codename": "delete_answer", "name": "Can delete answer", "content_type": 9}}, {"pk": 28, "model": "auth.permission", "fields": {"codename": "add_quiz", "name": "Can add quiz", "content_type": 10}}, {"pk": 29, "model": "auth.permission", "fields": {"codename": "change_quiz", "name": "Can change quiz", "content_type": 10}}, {"pk": 30, "model": "auth.permission", "fields": {"codename": "delete_quiz", "name": "Can delete quiz", "content_type": 10}}, {"pk": 31, "model": "auth.permission", "fields": {"codename": "add_questionpaper", "name": "Can add question paper", "content_type": 11}}, {"pk": 32, "model": "auth.permission", "fields": {"codename": "change_questionpaper", "name": "Can change question paper", "content_type": 11}}, {"pk": 33, "model": "auth.permission", "fields": {"codename": "delete_questionpaper", "name": "Can delete question paper", "content_type": 11}}, {"pk": 34, "model": "auth.permission", "fields": {"codename": "add_questionset", "name": "Can add question set", "content_type": 12}}, {"pk": 35, "model": "auth.permission", "fields": {"codename": "change_questionset", "name": "Can change question set", "content_type": 12}}, {"pk": 36, "model": "auth.permission", "fields": {"codename": "delete_questionset", "name": "Can delete question set", "content_type": 12}}, {"pk": 37, "model": "auth.permission", "fields": {"codename": "add_answerpaper", "name": "Can add answer paper", "content_type": 13}}, {"pk": 38, "model": "auth.permission", "fields": {"codename": "change_answerpaper", "name": "Can change answer paper", "content_type": 13}}, {"pk": 39, "model": "auth.permission", "fields": {"codename": "delete_answerpaper", "name": "Can delete answer paper", "content_type": 13}}, {"pk": 40, "model": "auth.permission", "fields": {"codename": "add_assignmentupload", "name": "Can add assignment upload", "content_type": 14}}, {"pk": 41, "model": "auth.permission", "fields": {"codename": "change_assignmentupload", "name": "Can change assignment upload", "content_type": 14}}, {"pk": 42, "model": "auth.permission", "fields": {"codename": "delete_assignmentupload", "name": "Can delete assignment upload", "content_type": 14}}, {"pk": 43, "model": "auth.permission", "fields": {"codename": "add_testcase", "name": "Can add test case", "content_type": 15}}, {"pk": 44, "model": "auth.permission", "fields": {"codename": "change_testcase", "name": "Can change test case", "content_type": 15}}, {"pk": 45, "model": "auth.permission", "fields": {"codename": "delete_testcase", "name": "Can delete test case", "content_type": 15}}, {"pk": 46, "model": "auth.permission", "fields": {"codename": "add_tag", "name": "Can add Tag", "content_type": 16}}, {"pk": 47, "model": "auth.permission", "fields": {"codename": "change_tag", "name": "Can change Tag", "content_type": 16}}, {"pk": 48, "model": "auth.permission", "fields": {"codename": "delete_tag", "name": "Can delete Tag", "content_type": 16}}, {"pk": 49, "model": "auth.permission", "fields": {"codename": "add_taggeditem", "name": "Can add Tagged Item", "content_type": 17}}, {"pk": 50, "model": "auth.permission", "fields": {"codename": "change_taggeditem", "name": "Can change Tagged Item", "content_type": 17}}, {"pk": 51, "model": "auth.permission", "fields": {"codename": "delete_taggeditem", "name": "Can delete Tagged Item", "content_type": 17}}, {"pk": 1, "model": "auth.group", "fields": {"name": "moderator", "permissions": [25, 26, 27, 37, 38, 39, 40, 41, 42, 19, 20, 21, 22, 23, 24, 31, 32, 33, 34, 35, 36, 28, 29, 30, 43, 44, 45]}}, {"pk": 1, "model": "auth.user", "fields": {"username": "admin", "first_name": "", "last_name": "", "is_active": true, "is_superuser": true, "is_staff": true, "last_login": "2015-10-08T06:01:15.263", "groups": [1], "user_permissions": [], "password": "pbkdf2_sha256$12000$qartiEZkS5K0$wP0uhbdYEcuvRXAveA2geMUcknL11UzwL+TS2r2pL2I=", "email": "admin@admin.com", "date_joined": "2015-10-08T05:51:13"}}, {"pk": 2, "model": "auth.user", "fields": {"username": "student", "first_name": "Student", "last_name": "Yaksh", "is_active": true, "is_superuser": false, "is_staff": false, "last_login": "2015-10-08T06:05:29.551", "groups": [], "user_permissions": [], "password": "pbkdf2_sha256$12000$iRBPv5gvit8o$xKheYrWGGL4c3WN/F7j5UlRkmjAy9hx1BWWhdhd9uh0=", "email": "student@yaksh.xyz", "date_joined": "2015-10-08T05:55:56.956"}}, {"pk": 3, "model": "auth.user", "fields": {"username": "teacher", "first_name": "Teacher", "last_name": "Yaksh", "is_active": true, "is_superuser": false, "is_staff": false, "last_login": "2015-10-08T06:01:51.536", "groups": [1], "user_permissions": [], "password": "pbkdf2_sha256$12000$J6BkGV3t0Ajz$Q0LPr2588cYNBjWsw+PyY+Kzc4FcrWojtZek5iZ4LA8=", "email": "teacher@yaksh.xyz", "date_joined": "2015-10-08T05:57:52"}}, {"pk": 1, "model": "yaksh.profile", "fields": {"institute": "Demo Institute", "department": "Demo Department", "roll_number": "1", "user": 2, "position": "Student"}}, {"pk": 2, "model": "yaksh.profile", "fields": {"institute": "Demo Institute", "department": "Demo Department", "roll_number": "2", "user": 3, "position": "Teacher"}}, {"pk": 1, "model": "admin.logentry", "fields": {"action_flag": 1, "action_time": "2015-10-08T05:58:41.912", "object_repr": "moderators", "object_id": "1", "change_message": "", "user": 1, "content_type": 3}}, {"pk": 2, "model": "admin.logentry", "fields": {"action_flag": 2, "action_time": "2015-10-08T05:59:22.724", "object_repr": "admin", "object_id": "1", "change_message": "Changed groups.", "user": 1, "content_type": 4}}, {"pk": 3, "model": "admin.logentry", "fields": {"action_flag": 2, "action_time": "2015-10-08T05:59:30.335", "object_repr": "teacher", "object_id": "3", "change_message": "Changed groups.", "user": 1, "content_type": 4}}, {"pk": 4, "model": "admin.logentry", "fields": {"action_flag": 2, "action_time": "2015-10-08T06:01:24.134", "object_repr": "moderator", "object_id": "1", "change_message": "Changed name.", "user": 1, "content_type": 3}}] \ No newline at end of file
diff --git a/yaksh/fixtures/initial_fixtures.json b/yaksh/fixtures/initial_fixtures.json
deleted file mode 100644
index e16b09f..0000000
--- a/yaksh/fixtures/initial_fixtures.json
+++ /dev/null
@@ -1 +0,0 @@
-[{"pk": 1, "model": "contenttypes.contenttype", "fields": {"model": "logentry", "name": "log entry", "app_label": "admin"}}, {"pk": 2, "model": "contenttypes.contenttype", "fields": {"model": "permission", "name": "permission", "app_label": "auth"}}, {"pk": 3, "model": "contenttypes.contenttype", "fields": {"model": "group", "name": "group", "app_label": "auth"}}, {"pk": 4, "model": "contenttypes.contenttype", "fields": {"model": "user", "name": "user", "app_label": "auth"}}, {"pk": 5, "model": "contenttypes.contenttype", "fields": {"model": "contenttype", "name": "content type", "app_label": "contenttypes"}}, {"pk": 6, "model": "contenttypes.contenttype", "fields": {"model": "session", "name": "session", "app_label": "sessions"}}, {"pk": 7, "model": "contenttypes.contenttype", "fields": {"model": "profile", "name": "profile", "app_label": "exam"}}, {"pk": 8, "model": "contenttypes.contenttype", "fields": {"model": "question", "name": "question", "app_label": "exam"}}, {"pk": 9, "model": "contenttypes.contenttype", "fields": {"model": "answer", "name": "answer", "app_label": "exam"}}, {"pk": 10, "model": "contenttypes.contenttype", "fields": {"model": "quiz", "name": "quiz", "app_label": "exam"}}, {"pk": 11, "model": "contenttypes.contenttype", "fields": {"model": "questionpaper", "name": "question paper", "app_label": "exam"}}, {"pk": 12, "model": "contenttypes.contenttype", "fields": {"model": "questionset", "name": "question set", "app_label": "exam"}}, {"pk": 13, "model": "contenttypes.contenttype", "fields": {"model": "answerpaper", "name": "answer paper", "app_label": "exam"}}, {"pk": 14, "model": "contenttypes.contenttype", "fields": {"model": "assignmentupload", "name": "assignment upload", "app_label": "exam"}}, {"pk": 15, "model": "contenttypes.contenttype", "fields": {"model": "testcase", "name": "test case", "app_label": "exam"}}, {"pk": 16, "model": "contenttypes.contenttype", "fields": {"model": "tag", "name": "Tag", "app_label": "taggit"}}, {"pk": 17, "model": "contenttypes.contenttype", "fields": {"model": "taggeditem", "name": "Tagged Item", "app_label": "taggit"}}, {"pk": "3tcbtzy1umsaf1zesqbsprjm2bw7w1gi", "model": "sessions.session", "fields": {"expire_date": "2015-07-08T12:52:42.395", "session_data": "ZjM0OGNlZmQxYzgzM2U4ZGJlNGZkYzE3MDdmYzY5NDMzMmVlMzdmYjp7Il9hdXRoX3VzZXJfYmFja2VuZCI6ImRqYW5nby5jb250cmliLmF1dGguYmFja2VuZHMuTW9kZWxCYWNrZW5kIiwiX2F1dGhfdXNlcl9pZCI6MX0="}}, {"pk": 1, "model": "exam.question", "fields": {"ref_code_path": "", "description": "\r\nWrite a function called <code>fact</code> which takes a single integer argument\r\n(say <code>n</code>) and returns the factorial of the number. \r\nFor example:<br/>\r\n<code>fact(3) -> 6</code>\r\n", "language": "python", "summary": "Factorial", "snippet": "def fact(num):", "active": true, "points": 2.0, "test": "assert fact(0) == 1\r\nassert fact(5) == 120", "type": "code", "options": ""}}, {"pk": 2, "model": "exam.question", "fields": {"ref_code_path": "", "description": "Create a simple function called <code>sqr</code> which takes a single \r\nargument and returns the square of the argument. For example: <br/>\r\n<code>sqr(3) -> 9</code>.", "language": "python", "summary": "Simple function", "snippet": "def sqr(num):", "active": true, "points": 1.0, "test": "import math\r\nassert sqr(3) == 9\r\nassert abs(sqr(math.sqrt(2)) - 2.0) < 1e-14", "type": "code", "options": ""}}, {"pk": 3, "model": "exam.question", "fields": {"ref_code_path": "docs/sample.sh, docs/sample.args", "description": "Write a shell script which takes two arguments on the\r\n command line and prints the sum of the two on the output.", "language": "bash", "summary": "Bash addition", "snippet": "#!/bin/bash", "active": true, "points": 2.0, "test": "", "type": "code", "options": ""}}, {"pk": 4, "model": "exam.question", "fields": {"ref_code_path": "", "description": "What is the largest integer value that can be represented\r\nin Python?", "language": "python", "summary": "Size of integer in Python", "snippet": "", "active": true, "points": 0.5, "test": "No Limit", "type": "mcq", "options": "No Limit\r\n2**32\r\n2**32 - 1\r\nNone of the above\r\n"}}, {"pk": 1, "model": "exam.quiz", "fields": {"description": "Demo Quiz", "language": "C", "time_between_attempts": 0, "pass_criteria": 2.0, "active": true, "attempts_allowed": -1, "duration": 30, "start_date": "2015-06-24", "prerequisite": null}}, {"pk": 1, "model": "exam.questionpaper", "fields": {"shuffle_questions": true, "total_marks": 5.5, "fixed_questions": [1, 2, 3, 4], "random_questions": [], "quiz": 1}}, {"pk": 1, "model": "taggit.tag", "fields": {"name": "Python", "slug": "python"}}, {"pk": 2, "model": "taggit.tag", "fields": {"name": "function", "slug": "function"}}, {"pk": 3, "model": "taggit.tag", "fields": {"name": "factorial", "slug": "factorial"}}, {"pk": 4, "model": "taggit.tag", "fields": {"name": "", "slug": ""}}, {"pk": 5, "model": "taggit.tag", "fields": {"name": "mcq", "slug": "mcq"}}, {"pk": 8, "model": "taggit.taggeditem", "fields": {"tag": 1, "content_type": 8, "object_id": 1}}, {"pk": 9, "model": "taggit.taggeditem", "fields": {"tag": 2, "content_type": 8, "object_id": 1}}, {"pk": 10, "model": "taggit.taggeditem", "fields": {"tag": 3, "content_type": 8, "object_id": 1}}, {"pk": 11, "model": "taggit.taggeditem", "fields": {"tag": 1, "content_type": 8, "object_id": 2}}, {"pk": 12, "model": "taggit.taggeditem", "fields": {"tag": 2, "content_type": 8, "object_id": 2}}, {"pk": 13, "model": "taggit.taggeditem", "fields": {"tag": 5, "content_type": 8, "object_id": 4}}, {"pk": 1, "model": "auth.permission", "fields": {"codename": "add_logentry", "name": "Can add log entry", "content_type": 1}}, {"pk": 2, "model": "auth.permission", "fields": {"codename": "change_logentry", "name": "Can change log entry", "content_type": 1}}, {"pk": 3, "model": "auth.permission", "fields": {"codename": "delete_logentry", "name": "Can delete log entry", "content_type": 1}}, {"pk": 4, "model": "auth.permission", "fields": {"codename": "add_permission", "name": "Can add permission", "content_type": 2}}, {"pk": 5, "model": "auth.permission", "fields": {"codename": "change_permission", "name": "Can change permission", "content_type": 2}}, {"pk": 6, "model": "auth.permission", "fields": {"codename": "delete_permission", "name": "Can delete permission", "content_type": 2}}, {"pk": 7, "model": "auth.permission", "fields": {"codename": "add_group", "name": "Can add group", "content_type": 3}}, {"pk": 8, "model": "auth.permission", "fields": {"codename": "change_group", "name": "Can change group", "content_type": 3}}, {"pk": 9, "model": "auth.permission", "fields": {"codename": "delete_group", "name": "Can delete group", "content_type": 3}}, {"pk": 10, "model": "auth.permission", "fields": {"codename": "add_user", "name": "Can add user", "content_type": 4}}, {"pk": 11, "model": "auth.permission", "fields": {"codename": "change_user", "name": "Can change user", "content_type": 4}}, {"pk": 12, "model": "auth.permission", "fields": {"codename": "delete_user", "name": "Can delete user", "content_type": 4}}, {"pk": 13, "model": "auth.permission", "fields": {"codename": "add_contenttype", "name": "Can add content type", "content_type": 5}}, {"pk": 14, "model": "auth.permission", "fields": {"codename": "change_contenttype", "name": "Can change content type", "content_type": 5}}, {"pk": 15, "model": "auth.permission", "fields": {"codename": "delete_contenttype", "name": "Can delete content type", "content_type": 5}}, {"pk": 16, "model": "auth.permission", "fields": {"codename": "add_session", "name": "Can add session", "content_type": 6}}, {"pk": 17, "model": "auth.permission", "fields": {"codename": "change_session", "name": "Can change session", "content_type": 6}}, {"pk": 18, "model": "auth.permission", "fields": {"codename": "delete_session", "name": "Can delete session", "content_type": 6}}, {"pk": 19, "model": "auth.permission", "fields": {"codename": "add_profile", "name": "Can add profile", "content_type": 7}}, {"pk": 20, "model": "auth.permission", "fields": {"codename": "change_profile", "name": "Can change profile", "content_type": 7}}, {"pk": 21, "model": "auth.permission", "fields": {"codename": "delete_profile", "name": "Can delete profile", "content_type": 7}}, {"pk": 22, "model": "auth.permission", "fields": {"codename": "add_question", "name": "Can add question", "content_type": 8}}, {"pk": 23, "model": "auth.permission", "fields": {"codename": "change_question", "name": "Can change question", "content_type": 8}}, {"pk": 24, "model": "auth.permission", "fields": {"codename": "delete_question", "name": "Can delete question", "content_type": 8}}, {"pk": 25, "model": "auth.permission", "fields": {"codename": "add_answer", "name": "Can add answer", "content_type": 9}}, {"pk": 26, "model": "auth.permission", "fields": {"codename": "change_answer", "name": "Can change answer", "content_type": 9}}, {"pk": 27, "model": "auth.permission", "fields": {"codename": "delete_answer", "name": "Can delete answer", "content_type": 9}}, {"pk": 28, "model": "auth.permission", "fields": {"codename": "add_quiz", "name": "Can add quiz", "content_type": 10}}, {"pk": 29, "model": "auth.permission", "fields": {"codename": "change_quiz", "name": "Can change quiz", "content_type": 10}}, {"pk": 30, "model": "auth.permission", "fields": {"codename": "delete_quiz", "name": "Can delete quiz", "content_type": 10}}, {"pk": 31, "model": "auth.permission", "fields": {"codename": "add_questionpaper", "name": "Can add question paper", "content_type": 11}}, {"pk": 32, "model": "auth.permission", "fields": {"codename": "change_questionpaper", "name": "Can change question paper", "content_type": 11}}, {"pk": 33, "model": "auth.permission", "fields": {"codename": "delete_questionpaper", "name": "Can delete question paper", "content_type": 11}}, {"pk": 34, "model": "auth.permission", "fields": {"codename": "add_questionset", "name": "Can add question set", "content_type": 12}}, {"pk": 35, "model": "auth.permission", "fields": {"codename": "change_questionset", "name": "Can change question set", "content_type": 12}}, {"pk": 36, "model": "auth.permission", "fields": {"codename": "delete_questionset", "name": "Can delete question set", "content_type": 12}}, {"pk": 37, "model": "auth.permission", "fields": {"codename": "add_answerpaper", "name": "Can add answer paper", "content_type": 13}}, {"pk": 38, "model": "auth.permission", "fields": {"codename": "change_answerpaper", "name": "Can change answer paper", "content_type": 13}}, {"pk": 39, "model": "auth.permission", "fields": {"codename": "delete_answerpaper", "name": "Can delete answer paper", "content_type": 13}}, {"pk": 40, "model": "auth.permission", "fields": {"codename": "add_assignmentupload", "name": "Can add assignment upload", "content_type": 14}}, {"pk": 41, "model": "auth.permission", "fields": {"codename": "change_assignmentupload", "name": "Can change assignment upload", "content_type": 14}}, {"pk": 42, "model": "auth.permission", "fields": {"codename": "delete_assignmentupload", "name": "Can delete assignment upload", "content_type": 14}}, {"pk": 43, "model": "auth.permission", "fields": {"codename": "add_testcase", "name": "Can add test case", "content_type": 15}}, {"pk": 44, "model": "auth.permission", "fields": {"codename": "change_testcase", "name": "Can change test case", "content_type": 15}}, {"pk": 45, "model": "auth.permission", "fields": {"codename": "delete_testcase", "name": "Can delete test case", "content_type": 15}}, {"pk": 46, "model": "auth.permission", "fields": {"codename": "add_tag", "name": "Can add Tag", "content_type": 16}}, {"pk": 47, "model": "auth.permission", "fields": {"codename": "change_tag", "name": "Can change Tag", "content_type": 16}}, {"pk": 48, "model": "auth.permission", "fields": {"codename": "delete_tag", "name": "Can delete Tag", "content_type": 16}}, {"pk": 49, "model": "auth.permission", "fields": {"codename": "add_taggeditem", "name": "Can add Tagged Item", "content_type": 17}}, {"pk": 50, "model": "auth.permission", "fields": {"codename": "change_taggeditem", "name": "Can change Tagged Item", "content_type": 17}}, {"pk": 51, "model": "auth.permission", "fields": {"codename": "delete_taggeditem", "name": "Can delete Tagged Item", "content_type": 17}}, {"pk": 1, "model": "auth.group", "fields": {"name": "moderator", "permissions": [25, 26, 27, 37, 38, 39, 40, 41, 42, 19, 20, 21, 22, 23, 24, 31, 32, 33, 34, 35, 36, 28, 29, 30, 43, 44, 45]}}, {"pk": 1, "model": "auth.user", "fields": {"username": "admin", "first_name": "", "last_name": "", "is_active": true, "is_superuser": true, "is_staff": true, "last_login": "2015-06-24T12:52:42.246", "groups": [1], "user_permissions": [], "password": "pbkdf2_sha256$12000$cm9G5GLAN5TA$hmAKSYEUGjgicK/JJPYlB3BiROfv6FLJqhw/slAQIqU=", "email": "admin@admin.com", "date_joined": "2015-06-24T12:47:31"}}, {"pk": 2, "model": "auth.user", "fields": {"username": "teacher", "first_name": "Teacher", "last_name": "Demo", "is_active": true, "is_superuser": false, "is_staff": false, "last_login": "2015-06-24T12:50:42", "groups": [1], "user_permissions": [], "password": "pbkdf2_sha256$12000$RVSJsXu5jmkK$TfcRzV2LPFpEpv/shnlPG1CxWK6D6HovprqE+1neuqk=", "email": "teacher@teacher.com", "date_joined": "2015-06-24T12:50:40"}}, {"pk": 3, "model": "auth.user", "fields": {"username": "student", "first_name": "Student", "last_name": "Demo", "is_active": true, "is_superuser": false, "is_staff": false, "last_login": "2015-06-24T12:51:41.470", "groups": [], "user_permissions": [], "password": "pbkdf2_sha256$12000$jdwsvOoiB4UH$G+iAJR0nse50jxyNd+V/IATLrTra/FtaL+R1Uat0ewE=", "email": "student@student.com", "date_joined": "2015-06-24T12:51:40.477"}}, {"pk": 1, "model": "exam.profile", "fields": {"institute": "Teacher Institute", "department": "Teacher Department", "roll_number": "12345", "user": 2, "position": "Teacher"}}, {"pk": 2, "model": "exam.profile", "fields": {"institute": "Student Institute", "department": "Student Department", "roll_number": "54321", "user": 3, "position": "Student"}}, {"pk": 1, "model": "admin.logentry", "fields": {"action_flag": 1, "action_time": "2015-06-24T12:49:40.282", "object_repr": "moderator", "object_id": "1", "change_message": "", "user": 1, "content_type": 3}}, {"pk": 2, "model": "admin.logentry", "fields": {"action_flag": 2, "action_time": "2015-06-24T12:52:08.691", "object_repr": "admin", "object_id": "1", "change_message": "Changed groups.", "user": 1, "content_type": 4}}, {"pk": 3, "model": "admin.logentry", "fields": {"action_flag": 2, "action_time": "2015-06-24T12:52:17.144", "object_repr": "teacher", "object_id": "2", "change_message": "Changed groups.", "user": 1, "content_type": 4}}] \ No newline at end of file
diff --git a/yaksh/scripts/yaksh.py b/yaksh/scripts/cli.py
index 4360d1b..79523f9 100644
--- a/yaksh/scripts/yaksh.py
+++ b/yaksh/scripts/cli.py
@@ -20,13 +20,15 @@ TEMPLATE_DIR = path.join(PARENT_DIR, 'demo_templates')
def main():
#Parse command-line to obtain the arguments and/or options
# create top-level parser object
- parser = argparse.ArgumentParser(prog="vimarsh")
+ parser = argparse.ArgumentParser(prog="yaksh")
subparser = parser.add_subparsers(dest="subcommand")
# create parser for the "create_demo" subcommand
create_demo_parser = subparser.add_parser("create_demo",
help="Create a new demo Django project")
create_demo_parser.add_argument("project_name", type=str,
+ default="yaksh_demo",
+ nargs="?",
help="name of demo Django project")
create_demo_parser.add_argument("-p", "--path", type=str,
help="path of demo Django project")
@@ -37,7 +39,7 @@ def main():
# create parser for the "run_code_server" subcommand
code_server_parser = subparser.add_parser("run_code_server",
- help="Initialise Vimarsh code server")
+ help="Initialise yaksh code server")
code_server_parser.add_argument("-P", "--ports", type=int, nargs='+',
help="code server ports")
@@ -65,13 +67,13 @@ def main():
else:
run_server()
-def create_demo(project_name='vimarsh_demo', project_dir=CUR_DIR):
+def create_demo(project_name='yaksh_demo', project_dir=CUR_DIR):
try:
management.call_command('startproject', project_name, project_dir)
print("Demo Django project '{0}' created at '{1}'".format(project_name,
project_dir))
except Exception, e:
- print("Error: {0}\nExiting Vimarsh Installer".format(e))
+ print("Error: {0}\nExiting yaksh Installer".format(e))
if project_dir is None:
top_dir = path.join(os.getcwd(), project_name)
@@ -80,6 +82,7 @@ def create_demo(project_name='vimarsh_demo', project_dir=CUR_DIR):
project_path = path.join(top_dir, project_name)
fixture_dir = path.join(PARENT_DIR, 'fixtures')
+ fixture_path = path.join(fixture_dir, 'demo_fixtures.json')
# Store project details
_set_project_details(project_name, top_dir)
@@ -95,12 +98,15 @@ def create_demo(project_name='vimarsh_demo', project_dir=CUR_DIR):
command = ("python ../manage.py syncdb "
"--noinput --settings={0}.demo_settings").format(project_name)
+ loaddata_command = ("python ../manage.py loaddata "
+ "--settings={0}.demo_settings {1}").format(project_name, fixture_path)
+
# Create demo_settings file
_render_demo_files(settings_template_path, settings_target_path, settings_context)
# Create demo_urls file
_render_demo_files(urls_template_path, urls_target_path)
# Run syncdb
- subprocess.call(command, shell=True)
+ subprocess.call("{0}; {1}".format(command, loaddata_command), shell=True)
def run_demo(project_name, top_dir):
with _chdir(top_dir):
@@ -114,7 +120,7 @@ def run_server():
from yaksh import code_server
code_server.main()
except Exception as e:
- print("Error: {0}\nExiting Vimarsh code server".format(e))
+ print("Error: {0}\nExiting yaksh code server".format(e))
def _set_project_details(project_name, top_dir):
file_path = path.join(SCRIPT_DIR, 'project_detail.py')