EduBlog Implementation

From OLPC
Jump to navigation Jump to search

EduBlog required the modification of a few different areas of Moodle 1.9 with OU Blog. 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 four branches which form the system when merged: tinyMCE w/ Sugar Theme, OU Blog, OU Blog Teacher Approval, OU Blog Remote Blogging. 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 my 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.

Remote Blog Integration

Remote Blog API

Write Upload

Browse / Write 656 Patches