T-SQL script to check if index rebuild operations are online are off
Referencing the information in Capture Index Maintenance Operations, you might be able to use Extended Events to capture online index operations.

From that post:

Create the Extended Event

Note that this example is using the Ring Buffer, so you may want to pick a different target.  The example is also looking for database_id = 5, so adjust accordingly

-- Create the Event Session
IF EXISTS (
        SELECT *
        FROM sys.server_event_sessions
        WHERE NAME = 'OnlineIXOps'
        )
    DROP EVENT SESSION OnlineIXOps ON SERVER;
GO

CREATE EVENT SESSION OnlineIXOps ON SERVER
    --+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
    --+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
    /* The online index operations */
    --ADD EVENT sqlserver.progress_report_online_index_operation
    --+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
    --+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
    ADD EVENT sqlserver.progress_report_online_index_operation (
    ACTION(sqlserver.database_name, sqlserver.client_hostname, sqlserver.client_app_name, sqlserver.sql_text, sqlserver.session_id)
    --Change this to match the database in question, 
    WHERE sqlserver.database_id = 5
    ) ADD TARGET package0.ring_buffer
    WITH (MAX_DISPATCH_LATENCY = 5 SECONDS)
GO

-- Start the Event Session
ALTER EVENT SESSION OnlineIXOps ON SERVER STATE = START;
GO


Now, run some kind of online index operation.  From the post:

ALTER INDEX IX_PolicyUserRole ON PolicyUserRole REBUILD PARTITION = ALL WITH (online = ON)


Having rebuilt that index online, you can then query the Event session with tsql using a query similar to the following:

SELECT event_data.value('(event/@name)[1]', 'varchar(50)') AS event_name
    ,event_data.value('(event/@timestamp)[1]', 'varchar(50)') AS TIMESTAMP
    ,event_data.value('(event/action[@name="database_name"]/value)[1]', 'varchar(max)') AS DBName
    ,event_data.value('(event/data[@name="object_name"]/value)[1]', 'varchar(max)') AS ObjName
    ,event_data.value('(event/data[@name="index_name"]/value)[1]', 'varchar(max)') AS index_name
    ,event_data.value('(event/data[@name="partition_number"]/value)[1]', 'varchar(max)') AS PartitionNumber
    ,event_data.value('(event/action[@name="session_id"]/value)[1]', 'varchar(max)') AS SessionID
    ,event_data.value('(event/data[@name="build_stage"]/value)[1]', 'varchar(max)') AS Build_Stage
    ,event_data.value('(event/data[@name="build_stage"]/text)[1]', 'varchar(max)') AS BuildStage_Description
    ,event_data.value('(event/action[@name="client_hostname"]/value)[1]', 'varchar(max)') AS Client_hostName
    ,event_data.value('(event/action[@name="client_app_name"]/value)[1]', 'varchar(max)') AS Client_AppName
    ,event_data.value('(event/action[@name="sql_text"]/value)[1]', 'varchar(max)') AS sql_text
    ,event_data.value('(event/data[@name="duration"]/value)[1]', 'Decimal(18,2)') / 1000 AS Duration_ms
    ,event_data.value('(event/data[@name="rows_inserted"]/value)[1]', 'varchar(max)') AS rows_inserted
FROM (
    SELECT evnt.query('.') AS event_data
    FROM (
        SELECT CAST(target_data AS XML) AS TargetData
        FROM sys.dm_xe_sessions AS s
        INNER JOIN sys.dm_xe_session_targets AS t ON s.address = t.event_session_address
        WHERE s.NAME = 'OnlineIXOps'
            AND t.target_name = 'ring_buffer'
        ) AS tab
    CROSS APPLY TargetData.nodes('RingBufferTarget/event') AS split(evnt)
    ) AS evts(event_data)
ORDER BY TIMESTAMP
    ,Build_Stage


When  I tested a non-online rebuild, there we no Extended Events captured.