Commit 08463b35 by Sola

Merge branch 'master' of https://github.com/solashirai/crowdsourcehinter into soladev

Conflicts:
	.gitignore
	README.md
parents 4f0d011d 7bfe5648
<<<<<<< HEAD
*.pyc
*~
=======
*.pyc
*~
>>>>>>> 7bfe56482564bb5976010b447d4e11f64ed2e516
...@@ -14,7 +14,7 @@ An example of a hint giving feedback ...@@ -14,7 +14,7 @@ An example of a hint giving feedback
To bring the crowd sourced hinter into a demo course: To bring the crowd sourced hinter into a demo course:
First, follow https://github.com/edx/edx-platform/blob/master/docs/en_us/developers/source/xblocks.rst#testing for general xblock creation. First, follow https://github.com/edx/edx-platform/blob/master/docs/en_us/developers/source/xblocks.rst#testing for general xblock creation.
The name of the module to set in the advanced settings tab is "crowdxblock" (this will likely be changed in the near future to something like "crowdsourced_hinter"). The name of the module to set in the advanced settings tab is "crowdxblock" (this will likely be changed in the near future to something like "crowd_sourced_hinter").
After creating a new unit, add the crowdsourcedhinter XBlock into a course just like any other XBlock. The name of the crowd sourced hinter may not show up in studio for some unknown reason, but an empty space where its name should be will be clickable (problem to be identified/fixed...). After creating a new unit, add the crowdsourcedhinter XBlock into a course just like any other XBlock. The name of the crowd sourced hinter may not show up in studio for some unknown reason, but an empty space where its name should be will be clickable (problem to be identified/fixed...).
......
This is the repository for the Crowd Sourced Hinter XBlock. The Crowd Sourced Hinter serves to provide students with hints when they incorrectly answer a problem within a course (currently tested for text and numerical input type questions).
This XBlock is still under construction. Functionalities to set default hints, properly moderate flagged hints, and improvements to user interface are to be done soon.
backlog: https://docs.google.com/a/edx.org/document/d/1lOBLZWohwRmnfgwz53gc4b4GdfP4EER3UNohdYfcEJU/edit#
An example of a student recieving a hint
![CrowdSourcedHinter Hint Screenshot](crowdsourcedhinter_hint.png)
An example of a hint giving feedback
![CrowdSourcedHinter Student Feedback Screenshot](crowdsourcedhinter_feedback.png)
To bring the crowd sourced hinter into a demo course:
First, follow https://github.com/edx/edx-platform/blob/master/docs/en_us/developers/source/xblocks.rst#testing for general xblock creation.
<<<<<<< HEAD
The name of the module to set in the advanced settings tab is "crowdxblock" (this will likely be changed in the near future to something like "crowdsourced_hinter").
=======
The name of the module to set in the advanced settings tab is "crowdxblock" (this will likely be changed in the near future to something like "crowd_sourced_hinter").
>>>>>>> 7bfe56482564bb5976010b447d4e11f64ed2e516
After creating a new unit, add the crowdsourcedhinter XBlock into a course just like any other XBlock. The name of the crowd sourced hinter may not show up in studio for some unknown reason, but an empty space where its name should be will be clickable (problem to be identified/fixed...).
Testing the functionality of the crowd sourced hinter works best when switching between different users and answering the same problem.
What It Does:
The two key features of the crowd sourced hinter are the abilities to show students hints and to have the students themselves create hints to be shown to future students.
When a student incorrectly answers a text input type problem, the crowd sourced hinter will look through its database to search for a hint that has been stored for that exact incorrect answer input (i.e. when the database is large enough, two different incorrect answers would not receive the same hint). If hints exist for a student's incorrect answer, this hint is shown to the student. The student then may have the opportunity to input their answer again, which may prompt another hint to be displayed.
After a student re-submits an answer correctly, they can rate hints as well as submit new hints. Rating hints works by upvoting, downvoting, or flagging the hints (flagged hints are not shown to students). Students can submit new hints for each incorrect answer that has been made, and this hint will be stored only for that specific incorrect answer.
...@@ -19,35 +19,36 @@ class CrowdXBlock(XBlock): ...@@ -19,35 +19,36 @@ class CrowdXBlock(XBlock):
that specifically address their mistake. Additionally, the hints that this Xblock shows that specifically address their mistake. Additionally, the hints that this Xblock shows
are created by the students themselves. This doc string will probably be edited later. are created by the students themselves. This doc string will probably be edited later.
""" """
hint_database = Dict(default={: {}}, scope=Scope.user_state_summary) # Database of hints. hints are stored as such: {"incorrect_answer": {"hint": rating}}. each key (incorrect answer)
# database of hints. hints are stored as such: {"incorrect_answer": {"hint": rating}}. each key (incorrect answer)
# has a corresponding dictionary (in which hints are keys and the hints' ratings are the values). # has a corresponding dictionary (in which hints are keys and the hints' ratings are the values).
HintsToUse = Dict({}, scope=Scope.user_state) hint_database = Dict(default={: {}}, scope=Scope.user_state_summary)
# this is a dictionary of hints that will be used to determine what hints to show a student. # This is a dictionary of hints that will be used to determine what hints to show a student.
# flagged hints are not included in this dictionary of hints # flagged hints are not included in this dictionary of hints
WrongAnswers = List([], scope=Scope.user_state) HintsToUse = Dict({}, scope=Scope.user_state)
# this is a list of incorrect answer submissions made by the student. this list is mostly used for # This is a list of incorrect answer submissions made by the student. this list is mostly used for
# feedback, to find which incorrect answer's hint a student voted on. # feedback, to find which incorrect answer's hint a student voted on.
DefaultHints = Dict(default={}, scope=Scope.content) WrongAnswers = List([], scope=Scope.user_state)
# a dictionary of default hints. default hints will be shown to students when there are no matches with the # A dictionary of default hints. default hints will be shown to students when there are no matches with the
# student's incorrect answer within the hint_database dictionary (i.e. no students have made hints for the # student's incorrect answer within the hint_database dictionary (i.e. no students have made hints for the
# particular incorrect answer) # particular incorrect answer)
Used = List([], scope=Scope.user_state) DefaultHints = Dict(default={}, scope=Scope.content)
# list of which hints from the HintsToUse dictionary have been shown to the student # List of which hints from the HintsToUse dictionary have been shown to the student
# this list is used to prevent the same hint from showing up to a student (if they submit the same incorrect answers # this list is used to prevent the same hint from showing up to a student (if they submit the same incorrect answers
# multiple times) # multiple times)
Voted = List(default=[], scope=Scope.user_state) Used = List([], scope=Scope.user_state)
# this list is used to prevent students from voting multiple times on the same hint during the feedback stage. # This list is used to prevent students from voting multiple times on the same hint during the feedback stage.
# i believe this will also prevent students from voting again on a particular hint if they were to return to # i believe this will also prevent students from voting again on a particular hint if they were to return to
# a particular problem later # a particular problem later
Flagged = Dict(default={}, scope=Scope.user_state_summary) Voted = List(default=[], scope=Scope.user_state)
# this is a dictionary of hints that have been flagged. the keys represent the incorrect answer submission, and the # This is a dictionary of hints that have been flagged. the keys represent the incorrect answer submission, and the
# values are the hints the corresponding hints. even if a hint is flagged, if the hint shows up for a different # values are the hints the corresponding hints. even if a hint is flagged, if the hint shows up for a different
# incorrect answer, i believe that the hint will still be able to show for a student # incorrect answer, i believe that the hint will still be able to show for a student
Flagged = Dict(default={}, scope=Scope.user_state_summary)
def student_view(self, context=None): def student_view(self, context=None):
""" """
This function defines which files to access when a student views this xblock. This view renders the hint view to the students. The HTML has the hints templated
in, and most of the remaining functionality is in the JavaScript.
""" """
html = self.resource_string("static/html/crowdxblock.html") html = self.resource_string("static/html/crowdxblock.html")
frag = Fragment(html.format(self=self)) frag = Fragment(html.format(self=self))
...@@ -58,8 +59,9 @@ class CrowdXBlock(XBlock): ...@@ -58,8 +59,9 @@ class CrowdXBlock(XBlock):
def studio_view(self, context=None): def studio_view(self, context=None):
""" """
This function defines which files to access when an instructor views this xblock through the This function defines a view for editing the XBlock when embedding it in a course. It will allow
studio view (and click "edit"). The only difference from student_view is the html script. one to define, for example, which problem the hinter is for. It is unfinished and does not currently
work.
""" """
html = self.resource_string("static/html/crowdxblockstudio.html") html = self.resource_string("static/html/crowdxblockstudio.html")
frag = Fragment(html.format(self=self)) frag = Fragment(html.format(self=self))
...@@ -70,17 +72,17 @@ class CrowdXBlock(XBlock): ...@@ -70,17 +72,17 @@ class CrowdXBlock(XBlock):
def resource_string(self, path): def resource_string(self, path):
""" """
This function is used to get the path of static resources. This function is used to get the path of static resources.
""" """
data = pkg_resources.resource_string(__name__, path) data = pkg_resources.resource_string(__name__, path)
return data.decode("utf8") return data.decode("utf8")
@XBlock.json_handler @XBlock.json_handler
def clear_temp(self, data, suffix=''): def clear_temp(self, data, suffix=''):
""" """ TODO: Remove or fix.
this clears all temprorary lists/dictionaries. This may not be relevant any longer This clears all temprorary lists/dictionaries. This may not be relevant any longer
but is intended to prevent hints from messing up when changing between units within but is intended to prevent hints from messing up when changing between units within
a section a section.
""" """
remove_list = [] remove_list = []
# a list is used to systematically remove all key/values from a dictionary. # a list is used to systematically remove all key/values from a dictionary.
......
edxapp@precise64.12683:1405603606
\ No newline at end of file
edxapp@precise64.13574:1405603606
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment