Commits

Anonymous committed d3ee8ca

Added method to grade quizzes that are based on rating scales. Sums scaled ratings

Comments (0)

Files changed (15)

 Production testing isn't necessary if we do thorough testing in the lab.: False
 Management buy-in for production testing may be easier than you think.: True
 It costs too much.: False
+
+Decision Criteria For Your App Testing Platform
+scale: 5
+questions: 10
             
     return quizzes
 
+def get_form(name, quizzes):
+    for q in quizzes:
+        if q.Name == name:
+            return q
+    raise Exception("Quiz '%s' not found in %s" % (name, [x.Name for x in quizzes]))
+
 def get_answer_key(name):
     return get_answer_keys()[name]
         
     for form in api.forms:
         print 'Quiz: %s (%s)\n' % (form.Name, form.entry_count)
 
+def grade_rating_quiz(entry, form, num_questions, scale):
+    name = form.get_field('Name')
+    email = form.get_field('Email')
+    exclude = [email.ID, 'HandshakeKey', 'DateCreated', 'FieldStructure',
+            'CreatedBy', 'EntryId', 'FormStructure', 'IP']
+    if name.ID is None:
+        exclude += [sub.ID for sub in name.SubFields]
+    else:
+        exclude += [name.ID]
+    sum = 0
+    multiplier = 100/(int(num_questions) * int(scale))
+    for field, answer in entry.items():
+        if not field in exclude:
+            sum += multiplier*int(answer[0:1].strip())
+    return sum 
+
 def process_quizzes(api, keys):
     """
     Determine which quizzes have corresponding forms and should be graded, then grade those,
                 # Only get entries created in the last N days
                 # FIXME specifiable date
                 #if datetime.datetime.strptime(entry[date_created.ID], "%Y-%m-%d %H:%M:%S") > (datetime.datetime.now() + relativedelta(weeks=-1)):
-                    grade = grade_quiz(answers, entry, form)
+                    if 'scale' in answers and 'questions' in answers:
+                        grade = grade_rating_quiz(entry, form, answers['questions'], answers['scale'])
+                    else:
+                        grade = grade_quiz(answers, entry, form)
                     print "%s scored %.2f percent on %s." % (entry[email_field.ID], grade, form.Name)
                     entry["Grade"] = grade
 

scripts/https:__soastainc.wufoo.com_api_v3_forms.json.json

-{"Forms":[{"Name":"Production Testing Myths","Description":"8 Common Myths About Testing in Production","RedirectMessage":"Great! Thanks for filling out my form!","Url":"production-testing-myths","Email":"","IsPublic":"1","Language":"english","StartDate":"2000-01-01 12:00:00","EndDate":"2030-01-01 12:00:00","EntryLimit":"0","DateCreated":"2011-12-28 22:44:06","DateUpdated":"2011-12-28 23:25:15","Hash":"m7x3s5","LinkFields":"https:\/\/soastainc.wufoo.com\/api\/v3\/forms\/m7x3s5\/fields.json","LinkEntries":"https:\/\/soastainc.wufoo.com\/api\/v3\/forms\/m7x3s5\/entries.json","LinkEntriesCount":"https:\/\/soastainc.wufoo.com\/api\/v3\/forms\/m7x3s5\/entries\/count.json"}]}
+{"Forms":[{"Name":"Decision Criteria For Your App Testing Platform","Description":null,"RedirectMessage":"Thanks for taking the Decision Criteria for Web & Mobile App Testing Platform quiz. Your results will be emailed to you shortly.","Url":"decision-criteria-for-your-app-testing-platform","Email":"","IsPublic":"1","Language":"english","StartDate":"2000-01-01 12:00:00","EndDate":"2030-01-01 12:00:00","EntryLimit":"0","DateCreated":"2011-12-28 22:44:06","DateUpdated":"2012-01-11 21:12:49","Hash":"m7x3s5","LinkFields":"https:\/\/soastainc.wufoo.com\/api\/v3\/forms\/m7x3s5\/fields.json","LinkEntries":"https:\/\/soastainc.wufoo.com\/api\/v3\/forms\/m7x3s5\/entries.json","LinkEntriesCount":"https:\/\/soastainc.wufoo.com\/api\/v3\/forms\/m7x3s5\/entries\/count.json"}]}

scripts/https:__soastainc.wufoo.com_api_v3_forms_m7x3s5_fields.json.json

-{"Fields":[{"Title":"Entry Id","Type":"text","ID":"EntryId"},{"Title":"Name","Instructions":"","IsRequired":"1","ClassNames":"","DefaultVal":"","Page":"1","SubFields":[{"DefaultVal":"","ID":"Field113","Label":"First"},{"DefaultVal":"","ID":"Field114","Label":"Last"}],"Type":"shortname","ID":"Field113"},{"Title":"Email","Instructions":"We'll send you your quiz results and explanation immediately.","IsRequired":"1","ClassNames":"","DefaultVal":"","Page":"1","Type":"email","ID":"Field112"},{"Title":"Production testing = live testing.","Instructions":"","IsRequired":"1","ClassNames":"","DefaultVal":"","Page":"1","Choices":[{"Label":"True"},{"Label":"False"}],"Type":"radio","ID":"Field101"},{"Title":"Production testing is too risky.","Instructions":"","IsRequired":"1","ClassNames":"","DefaultVal":"","Page":"1","Choices":[{"Label":"True"},{"Label":"False"}],"Type":"radio","ID":"Field102"},{"Title":"Production testing is not about breaking the site; performance testing is about baseline testing, spikes, endurance and diagnostic testing.","Instructions":"","IsRequired":"1","ClassNames":"","DefaultVal":"","Page":"1","Choices":[{"Label":"True"},{"Label":"False"}],"Type":"radio","ID":"Field103"},{"Title":"It takes too long; we're lucky to have time for QA testing.","Instructions":"","IsRequired":"1","ClassNames":"","DefaultVal":"","Page":"1","Choices":[{"Label":"True"},{"Label":"False"}],"Type":"radio","ID":"Field104"},{"Title":"The technology to do production performance testing has changed so you now have the expertise in house.","Instructions":"","IsRequired":"1","ClassNames":"","DefaultVal":"","Page":"1","Choices":[{"Label":"True"},{"Label":"False"}],"Type":"radio","ID":"Field105"},{"Title":"Production testing isn't necessary if we do thorough testing in the lab.","Instructions":"","IsRequired":"1","ClassNames":"","DefaultVal":"","Page":"1","Choices":[{"Label":"True"},{"Label":"False"}],"Type":"radio","ID":"Field106"},{"Title":"Management buy-in for production testing may be easier than you think.","Instructions":"","IsRequired":"1","ClassNames":"","DefaultVal":"","Page":"1","Choices":[{"Label":"True"},{"Label":"False"}],"Type":"radio","ID":"Field107"},{"Title":"It costs too much.","Instructions":"","IsRequired":"1","ClassNames":"","DefaultVal":"","Page":"1","Choices":[{"Label":"True"},{"Label":"False"}],"Type":"radio","ID":"Field108"},{"Title":"Date Created","Type":"date","ID":"DateCreated"},{"Title":"Created By","Type":"text","ID":"CreatedBy"},{"Title":"Last Updated","Type":"date","ID":"LastUpdated"},{"Title":"Updated By","Type":"text","ID":"UpdatedBy"}]}
+{"Fields":[{"Title":"Entry Id","Type":"text","ID":"EntryId"},{"Title":"Name","Instructions":"","IsRequired":"1","ClassNames":"","DefaultVal":"","Page":"1","SubFields":[{"DefaultVal":"","ID":"Field113","Label":"First"},{"DefaultVal":"","ID":"Field114","Label":"Last"}],"Type":"shortname","ID":"Field113"},{"Title":"Email","Instructions":"We'll send you your quiz results and explanation immediately.","IsRequired":"1","ClassNames":"","DefaultVal":"","Page":"1","Type":"email","ID":"Field112"},{"Title":"Please rate each of the following according to your organization's testing solutions.","Instructions":"","IsRequired":"1","ClassNames":"","DefaultVal":"0","Page":"1","SubFields":[{"DefaultVal":"0","ID":"Field116","Label":"1. Does your solution have the flexibility to generate load both internally and externally?"},{"DefaultVal":"0","ID":"Field117","Label":"2. Are you able to build and modify complex tests within hours?"},{"DefaultVal":"0","ID":"Field118","Label":"3. Can your test platform support dynamic web and mobile technologies and protocols?"},{"DefaultVal":"0","ID":"Field119","Label":"4. Is your test environment elastic and globally distributed?"},{"DefaultVal":"0","ID":"Field120","Label":"5. Are you able to do dynamic and fully automated test grid provisioning?"},{"DefaultVal":"0","ID":"Field121","Label":"6. Can you control test sessions to start, pause, stop, modify, re-start, and analyze?"},{"DefaultVal":"0","ID":"Field122","Label":"7. Does your solution have a single, integrated view of performance and monitoring metrics?"},{"DefaultVal":"0","ID":"Field123","Label":"8. Can you rapidly isolate performance issues in real-time at any scale?"},{"DefaultVal":"0","ID":"Field124","Label":"9. Does your test platform allow functional and load testing from lab to production?"},{"DefaultVal":"0","ID":"Field125","Label":"10. Is your test platform affordable enough for everyday testing?"}],"Choices":[{"Score":1,"Label":"1 - No, Not At All."},{"Score":2,"Label":"2"},{"Score":3,"Label":"3"},{"Score":4,"Label":"4"},{"Score":5,"Label":"5 - Yes, completely."}],"Type":"likert","ID":"Field116"},{"Title":"Date Created","Type":"date","ID":"DateCreated"},{"Title":"Created By","Type":"text","ID":"CreatedBy"},{"Title":"Last Updated","Type":"date","ID":"LastUpdated"},{"Title":"Updated By","Type":"text","ID":"UpdatedBy"}]}
     # Put strings here, like "/home/html/django_templates" or "C:/www/django/templates".
     # Always use forward slashes, even on Windows.
     # Don't forget to use absolute paths, not relative paths.
-    #'/Users/rgraham/whitetail/wufoo-quizzes/templates',
-    '/root/wufoo-consulting/wufoo-quizzes/templates',
+    '/Users/rgraham/whitetail/wufoo-quizzes/templates',
+    #'/root/wufoo-consulting/wufoo-quizzes/templates',
 )
 
 INSTALLED_APPS = (

wufoo_responder/.tests.py.swp

Binary file modified.

wufoo_responder/.tests.py.un~

Binary file modified.

wufoo_responder/.views.py.un~

Binary file modified.

wufoo_responder/__init__.pyc

Binary file modified.

wufoo_responder/models.pyc

Binary file modified.

wufoo_responder/tests.py

         'HandshakeKey': 'SoastaWufooProject',
         'IP': '99.156.89.47'}
 
-	self.soasta = { 'FieldStructure':{
-	  "Fields": [    {
-	      "Title": "Name",
-	      "Instructions": "",
-	      "IsRequired": "0",
-	      "ClassNames": "",
-	      "DefaultVal": "",
-	      "Page": "1",
-	      "SubFields": [        {
-	         "DefaultVal": "",
-	          "ID": "Field113",
-	          "Label": "First"
-	        },        {
-	          "DefaultVal": "",
-	          "ID": "Field114",
-	          "Label": "Last"
-	        }],
-	      "Type": "shortname",
-	      "ID": "Field113"
-	    },    {
-	      "Title": "Email",
-	      "Instructions": "We'll send you your quiz results and explanation immediately.",
-	      "IsRequired": "0",
-	      "ClassNames": "",
-	      "DefaultVal": "",
-	      "Page": "1",
-	      "Type": "email",
-	      "ID": "Field112"
-	    },    {
-	      "Title": "Production testing = live testing.",
-	      "Instructions": "",
-	      "IsRequired": "1",
-	      "ClassNames": "",
-	      "DefaultVal": "",
-	      "Page": "1",
-	      "Choices": [        {
-	          "Label": None
-       	 },        {
-	          "Label": None
-	        }],
-	      "Type": "radio",
-	      "ID": "Field101"
-	    },    {
-	      "Title": "Production testing is too risky.",
-	      "Instructions": "",
-	      "IsRequired": "1",
-	      "ClassNames": "",
-	      "DefaultVal": "",
-	      "Page": "1",
-	      "Choices": [        {
-	          "Label": None
-	        },        {
-	          "Label": None
-	        }],
-	      "Type": "radio",
-	      "ID": "Field102"
-	    },    {
-	      "Title": "Production testing is not about breaking the site; performance testing is about baseline testing, spikes, endurance and diagnostic testing.",
-	      "Instructions": "",
-	      "IsRequired": "1",
-	      "ClassNames": "",
-	      "DefaultVal": "",
-	      "Page": "1",
-	      "Choices": [        {
-	          "Label": None
-	        },        {
-	          "Label": None
-	        }],
-	      "Type": "radio",
-	      "ID": "Field103"
-	    },    {
-	      "Title": "It takes too long; we're lucky to have time for QA testing.",
-	      "Instructions": "",
-	      "IsRequired": "1",
-	      "ClassNames": "",
-	      "DefaultVal": "",
-	      "Page": "1",
-	      "Choices": [        {
-	          "Label": None
-	        },        {
-	          "Label": None
-	        }],
-	      "Type": "radio",
-	      "ID": "Field104"
-	    },    {
-	      "Title": "The technology to do production performance testing has changed so you now have the expertise in house.",
-	      "Instructions": "",
-	      "IsRequired": "1",
-	      "ClassNames": "",
-	      "DefaultVal": "",
-	      "Page": "1",
-	      "Choices": [        {
-	          "Label": None
-	        },        {
-	          "Label": None
-	        }],
-	      "Type": "radio",
-	      "ID": "Field105"
-	    },    {
-	      "Title": "Production testing isn't necessary if we do thorough testing in the lab.",
-	      "Instructions": "",
-	      "IsRequired": "1",
-	      "ClassNames": "",
-	      "DefaultVal": "",
-	      "Page": "1",
-	      "Choices": [        {
-	          "Label": None
-	        },        {
-	          "Label": None
-	        }],
-	      "Type": "radio",
-	      "ID": "Field106"
-	    },    {
-	      "Title": "Management buy-in for production testing may be easier than you think.",
-	      "Instructions": "",
-	      "IsRequired": "1",
-	      "ClassNames": "",
-	      "DefaultVal": "",
-	      "Page": "1",
-	      "Choices": [        {
-	          "Label": None
-	        },        {
-	          "Label": None
-	        }],
-	      "Type": "radio",
-	      "ID": "Field107"
-	    },    {
-	      "Title": "It costs too much.",
-	      "Instructions": "",
-	      "IsRequired": "1",
-	      "ClassNames": "",
-	      "DefaultVal": "",
-	      "Page": "1",
-	      "Choices": [        {
-	          "Label": None
-	        },        {
-	          "Label": None
-	        }],
-	      "Type": "radio",
-	      "ID": "Field108"
-	    }]
-	},
-	'FormStructure':	{
-	  "Name": "Production Testing Myths",
-	  "Description": "8 Common Myths About Testing in Production",
-	  "RedirectMessage": "Great! Thanks for filling out my form!",
-	  "Url": "production-testing-myths",
-	  "Email": None,
-	  "IsPublic": "1",
-	  "Language": "english",
-	  "StartDate": "2000-01-01 12:00:00",
-	  "EndDate": "2030-01-01 12:00:00",
-	  "EntryLimit": "0",
-	  "DateCreated": "2011-12-28 22:44:06",
-	  "DateUpdated": "2011-12-28 22:56:32",
-	  "Hash": "m7x3s5"
-	},
-	'Field113':	'Rob',
-	'Field114':	'Graham',
-	'Field112':	'rgraham@whitetailsoftware.com',
-	'Field101':	False,
-	'Field102':	False,
-	'Field103':	True,
-	'Field104':	True,
-	'Field105':	True,
-	'Field106':	False,
-	'Field107':	True,
-	'Field108':	False,
-	'CreatedBy':	'public',
-	'DateCreated':	'2011-12-28 23:18:12',
-	'EntryId':	2,
-	'IP':	'99.156.89.47',
-	'HandshakeKey': 'SoastaWufooProject' }
-	
+        self.soasta = { 'FieldStructure':{
+      "Fields": [    {
+          "Title": "Name",
+          "Instructions": "",
+          "IsRequired": "0",
+          "ClassNames": "",
+          "DefaultVal": "",
+          "Page": "1",
+          "SubFields": [        {
+             "DefaultVal": "",
+              "ID": "Field113",
+              "Label": "First"
+            },        {
+              "DefaultVal": "",
+              "ID": "Field114",
+              "Label": "Last"
+            }],
+          "Type": "shortname",
+          "ID": "Field113"
+        },    {
+          "Title": "Email",
+          "Instructions": "We'll send you your quiz results and explanation immediately.",
+          "IsRequired": "0",
+          "ClassNames": "",
+          "DefaultVal": "",
+          "Page": "1",
+          "Type": "email",
+          "ID": "Field112"
+        },    {
+          "Title": "Production testing = live testing.",
+          "Instructions": "",
+          "IsRequired": "1",
+          "ClassNames": "",
+          "DefaultVal": "",
+          "Page": "1",
+          "Choices": [        {
+              "Label": None
+         },        {
+              "Label": None
+            }],
+          "Type": "radio",
+          "ID": "Field101"
+        },    {
+          "Title": "Production testing is too risky.",
+          "Instructions": "",
+          "IsRequired": "1",
+          "ClassNames": "",
+          "DefaultVal": "",
+          "Page": "1",
+          "Choices": [        {
+              "Label": None
+            },        {
+              "Label": None
+            }],
+          "Type": "radio",
+          "ID": "Field102"
+        },    {
+          "Title": "Production testing is not about breaking the site; performance testing is about baseline testing, spikes, endurance and diagnostic testing.",
+          "Instructions": "",
+          "IsRequired": "1",
+          "ClassNames": "",
+          "DefaultVal": "",
+          "Page": "1",
+          "Choices": [        {
+              "Label": None
+            },        {
+              "Label": None
+            }],
+          "Type": "radio",
+          "ID": "Field103"
+        },    {
+          "Title": "It takes too long; we're lucky to have time for QA testing.",
+          "Instructions": "",
+          "IsRequired": "1",
+          "ClassNames": "",
+          "DefaultVal": "",
+          "Page": "1",
+          "Choices": [        {
+              "Label": None
+            },        {
+              "Label": None
+            }],
+          "Type": "radio",
+          "ID": "Field104"
+        },    {
+          "Title": "The technology to do production performance testing has changed so you now have the expertise in house.",
+          "Instructions": "",
+          "IsRequired": "1",
+          "ClassNames": "",
+          "DefaultVal": "",
+          "Page": "1",
+          "Choices": [        {
+              "Label": None
+            },        {
+              "Label": None
+            }],
+          "Type": "radio",
+          "ID": "Field105"
+        },    {
+          "Title": "Production testing isn't necessary if we do thorough testing in the lab.",
+          "Instructions": "",
+          "IsRequired": "1",
+          "ClassNames": "",
+          "DefaultVal": "",
+          "Page": "1",
+          "Choices": [        {
+              "Label": None
+            },        {
+              "Label": None
+            }],
+          "Type": "radio",
+          "ID": "Field106"
+        },    {
+          "Title": "Management buy-in for production testing may be easier than you think.",
+          "Instructions": "",
+          "IsRequired": "1",
+          "ClassNames": "",
+          "DefaultVal": "",
+          "Page": "1",
+          "Choices": [        {
+              "Label": None
+            },        {
+              "Label": None
+            }],
+          "Type": "radio",
+          "ID": "Field107"
+        },    {
+          "Title": "It costs too much.",
+          "Instructions": "",
+          "IsRequired": "1",
+          "ClassNames": "",
+          "DefaultVal": "",
+          "Page": "1",
+          "Choices": [        {
+              "Label": None
+            },        {
+              "Label": None
+            }],
+          "Type": "radio",
+          "ID": "Field108"
+        }]
+    },
+    'FormStructure':    {
+      "Name": "Production Testing Myths",
+      "Description": "8 Common Myths About Testing in Production",
+      "RedirectMessage": "Great! Thanks for filling out my form!",
+      "Url": "production-testing-myths",
+      "Email": None,
+      "IsPublic": "1",
+      "Language": "english",
+      "StartDate": "2000-01-01 12:00:00",
+      "EndDate": "2030-01-01 12:00:00",
+      "EntryLimit": "0",
+      "DateCreated": "2011-12-28 22:44:06",
+      "DateUpdated": "2011-12-28 22:56:32",
+      "Hash": "m7x3s5"
+    },
+    'Field113': 'Rob',
+    'Field114': 'Graham',
+    'Field112': 'rgraham@whitetailsoftware.com',
+    'Field101': False,
+    'Field102': False,
+    'Field103': True,
+    'Field104': True,
+    'Field105': True,
+    'Field106': False,
+    'Field107': True,
+    'Field108': False,
+    'CreatedBy':    'public',
+    'DateCreated':  '2011-12-28 23:18:12',
+    'EntryId':  2,
+    'IP':   '99.156.89.47',
+    'HandshakeKey': 'SoastaWufooProject' }
+
+        self.ratingQuiz = { 'FieldStructure':{
+              "Fields": [    {
+                  "Title": "Name",
+                  "Instructions": "",
+                  "IsRequired": "1",
+                  "ClassNames": "",
+                  "DefaultVal": "",
+                  "Page": "1",
+                  "SubFields": [        {
+                      "DefaultVal": "",
+                      "ID": "Field113",
+                      "Label": "First"
+                    },        {
+                      "DefaultVal": "",
+                      "ID": "Field114",
+                      "Label": "Last"
+                    }],
+                  "Type": "shortname",
+                  "ID": "Field113"
+                },    {
+                  "Title": "Email",
+                  "Instructions": "We'll send you your quiz results and explanation immediately.",
+                  "IsRequired": "1",
+                  "ClassNames": "",
+                  "DefaultVal": "",
+                  "Page": "1",
+                  "Type": "email",
+                  "ID": "Field112"
+                },    {
+                  "Title": "Please rate each of the following according to your organization's testing solutions.",
+                  "Instructions": "",
+                  "IsRequired": "1",
+                  "ClassNames": "",
+                  "DefaultVal": "0",
+                  "Page": "1",
+                  "SubFields": [        {
+                      "DefaultVal": "0",
+                      "ID": "Field116",
+                      "Label": "1. Does your solution have the flexibility to generate load both internally and externally?"
+                    },        {
+                      "DefaultVal": "0",
+                      "ID": "Field117",
+                      "Label": "2. Are you able to build and modify complex tests within hours?"
+                    },        {
+                      "DefaultVal": "0",
+                      "ID": "Field118",
+                      "Label": "3. Can your test platform support dynamic web and mobile technologies and protocols?"
+                    },        {
+                      "DefaultVal": "0",
+                      "ID": "Field119",
+                      "Label": "4. Is your test environment elastic and globally distributed?"
+                    },        {
+                      "DefaultVal": "0",
+                      "ID": "Field120",
+                      "Label": "5. Are you able to do dynamic and fully automated test grid provisioning?"
+                    },        {
+                      "DefaultVal": "0",
+                      "ID": "Field121",
+                      "Label": "6. Can you control test sessions to start, pause, stop, modify, re-start, and analyze?"
+                    },        {
+                      "DefaultVal": "0",
+                      "ID": "Field122",
+                      "Label": "7. Does your solution have a single, integrated view of performance and monitoring metrics?"
+                    },        {
+                      "DefaultVal": "0",
+                      "ID": "Field123",
+                      "Label": "8. Can you rapidly isolate performance issues in real-time at any scale?"
+                    },        {
+                      "DefaultVal": "0",
+                      "ID": "Field124",
+                      "Label": "9. Does your test platform allow functional and load testing from lab to production?"
+                    },        {
+                      "DefaultVal": "0",
+                      "ID": "Field125",
+                      "Label": "10. Is your test platform affordable enough for everyday testing?"
+                    }],
+                  "Choices": [        {
+                      "Score": 1,
+                      "Label": 'null'
+                    },        {
+                      "Score": 2,
+                      "Label": 'null'
+                    },        {
+                      "Score": 3,
+                      "Label": 'null'
+                    },        {
+                      "Score": 4,
+                      "Label": 'null'
+                    },        {
+                      "Score": 5,
+                      "Label": 'null'
+                    }],
+                  "Type": "likert",
+                  "ID": "Field116"
+                }]
+            },
+            'FormStructure':    {
+              "Name": "Decision Criteria For Your App Testing Platform",
+              "Description": 'null',
+              "RedirectMessage": "Great! Thanks for filling out our quiz!",
+              "Url": "web-mobile-application-testing-criteria",
+              "Email": 'null',
+              "IsPublic": "1",
+              "Language": "english",
+              "StartDate": "2000-01-01 12:00:00",
+              "EndDate": "2030-01-01 12:00:00",
+              "EntryLimit": "0",
+              "DateCreated": "2011-12-28 22:44:06",
+              "DateUpdated": "2012-01-10 22:26:53",
+              "Hash": "m7x3s5"
+            },
+            'Field113': 'Robert',
+            'Field114': 'Graham',
+            'Field112': 'rgraham@whitetailsoftware.com',
+            'Field116': '5 - Yes, completely.',
+            'Field117': '5 - Yes, completely.',
+            'Field118': '5 - Yes, completely.',
+            'Field119': '5 - Yes, completely.',
+            'Field120': '5 - Yes, completely.',
+            'Field121': '5 - Yes, completely.',
+            'Field122': '5 - Yes, completely.',
+            'Field123': '5 - Yes, completely.',
+            'Field124': '5 - Yes, completely.',
+            'Field125': '5 - Yes, completely.',
+            'CreatedBy':    'public',
+            'DateCreated':  '2012-01-10 22:45:03',
+            'EntryId':  10,
+            'IP':   '99.156.89.47',
+            'HandshakeKey': 'SoastaWufooProject'}
+    
+    
     def test_response(self):
         """
         Check against a sample post from Wufoo.
         """
-        response = self.client.post('/', {'form': json.dumps(self.soasta)})
+        response = self.client.post('/', {'form': json.dumps(self.ratingQuiz)})
         self.assertEqual(response.content,
          "Firing off an email to rgraham@whitetailsoftware.com.\n")
         self.assertEqual(response.status_code, 200)

wufoo_responder/tests.pyc

Binary file modified.

wufoo_responder/urls.pyc

Binary file modified.

wufoo_responder/views.py

     # FIXME change to relevant quiz name
     answers = quizgrader.get_answer_key(quiz_name)
     # FIXME change api.forms[0] to grabbing the required quiz
-    form = api.forms[0]
-    grade = quizgrader.grade_quiz(answers, data, form)
+    form = quizgrader.get_form("Decision Criteria For Your App Testing Platform",
+            api.forms)
+    grade = quizgrader.grade_rating_quiz(data, form, answers['scale'],
+            answers['questions'])
     data['Grade'] = grade
 
     if send_user_emails:
            context_instance=RequestContext(request)) 
 
 def _get_email_field(fs):
-	field_name = None
-	try:
-		fs['Fields']
-	except TypeError, e:
-		fs = json.loads(fs)
-	for f in fs['Fields']:
-		if f['Title'] == 'Email':
-			field_name = f['ID']
-	return field_name
+    field_name = None
+    try:
+        fs['Fields']
+    except TypeError, e:
+        fs = json.loads(fs)
+    for f in fs['Fields']:
+        if f['Title'] == 'Email':
+            field_name = f['ID']
+    return field_name

wufoo_responder/views.pyc

Binary file modified.