'Return a JSON representation of the XBlock, suitable
for sending as POST data to /xblock
XBlocks are always set to public visibility.'

def serialize(self):

    returned_data = {'display_name': self.display_name, 'data': self.data, 'metadata': self.metadata, 'graderType': self.grader_type, 'publish': self.publish, 'fields': self.fields}
    return json.dumps(returned_data)
