Initial commit

So far, this puppy uploads a Blackboard Exportfile and unzips it… it had been parsing the manifest, but I seem to have moved something around and now it's unhappy.

Signed-off-by: Seth Battis <SethBattis@stmarksschool.org>
Scope Fix

Seth now remembers that variable scope is a real thing.

Signed-off-by: Seth Battis <SethBattis@stmarksschool.org>
Bb XML Parsed

The Blackboard XML parsing seems more or less accomplished, and we can handle files up to 250MB without a problem (or, at least, our biggest test file is 215MB and it worked fine). I've diagrammed out the conversion from Blackboard objects to Canvas objects, and now we're down to the fiddly bits.

(N.B. I have rejiggered the .gitignore file so that I can maintain a file with a plaintext copy of the API key and matching instance URL without committing it to Git accidentally.)

Signed-off-by: Seth Battis <SethBattis@stmarksschool.org>
Mapping the Bb Content Item

This is a tentative map. I'm pretty sure there are a view other basic XML structures, but this the big one we need to start with.

Still to come (or at least to be assessed for worthiness):

NAVIGATIONAPLICATIONS
NAVIGATIONSETTINGS
GRADEBOOK
lom (for Content Collection files)
ANNOUNCEMENT
NOTIFICATIONRULES
questestinterop (tests and quizzes)
ASSESSMENTCREATIONSETTINGS
LINK (this might fix some of my frustration with course links!)
GROUPS
FORUM

Signed-off-by: Seth Battis <SethBattis@stmarksschool.org>
Some More Docs

Scrounging around for some more test files and documentation. (This feels like something that shouldn't have to be written from scratch… or decoded from first principles. So far… it is, though.)

Signed-off-by: Seth Battis <SethBattis@stmarksschool.org>
Routing Complete

All Blackboard items appear (so far, fingers crossed) that show up in the course Table of Contents in the manifest (so, not the other resources, like announcements and course links) seem to be being routed to the correct Canvas type. I've continued to update the documentation of that routing as I go.

Signed-off-by: Seth Battis <SethBattis@stmarksschool.org>
PEST and XSLT Implemented

So, a minor diversion caused by my aggravation at Bb's inconsistent capitalization of their XML (and subsequent frustration at parsing it… XML is case-sensitive, yo!). Learned XSLT, or just enough to do what I wanted. Hooked it all together and set up PEST to connect to the RESTful API — which should work, now that I'm actually getting good data out of the XML. Pages should be created with a couple more lines of code.

Signed-off-by: Seth Battis <SethBattis@stmarksschool.org>
Pest, not PestJSON

Turns out that PestJSON is _sending_ JSON as well as receiving it. We actually want to be using regular Pest (but need to json_decode() the responses we get).

Signed-off-by: Seth Battis <SethBattis@stmarksschool.org>
Cleaner UI

Added some CSS and a bit of formatting so that I could take my mind off of how ugly the interface is and get back to coding.

Signed-off-by: Seth Battis <SethBattis@stmarksschool.org>
Code Reorganization

Things were getting long (and about to get longer), broke things into chunks.

Signed-off-by: Seth Battis <SethBattis@stmarksschool.org>
Pages, ExternalURLs, Assignments, Subheaders

Got a bunch of things working, more or less — lots of mop-up to do with fine details.

What's working:

- Pages (still need to process Bb MIME types to get all information and upload attached files).
- ExternalURLS (so long as they don't have descriptive text — if they do, they're Pages and are part of the MIME type issue).
- SubHeaders (with items indented underneath them recursively, to accommodate nested folders clearly).
- Assignments (need to get points, due dates, etc. out of the gradebook res00000 file).

Lots and lots of CSS fiddling while I was thinking about other things.

A redesign of the parser structure to better use Xpaths and to simplify recursion to generate indents.

General code cleanup across the board (again, while I was thing about other things).

Added some documentation about my invisible-to-Git authentication file, just for giggles (while I was thinking about other things).

Signed-off-by: Seth Battis <SethBattis@stmarksschool.org>
Adding subitems, Creating new courses

Fixed a couple of small logic errors that prevented the recursive traversing of subitems of Folders and Lessons and that botched the creation of new courses in Canvas. (And, having noticed some flakiness when I repeatedly import into the same test target course in Canvas, I'm changed my debugging code to usually create a new course, rather than import into an existing course.)

Signed-off-by: Seth Battis <SethBattis@stmarksschool.org>
File Uploads Borked by Canvas API

File uploads are implemented, but there's some hang-up in the Canvas API that's keeping it from working. I've reached out to Canvas for support. But the structure for uploading files is starting to be in place.

Signed-off-by: Seth Battis <SethBattis@stmarksschool.org>
Course Settings

Course settings are now imported. Still waiting on resolution for the file upload issue with Canvas — much of what is left hinges on that (or can only be tested when that works).

Signed-off-by: Seth Battis <SethBattis@stmarksschool.org>
File Attachments

Fixed the file uploading by opting not to try and use the POST call to upload the file, but instead transferring it through a public URL — after munging the filename to obscure it.

Subitems were not importing and indenting ([Issue 4](https://github.com/smtech/canvas/issues/4)) because they were files and files weren't even attempted. Now they are. Now it should be working.

Still to come, in order:

- Embedded links and images
- Assignment details
- Course links
- Quizzes
- Conferences

Signed-off-by: Seth Battis <SethBattis@stmarksschool.org>
Disambiguated SIS ID

Bah. So much for trying to be smart. If the user wants to create another course with the same SIS ID, I say "feh!". Instead, all SIS IDs are now a combination of the original course ID from Bb and a timestamp for the import. (Also: cleaned up timestamp formatting.)

Signed-off-by: Seth Battis <SethBattis@stmarksschool.org>
Attachments Redux

Reworked the attachment code and the content collection code to not conflict. (I think the core problem is that the PHP Zip class is not friendly towards windows paths, which is what Bb generated in their export files. Blergh.)

Started in on embedded links (simple ones might even be working).

Broadly speaking, this death star is operational. It still needs a few frills, but the hard part is done.

Signed-off-by: Seth Battis <SethBattis@stmarksschool.org>
Slap Happy

I probably shouldn't be allowed to code. Or use Photoshop. But now the Blackboard Imports sub-account has its own logo.

Because I can.

Signed-off-by: Seth Battis <SethBattis@stmarksschool.org>
Embedded Links

Embedded Links appear to be working (at least, for files that exist in the ExportFile… it appears that Blackboard did not export _all_ content collection items with the course, so some courses may refer to files that simply aren't in the export. I think the Bb only exported things that were in the teacher's personal content collection or the course's content collection — but not things that were from other content collections. Maybe.)

Signed-off-by: Seth Battis <SethBattis@stmarksschool.org>
Ignore Files

Added files whose names start with .ignore to the .gitignore file (so that I can store my authentication credentials in them!)

Signed-off-by: Seth Battis <SethBattis@stmarksschool.org>