EduBlog Implementation
Information as of August 8, 2008
EduBlog required the modification of a few different areas of Moodle 1.9 with OU Blog. The base is a weekly build. We should look for a more stable build and merge into that. The tinyMCE work may be useful for other XS based web apps and XS Moodle. Remote Blog API is headed for being an independent API that other apps can use for remote blogging. Ideally, I would like EduBlog to be split into five branches which form the system when merged: tinyMCE w/ Sugar Theme, OU Blog (Not ours), OU Blog Teacher Approval, OU Blog Remote Blogging and Primary XO Theme. Some partitioning of code is needed for this task which will aid in the maintainability of the system.
tinyMCE
TinyMCE was fit into Moodle 1.9 for three reasons: Moodle 2.0 will have tinyMCE as an editor option, tinyMCE supports themeing which the standard HTMLArea does not, other XS based apps can make use of the sugary Editor. Other available editors (Xinha, FCKEditor, others?) were not considered and may be worth a second look.
TinyMCE Integration
The integration of tinyMCE and Moodle is EXTREMELY messy, but should sort itself out with the release of Moodle 2.0. At present, it is based on a weekly build [will find out which one] that has partial support for multiple editors. No core tinyMCE code needed to be modified, but a new Sugar theme was created to model the Write interface. This means that upgrading to the latest tinyMCE would be trivial. The integration code spans a few files including moodlelib.php to get XO Browse recognized as being able to run the editor. Many files in lib/editor/2 were modified also to trim out extra code spit out on the web pages. Two new files uploadimage.php and uploadwrite.php handle uploads from the sugar theme. Both are in need of standard Moodle security checks. This area should be revisited after Moodle 2.0 is released with multiple editor support.
Future Work with tinyMCE Integration
- tinyMCE forms need to have Moodle data in hidden fields
- Look to Moodle 2.0 and figure out how to transition cleanly and smoothly
- Try to implement the php compressor to optimize transfer of tinyMCE (reportedly 75% faster download)
TinyMCE Sugar Theme
The tinyMCE Sugar Theme gives tinyMCE a pretty Write-like interface. The idea was to model the editor after something the kids already know how to use. Most of the implementation is clean, with the exception of the file upload box which should be ripped out and placed in a plugin instead.
Future Work with Sugar Theme
- IE is not supported, but should be. The cause is an annoying issue of how to create an Iframe and change the src with javascript. It is clearly possible since other portions of tinyMCE do this, but it has not been implemented in the Sugar Theme.
- Moodle is not really supported, but should be. A few hidden fields need to be put in the forms for file upload in tinyMCE so that Moodle does not need to circumvent its internal security.
- The XO bug preventing images from being resized needs to be fixed
- The XO bug preventing preview from showing properly needs to be fixed - also need to send a patch upstream to MoxieCode about preview plugin
- The file upload system should be a standalone plugin, not part of the sugar theme
- Sugar Theme needs to make use of configuration settings for toolbars and buttons like other themes
- Preview plugin and comboboxes needs to look more sugary and the buttons should have sugar tooltip graphics
- Some icons are not correct (preview, image upload, write upload) and proper icons need to be made for these features
- More options like emoticons and colors should be implemented
- Remove dependency of getElementsByClassName and other general code cleanup
TinyMCE Plugins
At a minimum, we need to use the inlinepopups plugin for tinyMCE to work properly on the XO. We should create a more native style for inlinepopups instead of using clearlooks2. We also use a patched preview plugin (we should get that patch upstream AFAICT it was a bug). Many other useful plugins exist that we may want to integrate in the future: emoticons, video, flash, etc. A full list is on the tinyMCE website.
OU Blog
Two features were added to Open University's Blog Module: Teacher Approval and Remote Blogging. Affected files all reside in mod/oublog.
Teacher Approval
Core functionality is in locallib.php. The main areas modified include the functions oublog_approve_post, oublog_print_post, oublog_can_view_post and constants defined for selecting the approval type [this needs verification]. Form actions affected include approvepost.php and publishpost.php. Changes to the UI are contained in mod_form.php and post_form.php.
Future Work with Teacher Approval
- Unify the channel for a post becoming public - currently each action needs to call functions in locallib. It should only need to call one function that means a post is going public.
- Better communication between student and teacher - need to discuss
- How to add extra options to the post (both approve and publish) in a less patchy way
Remote Blog Integration
Integration of the Remote Blog API is done through remotebloglib.php and calls to its functions from several oublog files. A few call member functions of the remoteblog class directly, and that dependency should be rerouted through remotebloglib.php. This goes alongvwith removing Moodle dependency from the API itself. The UI is handled by manageremoteblog.php and addremoteblog.php
Future Work with Remote Blog Integration
- Clean Up
- Captcha handling follows from changes to Remote Blog API
- How to handle post failures from spotty connections (queue, cron, etc.) - need to discuss
- Allow editing of remote blogs
- What to do during delete (what if other blogs use this connection?)
- Integrate as much as possible upstream
Remote Blog API
This API is intended to make oublog's access to any remote blog transparent to oublog. Currently only Blogger.com is partially supported. Files reside in mod/oublog/remoteblog. The abstract class oublog_remoteblog [verify] in remoteblog.php provides the base which plugin files need to extend. Any php file with the proper construct in that folder will be automatically recognized and used as a plugin for a remote blog system. Moodle dependency for form generation should be pushed into remotebloglib.php as well as parsing of image src's. The plugin for Google Blogger (blogger.php) requires the Zend GData Library which in turn requires phpxml (yum package php-xml [verify]).
Future Work with Remote Blog API
- Need to remove Moodle dependency
- Should fail cleanly if needed API's (Zend GData) are missing
- Should fail cleanly if login or posting fails
- Support for CAPTCHA (used by Google Blogger may be used by others) - need to discuss how to handle
- Support for video
- Support more flexible selection of image, blog, video host service
- More plugins! MetaWeblog may be a good start. Creating a plugin is nothing more than creating a subclass of oublog_remoteblog and overriding a few functions (see blogger.php)
Write Upload
Since the version of libabiword in build 656 only supports abw properly, we need to handle the conversion to HTML on the server. The easiest way is to install the latest abiword and use its export function. This can all be phased out once people upgrade their builds and can save as HTML properly and upload that rather than the abw file. The relevant files are lib/editor/2/uploadwrite.php [verify] and lib/abiwordlib.php. AbiWord 2.6.0 or greater is also required. This was last minute so it is messy and I'm sure buggy as well.
XO Theme
A fork of Moodle's Primary theme [link it], the Primary XO Theme uses client side javascript to hide excess Moodle options. It may be better to do this stuff serverside, but until we sync up our code with Moodle, it helps keep things separated. Moodle theming is described more on the XS Roadmap [link it]. We need to evaluate the best way to move forward in this area.
Browse / Write 656 Patches
A bug with objectchooser.py prevents the selection of files to upload / insert. Patched version's WriteNew and BrowseNew are intended to overcome the issue until XO builds are upgraded (AFAIK 656 Update 1 is okay). No support aside from fixes to really severe issues will be provided for the patches.
Progress Start - August 15, 2008
Editor UI – June 20 (mostly JS+HTML+a little PHP for uploads)
- Theme for tinyMCE that looks like the Write Activity
- Make it really easy to upload images and video (2-3 clicks)
- Support Browse, Firefox 2, Firefox 3, Internet Explorer 6
- Additional Work (Critical): IE support, Integration of File Upload with Moodle
- Additional Work (Non-critical): Sugar Theme Improvements (select/list boxes, better clarity icons, list for justify select, highlight on iframe overlay), Add Smiley Plugin, Make icons for preview and post, Clean integration of tinyMCE with Sugar theme into Moodle, Proper file upload (as plugin)
Preview – June 25 (PHP+DB)
- Use tinyMCE Preview Plugin
- Additional Work (Critical): Preview plugin does not work in Browse
- Additional Work (Non-critical): Stylesheet for OU Blog, Blogger.com for more accurate rendering
Teacher Review – July 4 (PHP+DB)
Add a column in the blog table that is true if a post has been approved and false otherwise, update pages to use this and only show relevant postsAlternative: use another table, and push data from this “unapproved post” table into the standard one (requires less changes to underlying php but not technically best solution)- Use the visibility settings and permissions management in oublog to create a status for unapproved posts and allows teachers to change he status as they approve the post
Simplify Moodle UI (Teacher and Admin for blogs) – July 9 (PHP+XHTML+CSS+a bit of Moodle knowledge)
- Using Primary Theme with some modifications - renders better on Browse
Post to Remote Blog – July 18 (PHP+XML-RPC+Blogger API)
- Add options for setting up EduBlog (Admin Page)
- Create a simple API that can handle posting HTML and images
- Create a plug-in for Blogger.com that at least supports pushing HTML and images
- Additional Work (Non-critical): API to handle remote editing posts and commenting, Handling unlikely glitches in replacing image src url
- Additional Work (Critical): Error handling when posting to remote blog, captcha request handling, Moodle API based handling of files and urls
Authentication – July 23 [can be done concurrently] (PHP)
Create auth plugin that will just authenticate based on name and push cookies permanentlyMake the session permanent- Ensure that direct links can be made to the blog pages
Packaging – July 28 (Fedora+Shell)
- Package into YUM/RPM
- Alternative: make a self extracting archive and a script to install the tables
UI Modifications from User Feedback - August 2
- A few rounds of modifications and feedback to get it just right