BIM – the show student posts screen

This post describes the initial implementation of show student posts screen. IT builds on the format/process used in the show student details screen.

Required data

There should be some similarity with the show student details screen. The first three match.

  • Which students the marker is responsible for.
  • User details for those students.
  • Student details from student feeds
  • Split students into registered and unregistered.
  • Student details from bim_marking.
  • List of questions for the bim.

Implementation questions

  • Main question appears to be how to call this screen.
    Probably need an additional parameter to specify which of the operations that the teacher can call: ShowPostsDetails AllocatePosts MarkPost.

    Yep, that seems to work. Using screen as the parameter. If empty, defaults to show student details.

  • There's also the question of including both bimId and courseId in the view.php for bim.
    Currently it is only including the course id. This means that a course can only have one BIM. A limitation.
    Actually, this is an example of my limited, but hopefully growing, knowledge of Moodle. The id passed in is for the course_module table which holds information about the combination of course and activity/module. So this is not a worry.

Get the data

The first four points from above are duplicated from the show student details screen. Easy.

List of questions - uses existing bim_get_question_hash.

Student details from bim_marking. Given a list of student ids (from $registered) get the appropriate details. Very similar to bim_get_feed_details. So create bim_get_marking_details

Show the data

This should be very similar to show student details. Simply showing some additional fields in the table. Tasks are

  • Show the unregistered students first. Done
    This is intended to be annoying so as to encourage the markers to get the students registered. Of course, this may back fire for students who have stopped the course early.
  • Show the registered students.Done
    Bit of work, but is going. Have to look at the sorting of columns in flexible_table. Actually, that's down to the test data. Will leave it for now.

What's left to do

Tasks left to do on this screen and subsequent screens include:

  • General improvement in look and feel.
  • The sorting isn't working as expected. flexible_table not quite set up properly yet. This will effect the details screen as well.
  • The tab interface for details/posts screens needs to be set up.
    Some initial attempts have proven to be somewhat less than successful.
  • There are now links to the AllocatePosts screen - but it's not working.
    Function in place, but just displays message.
  • There are now links to the MarkPost screen - but it's not working.
    Function in place, but just displays message.
  • Question of sorting on the question columns (by mark, submit and not submit)
  • The # of functions per screen is getting quite large, getting to the stage of needing to break it out into support libraries.

BIM – Staff show details screen

This post documents the creation/completion of the BIM show details screen. This is used by staff to get a summary of their student details, whether they have registered their feed, made posts etc.

The BIM design will be based on the equivalent BAM screen with some slight modifications. For example, I don’t believe Moodle will have the equivalent of the Webfuse “Photo Gallery” or “email merge” facilities.

The post is starting to evolve into a semi-standard structure that I think I’ll use with the other screens. Will see how that goes. The structure at the moment is:

  • Identify all the data required for the screen.
  • Specify any questions about the implementation I have.
  • Document what I did to get the data.
  • Document what I did to get it showing in the browser.

Data that is required

To implement this screen, the code will need to retrieve the following data

  • The list of students who the staff member is responsible for marking.
  • User details about the staff member (name etc).
  • User details about the students.
  • Information for the students from bim_student_feeds
  • Identify which of the marker’s students haven’t registered their feeds.


  • Staff (not course coordinator) have two main screens for BIM: show details and show posts. Should I implement these as tabs? Probably yes
    The coordinator will have an additional screen to configure the BIM activity, this could be represented using an additional tab.
  • Does the coordinator/teacher/student switch in view.php work with the test data?
    It seemed to work before. If I’m going to write this screen, I need to login to Moodle as a teacher, but not coordinator. It works as expected. Little wins are good wins – well they are better than loses.

Get the data

Basically this should document the points identified in the data section above.

Staff members students

Need to know which students the staff member is responsible for marking.

For the purposes of testing this is being held in the table bim_markers_students because I’m uncertain how the local Moodle instance will populate this information. Eventually, I’m assuming it will be part of the groups features. I can update the code then.

Rather than separate out getting the list of student usernames and then their details. Let’s combine all this into the one function bim_get_markers_students( $bim, $userid)

