#!/usr/bin/env python3
#
# Merge the participant results of a run by this tool into a
#

import pscheduler

input = pscheduler.json_load(exit_on_error=True);

try:
    result = input['results'][0]['result']
except (IndexError, KeyError) as ex:
    result = {
        'succeeded': False,
        'error': "Error in result data: {}".format(str(ex))
    }

pscheduler.succeed_json(result)
