made change in show report as per requirement and improved the quiz intro
authornishanth
Wed, 05 May 2010 09:57:33 +0530
changeset 56 d8d4387b3281
parent 55 8d78e1e62424
child 57 0ca5016cde82
made change in show report as per requirement and improved the quiz intro
feedback/utils.py
templates/quiz_intro.html
--- a/feedback/utils.py	Mon Apr 26 07:48:53 2010 +0530
+++ b/feedback/utils.py	Wed May 05 09:57:33 2010 +0530
@@ -14,53 +14,53 @@
 
 EXPAND_OPTION = {
     "topics" : {
-        "1" : "%s%% of the people felt that the range of topics covered was very relevant",
-        "2" : "%s%% of the people felt that the range of topics covered was relevant",
-        "3" : "%s%% of the people felt that the range of topics covered was somewhat relevant",
-        "4" : "%s%% of the people felt that the range of topics covered was not relevant",
+        "1" : "%d out of %s people felt that the range of topics covered was very relevant",
+        "2" : "%d out of %s people felt that the range of topics covered was relevant",
+        "3" : "%d out of %s people felt that the range of topics covered was somewhat relevant",
+        "4" : "%d out of %s people felt that the range of topics covered was not relevant",
     },
 
     "depth" : {
-        "1" : "%s%% of the people felt that the depth of coverage was too detailed",
-        "2" : "%s%% of the people felt that the depth of coverage was detailed",
-        "3" : "%s%% of the people felt that the depth of coverage was not detailed enough",
-        "4" : "%s%% of the people felt that the depth of coverage was poorly detailed",
+        "1" : "%d out of %s people felt that the depth of coverage was too detailed",
+        "2" : "%d out of %s people felt that the depth of coverage was detailed",
+        "3" : "%d out of %s people felt that the depth of coverage was not detailed enough",
+        "4" : "%d out of %s people felt that the depth of coverage was poorly detailed",
     },
 
     "methodology" : {
-        "1" : "%s%% of the people felt that the teaching methodology was extremely effective",
-        "2" : "%s%% of the people felt that the teaching methodology was effective",
-        "3" : "%s%% of the people felt that the teaching methodology was not very effective",
-        "4" : "%s%% of the people felt that the teaching methodology was ineffective",
+        "1" : "%d out of %s people felt that the teaching methodology was extremely effective",
+        "2" : "%d out of %s people felt that the teaching methodology was effective",
+        "3" : "%d out of %s people felt that the teaching methodology was not very effective",
+        "4" : "%d out of %s people felt that the teaching methodology was ineffective",
     },
 
     "pace" : {
-        "1" : "%s%% of the people felt that the the pace of coverage was too fast",
-        "2" : "%s%% of the people felt that the the pace of coverage was fast",
-        "3" : "%s%% of the people felt that the the pace of coverage was just right",
-        "4" : "%s%% of the people felt that the the pace of coverage was slow",
-        "5" : "%s%% of the people felt that the the pace of coverage was too slow",
+        "1" : "%d out of %s people felt that the the pace of coverage was too fast",
+        "2" : "%d out of %s people felt that the the pace of coverage was fast",
+        "3" : "%d out of %s people felt that the the pace of coverage was just right",
+        "4" : "%d out of %s people felt that the the pace of coverage was slow",
+        "5" : "%d out of %s people felt that the the pace of coverage was too slow",
     },
 
     "applicability" : {
-        "1" : "%s%% of the people felt that they can apply what they have learnt immediately",
-        "2" : "%s%% of the people felt that they can apply what they have learnt somewhat immediately",
-        "3" : "%s%% of the people felt that they cannot apply what they have learnt immediately",
-        "4" : "%s%% of the people felt that they might never apply what they have learnt",
+        "1" : "%d out of %s people felt that they can apply what they have learnt immediately",
+        "2" : "%d out of %s people felt that they can apply what they have learnt somewhat immediately",
+        "3" : "%d out of %s people felt that they cannot apply what they have learnt immediately",
+        "4" : "%d out of %s people felt that they might never apply what they have learnt",
     },
 
     "problems" : {
-        "1" : "%s%% of the people felt that the problems were very interesting",
-        "2" : "%s%% of the people felt that the problems were interesting",
-        "3" : "%s%% of the people felt that the problems were somewhat interesting",
-        "4" : "%s%% of the people felt that the problems were not interesting",
+        "1" : "%d out of %s people felt that the problems were very interesting",
+        "2" : "%d out of %s people felt that the problems were interesting",
+        "3" : "%d out of %s people felt that the problems were somewhat interesting",
+        "4" : "%d out of %s people felt that the problems were not interesting",
     },
 
     "exercises" : {
-        "1" : "%s%% of the people felt that the exercises were very instructive",
-        "2" : "%s%% of the people felt that the exercises were instructive",
-        "3" : "%s%% of the people felt that the exercises were somewhat instructive",
-        "4" : "%s%% of the people felt that the exercises were not instructive",
+        "1" : "%d out of %s people felt that the exercises were very instructive",
+        "2" : "%d out of %s people felt that the exercises were instructive",
+        "3" : "%d out of %s people felt that the exercises were somewhat instructive",
+        "4" : "%d out of %s people felt that the exercises were not instructive",
     },
 }
 
@@ -82,9 +82,10 @@
         field_report = []
         for option in sorted(choices_dict.keys()):
             args_dict = {field : option}
-            option_percent = feeds.filter(**args_dict).count() / no_of_feeds * 100
-            if option_percent:
-                field_report.append((EXPAND_OPTION[field][option])%option_percent)
+            option_percent = feeds.filter(**args_dict).count() * 100.0 / no_of_feeds
+            option_feeds = feeds.filter(**args_dict).count()
+            if option_feeds:
+                field_report.append((EXPAND_OPTION[field][option])%(option_feeds,no_of_feeds))
         
         if field_report:
             day_report.extend( [LONG_FIELD_NAME[field], field_report] )
--- a/templates/quiz_intro.html	Mon Apr 26 07:48:53 2010 +0530
+++ b/templates/quiz_intro.html	Wed May 05 09:57:33 2010 +0530
@@ -27,13 +27,13 @@
 		<li> Please use 4 spaces for indentation </li>
 		<li> Some questions are multiple choice type and hence will have options instead of textbox </li>
 		<br />
-<li> There will be a timer running at the bottom as shown in this page.</li>
-<li> The page will auto submit after the timer runs out </li>
+<li> Each question will have a timer running at the bottom as shown in this page.</li>
+<li> The question will auto submit after the timer runs out </li>
 <li> You can also click the submit button to submit the answer before the timer ends </li>
 <br />
 <li> DO NOT refresh the page after the timer starts. If a question reloads, it is marked as incorrect </li>
 <br />
-The quiz starts after the timer runs out.<br />
+The quiz starts after the timer on this page runs out.<br />
 You can click on submit to start the quiz right away.<br />
 All the best.<br /><br />
 Answer:<br />