Since my last meeting with Louise, I’ve been working on the e-Portfolio Templates widget, specifically looking at customising it for her Legal Skills module. When the first instance of this is done, we’ll have our first use case scenario to test out. I have, however, come across a number of issues which I thought it’d be worth posting about. I only cover one here really and aim to look at others (if they remain issues) in future posts1.
The first issue I have is dynamically inserting content into each page of a student’s portfolio, automatically on their behalf. If we are to provide students with a structure for their portfolio, it’s not enough to provide them with a set of titled but blank pages (as I do in the demo video within the summary of the lunch meeting) — the pages need structure too. Blackboard’s e-portfolio tool allows (or requires that) users edit their pages through a Visual Text Box Editor (VBTE), with its own formatting toolbars. The VBTE in Blackboard is an rendered by an iframe within a form. To get readymade structures onto each page the widget needs to enter information into the iframe before the user does and, because we are building several templates at once, it needs to submit the form on their behalf too.
Unfortunately, the iframe in question loads after the rest of the page. If the tool is set to try and insert content right away, an error is produced effectively saying that the element could not be found or that a certain property of it does not exist. I can’t find a way (perhaps simply due to my lack of knowledge in this area) to hold off inserting the content until the iframe has loaded properly. Adding an onload event handler for example doesn’t seem to work.
The solution I’ve come up for now involves using a setTimeout call to delay the load by a second. I am, by doing this, effectively hoping that the iframe will have loaded after a second’s delay. Perhaps this is okay — it proves that the widget can work in principle and even if the iframe’s content hasn’t loaded it’s enough that the element itself exists and isn’t producing an error — but it’s not a very elegant or efficient way of dealing with the problem.
Further to that, I’ve found that even after successfully getting the content into the iframe, submitting the form with a simple form.submit() call will not save it. Instead I have to simulate a click of the actual button “Submit” in Blackboard. Again, perhaps this is okay but it does seem a little messy.
So there has been progress but it’s been hampered by a few hiccoughs on the way.
Since my last meeting with Louise, I’ve been busy getting in touch with others she mentioned might be interested in the e-Portfolio Templates widget. I will post more on progress with piloting shortly, as well as the library I have been building to keep the basis of the widget platform agnostic.
1. I’ve refrained from posting on development of this widget previously because much of it was re-factoring code that was developed in another project and would have meant blogging an awful lot of not particularly interesting or necessarily relevant background information. And now I see that, as the tool that operates in a very different and hopefully much more useful way, I was probably right to do this. But it does mean I’m encountering issues I’ve not encountered before, either because they’re completely new or because of my increased awareness of standards. So this is, to borrow Karsten’s phrase, my first “geekcode” post. Sort of.