[Xerte-dev] Re: A little help digging into Xerte's internals?
Smith, John
J.J.Smith at gcu.ac.uk
Sat May 9 09:28:27 BST 2015
Hi Brad,
You are in the right place for both. For q1 I suspect that you are falling foul of browser caching; I'm making the assumption that you are definitely not using the Flash LO engine and it is the javascript one, ie xenith.js
What I often do after a page model change is navigate to the lo page of interest, look in the network tab of the browser console and find textVideo.html. Double click on it and it will open in its own tab - it wont display correctly or will show garbage but if you hit F5 or reload/refresh then it should update the cached copy and then refresh the LO tab. It should now use the newly downloaded copy. Doing it this way I find is quicker than having to clear the cache each time...
As for the LO pages data, it is all stored in the preview.xml file (and then in data.xml when published) within the relevant USER_FILES folder for that particular id. The cdata blocks are there to escape blocks that would invalidate the xml, such as < > etcSome of the text that is displayed on screen, especiallybin prompts or buttons etc in the LOs however comes from the language files. Use the network tab in console to watchbthe browser download the files the lo uses and you can double click them to examine their contents.
What is the string you are looking for? If it is a default one then github is also a good place to search. If its entered by yourself it will be in preview.xml somewhere...
John
Sent from Samsung tablet
________________________________________
From: Smith, Bradley [brsmith at akamai.com]
Sent: 09 May 2015 00:43
To: Smith, John; For Xerte technical developers
Subject: Re: [Xerte-dev] A little help digging into Xerte's internals?
Thanks for the quick reply, fellow Smith! :)
I’m still left with two questions:
1. (the really important one) So, if I suspect that something is misbehaving in the javascript that controls textVideo pages. …where should I be looking to debug/change that? The only suspect I’ve found is `models_html5/textVideo.html`, but as I’ve said, changing it doesn’t seem to actually affect anything.
2. Where is the actual page content (the stuff that replaces "<![CDATA[ Enter text for the page here ]]>” in preview.xml) stored? I did a recursive grep for a string that I know is in one of my LOs in both USER-FILES (and later the whole xerte tree), and in a mysqldump of the database, and got no matches. Is the content in the database but encoded or something? If it’s in the database, given that Xerte already keeps some LO-specific data in preview.xml, why not just keep it all there? An LO that isn’t trying to cram in way too much stuff for one lesson shouldn’t really get big enough for it to make much difference performance-wise, right, and then you’d have a more revision-controllable, text-based format that could just be archived up with the rest of the stuff in its USER-FILES subdir for portability, right?
—Brad
> On May 8, 2015, at 6:40 PM, Smith, John <J.J.Smith at gcu.ac.uk> wrote:
>
> Hi Brad,
>
> See below.
>
> John
>
> Sent from Samsung tablet
>
> Please send all enquiries to our shared Blended Learning inbox at hlsblt at gcu.ac.uk and one of the Learning Technologists will respond.
>
>
>
> -------- Original message --------
> From: "Smith, Bradley" <brsmith at akamai.com>
> Date: 08/05/2015 23:18 (GMT+00:00)
> To: For Xerte technical developers <xerte-dev at lists.nottingham.ac.uk>
> Subject: [Xerte-dev] A little help digging into Xerte's internals?
>
>
> I’ve noticed that, at least for me, the “Video Width” and “Video Height” properties on video pages don’t seem to have any effect. I’d like to learn more about Xerte’s internals and help out by troubleshooting this, so I’ve been digging around, but I’ve hit some walls and only have so much time I can spend on the issue (which unfortunately is making the video page pretty much unusable for me).
>
> So, in light of the recent thread about how handy it would be to have more some more detailed references re how XOT content is built, how about I write up what I’ve figured out, and then hopefully someone more knowledgable can help me fill in the missing pieces?
>
>
> 1. A template page like `modules/xerte/parent_templates/Nottingham/wizards/en-GB/data.xwd` defines the properties you see in the `edithtml.php`
> * …but the field definitions in here don’t look like they’re intended for human consumption, so maybe they come from somewhere else? like `src/Nottingham/wizards/en-GB/textVideo.xwd`? If so, I haven’t been able to make changes in the latter show up in the former… the latter are the individual page model wizard files. These are not used by the wizard but are combined to produce the data.xwd file that the wizard/editor loads
> 2. When you save content in the editor, it is written to `USER-FILES/$ID-$USER-$TEMPLATE/preview.xml`, which is read by `show_preview_code()` in `modules/xerte/preview.php` when you click Play.
> * side-note: it looks like XOT saves the last ten versions as `preview.xml.1`, `preview.xml.2`, which would suggest some kind of revision control feature, which is cool but I’ve seen no evidence of such a thing. What’s going on there? Not sure. Probably something Tom added while working on the new editor. Its either a new feature or for testing the data integrity while saving
> 3. `show_preview_code()` calls show_template_page() in play.php. Assuming you’re rendering as html5, this loads `modules/xerte/player_html5/rloObject.htm`
> * A fun fact I picked up here: you can append “&page=X” to the url to link directly to page X of the LO. Nice! You can also use PageID= and LinkID= which are less likely to be changed (such as by adding/moving pages)
> 4. At this point most of the heavy lifting seems to be handled by `modules/xerte/parent_templates/Nottingham/common_html5/js/xenith.js`
> 5. This does an AJAX call to retrieve USER-FILES/$ID-$USER-$TEMPLATE/preview.xml?time=$UNIX_TIMESTAMP
> * First, why would you pass a url argument to a request for a static file? Is there something more going on here? There are some .htaccess files scattered about, but they don’t look like they do anything related to this, and yet... The timestamp parameter to to ensure the file is downloaded from server and not losded from cache
> * The xml just describes the structure of the LO, and has "<![CDATA[ Enter text for the page here ]]>” where all the content should be, so it must be being replaced by something…
> 6. …and at this point I’ve spent more time than I can justify today digging around trying to get to the bottom of this problem. Unfortunately I still haven’t answered question I really need to answer here: where the heck does the actual page content come from? The LO data comes from the xml file you mention above. It is loaded and parsed, page by page, by xenith.js and the page data is made available to the page models as they are loaded to be used for the first time.
> * A model file like `modules/xerte/parent_templates/Nottingham/models_html5/textVideo.html` seems like it has to be involved, since it appears to define the code that actually displays a given page type, but when I make changes in this file they don’t seem to be reflected in what gets rendered.
>
> I feel like I’ve gotta be close to the end of this trail (at least, I dearly hope I am…), but I just don’t have any more time to spend on this. Could one of the devs help me out? Then maybe this could be turned into a sort of architecture overview on the github wiki to help other new folks in the future.
>
> Thanks!
> —Brad
>
>
>
> This message and any attachment are intended solely for the addressee
> and may contain confidential information. If you have received this
> message in error, please send it back to me, and immediately delete it.
>
> Please do not use, copy or disclose the information contained in this
> message or in any attachment. Any views or opinions expressed by the
> author of this email do not necessarily reflect the views of the
> University of Nottingham.
>
> This message has been checked for viruses but the contents of an
> attachment may still contain software viruses which could damage your
> computer system, you are advised to perform your own checks. Email
> communications with the University of Nottingham may be monitored as
> permitted by UK legislation.
>
>
> Glasgow Caledonian University is a registered Scottish charity, number SC021474
> _______________________________________________
> Xerte-dev mailing list
> Xerte-dev at lists.nottingham.ac.uk
> http://lists.nottingham.ac.uk/mailman/listinfo/xerte-dev
>
>
>
>
> This message and any attachment are intended solely for the addressee
> and may contain confidential information. If you have received this
> message in error, please send it back to me, and immediately delete it.
>
> Please do not use, copy or disclose the information contained in this
> message or in any attachment. Any views or opinions expressed by the
> author of this email do not necessarily reflect the views of the
> University of Nottingham.
>
> This message has been checked for viruses but the contents of an
> attachment may still contain software viruses which could damage your
> computer system, you are advised to perform your own checks. Email
> communications with the University of Nottingham may be monitored as
> permitted by UK legislation.
>
Glasgow Caledonian University is a registered Scottish charity, number SC021474
More information about the Xerte-dev
mailing list