Skip to content

Support for Microsoft SQL Server #2

@mrkskwsnck

Description

@mrkskwsnck

Unfortunately, the course statistics do not seem to work at all but lead to an SQL Server error. Anyhow, we would like to give it a try.

Maybe the most important fact is that our Moodle platform runs with Microsoft SQL Server as database.

System

  • Moodle 3.9.4+ (Build: 20210226)
  • DB: Microsoft SQL Server
  • Plug-ins:
    • Learning Analytics Log v0.8.0 (Build: 2020102200)
    • Learning Analytics v0.16.0 (Build: 2021021500)

Steps to reproduce

Screenshot

image

Full error message

Debug info: SQLState: 42S22<br>
Error Code: 207<br>
Message: [Microsoft][ODBC Driver 17 for SQL Server][SQL Server]Invalid column name 'week'.<br>

SELECT (FLOOR((l.timecreated - 1604271600) / (7 * 60 * 60 * 24)) + 1)
AS WEEK,
COUNT(*) clicks
FROM mdl_logstore_lanalytics_log l
WHERE l.courseid = '26'
GROUP BY week
ORDER BY week;
[array (
0 => 26,
)]
Error code: dmlreadexception
Stack trace:

    line 486 of /lib/dml/moodle_database.php: dml_read_exception thrown
    line 324 of /lib/dml/sqlsrv_native_moodle_database.php: call to moodle_database->query_end()
    line 431 of /lib/dml/sqlsrv_native_moodle_database.php: call to sqlsrv_native_moodle_database->query_end()
    line 900 of /lib/dml/sqlsrv_native_moodle_database.php: call to sqlsrv_native_moodle_database->do_query()
    line 976 of /lib/dml/sqlsrv_native_moodle_database.php: call to sqlsrv_native_moodle_database->get_recordset_sql()
    line 63 of /local/learning_analytics/reports/coursedashboard/classes/query_helper.php: call to sqlsrv_native_moodle_database->get_records_sql()
    line 50 of /local/learning_analytics/reports/coursedashboard/lareport_coursedashboard.php: call to lareport_coursedashboard\query_helper::query_weekly_activity()
    line 460 of /local/learning_analytics/reports/coursedashboard/lareport_coursedashboard.php: call to lareport_coursedashboard->activiyoverweeks()
    line 46 of /local/learning_analytics/classes/router.php: call to lareport_coursedashboard->run()
    line 103 of /local/learning_analytics/classes/router.php: call to local_learning_analytics\router::run_report_or_page()
    line 118 of /local/learning_analytics/index.php: call to local_learning_analytics\router::run()

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions