'AJAX handler for the plot button
Args:
get (dict) - should have key \'submission\' which contains the student submission
Returns:
dict - \'success\' - whether or not we successfully queued this submission
- \'message\' - message to be rendered in case of error'

def _plot_data(self, data):

    _ = self.capa_system.i18n.ugettext
    if (self.capa_system.xqueue is None):
        return {'success': False, 'message': _('Cannot    connect    to    the    queue')}
    response = data['submission']
    qinterface = self.capa_system.xqueue['interface']
    qtime = datetime.utcnow().strftime(xqueue_interface.dateformat)
    callback_url = self.capa_system.xqueue['construct_callback']('ungraded_response')
    anonymous_student_id = self.capa_system.anonymous_student_id
    queuekey = xqueue_interface.make_hashkey((((str(self.capa_system.seed) + qtime) + anonymous_student_id) + self.input_id))
    xheader = xqueue_interface.make_xheader(lms_callback_url=callback_url, lms_key=queuekey, queue_name=self.queuename)
    student_info = {'anonymous_student_id': anonymous_student_id, 'submission_time': qtime}
    contents = {'grader_payload': self.plot_payload, 'student_info': json.dumps(student_info), 'student_response': response, 'token': getattr(self.capa_system, 'matlab_api_key', None), 'endpoint_version': '2', 'requestor_id': anonymous_student_id}
    (error, msg) = qinterface.send_to_queue(header=xheader, body=json.dumps(contents))
    if (error == 0):
        self.input_state['queuekey'] = queuekey
        self.input_state['queuestate'] = 'queued'
        self.input_state['queuetime'] = time.time()
    return {'success': (error == 0), 'message': msg}