Ahh, but of course, I’ve created the table markers_students using the course, not the BIM. As this was how BAM worked (sort of). This means $bim will need to, in the short term, be replaced with the course id.

DONE: currently returns an array of user details for all the markers’ students with the key being Moodle user id.

User details for markers

This is a quite straight forward use of Moodle database API.

Student information from bim_student_feeds

Need to take the student ids from the array above and get the information for the students from bim_student_feeds.

$student_ids = array_keys( $student_details );
$feed_details = bim_get_feed_details( $bim, $student_ids );

Identify which students haven’t registered

This is essentially find all those students in $student_details that don’t have an entry in $feed_details. The question is, does PHP have some in-built functions that might help with this? A simple for loop and an ‘exist’ function could do this. Do I worry about going further?

This page suggests that the function array_diff_key() might be what I’m looking for.

However, the trouble is that bim_get_feed_details is returning an array with keys being the feed id, not the student id. Need to update that.

That’s working.

Get it producing in the browser

Time to get it working in the browser.

Will leave the question of the tabbed interface until the next bit of work. Will focus on getting this screen working. There are going to be two main sections to this screen:

  1. Registered feeds.
  2. Unregistered.

The course description section that is in the BAM version of this screen can be forgotten, I believe, as BIM is working within the course Moodle site.

This is essentially showing a bunch of data in a table. Can do this in for loops, but surely there’s a quicker way in Moodle. Seems I need to dig into weblib.php again. Of course, print_table. Will need to manipulate the data to use it.

That’s working, at a basic level. More work to be done includes:

  • Look at alternating row colours to improve layout/appearance.
  • Figure out how to display the date/time properly, in this case number of days ago.
  • Add in the red/green/yellow for the cases where the last post was a while ago.
  • Modify URL for live blog to some HTML.
  • Left align the headers.
  • Left align the other numeric columns.
  • Add the ability to sort by columns.

I now learn about tablelib.php that specifies a flexible_table class.

Current status

Have got flexible_table working somewhat. The sorting isn’t working appropriately, the display of columns etc needs some work, but the data is being displayed.

Doing a similar thing with the show posts screen should be fairly simple and somewhat similar. Probably pay for the next step to be to finish these screen and get the tabs working, before duplication for show posts.

Time to go home on Xmas eve.

BIM – minor fixes to show student details

This post follows on from the last post in doing some minor improvements to the show student details screen in BIM. This includes:

  • Link between the question ID and the question name
  • Double check the display of the “All posts”.
  • Add in the link to posts for Marked Answers.
  • Re-do the interface to be Moodle like.

Question ID and question name

In a couple of places on the screen there is a need to take the question id and return the question title. Basic solution is:

  • Create a hash with question id as key and title as value (possibly with other things).
    bim_get_question_hash( $bim ) seems like the go.
  • Use the hash in the appropriate places.

Done and working nicely. The link for posts is also done. The all posts is working as currently designed. This means, apart from look and feel, this screen is essentially working.

Make it Moodle

Moodle has a particular style/approach to HTML/look and feel. At this point in time, I haven’t used it for this screen. Time to start doing it.

Where I’m up to

Did a bunch of work on the view student details screen, tidied up a bunch of stuff. Still not happy with the look, but will leave that till later. Time to move onto some of the staff screens.

A screen dump of the screen is available on Flickr. It’s based on real data so identifying information has been blurred out. But you get the idea, boring, ugly. Needs to be better.

Herding cats and losing weight: the vimeo video

This is in part a test of’s new support for Vimeo video. The video below is of a presentation I gave at CQU this year. The abstract is below. The slides are on slideshare.


The environment within which Universities operate has changed significantly over recent years. Two of the biggest changes have been a reduction in state funding for universities and, at the same time, an increased need for universities to demonstrate the quality and appropriateness of their services, especially learning and teaching.

Consequently, most universities have developed a range of strategies, policies, structures and systems with the intent of improving and demonstrating the quality of their learning and teaching. This presentation will draw on the metaphors of herding cats and losing weight to examine the underlying assumptions of these attempts, the resulting outcomes, question whether or not they are the best we can hope for, and present some alternatives.

