-
Type:
Bug
-
Status: Closed (View Workflow)
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: 9.4.0
-
Fix Version/s: 9.4.0
-
Labels:None
-
Funded by:
When trying to watch the statistics of a FIB question (configured as case sensitive) a RS appears. The cause is a PostgreSQL error: "Spalte »qtistatist0_.answer« muss in der GROUP-BY-Klausel erscheinen oder in einer Aggregatfunktion verwendet werden".
After searching for this error, it seems that the query is not standard compliant. MySQL is a little lax in that case and does not throw an error.
Using PostgreSQL a "group by res.answer" will return the desired result (I think )
The relevant code is org.olat.ims.qti.statistics.manager.QTIStatisticsManagerImpl.getStatisticAnswerOptionsOfItem().
The query:
select res.answer, count(res.key) from qtistatsresult res inner join res.resultSet rset where rset.olatResource=:resourceId and rset.olatResourceDetail=:resSubPath and rset.lastModified = (select max(r2set.lastModified) from org.olat.ims.qti.statistics.model.QTIStatisticResultSet r2set where r2set.identityKey=rset.identityKey and r2set.olatResource=rset.olatResource and r2set.olatResourceDetail=rset.olatResourceDetail ) and res.itemIdent=:itemIdent and res.duration > 0 group by res.key