//
//  MMSEViewController.swift
//  SAGE_RK_ML
//
//  Created by Juan David Lopez Regalado on 31/01/25.
//

import UIKit
import ResearchKitUI
import ResearchKit

class MMSEViewController: UIViewController, ORKTaskViewControllerDelegate {

    override func viewDidLoad() {
        super.viewDidLoad()

        // Do any additional setup after loading the view.
    }
    

    @IBAction func mmseButton(_ sender: UIButton) {
        let task = MMSEManager.shared.createMMSE() // Cambia el cuestionario a MMSE
        let taskViewController = ORKTaskViewController(task: task, taskRun: nil)
        taskViewController.modalPresentationStyle = .fullScreen
        taskViewController.delegate = self
        present(taskViewController, animated: true, completion: nil)
    }
    
    func taskViewController(_ taskViewController: ORKTaskViewController, didFinishWith reason: ORKTaskFinishReason, error: (any Error)?) {
        taskViewController.dismiss(animated: true, completion: nil)

    }
}
