Skip to content
This repository was archived by the owner on May 29, 2024. It is now read-only.

Commit cf11faf

Browse files
author
Seth Battis
committed
Human-readable
Not sure what happened, but apparently a bunch of the data that makes the data human-readable had been lost in all the merges at mid-summer. Oy. Signed-off-by: Seth Battis <[email protected]>
1 parent ab4c082 commit cf11faf

File tree

2 files changed

+37
-29
lines changed

2 files changed

+37
-29
lines changed

canvas-grading-analytics.sql

Lines changed: 25 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,37 @@
1-
-- phpMyAdmin SQL Dump
2-
-- version 3.5.3
3-
-- http://www.phpmyadmin.net
4-
--
5-
-- Host: localhost
6-
-- Generation Time: Jun 20, 2014 at 12:58 PM
7-
-- Server version: 5.5.37-0ubuntu0.12.04.1
8-
-- PHP Version: 5.3.10-1ubuntu3.11
9-
10-
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
11-
SET time_zone = "+00:00";
1+
# ************************************************************
2+
# Sequel Pro SQL dump
3+
# Version 4096
4+
#
5+
# http://www.sequelpro.com/
6+
# http://code.google.com/p/sequel-pro/
7+
#
8+
# Host: 127.0.0.1 (MySQL 5.5.38-0ubuntu0.12.04.1)
9+
# Database: canvas-grading-analytics
10+
# Generation Time: 2014-10-07 20:40:28 +0000
11+
# ************************************************************
1212

1313

1414
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
1515
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
1616
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
1717
/*!40101 SET NAMES utf8 */;
18+
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
19+
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
20+
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
1821

19-
--
20-
-- Database: `grading-analytic`
21-
--
22-
CREATE DATABASE `grading-analytic` DEFAULT CHARACTER SET latin1 COLLATE latin1_swedish_ci;
23-
USE `grading-analytic`;
24-
25-
-- --------------------------------------------------------
2622

27-
--
28-
-- Table structure for table `course_statistics`
29-
--
30-
-- Creation: Apr 24, 2014 at 10:40 AM
31-
--
23+
# Dump of table course_statistics
24+
# ------------------------------------------------------------
3225

33-
CREATE TABLE IF NOT EXISTS `course_statistics` (
26+
CREATE TABLE `course_statistics` (
3427
`id` int(11) NOT NULL AUTO_INCREMENT,
3528
`timestamp` text NOT NULL COMMENT 'When this statistic was collected',
3629
`course[id]` int(11) NOT NULL COMMENT 'Canvas course ID',
3730
`course[name]` text NOT NULL COMMENT 'Human-readable course name, as listed in Canvas',
3831
`course[account_id]` int(11) NOT NULL COMMENT 'The account_id associated with this course (i.e. the department) for departmental aggregation of data.',
3932
`account[name]` text NOT NULL COMMENT 'Human-readable department name',
4033
`teacher[id]s` text NOT NULL COMMENT 'A serialized array of Canvas user IDs for the teacher(s) of the course.',
41-
`teacher[sortable_name]s` int(11) NOT NULL COMMENT 'Serialized list of human-readable teacher names',
34+
`teacher[sortable_name]s` text NOT NULL COMMENT 'Serialized list of human-readable teacher names',
4235
`assignments_due_count` int(11) NOT NULL COMMENT 'The overall number of assignments with due dates prior to the timestamp, including both graded and ungraded assignments and zero-point assignments.',
4336
`dateless_assignment_count` int(11) NOT NULL COMMENT 'Assignments that lack due dates.',
4437
`gradeable_assignment_count` int(11) NOT NULL COMMENT 'The number of gradeable, non-zero-point, assignments posted in this course with due dates prior to this statistic collection timestamp',
@@ -52,8 +45,14 @@ CREATE TABLE IF NOT EXISTS `course_statistics` (
5245
`gradebook_url` text NOT NULL COMMENT 'URL of the course gradebook',
5346
`student_count` int(11) NOT NULL COMMENT 'The number of student enrollments in this course. (Not yet filtering out the Test Student enrollments.)',
5447
PRIMARY KEY (`id`)
55-
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=30387 ;
48+
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
49+
50+
51+
5652

53+
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
54+
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
55+
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
5756
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
5857
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
5958
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;

private/data-collection.php

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ function collectStatistics($term) {
4040
);
4141

4242
$teacherIds = array();
43+
$teacherNames = array();
4344
$teachers = $lookupApi->get(
4445
"/courses/{$course['id']}/enrollments",
4546
array(
@@ -48,19 +49,25 @@ function collectStatistics($term) {
4849
);
4950
do {
5051
foreach ($teachers as $teacher) {
51-
$teacherIds[] = $teacher['id'];
52+
$teacherIds[] = $teacher['user']['id'];
53+
$teacherNames[] = $teacher['user']['sortable_name'];
5254
}
5355
} while ($teachers = $lookupApi->nextPage());
56+
print_r($teacherIds);
57+
print_r($teacherNames);
5458
$statistic['teacher[id]s'] = serialize($teacherIds);
59+
$statistic['teacher[sortable_name]s'] = serialize($teacherNames);
60+
61+
$account = $lookupApi->get("/accounts/{$course['account_id']}");
62+
$statistic['account[name]'] = $account['name'];
5563

5664
// ignore classes with no teachers (how do they even exist? weird.)
5765
if (count($teacherIds) != 0) {
5866
$statistic['student_count'] = 0;
5967
$students = $lookupApi->get(
6068
"/courses/{$course['id']}/enrollments",
6169
array(
62-
'type[]' => 'StudentEnrollment',
63-
'per_page' => 50
70+
'type[]' => 'StudentEnrollment'
6471
)
6572
);
6673
do {
@@ -114,10 +121,12 @@ function collectStatistics($term) {
114121
if (strtotime($assignment['due_at']) < strtotime($statistic['oldest_ungraded_assignment_due_date'])) {
115122
$statistic['oldest_ungraded_assignment_due_date'] = $assignment['due_at'];
116123
$statistic['oldest_ungraded_assignment_url'] = $assignment['html_url'];
124+
$statistic['oldest_ungraded_assignment_name'] = $assignment['name'];
117125
}
118126
} else {
119127
$statistic['oldest_ungraded_assignment_due_date'] = $assignment['due_at'];
120128
$statistic['oldest_ungraded_assignment_url'] = $assignment['html_url'];
129+
$statistic['oldest_ungraded_assignment_name'] = $assignment['name'];
121130
}
122131
}
123132
}

0 commit comments

Comments
 (0)