How do I set pages to default to the HTML editor (when I'm editing pages), either in my account or my course?
There is not a way to do this, currently. There was a feature idea launched about a year ago (you can see it here but only if you have access to Cold StorageAllow users to set HTML or WYSIWYG editing mode default) but it was archived due to lack of support.
As I read through the discussion surrounding the feature request that Tracey linked to, I pulled in an idea from another discussion that was happening in the last week about Create Global variable so that something would run only once. If, and that's a big if, you could figure out how to make it default to HTML mode, then you could save that preference in a cookie or in the Canvas Custom User Data to remember the change.
In short, I agree with Tracey that it can't be done, at least not easily and not using Canvas' core functionality.
In some other places, I've shared part of the experimentation and exploration I've done into overriding the default behavior of the Rich Content Editor (RCE).
You would need to identify part of the initialization code needed modified. I've said it everywhere I've written about this, but I don't understand this well enough to know what this might break.
Another, less invasive, approach might be to wait until Canvas has loaded the Rich Content Editor and then just trigger the link that switches to the HTML editor. I looked at a related idea over spring break while trying to avoid grading papers. The idea there was for Canvas to remember where you were when you switched between RCE to HTML views. While I as primarily focused on that aspect, if I had managed to find something that worked, I would have attached an event listener to the link that did the toggle to know when to invoke my code.
There's also the issue of determining when it should run; that's always been an issue with writing anything that deals with the Rich Content Editor. It is found in a lot of different places, and even if someone's default is to start off in HTML editor mode, that's probably not the mode that someone should start with if they were taking a quiz.
Retrieving data ...