how to make true or false in the game quiz using drag and drop ?

I make games like quizzes, but use the concept of drag and drop. for example there are choices A and B, when I select option A to column 1, option B I drag to column 2. Then both of them will check whether they are right and wrong. I can only drag and drop, follow the tutorial on YouTube. Can anyone help me, check right / wrong?

[126471-inkeda-li-min.jpg`using System.Collections;|126471]

using System.Collections.Generic;
using UnityEngine;
using UnityEngine.EventSystems;

public class DragHandeler : MonoBehaviour, IBeginDragHandler, IDragHandler, IEndDragHandler
{
public static GameObject itemDrag;
Vector3 posisiAwal;
//membuat pengaturan variabel lain yang disebut startParent.
Transform startParent;

public void OnBeginDrag(PointerEventData eventData)
{
    //select objek yang di drag
    itemDrag = gameObject;
    posisiAwal = transform.position;
    //menggunakan ini untuk menentukan apakah objek telah jatuh ke slot baru.
    startParent = transform.parent;
    //sementara kita menyeret ini didrag memungkinkan untuk melewati peristiwa melalui item yang diseret dan didrag kembali ke posisi sebelumnya.
    GetComponent<CanvasGroup>().blocksRaycasts = false;
}

public void OnDrag(PointerEventData eventData)
{
    //ketika di drag mengikuti mouse
    transform.position = Input.mousePosition;
}

public void OnEndDrag(PointerEventData eventData)
{ 
    //item yang digrag tidak ada, maka posisi awal
    itemDrag = null;
    GetComponent<CanvasGroup>().blocksRaycasts = true;
    //agar tidak kembali ke posisinya yang asli tapi ke posisi yang barunya
    if (transform.parent == startParent)
    {
        transform.position = posisiAwal;
    }
}

}
`

I think the solution here will be to write a script that makes use of the IDropHandler interface. You’d write a DragHandler that would be attached to each of your answer blocks and in the OnDrop method you could look at what was dropped and process it. I’m not sure how you’re validating which answers are correct but this is a basic example that should hopefully help you get started:

using UnityEngine;
using UnityEngine.EventSystems;

public class DropHandler : MonoBehaviour, IDropHandler
{
    public GameObject CorrectAnswer;

    public void OnDrop(PointerEventData eventData)
    {
        if (DragHandler.DraggedItem != null)
        {
            if (DragHandler.DraggedItem == CorrectAnswer)
            {
                //Handle correct answer
            }
            else
            {
                //Handle incorrect answer
            }
        }
    }
}

For this script to work, attach it to both of your answer blocks and set the “CorrectAnswer” variable to whichever draggable object is correct for that block.