Commit 2db65fe0 by Piotr Mitros Committed by Piotr Mitros

Updated a few comments

parent d94f2cf5
...@@ -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))
...@@ -77,10 +79,10 @@ class CrowdXBlock(XBlock): ...@@ -77,10 +79,10 @@ class CrowdXBlock(XBlock):
@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.
......
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