Commit eecc234b by solashirai

removed print

parent 169f86cb
......@@ -157,7 +157,6 @@ class CrowdsourceHinter(XBlock):
answers = [a.split('=') for a in answers.split("&")]
# Next, we decode the HTML escapes
answers = [(a[0], urllib.unquote_plus(a[1])) for a in answers]
print answers
return dict(answers)
@XBlock.json_handler
......@@ -287,13 +286,12 @@ class CrowdsourceHinter(XBlock):
# for the time being only the first answer/hint pair will be shown to the studen
if self.used[0] in self.hint_database[self.incorrect_answers[0]]:
# add new key (hint) to used_hint_answer_text with a value (incorrect answer)
used_hint_answer_text[self.used[0]] = self.incorrect_answers[0]
used_hint_answer_text[json.dumps(self.used[0])] = json.dumps(self.incorrect_answers[0])
else:
# if the student's answer had no hints (or all the hints were reported and unavailable) return None
used_hint_answer_text[None] = self.incorrect_answers[0]
used_hint_answer_text[None] = json.dumps(self.incorrect_answers[0])
self.incorrect_answers = []
self.used = []
print used_hint_answer_text
return used_hint_answer_text
@XBlock.json_handler
......@@ -359,7 +357,6 @@ class CrowdsourceHinter(XBlock):
"""
submission = data['new_hint_submission']
answer = data['answer']
print answer, submission
# If we don't have the hint already, add it
if submission not in self.hint_database[answer]:
......
......@@ -145,7 +145,7 @@ function CrowdsourceHinter(runtime, element, data){
* @param student_answers is the text of the student's incorrect answer
*/
function showStudentSubmissionHistory(student_answer){
var showStudentSubmissionTemplate = $(Mustache.render($('#show_student_submission').html(), {answer: student_answer}));
var showStudentSubmissionTemplate = $(Mustache.render($('#show_student_submission').html(), {answer:student_answer}));
$('.csh_student_submission', element).append(showStudentSubmissionTemplate);
}
......@@ -169,8 +169,8 @@ function CrowdsourceHinter(runtime, element, data){
}
$.each(result, function(index, value) {
if(value != "Reported"){
showStudentSubmissionHistory(value);
student_answer = encodeURI(value);
showStudentSubmissionHistory($.parseJSON(value));
student_answer = value;
hint = index;
//hints return null if no answer-specific hints exist
if(hint === "null") {
......
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