Archive for the ‘Moodle’ Category

Screen Cast

Thursday, September 18th, 2008

After having tones of trouble with sound drivers and getting my mic to work i have finally been able to get sound in my screen cast and it uploaded.

You can view the flash version of the screen cast here: http://compsci.ca/~dan/screencast.swf

This screen cast is a demo of the first version of the Moodle Grade Book stats and visual reports witch i worked on for Google Summer of Code.

End of My Summer of Code

Monday, August 18th, 2008

Today is the official pencil down date for the 2008 Google Summer of Code and is the last day code can be submitted to be counted in the final evaluation. This is also the week i move back to Thunder Bay to start a new term at Lakehead University, so it has been a busy week of finishing up code and documentation, getting packed up for the move and setting up the CompSci.ca server to host a new project i will be a part of this fall.

I have committed the latest code for the project and considering this to be a first release of the report/stats and report/visual plug-ins for Moodle 2.0 dev. I have also update my test site with the newest code so any one can take a look at the plug-ins running in a Moodle install (you can login as guest). I had also hoped to have a screen cast demoing the plug-ins for today however due to some trouble getting sound working right it will probably be ready late Tuesday or early Wednesday.

Anthony Borrow has requested that i get an entry for the plug-ins added to the Moodle Modules and Plugins Database and some pages up about it on the Moodle Wiki instructing users how to use the plug-ins and install them, witch i plan to also get done this week, time and internet permitting (i may not have internet access for a few days well moving back to Thunder Bay).

You can download the plug-ins at:

report/visual: http://download.moodle.org/plugins/grade/report/visual.zip
report/stats: http://download.moodle.org/plugins/grade/report/stats.zip

GSoC 2008: Comming to an end

Wednesday, August 6th, 2008

Google Summer of Code 2008 is coming to an end with the “Suggested ‘pencils down’ date” on the 11th and the “Firm ‘pencils down’ date.” on the 18th and yet i still feel like there is so much that could be added to my project.

Whats done:

  • report/stats gradebook plug-in works and shows text based statics on a courses grades in a table format.
  • report/stats has a modular design that allows for new statics to be dropped in.
  • Printable version of report/stats.
  • Group related functions for report/stats.
  • Settings page for report/stats.
  • report/visual gradebook plug-in’s framework is done and allows for new visualization to be dropped in.
  • report/visual gradebook plug-in’s flash/flex with flare front end is in a running state and can take grade data from Moodle, a visualization’s settings in an XML format and turn them into an interactive visualization for the user.
  • Continuous Grade Distribution Visualization.
  • Grade Distribution by Item (Bar) Visualization.
  • Grade Distribution by Group (Bar) Visualization.
  • Grade Distribution (Line) Visualization.
  • Normalized Grades vs Students Visualization.
  • Ability to invert Visualization’s axes.
  • Ability to hide axes.
  • Ability to hide axes labels.
  • Ability to hide any legend item (hide a group or item).
  • UI Selector widget for changing data source of the visualization.
  • Highlighting of legend items (highly a group or item in a graph).
  • Popup detailing a nodes information/data.

What needs to be done this week:

  • Finish printer friendly version of report/visual.
  • Add in checking of users capability to see if they should be able to view a visualization or statistic.
  • Add in two or three other visualizations i was planing to get in.
  • Finish options page for report/visual.
  • Fix mode problem in report/stats where students could possibly see all grades.

What needs to be done before the 18th:

  • Add more documentation.
  • Do final testing and fix any bugs found.
  • Clean up code.

What i wanted to get in but probably will not have time for:

  • Back port to Moodle 1.9.x
  • Export functionality to other programs and document types like excel.
  • Port to flare 2008.07.29 (new major flare release that had some big changes to the API witch would require some recoding of the plug-in’s front end).
  • Stats and visuals for outcomes and outcome reports.
  • “Find me in data” - a feature i wanted to add to show a user where they are in the data being visualized.
  • More options, more controls, more functions, more cool looking animations, more visualizations, more statistics, etc.
  • Better looking graphically and more natural UI.
  • Add reports that go beyond just grades in a course. Compare diffrent courses, years, drop out trends, age of students, submission times, etc.

Overall i am rather happy with how far the project has come considering that at the start i knew nothing of Moodle, Flex, Flare, Actionscript 3, or much flash. I think the plug-ins that i have made will be use full to teachers and educators and i hope to keep supporting them and working on them in my spare time as a hobby after GSoC has come to an end.

