import csv import os LOG_FILE = "feedback_log.csv" def log_feedback(question, option1, option2, context, evo_output, evo_was_correct): file_exists = os.path.isfile(LOG_FILE) with open(LOG_FILE, mode='a', newline='', encoding='utf-8') as file: writer = csv.writer(file) if not file_exists: writer.writerow([ "question", "option1", "option2", "context", "evo_output", "evo_was_correct" ]) writer.writerow([ question, option1, option2, context, evo_output, "yes" if evo_was_correct else "no" ])