This function helps to facilitate student rating of hints and contribution of new hints.
This function helps to facilitate student rating of hints and
Specifically this function is used to send necessary data to JS about incorrect answer
contribution of new hints. Specifically this function is used
submissions and hints. It also will return hints that have been reported, although this
to send necessary data to JS about incorrect answer
is only for Staff.
submissions and hints. It also will return hints that have
been reported, although this is only for Staff.
Returns:
Returns:
used_hint_answer_text: This dicitonary contains reported hints/answers (if the user is staff) and the
used_hint_answer_text: This dicitonary contains reported hints/answers (if the user is staff) and the
first hint/answer pair that the student submitted for a problem.
first hint/answer pair that the student submitted for a problem.
"""
"""
# used_hint_answer_text is a dictionary of hints (or lack thereof) used for a
# used_hint_answer_text is a dictionary of hints (or lack thereof) used for a
# specific answer, as well as 2 other random hints that exist for each answer
# specific answer, as well as 2 other random hints that exist for each answer
...
@@ -240,7 +285,9 @@ class CrowdsourceHinter(XBlock):
...
@@ -240,7 +285,9 @@ class CrowdsourceHinter(XBlock):
defrate_hint(self,data,suffix=''):
defrate_hint(self,data,suffix=''):
"""
"""
Used to facilitate hint rating by students.
Used to facilitate hint rating by students.
Hint ratings in hint_database are updated and the resulting hint rating (or reported status) is returned to JS.
Hint ratings in hint_database are updated and the resulting
hint rating (or reported status) is returned to JS.
Args:
Args:
data['student_answer']: The incorrect answer that corresponds to the hint that is being rated
data['student_answer']: The incorrect answer that corresponds to the hint that is being rated
data['hint']: The hint that is being rated
data['hint']: The hint that is being rated
...
@@ -248,6 +295,7 @@ class CrowdsourceHinter(XBlock):
...
@@ -248,6 +295,7 @@ class CrowdsourceHinter(XBlock):
Returns:
Returns:
'rating': the new rating of the hint, or the string 'reported' if the hint was reported
'rating': the new rating of the hint, or the string 'reported' if the hint was reported
'hint': the hint that had its rating changed
'hint': the hint that had its rating changed
"""
"""
answer_data=data['student_answer']
answer_data=data['student_answer']
data_rating=data['student_rating']
data_rating=data['student_rating']
...
@@ -325,7 +373,9 @@ class CrowdsourceHinter(XBlock):
...
@@ -325,7 +373,9 @@ class CrowdsourceHinter(XBlock):
@staticmethod
@staticmethod
defworkbench_scenarios():
defworkbench_scenarios():
"""A canned scenario for display in the workbench."""
"""
A canned scenario for display in the workbench.
"""
return[
return[
("CrowdsourceHinter",
("CrowdsourceHinter",
"""
"""
...
@@ -333,9 +383,7 @@ class CrowdsourceHinter(XBlock):
...
@@ -333,9 +383,7 @@ class CrowdsourceHinter(XBlock):
<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."}, "hinting_element": "i4x://edX/DemoX/problem/Text_Input"}
</crowdsourcehinter>
</crowdsourcehinter>
</verticaldemo>
</verticaldemo>""")
"""
)
]
]
@classmethod
@classmethod
...
@@ -350,3 +398,19 @@ class CrowdsourceHinter(XBlock):
...
@@ -350,3 +398,19 @@ class CrowdsourceHinter(XBlock):