Grade Distribution

Thursday, July 24th, 2008

I have finally been able to get another visualization working for the report/visual plug-in. This one is a Grade Distribution line graph that can show the distribution of grades for any group or item in a course including aggregated items like course total (a students overall mark in a course). Some screen shots of the new visualization can be seen below:

gadedist.pnggadedist1.pnggadedist2.png

Currently the grades are being place in groups of 10% (0% - 9.99..%, 10% - 19.99…, and so on) witch is used as the x axis and the number of students is used as the y axis. As with the other visualization, the axis are invertible and the same UI and features are used.

Unfortunately the changes to the back and front ends of the plug-in to make them dynamic as possible and to allow creation of new visualizations simply by making a PHP class in Moodle was more complicated then anticipated and has set me some what behind my original schedule for the project. Hopefully i will be able to make up for some of the lost time and still be able to get in all the features i wanted.

Moodle Easter Egg?

Monday, July 21st, 2008

moodle-egg.jpgWell looking for the Moodle library file, “weblib.php”, i came across an oddly named file calledwomenslib.php. After wondering what kind of library could possible be called that and what could it do for a few seconds i opened it up and found the fallowing code:

<?php
include(’../config.php’);
redirect(’http://en.wikipedia.org/wiki/Women%27s_liberation’);
?>

This file also seems to be on the main moodle.org site: http://moodle.org/lib/womenslib.php

It would seem that the Moodle core developers have a senses of humor.

Bugs, Patches and Open Source

Saturday, July 19th, 2008

moodlepatch.jpgOne of the requirements of my project is to develop the stats and visual plug-in for Moodle 2.0, a version of Moodle witch is still under development. This means that if done right my plug-in will be compatible with the new release of Moodle once it comes out as well as take advantages of the new functions and frame works that are being added and are introduced in PHP5 (Moodle 2.x is moving from PHP4 to PHP5). However it also means that some of the functions i am using from the Moodle frame work are still buggy and at rare times new bugs are introduced to the development branch as the core developers work towards the new release.

Such seems to be the case tonight where a new bug showed up once i updated from development branch and all of a sudden the group (class/course sections) functions started messing up in my plug-in. After searching my own code for some time, thinking it was something i changed, i traced the bug back in to the Moodle core functions where there was a check that was failing as a side effect of a change to a seemingly unrelated piece of code.

So i whipped up a bug report and a patch to fix the bug and summited it to the Moodle tracker in the hopes that some one would look over my report in a day or two and look in to it. After all i was posting it at 3:37 AM on the week end, however to my amazement 30 minutes latter my report had been looked in to, commented on, a patch (based on mine but better) was committed to the development branch and the tracker issue was closed.

This is one of the reasons why i love the Open Source Ideology so much. In a closed source corporate environment a bug like this could take days to get from begin reported, to being looked in to, to being fixed (especially since it was reported early in the morning on Saturday) causing untold amount of frustration to the users and delays to developers working on the code effected by the bug. If Moodle was closed source software for witch i was creating the same plug-in from a limited plug-in API available to the public my bug report would have not be any where as nearly detailed in to the cause of and how to fix the bug and would be limited to simply saying “hey X is not working for some reason” and i deftly would not haven been able to give a patch that the core developers could base a fix on, causing lost man hours for the payed developers looking in to and tracking down a bug in a vague report that could be better spent.

There is also a great feeling knowing that you where able to help out an Open Source project and that your patch (as simple as it may be in this case) got in to the code base and will help others. It is also great thing to be able to fix the bugs you come across in software, change it in any way you may feel like or just see how things work under the hood.

Now if i could only get the bugs in windows mobile on my phone fixed….

Playing with XML

Wednesday, July 16th, 2008

In addition to the printer issue i am also working on making the flex with flare interface more dynamic in that it can be heavily changed from the Moodle back end with out the need for touching the actionscript code.

As Moodle is a PHP project there may be few developers willing to update the flex side of the application i am making, so in an effort to making the project maintainable in the future i am try to keep as many settings in the Moodle side as possible. The way i am accomplishing this in an elegent manner is to have a dynamically generated XML file with each setting for the current visualizations being displayed to the user, witch will be read in by the flex application and determine how and what visualization is being displayed.

This XML settings file will have everything needed to define a
visualization (except the raw data) including the language strings, the flare layout type to use, what encoders to use, the legends to be displayed, what data is on the axes, and even the fonts and colors to be used. This XML file will be generated based on a visualization class for each visualization witch will be dynamically loaded in. In theory this should allow for new visualizations to be added in with no need to change the actionscript code that makes up the flex application or to change any code in the plug-in (just drop the new class in the visualization dir).

The parsing of the XML in to the flex application is made impressively easy in Flex 3 with the XML class. As can be seen from this relay cool example provided by adobe, XML code can be read in (in this example hard coded) in about one line and then be tread like a class but with some additional tricks and abilities to share. To make things even easier this XML functionality can be used with the URLLoader and URLRequest classes witch my application already uses to load tab formated data for flare such as in this example (also from adobe).

On the Moodle side of things there is also some functions for dealing with XML however they are apparently a bit out of date. Moodle includes an XML library in it’s framework (/lib/phpxml/xml.php) witch has a function for converting a PHP array into an XML string. Unfortunately this library seems to have been made for an older version of PHP and now spits out:

Notice: Only variable references should be returned by reference in /var/www/localhost/htdocs/moodle/lib/phpxml/xml.php on line 50

when used due to it returning a reference to a string rather then the value of it when debugging is on. This normally would not be a big problem but it breaks the XML format and makes the loading of the settings from the flex application fail. As a temporary fix i have added the fallowing to turn off the reporting of any error messages in the generated XML file as no human would be reading it:

error_reporting(0);

It’s nice when there are APIs and library’s so you can constraint on the problem and making the solution and not messing around formating XML ;)