The video

Shaking up e-learning “design” – little help?

This is a plea for pointers, suggestions and direct assistance.

It arises from the confluence of at least three separate threads over the last couple of days:

  1. Some talk on Cloudworks about motivating teachers to use technologies;
  2. A blog post and associated presentation about bringing aspects of game design to boring tasks; and
  3. My current task on developing BIM, particularly the interface.

The premise

It’s moderately difficult to motivate students and staff to engage with e-learning technology. Most e-learning technology has boring, if not actively complex and disheartening, interfaces. Insights from game design and other areas offer an opportunity to make some improvements which may in turn help make it more likely for people to use and enjoy e-learning technology.

The difficulty

Most e-learning technology is designed by techno-nerds (e.g. myself). Most nerds suck at interface/experience design.

My current designs for BIM illustrate this quite effectively. But then so do most of the interface/experience designs that I see with Moodle activities/modules. Let’s not get started on some of the commercial LMS/VLEs.

One of the reasons BIM is designed to allow students to use external blogs (like WordPress) is that the interface/experience design is just so much better.

The desire

There’s a definite experience gap between the students/staff using an external blog service like WordPress and then having to come back to occasionally use BAM/BIM. It would be great to try and make the design of BIM engaging, different, fun, interesting….More like and vimeo, perhaps even better.

The first iteration won’t achieve this goal. Timelines too short. But playing with re-designs that draw on these principles would be an interesting, and hopefully fun, little project.

Little help?

Given that I currently suck at this type of interface/experience design, I need a little help in the shape of books, blogs, websites, interested folk and general advice on what principles might guide such a project.

Please make suggestions below. Feel free to volunteer.

Resources I’m already aware of:

BIM – cron and view student details screen

In the last bit of BIM work I’d successfully created some test data and laid out some rough plans for what is next.

The aim of this post is to document the bit of work done on the show details screen up and going. The initial work on the screen was documented here. This post draws on the test data, adds some support functions to manipulate it and improves the screen.

Should be fairly simple.

What’s to be done – testing the test data

First, things first. There’s an error when I view a BIM as the old student I was using for testing. Perhaps it is time to test out one of the new students.

Choose one of the students enrolled in one of the courses, use the dummy password and we’re away. Get into the course, click on the bim activity and get an “error getting feed for” error.

This error comes about because the feeds aren’t getting automatically updated/mirrored yet. So the attempt to look at the local RSS file fails.

At this stage, I could probably kludge this up and/or write the section of BIM that should do the updating – i.e. run from cron. That’s what we’ll do.

Moodle, activity modules and cron

So now begins the trawl through the Moodle resources to find out how to run/define cron activity from an activity.

The version.php file in each activity defines a cron value, which appears to identify how regularly to do something. The question is what?

This appears to be answered here with the details being that this value specifies how regularly (in seconds) to run the modulename_cron method defined in the lib.php file.

What to do?

The bim_cron function basically has to check all the current bim activities that are being mirrored, for all registered student feeds, it has to attempt to do a mirror on the feed URL and the copy of the feed on disk. Some pseudo-code

$mirrored = get_mirrored_bims()
foreach ( $mirrored as $bim )
  $students = get_registered_feeds( $bim );
  foreach ( $students as $student )
    mirror the feed;

One of the problems in writing this is the testing of the code for the above. Running from cron complicates the testing, so I’m going to run it from the show student details screen while under development.

Most of that is all working. Just working on the question of doing the mirroring process.


Looking into this has led me down the path of using the SimplePie caching mechanism for maintaining the local versions of the RSS files, rather than the original method. This has resulted in a few other changes in how the rss is retrieved, but it’s all working.

As a result some of the necessary changes to the show details screen happen automatically.

What’s next

Some minor tasks related to the show details screen to do:

  • Do something about the link between the question ID and the question name in both Marked answers and All posts sections.
  • Double check the display of the “All posts”.
  • Add in the link to posts for Marked Answers.
  • Re-do the interface to be Moodle like.

BIM – Creating the test data, completing dbase design

