Did I find the right examples for you? yes no

All Samples(1)  |  Call(1)  |  Derive(0)  |  Import(0)
Writes exam results to a file.

If filename is None, results are written to stdout. The output
file is overwritting by default. Use append=True to append
instead of overwriting.

        def write_results(results, filename, csv_dialect, append=False):
    """Writes exam results to a file.

       If filename is None, results are written to stdout. The output
       file is overwritting by default. Use append=True to append
       instead of overwriting.

    """
    if filename is not None:
        if not append:
            file_ = open(filename, 'wb')
        else:
            file_ = open(filename, 'ab')
    else:
        file_ = sys.stdout
    writer = csv.writer(file_, dialect = csv_dialect)
    for result in results:
        data = [str(result['seq-num']),
                result['student-id'],
                result['model'],
                str(result['good']),
                str(result['bad']),
                str(result['score']),
                '/'.join([str(d) for d in result['answers']])]
        writer.writerow(data)
    if filename is not None:
        file_.close()
        


src/e/y/eyegrade-HEAD/eyegrade/modify_results.py   eyegrade(Download)
    for result in results:
        modify(result, exam_data, invalidate, set_correct)
    utils.write_results(results, output_filename, utils.config['csv-dialect'])
 
def modify(result, exam_data, invalidate, set_correct):