Commit f716196e by solashirai Committed by Piotr Mitros

parse_xml progress, fixing problem_graded/problem_check

parent 4661f181
user@olduser-VPCEB3NFX.4809:1424514334
\ No newline at end of file
...@@ -38,7 +38,7 @@ class CrowdsourceHinter(XBlock): ...@@ -38,7 +38,7 @@ class CrowdsourceHinter(XBlock):
# particular incorrect answer) # particular incorrect answer)
# #
# Example: ["Make sure to check your answer for simple mistakes, like spelling or spaces!"] # Example: ["Make sure to check your answer for simple mistakes, like spelling or spaces!"]
generic_hints = List(default=["check for simple mistakes like typos"], scope=Scope.content) generic_hints = List(default=[], scope=Scope.content)
# List of which hints have been shown to the student # List of which hints 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)
...@@ -126,6 +126,9 @@ class CrowdsourceHinter(XBlock): ...@@ -126,6 +126,9 @@ class CrowdsourceHinter(XBlock):
or another random hint for an incorrect answer or another random hint for an incorrect answer
or 'Sorry, there are no more hints for this answer.' if no more hints exist or 'Sorry, there are no more hints for this answer.' if no more hints exist
""" """
print(self.initial_hints)
print(self.generic_hints)
print str(data["submittedanswer"])
# populate hint_database with hints from initial_hints if there are no hints in hint_database. # populate hint_database with hints from initial_hints if there are no hints in hint_database.
# this probably will occur only on the very first run of a unit containing this block. # this probably will occur only on the very first run of a unit containing this block.
if not bool(self.hint_database): if not bool(self.hint_database):
...@@ -398,6 +401,7 @@ class CrowdsourceHinter(XBlock): ...@@ -398,6 +401,7 @@ class CrowdsourceHinter(XBlock):
A minimal working test for parse_xml A minimal working test for parse_xml
""" """
block = runtime.construct_xblock_from_class(cls, keys) block = runtime.construct_xblock_from_class(cls, keys)
#from IPython import embed xmlText = ast.literal_eval((node.text).encode('utf-8'))
#embed() block.generic_hints.append(xmlText["generic_hints"])
block.initial_hints = copy.copy(xmlText["initial_hints"])
return block return block
...@@ -27,6 +27,10 @@ function CrowdsourceHinter(runtime, element){ ...@@ -27,6 +27,10 @@ function CrowdsourceHinter(runtime, element){
console.log(data); console.log(data);
} }
Logger.listen('problem_check', null, get_event_data); Logger.listen('problem_check', null, get_event_data);
function print_info(event_type, data, element){
console.log(data);
}
Logger.listen('problem_graded', null, print_info);
function onStudentSubmission(problem_graded_event_data){ function onStudentSubmission(problem_graded_event_data){
//This function will determine whether or not the student correctly answered the question. //This function will determine whether or not the student correctly answered the question.
......
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