We can use sql.js to evaluate SQL in browser and on the server. This should help with providing both client and server evaluation of a task. The task needs a few settings: - instruction: string - defaultQuery: string For evaluation, it should check whether the resulting datasets are equal. We can use EXCEPT to check that. - db: URL to a sqlite3 database - query: Solution query to compare against For feedback, there should be a few checks: - Report mismatched row count: If EXCEPT returns rows - Report mismatched column count: If EXCEPT errors with "SELECTs to the left and right of EXCEPT do not have the same number of result columns" - Report mismatched/unordered columns: If EXCEPT returns all rows - Show query result as table For the UI, we only need a code input with highlighting for the SQL query.
Activity