def extract_question_values(question, required_fields, is_reviewer):
 response = {'value': {'type': 'string'}, 'comments': COMMENTS_SCHEMA, 'extra': {'type': 'array'}}
 if (question.get('type') == 'object'):
  response['value'] = get_object_jsonschema(question, required_fields, is_reviewer)
 elif (question.get('type') == 'choose'):
  options = question.get('options')
  if options:
   response['value'] = get_options_jsonschema(options)
 elif (question.get('type') == 'osf-upload'):
  response['extra'] = OSF_UPLOAD_EXTRA_SCHEMA
 if is_reviewer:
  del response['extra']
  if (not (question.get('type') == 'object')):
   del response['value']
 return response

def extract_question_values ( question , required_fields , is_reviewer ) : response = { 'value' : { 'type' : 'string' } , 'comments' : COMMENTS_SCHEMA , 'extra' : { 'type' : 'array' } } if ( question . get ( 'type' ) == 'object' ) : response [ 'value' ] = get_object_jsonschema ( question , required_fields , is_reviewer ) elif ( question . get ( 'type' ) == 'choose' ) : options = question . get ( 'options' ) if options : response [ 'value' ] = get_options_jsonschema ( options ) elif ( question . get ( 'type' ) == 'osf-upload' ) : response [ 'extra' ] = OSF_UPLOAD_EXTRA_SCHEMA if is_reviewer : del response [ 'extra' ] if ( not ( question . get ( 'type' ) == 'object' ) ) : del response [ 'value' ] return response
pulls structure for value .