# if the hint exists already, simply upvote the previously entered hint
ifsubmissioninself.generic_hints:
self.upvote_hint(answer,submission)
return
return{'success':True,
else:
'result':'We already had this hint. We gave it an upvote'}
self.hint_database[answer][submission]+=1
return
@XBlock.json_handler
@XBlock.json_handler
defstudiodata(self,data,suffix=''):
defstudiodata(self,data,suffix=''):
...
@@ -374,7 +387,7 @@ class CrowdsourceHinter(XBlock):
...
@@ -374,7 +387,7 @@ class CrowdsourceHinter(XBlock):
"""
"""
<verticaldemo>
<verticaldemo>
<crowdsourcehinter>
<crowdsourcehinter>
{"generic_hints": "Make sure to check for basic mistakes like typos", "initial_hints": {"michiganp": "remove the p at the end.", "michigann": "too many Ns on there."}, "hinting_element": "i4x://edX/DemoX/problem/Text_Input"}
{"generic_hints": "Make sure to check for basic mistakes like typos", "initial_hints": {"michiganp": "remove the p at the end.", "michigann": "too many Ns on there."}, "target_problem": "i4x://edX/DemoX/problem/Text_Input"}
</crowdsourcehinter>
</crowdsourcehinter>
</verticaldemo>""")
</verticaldemo>""")
]
]
...
@@ -385,11 +398,14 @@ class CrowdsourceHinter(XBlock):
...
@@ -385,11 +398,14 @@ class CrowdsourceHinter(XBlock):