#!/usr/bin/env python3
"""Test the new comprehension assessor end-to-end."""
import sys, os, json
sys.path.append(os.path.dirname(os.path.abspath(__file__)))
from app import create_app


def run_test():
    app = create_app()
    with app.app_context():
        from app.services.comprehension_assessor import get_comprehension_assessor
        assessor = get_comprehension_assessor()
        q = "After initial greetings, how do both Person A and Person B describe their well-being?"
        a = "They say they are fine and doing well, mentioning being okay and busy with work."
        r = "Person A says 'I'm fine' and Person B says 'I'm doing well'. The conversation shows they are generally okay."
        print('Running assessor test...')
        res = assessor.evaluate_answer(q, a, r)
        print(json.dumps(res, indent=2))

if __name__ == '__main__':
    run_test()