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>
Merge branch 'refs/heads/dev-blackboard-import'
Minor Tweaks

A couple of minor tweaks related to moving files around and taking the import tool "live".

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

So… some of Ken's courses break the import process because he has title-only announcements. Now we check to see if there's a body (which Canvas requires) and create one as a non-breaking space (&nsbp;) if there is none.

Oy.

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

Caught one more error (trying to link to a missing file page as though it were the file itself) and generated a more  meaningful error message when a file couldn't be staged for upload.

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

It turns out that (somehow — god only knows how), you can add an external URL as a file attachment in Blackboard. Steve did this and broke things. I think it's now accounted for correctly AND the import receipt is now more informative both here and for missing files.

Also: it looked like we were exiting the file attachment loop early (https://github.com/smtech/canvas/blob/36f2c85f33c021ea108b0b3d1cf352f6d521af6e/www/api/blackboard-import/index.php#L1518) — although, empirically, I don't know if that was really happening. Weird. In any event, we're not breaking there _any more_.
Signed-off-by: Seth Battis <SethBattis@stmarksschool.org>
Reusable Functions

Pulling some more functions out of the Blackboard Import project into separate include files, for reuse by other projects (specifically the page-generator functions, which had been embedded in canvas-api.inc.php, where they didn't really, logically belong and the functions for working with session-based temporary directories).

Also, made callCanvasApi() more forgiving about the (now-optional) $data parameter.

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

A first, quick pass at a tool to archive discussions. Initially meant just to archive discussions out of a group, for potential reimport into a course, it's written so that it should be able to archive discussions out of a course, group or collection.

N.B. Because the group that I was archiving had less than 50 discussions, I didn't bother to deal with the pagination of Canvas' JSON responses proactively!

Signed-off-by: Seth Battis <SethBattis@stmarksschool.org>
Merge branch 'refs/heads/master' into dev-blackboard-import

Merging master branch into dev-blackboard-import to bring the dev branch up-to-date so I can clean up a few things.

Signed-off-by: Seth Battis <SethBattis@stmarksschool.org>
Deprecated exitOnError()

I build myself a much better error display function a while back, but hadn't replaced all the calls to exitOnError() with it. Now I have, and I have removed exitOnError().

Also: .gitignore has been updated to reflect the presence of .orig merge files scattered throughout the directory. Eventually they should get cleaned up. But, meanwhile, no need to commit them to the repo.
Signed-off-by: Seth Battis <SethBattis@stmarksschool.org>