Commit 002ae5a3 by Filippo Valsorda

Avoid a useless JSON serialization of the data

parent 06272fbe
......@@ -135,14 +135,7 @@ class DragAndDropBlock(XBlock):
self.display_name = submissions['display_name']
self.question_text = submissions['question_text']
self.weight = float(submissions['weight'])
try:
self.data = json.loads(submissions['data'])
except ValueError as e:
return {
'result': 'error',
'message': e.message
}
self.data = submissions['data']
return {
'result': 'success',
......
......@@ -356,7 +356,7 @@ function DragAndDropEditBlock(runtime, element) {
'display_name': $(element).find('.display-name').val(),
'weight': $(element).find('.weight').val(),
'question_text': $(element).find('.question-text').val(),
'data': JSON.stringify(_fn.data),
'data': _fn.data,
};
$('.xblock-editor-error-message', element).html();
......
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