diff options
author | Prabhu Ramachandran | 2015-03-01 10:31:18 +0530 |
---|---|---|
committer | Prabhu Ramachandran | 2015-03-01 10:31:18 +0530 |
commit | 997a7907a13b394e5ca69fadf17f5bb4d5445536 (patch) | |
tree | 4950c79bca8c99f8f83e20d314d3845aeff87423 | |
parent | 265ad4d17f481e30a84350e8eb96e72c8cedef6b (diff) | |
parent | 2c6aa7e1ec058453ce8c559fce26b3ee05d99cae (diff) | |
download | online_test-997a7907a13b394e5ca69fadf17f5bb4d5445536.tar.gz online_test-997a7907a13b394e5ca69fadf17f5bb4d5445536.tar.bz2 online_test-997a7907a13b394e5ca69fadf17f5bb4d5445536.zip |
Merge pull request #36 from prathamesh920/app_package
App package
-rw-r--r-- | LICENSE | 3 | ||||
-rw-r--r-- | MANIFEST.in | 13 | ||||
-rw-r--r-- | setup.py | 49 | ||||
-rw-r--r-- | testapp/README.rst | 41 | ||||
-rw-r--r-- | testapp/exam/admin.py | 2 | ||||
-rw-r--r-- | testapp/exam/forms.py | 2 | ||||
-rw-r--r-- | testapp/exam/management/commands/dump_user_data.py | 4 | ||||
-rw-r--r-- | testapp/exam/management/commands/load_exam.py | 2 | ||||
-rw-r--r-- | testapp/exam/management/commands/load_questions_xml.py | 2 | ||||
-rw-r--r-- | testapp/exam/management/commands/results2csv.py | 2 | ||||
-rw-r--r-- | testapp/exam/models.py | 2 | ||||
-rw-r--r-- | testapp/exam/templates/exam/design_questionpaper.html | 2 | ||||
-rw-r--r-- | testapp/exam/urls.py | 2 | ||||
-rw-r--r-- | testapp/exam/views.py | 8 |
14 files changed, 120 insertions, 14 deletions
@@ -0,0 +1,3 @@ +This is distributed under the terms of the BSD license. + +Developed by IIT Bombay, is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License. diff --git a/MANIFEST.in b/MANIFEST.in new file mode 100644 index 0000000..6775565 --- /dev/null +++ b/MANIFEST.in @@ -0,0 +1,13 @@ +include LICENSE +include README.rst +exclude testapp/production.py +exclude testapp/settings.py +exclude testapp/urls.py +exclude testapp/test_server.py +exclude testapp/manage.py +recursive-exclude testapp/myauthentication * +recursive-include testapp/exam/static * +recursive-include testapp/exam/templates * +recursive-include testapp/exam/management * +recursive-include testapp/exam/output * +recursive-include testapp/exam/fixtures * diff --git a/setup.py b/setup.py new file mode 100644 index 0000000..79efa76 --- /dev/null +++ b/setup.py @@ -0,0 +1,49 @@ +import os +from setuptools import setup, find_packages + +README = open(os.path.join(os.path.dirname(__file__), 'README.rst')).read() + +# allow setup.py to be run from any path +os.chdir(os.path.normpath(os.path.join(os.path.abspath(__file__), os.pardir))) + +link = 'git+https://github.com/prathamesh920/\ +django-taggit-autocomplete-modified.git' + +setup( + name='django-exam', + author='python team at IIT Bombay', + author_email='python@fossee.in', + version='0.1', + packages=find_packages(), + include_package_data=True, + license='BSD License', + entry_points = { + 'console_scripts': [ + 'code_server = testapp.exam.code_server:main', + ], + }, + description='A django app to conduct online tests.', + long_description=README, + install_requires=[ + 'django==1.6', + 'mysql-python==1.2.5', + 'django-taggit==0.12.2', + 'django-taggit-autocomplete-modified > 0.1.0b4', + ], + dependency_links=[link+'#egg=django_taggit_autocomplete_modified-0.2'], + classifiers=[ + 'Development Status :: 4 - Beta', + 'Environment :: Web Environment', + 'Framework :: Django', + 'Intended Audience :: Developers', + 'Intended Audience :: Education', + 'Intended Audience :: End Users/Desktop', + 'License :: OSI Approved :: BSD License', + 'Natural Language :: English', + 'Operating System :: OS Independent', + 'Programming Language :: Python', + 'Programming Language :: Python :: 2.6', + 'Programming Language :: Python :: 2.7', + 'Topic :: Internet :: WWW/HTTP :: Dynamic Content', + ], +) diff --git a/testapp/README.rst b/testapp/README.rst new file mode 100644 index 0000000..6f49d4b --- /dev/null +++ b/testapp/README.rst @@ -0,0 +1,41 @@ +=============== +Online Exam +=============== + +Online test application lets user(student) take an online programming test. +A special user called moderator can add questions, create question paper, +conduct online test and monitor the test. + + +Quick start +------------ + +1. Add "testapp.exam", "taggit" and "taggit_autocomplete_modified" apps + to your INSTALLED_APPS setting as follows:: + + INSTALLED_APPS =( + 'testapp.exam', + 'taggit', + 'taggit_autocomplete_modified', + ) + +2. In project settings, add AUTH_PROFILE_MODULE = 'testapp.exam.Profile' + You can change the testapp.exam.Profile to your desired app user profile. + +3. Include the "testapp.exam" and taggit_autocomplete_modified URL configuration + in your project urls.py as follows:: + + url(r'^exam/', include('testapp.exam.urls')), + url(r'^taggit_autocomplete_modified/', include\ + ('taggit_autocomplete_modified.urls')) + + +4. Run 'python manage.py syncdb' to create models for the new installed apps. + +5. Start the development server and visit http://localhost:8000/exam/ + +6. In exam app run code_sever command as superuser as follows:: + + $ code_server + + Note: You must have a sudo access to run the above command. diff --git a/testapp/exam/admin.py b/testapp/exam/admin.py index 8482ef9..060859a 100644 --- a/testapp/exam/admin.py +++ b/testapp/exam/admin.py @@ -1,4 +1,4 @@ -from exam.models import Question, Quiz +from testapp.exam.models import Question, Quiz from django.contrib import admin admin.site.register(Question) diff --git a/testapp/exam/forms.py b/testapp/exam/forms.py index 9bfedbe..f04fdb3 100644 --- a/testapp/exam/forms.py +++ b/testapp/exam/forms.py @@ -1,5 +1,5 @@ from django import forms -from exam.models import Profile, Quiz, Question +from testapp.exam.models import Profile, Quiz, Question from django.contrib.auth import authenticate from django.contrib.auth.models import User diff --git a/testapp/exam/management/commands/dump_user_data.py b/testapp/exam/management/commands/dump_user_data.py index ec016bb..c5537e5 100644 --- a/testapp/exam/management/commands/dump_user_data.py +++ b/testapp/exam/management/commands/dump_user_data.py @@ -5,8 +5,8 @@ from django.core.management.base import BaseCommand from django.template import Template, Context # Local imports. -from exam.views import get_user_data -from exam.models import User +from testapp.exam.views import get_user_data +from testapp.exam.models import User data_template = Template('''\ =============================================================================== diff --git a/testapp/exam/management/commands/load_exam.py b/testapp/exam/management/commands/load_exam.py index e3f72da..c4a34a3 100644 --- a/testapp/exam/management/commands/load_exam.py +++ b/testapp/exam/management/commands/load_exam.py @@ -5,7 +5,7 @@ from os.path import basename from django.core.management.base import BaseCommand # Local imports. -from exam.models import Question, Quiz +from testapp.exam.models import Question, Quiz def clear_exam(): """Deactivate all questions from the database.""" diff --git a/testapp/exam/management/commands/load_questions_xml.py b/testapp/exam/management/commands/load_questions_xml.py index 8bc2701..3e13ae1 100644 --- a/testapp/exam/management/commands/load_questions_xml.py +++ b/testapp/exam/management/commands/load_questions_xml.py @@ -8,7 +8,7 @@ import re from django.core.management.base import BaseCommand # Local imports. -from exam.models import Question +from testapp.exam.models import Question def decode_html(html_str): """Un-escape or decode HTML strings to more usable Python strings. diff --git a/testapp/exam/management/commands/results2csv.py b/testapp/exam/management/commands/results2csv.py index 2993745..1cdf8e3 100644 --- a/testapp/exam/management/commands/results2csv.py +++ b/testapp/exam/management/commands/results2csv.py @@ -7,7 +7,7 @@ from django.core.management.base import BaseCommand from django.template import Template, Context # Local imports. -from exam.models import Quiz, QuestionPaper +from testapp.exam.models import Quiz, QuestionPaper result_template = Template('''\ "name","username","rollno","email","answered","total","attempts","position",\ diff --git a/testapp/exam/models.py b/testapp/exam/models.py index 4d82783..196ee73 100644 --- a/testapp/exam/models.py +++ b/testapp/exam/models.py @@ -304,7 +304,7 @@ class AnswerPaper(models.Model): def time_left(self): """Return the time remaining for the user in seconds.""" - dt = datetime.datetime.now() - self.start_time + dt = datetime.datetime.now() - self.start_time.replace(tzinfo=None) try: secs = dt.total_seconds() except AttributeError: diff --git a/testapp/exam/templates/exam/design_questionpaper.html b/testapp/exam/templates/exam/design_questionpaper.html index 8994148..33c8b8f 100644 --- a/testapp/exam/templates/exam/design_questionpaper.html +++ b/testapp/exam/templates/exam/design_questionpaper.html @@ -165,7 +165,7 @@ select <div class="modal-header"> <h4 class="modal-title" id="myModalLabel">Cannot Save</h4> </div> - <div id = "modal_body"class="modal-body"> + <div class="modal-body"> Please select questions for your paper </div> <div class="modal-footer"> diff --git a/testapp/exam/urls.py b/testapp/exam/urls.py index 37a031d..f8a6cb8 100644 --- a/testapp/exam/urls.py +++ b/testapp/exam/urls.py @@ -1,6 +1,6 @@ from django.conf.urls import patterns, include, url -urlpatterns = patterns('exam.views', +urlpatterns = patterns('testapp.exam.views', url(r'^$', 'index'), url(r'^login/$', 'user_login'), url(r'^quizzes/$','quizlist_user'), diff --git a/testapp/exam/views.py b/testapp/exam/views.py index 7c9af6c..60dc01d 100644 --- a/testapp/exam/views.py +++ b/testapp/exam/views.py @@ -15,11 +15,11 @@ from django.views.decorators.csrf import csrf_exempt from taggit.models import Tag from itertools import chain # Local imports. -from exam.models import Quiz, Question, QuestionPaper, QuestionSet -from exam.models import Profile, Answer, AnswerPaper, User -from exam.forms import UserRegisterForm, UserLoginForm, QuizForm,\ +from testapp.exam.models import Quiz, Question, QuestionPaper, QuestionSet +from testapp.exam.models import Profile, Answer, AnswerPaper, User +from testapp.exam.forms import UserRegisterForm, UserLoginForm, QuizForm,\ QuestionForm, RandomQuestionForm -from exam.xmlrpc_clients import code_server +from testapp.exam.xmlrpc_clients import code_server from settings import URL_ROOT # The directory where user data can be saved. |