yetanalytics / lrsql

A SQL-based Learning Record Store
https://www.sqllrs.com
Apache License 2.0
89 stars 18 forks source link

Is there a way to search by multiple verbs on OR condition through API #393

Closed yogeshbb closed 5 months ago

yogeshbb commented 5 months ago

I want to check if user has completed the course using a common API for different courses having different verb for completion like 'completed' or 'passed'

For example /xapi/statements?unwrap_html=true&verb=http://adlnet.gov/expapi/verbs/passed&related_activities=false&related_agents=false&format=ids&attachments=false

this checks for verb 'passed' how can I pass or query for 'completed' verb in the same request, I am expecting statements which are matching either the verb 'passed' or 'completed'

OR is there a way to query on "result" key present in statement as: {"id": [STATEMENT_ID], "result": {"completion": true}}

I found that for both different verb 'completed'/'passed, the 'result.completion' is set to true

milt commented 5 months ago

Hi @yogeshbb! SQL LRS implements version 1.0.3 of the xAPI Specification which unfortunately does not include a way to do a boolean OR in your /statements query. Generally the LRS is concerned with storage of xAPI data and is not optimized for analytical use.

There are several methods you can use to do more complex queries outside of those in the spec:

yogeshbb commented 5 months ago

Hi @milt Thanks for the quick revert on this. Just one quick question post completion can 'Reactions' feature may end up in delays to insert the new statement based on heavy load? if so need to think of 1st option of direct DB communication.

milt commented 5 months ago

@yogeshbb Reactions use an asynchronous queue of configurable size but do add insertion overhead, yes.

yogeshbb commented 5 months ago

Thanks @milt for sharing the details.