Completed
Push — master ( 68e12f...ab20ed )
by Seth
02:02
created

course/js/index.js (1 issue)

Upgrade to new PHP Analysis Engine

These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more

1
/*jslint browser */
2
/*global $,fetch,Chart */
3
var gradingAnalytics = {
4
  loadChart: function(domId, chartUrl, course_id, department_id = false) {
5
    fetch("chart/" + chartUrl + "?course_id=" + course_id + (department_id !== false ? "&department_id=" + department_id : ""))
6
      .then(function (response) {
7
          return response.json();
8
      }).then(function (data) {
9
          new Chart($(domId), data);
0 ignored issues
show
Unused Code Best Practice introduced by
The object created with new Chart($(domId), data) is not used but discarded. Consider invoking another function instead of a constructor if you are doing this purely for side effects.
Loading history...
10
      });
11
  }
12
}
13