Coding Mental Block With Specific Django Task
I've been thinking of this for a LONG time the past few days and can't figure out with my current toolset how to implement this in Django. What I want is something that can be impl
Solution 1:
A pure django solution would be:
- create a form with three integer fields (say,
num1
,num2
andresult
) - in your view, populate
num1
andnum2
with the numbers to be added - render the form in your template (
num1
andnum2
fields should be read only) - the user enters the answer in the
result
field and submits the form - in your view, determine whether
num1 + num2 == result
- redirect to a success page if the answer is correct, otherwise redisplay the form
Post a Comment for "Coding Mental Block With Specific Django Task"