Printer Friendly

Monday, July 14th, 2008

One of the popular requests relating to the grade statics project from the Moodle community was a printer versions of the statics and visualizations. This is rather trivial to do for the report/stats plug-in as all the content is text based however it becomes some what more complicated for report/visual as the content is flash based and more dynamic.

Some browsers play nice when printing a page with flash content on it and will treat it like an image (as shown in scan below of a print out of the demo site in fire fox).

firefox_printing_flash.jpg

This would allow for a printer friendly page to be made that would work with browsers that print flash content by creating a page with just the visualizations on it and a slightly modified interface. However there is another method that i have started looking in to that might give even better results.

Flash it’s self has support for printing witch can be some what controlled from the flash (or flex in this case) application running in the browser, allowing for better resolution prints (as flash graphics are vector based) and allows for printing with in the application rather then having to load a new page.

A simple example of this can be seen in the right click menu over a flash application witch gives a print option.

flash_printing.png

Unfortunately, currently my application dose not quite print an accurate representation of the visualization using this method as can be seen below in a scan of the printed page.

flash_printing_flash.jpg

So the next step in the goal for a printer friendly flash/flex application is research the printing functions and abilities of action script and flex and then to try implementing a solution witch will ideally hide the visualization’s controls (buttons) and then print the visualization at the correct size to match that of the paper it is being printed on.

Start of a UI

Wednesday, July 2nd, 2008

This week i have been working on the user interface (UI) for the Flare based visualizations that will be shown in the report/visual plug-in.

So far i have the ability to invert the axis (with a cool animation), show and hide any item in the legends, click on a data point to show the information related to it and highlight all the data points related to a legend item.

A demo of one visualization with this UI can be found on the test site at http://compsci.ca/~dan/moodle where you can select “Moodle Tests“, login in as guest, select “Grades” in the lower left and then pick “Visual Report” from the drop down menu. You will have to have flash 9 installed (if you don’t it should try to install if for you).

Here are some screen shots of the visual report so far:

visual_ui1.pngvisual_ui2.pngvisual_ui4.pngvisual_ui5.pngvisual_ui6.pngvisual_ui7.pngvisual_ui8.png

First Visual

Thursday, June 26th, 2008

After many hours of trying to get Moodle and Flex with Flare to play nice, i finally have been able to get a simple visualization working using the grade book data from Moodle.

visual_test.png

The first visual is a scatter plot of Normalized Grades vs Students. The different colors represent different items that have grades associated with them and the different shapes are the groups/sections the students are in. It’s not much to show for UI or labeling of the chart yet but provides a starting point to make the report/visual plug-in and has gotten me on my way learning the Flare API.

Hopefully i will have some more polished visuals and UI to show off in the coming weeks.