I'm looking to foster a long term relationship with a vendor to outsource some of our development work to. We've developed, and are continuing to develop, a system using python/django. I'm looking for a developer, or team, that has good experience in python and django.
This project is fairly simple. Create a method called question_new, that will save a question and its answers. Create another method which will update the question/answers based on the model details. When a question, or its respective answers, is updated, the old version should be saved and stored. Use the django reversion extension (quite well known and found on github)
Your code should be able to take in the form values from and save them to the database. in addition to this, it should be able to update the information if it gets edited, for example, if the question text changes, the question text should get updated. If a new answer is created, or removed, it should likewise be removed in the database.
The django model looks is included in the next section.
Also, I require for the code to come with test cases testing the various scenarios (creating a new question, with 2 answer options, updating the question, updating the text to 1 answer, removing 1 answer, and adding another). That is 4 test cases.
## Deliverables
django model for question and answers:
class Question([login to view URL]):
QUESTION_TYPES = (
(u'T', u'True or False'),
(u'C', u'Multiple Choice'),
(u'S', u'Multiple Select'),
(u'B', u'Fill in the Blanks'),
(u'L', u'Connect the Answers'),
(u'M', u'Manually Marked'),
)
type = [login to view URL](max_length=1, choices=QUESTION_TYPES)
text = [login to view URL](null=True, help_text="Question text which is displayed")
score = [login to view URL]()
feedback = [login to view URL](Feedback, null=True)
randomize = [login to view URL](default=1, help_text="Randomize the order of the answers for this question")
is_published = [login to view URL](default=1, help_text="If disabled this question cannot be chosen for a paper")
version = [login to view URL](default=1)
created = [login to view URL](auto_now_add=True)
def __unicode__(self):
return [login to view URL][:10]+' (id: '+str([login to view URL])+')'
class Answer([login to view URL]):
question = [login to view URL](Question)
text = [login to view URL](help_text="Answer text or id (if applicable)")
score = [login to view URL](max_digits=4,decimal_places=2)
is_published = [login to view URL](default=1,
help_text="If disabled this answer can't be selected for the related question")
sequence = [login to view URL]()
created = [login to view URL](auto_now_add=True)
modified = [login to view URL](auto_now=True)
def __unicode__(self):
return 'Answer to q '+str([login to view URL])+' is: '+[login to view URL][:20]