1 | <?php |
||
16 | class Toolbox extends \smtech\StMarksReflexiveCanvasLTI\Toolbox |
||
17 | { |
||
18 | const TOOL_CANVAS_EXTERNAL_TOOL_ID = 'TOOL_CANVAS_EXTERNAL_TOOL_ID'; |
||
19 | const TOOL_CANVAS_ACCOUNT_ID = 'TOOL_CANVAS_ACCOUNT_ID'; |
||
20 | |||
21 | /** |
||
22 | * Course statistics history |
||
23 | * @var History |
||
24 | */ |
||
25 | protected $history; |
||
26 | |||
27 | /** |
||
28 | * Course statistics snapshots |
||
29 | * @var Statistic[] |
||
30 | */ |
||
31 | protected $snapshots; |
||
32 | |||
33 | /** |
||
34 | * Configure LTI configuration XML generator to include course and account |
||
35 | * navigation placements. |
||
36 | * |
||
37 | * {@inheritDoc} |
||
38 | * |
||
39 | * @return \smtech\LTI\Configuration\Generator |
||
40 | */ |
||
41 | public function getGenerator() |
||
58 | |||
59 | /** |
||
60 | * Extend load configuration to reset `TOOL_CANVAS_EXTERNAL_TOOL_ID` |
||
61 | * |
||
62 | * @param string $configFilePath |
||
63 | * @param boolean $forceRecache |
||
64 | * @return void |
||
65 | */ |
||
66 | protected function loadConfiguration($configFilePath, $forceRecache = false) |
||
75 | |||
76 | /** |
||
77 | * Get the course statistics history for a particular course |
||
78 | * |
||
79 | * @link https://smtech.github.io/grading-analytics/definitions.html Online |
||
80 | * documentation of course statistic fields |
||
81 | * |
||
82 | * @param string|integer $courseId Numerica Canvas course ID |
||
83 | * @return array|false One row per course statistic collected daily, as |
||
84 | * described in the documentation, or `FALSE` if no |
||
85 | * statistics are available |
||
86 | */ |
||
87 | public function getHistory($courseId) |
||
94 | |||
95 | /** |
||
96 | * Get a snapshot across a particular domain relevant to a course or |
||
97 | * department |
||
98 | * |
||
99 | * @link https://smtech.github.io/grading-analytics/definitions.html Online |
||
100 | * documentation of course statistic fields |
||
101 | * |
||
102 | * @param string|integer $courseOrDepartmentId A numeric Canvas course or |
||
103 | * ccount ID (course is is assumed unless explicitly specified by |
||
104 | * `$isCourseId`) |
||
105 | * @param Domain $domain Domain across which to take snapshot |
||
106 | * @param boolean $isCourseId (Optional, defaults to `TRUE`) whether or |
||
107 | * not `$courseOrDepartmentId` is a course |
||
108 | * (`TRUE`) or department (`FALSE`) Id |
||
109 | * @param string|integer|boolean $teacherFilter (Optional, defaults to |
||
110 | * `FALSE`) An optional filter |
||
111 | * to limit the snapshot data |
||
112 | * to courses taught by a |
||
113 | * particular numerica Canvas |
||
114 | * user ID |
||
115 | * @return array|false One row per course statistic collected daily, as |
||
116 | * described in the documentation, or `FALSE` if no |
||
117 | * statistics are available |
||
118 | */ |
||
119 | public function getSnapshot($courseOrDepartmentId, Domain $domain, $isCourseId = true, $teacherFilter = false) |
||
127 | } |
||
128 |