The last bit of BIM work resulted in getting the show student details screen up and going, mostly. Any more of these screens will draw on, at least in part, other data from other tables. Time to get those populated. This will be done using data from BAM currently being used.

Creating the table

Dummy data

Will need some good data for testing. So the plan is to convert some existing data from BAM into the BIM format. Here are the steps.

Get the BAM data

Need to update local versions of the BAM data as a first step. Getting some recent data likely to be most useful.

Complete the creation of all BIM database tables

Need to have these set up before I can convert all the data. Due to the linkages between tables, the conversion process will have to know something about these tables. Last one to be converted is bim_questions. Back to the XMLDB editor. bim_questions will have the following fields (initially)

  • id bigint(10)
  • bim bigint(10)
  • title varchar(255)
  • body text
  • min_mark int(5)
  • max_mark int(5)


However, Marker allocations: is still a problem. BAM relies on a Webfuse database to track which markers are responsible for marking which students. My current institution is still figuring out/potentially changing how they do this. I could figure out how Moodle does this currently, however, not sure if that will change + it will take more work.

At this stage, the plan is:

  • Convert the existing Webfuse MARKERS_STUDS database into a Moodle/BIM table.
  • Write a support function or two that allows BIM to use (but not manipulate) the data in that table in a way that is independent of representation/format.
  • Use those functions in BIM to get the data.
  • At a later date, modify the support function(s) to work with whatever is decided.

So, bim_markers_students will have the fields:

  • id bigint(10)
    ID for the table.
  • course bigint(10)
    The course ID for uniquely identifying the Moodle course for which the marker allocations hold.
  • marker bigint(10)
    The user id for the marker.
  • student bigint(10)
    The user id for the student.

To populate bim_markers_students with the data from MARKERS_STUDS will require the need to read MARKERS_STUDS, expand out the place markers (ALL, campus names etc), get user ids from Moodle, combine the two into SQL. DONE

This will require the entry of student and staff information into Moodle for the staff/students associated with the courses being tested. This has been done with a bulk upload of a CSV file generated from Webfuse code.

Convert BAM into BIM data

Due to the various connections between the different data, this is probably not going to be straight forward. Here’s a first attempt at the process I think I’ll need to follow:

  • Select the course offerings to bring over. I’m thinking at least 2 courses, currently only have permissions for 1 (but two different offerings of it).
  • Create Moodle courses for those offerings.
    I’m only talking about 2 to start with, so manual creation will do. Done.
  • Create accounts for both the students and the markers.
    This will involve a couple of hundred students. So will have to do the bulk upload thing. So, need to create a CSV file from local data. Here’s an example from the help screen

    username, password, firstname, lastname, email, lang, idnumber, maildisplay, course1, group1, type1
    jonest, verysecret, Tom, Jones,, en, 3663737, 1, Intro101, Section 1, 1
    reznort, somesecret, Trent, Reznor,, en_us, 6736733, 0, Advanced202, Section 3, 3

    Need to extract all student accounts from local data and have username=student number, contact data and populate the course information (DONE). Staff will be much the same but different username.(DONE).

  • Enrol the accounts in the courses.
    DONE as part of the bulk upload.
  • Convert the BAM_CONFIGURE (bim) data for the offerings I’m going to include. — Actually, this will be creating bim activities in the courses.
  • Convert the BAM_QUESTIONS (bim_questions) table.
  • Convert the BAM_BLOG_STATISTICS (bim_student_feeds) table.
  • Convert the BAM_BLOG_MARKING (bim_marking) table.
    Need to know the question ID for a given question in Moodle. i.e. translation from what question ID is currently in Webfuse and what has been created in Moodle. Hard code a hash will probably be the quickest way. Webfuse doesn’t use ID, it uses the title of the question. So, somewhat of change there. DONE

Where to now

So, I think that means I now have a good collection of test data on which to build the rest of the screens. The task now is to start working my way through those screens and getting them implemented/tested with the current data. Thinking the order should probably be:

  • Get the show student details screen working as much as possible.
  • Get the show posts and show details screens working for staff.
  • Get the marking screen done.
  • Get the re-allocation screen done.
  • Get the configuration screen for coordinator done.

That should get BIM very close to completion.