Monthly Archives: December 2010

Progressing the student interface for bim2

The last post ended up with the basics of the student controller and views functioning to produce some simple output. The aim here is to get the entire student interface up and actually reading data from the database. It won’t be completely finished. There will be some additional extra features to add. The aim here is to iron our the design of the whole model/view/controller set of classes.

Am going to release this post before it is finished and continue working on it. So it will change.

To do list

  • Help strings are not displaying consistently using either breakdown and also problems with identifiers of the help strings….Is this a problem with the version of Moodle 2 I have?
  • rationalise the filenames and object names for all of student. Feed into design approach for other users
  • Show questions
    • get_string not replace place holders with values.
    • add in support for due dates for questions.
    • include information about questions answered by the student, also details about whether its marked etc.
  • The show questions stuff can/probably should be re-used for staff, especially markers.
  • Need to read up more about the proper approach to using OUTPUT and PAGE in generating output, there’s a limit to how far simple copying can take you.
  • Setting the URL for the tables in show questions and posts, probably also activity details.
  • Show posts
    • Need to add user/blog/post summary/details at start
    • Need to test posts of various statuses.
    • Add in the option to allocate posts.
    • Is there a chance to add an internal navigation that allows jumping to individual posts
    • The “Allocated to:” value in details should be link, maybe a popup, to the question
  • Check that the views are setting the URL appropriately — e.g. does “tab” need to be included? is it?
  • Consider using html_table rather than flexible_table for some of the tables.
  • Need to look into table classes and setting styles on cells etc. to ensure table format okay

Student tabbed interface

Each of the user groups will be using a tab interface to access the different services, so have to get this up and going. After a bit of playing have this working by having the tabs declared in the controller and then having the view figure out how to display them…which is how the division of responsibilities should theoretically work.

Well, that’s working for the student views. Able to move between them all as a student with a registered blog. Need to work on the tabs for unregistered..where the other two tabs are inactivated. Actually, that works fine.

Models and object/relational mapping

The intent is that each individual page will have a model that is responsible for retrieving and manipulating all of the data required for page. That model is passed to the view which uses the data to display the necessary output. Some, if not all, of that data will be retrieved through classes that are essentially object/relational mapping objects.

I’m planning to implement the first of these with the student controller/views. Will start with the questions page as this is the most straight forward. It should simply display all of the questions that have been set for this activity.

Put in some data

I’m going to manually insert some test data into the database. The data will be taken from test data from bim.

Questions

The intent is to minimise the need for the main bim2 code to know a great deal about the tables and fields in the database. Hide all that behind a specific object, bimtwo_questions. Since Moodle already does much of this, this objects are likely to be fairly simple wrappers (and yes that does raise the question of why add the extra layer of abstraction…) One answer to that question is that some of the objects will have fairly high level methods that will perform important tasks on the data.

These o/r objects are going to sit in the lib directory for now.

The bimtwo_questions object is going to take the bimtwo identifier and retrieve all of the questions for that bim2 activity from the bimtwo_questions table.

At the moment, there will be little or no methods for the class. This is likely to change later when the idea of due dates for questions gets added. Methods to determine which questions has passed the deadline etc seem likely.

Data that will be required includes

  • questions – the list of questions for the activity;
  • answered questions – the list of questions the student has answered.

Okay, simple model up and going. Let’s get it displaying the content in a reasonably nice way. This means identifying how to produce pretty tables in Moodle 2.0.
Seems good old flexible_table remains. However, it’s gone to a oo based implementation.

Well, show questions is working, at least in a basic form. Will leave it there and move onto the other screens.

Your posts

Initially this can be a simple one and just display the list of posts the system knows about from the student. Eventually this should allow the student to manage the allocation for unallocated or unmarked questions.

First, put some approriate data into the database. bimtwo_marking needs to be filled in. Done.

Need an o/r mapping object to retrieve this data. Initially the class bimtwo_posts will be much the same as bimtwo_questions. Copy and paste and a search and replace.

Now I need to add in a model for the page and use the o/r object to get data and display it simply.

Okay, have the data, time to display it. The question is how. In bim the posts were separated into distinct tables based on state (i.e. allocated, marked, etc). For bim2, initial thinking is two tables unallocated posts and allocated posts. Allocated posts include those that have been marked, returned etc. and thus will have to include columns or some other indication of mark, dates, etc.

Actually, looks like a single table might be the way to go. Pity flexible_table doesn’t want to nest.

Need to update the test data to include posts that are

  • allocated
    Show the time allocated, Show the question that it’s been allocated to.
  • released
    Show time allocated, marked and released. Also the mark and also the comments.

Activity details

This page can take on a number of different forms, depending on whether a feed has been registered and whether or not the students are able to register a feed. The first one I’ll implement is the situation where the student has registered a feed and it has started to be mirrored.

In this situation, the page should display

  • Configuration details about the bim2 activity;
    This will be used to identify if registration is turned on, display the description of the activity and other config data around the activity.

    This data is already available as part of the bimtwo object within the factory, which is passed in.

  • feed details for the student;
    i.e. does the student have a registered feed and, if so, where is it, how many posts etc.

    This will likely need to be a new class.

  • user details.
    i.e. their name, userid etc. Used to display information, but also to get the feed details and other personal information.

    This looks like being a new class. Have made sure that factory stores the user id. This will be needed to get the user records.

Ending up with a single class that pulls all this information into the one place. However, it does rely on other classes that can be re-used elsewhere. Will document this at the end.

At the moment, I’m having to put in all the language strings and associated help files. I think I am liking the fact that help strings are now included in the help file, rather than in separate files in a separate directory.

Am having a problem getting parameters passed in correctly to help strings. Ahh, have to put curly braces around them. Interesting, I gather this from reading the code, not the Moodle documentation or discussion on moodle.org. Would be buggered without the ability to read the Moodle code.

Still having problems with getting the help strings to work properly. Going to have to put in place holders that aren’t working and leave this as a major todo. Downloaded latest version of Moodle and the problem continues. So, probably a problem with my code. Will have to look at this later.

Back to the start

The next step is to implement the activity details/student view from the start of the student interaction. i.e. before the student has registered their blog and in some cases, before the staff have turned registration on. The stages to be implemented are, when the student visits the activity and:

  • DONERegistration is not turned on and the student has not registered;
    Show the activity configuration section shown normally, but precede it with message about how the student has not registered and that registration is not on
  • DONERegistration is turned on and the student has not registered;
    Same as above, but show the registration form
  • Handle the registration of the student’s blog, which has two cases
    • Registration worked
      Show a success message and then show the normal interface.
    • It didn’t work
      Show an appropriate error message, some direction on how to fix it and show the registration form again

Use the three test students as a test case. Start with the registration not turned on.

Now to add the register form. Seems a straight copy across of the form from bim, a few substitutions for module name (bim to bimtwo) and we’re just about done. The processing of the form has to be modified to be more object oriented. i.e. a new class.

Perhaps time now to start a new blog post, this has been going on for weeks. The next one will handle the registration process.

BIM as a WordPress plugin?

I’m currently programming up bim2, a new version of BIM to work with Moodle 2.0. I’m wondering whether a version of BIM for WordPress might be an idea.

A while ago Leigh Blackall wondered why BIM had to be inside an LMS. There were some reasons at the time. However, most no longer apply and I’m increasingly interested in moving beyond the LMS world. As a long-term WordPress user, a WordPress plugin might make some sense.

Such a plugin would be a small step away from BIM towards edufeedr. Both BIM and edufeedr are very similar in what they do. The main difference is the infrastructure they rely upon, BIM on Moodle and edufeedr on elgg (if I recollect correctly). WordPress is perhaps a little more mainstream Web than elgg and WordPress is being used by some playing with open-ish courses.

BIM as a WordPress plugin would retain the marking/management features, but should probably pay a bit more attention to re-purposing aggregated posts. Perhaps aggregated posts could be fed into the main blog and other locations?

Wonder if there’s a WordPress plugin that already does this? Would this be a good idea?

Am aware of this tutorial for WordPress plugins via @marksmithers. Seems a good place to start.

Will have to wait until bim2 for Moodle is done.

The student controller for bim2 – models and view

bim2 now has a working controller structure, but it doesn’t do anything. This post summarises initial attempts to implement the student controller so that it actually implements the state machine for the student interactions. It’s also the first attempt to implement some models and views with the MVC structure for bim2. This is liable to raise a range of questions about design, testing and other tasks.

A change?

The existing bim student set of interactions is limited to essentially two phases

  1. Register a feed; and
  2. View details of existing feed.
    This is the everything bim knows about the student and the feed on one page.

There is some room for improvement and Mark Pea has made some suggestions which are really good. Am thinking I’ll adopt and adapt them

Arising from that, current thinking is that there will be three main bim2 pages for students.

  1. Activity details;
    This is the default bim2 activity home page for students. It would always show the description of the bim2 activity as entered by the person who created the activity. It would also show a summary of what is known about the individual student’s bim2 with three main options:
    1. Unregistered;
      Before the student has registered the URL for their feed, the page would show the textbox to enter the feed url and help information/links.
    2. Registered; and
      Once registered it would show a summary of the information known about the student’s participation in bim2 activity.
    3. Unable to register;
      In this state, the bim2 activity has been created, however, the creator has turned off (or not turned on) the ability for students to register their feed. This is actually a slight modification/cross cutting state to the other two options for this page.
  2. Questions;
    This will be a summary of the questions the student has to respond to via their feed. the questions are created by the person creating the bim2 activity. This should probably show information about when/if the student has responded to the questions.
  3. Your posts;
    This is where bim2 shows what posts it has mirrored from the student’s feed. It should also be where the student can allocate (unallocated) posts. This would be a new feature.

Mmm, am thinking it will be a good idea to create hard-coded prototypes for these pages to play around with the information that will be on them. This is a normal practice I got into with the previous development environment, but haven’t really gotten into with bim/Moodle.

Hard-coded views

The idea here is to get a version of bim2 code working with hard-coded templates. i.e. I (or anyone else who downloads it from git can see what is planned. Hopefully, the following outlines the implementation of this plan. It essentially means that I need to get the basic models and views for the student controller implemented.

But first, that means putting a bit more meat on the bones of the controller, which is essentially an empty function with some “hello world” code.

First step is how to identify the specific page to be displayed. With bim there are three components that are combined to figure out what to show the user

  1. The type of user;
  2. The “tab” to show;
    The staff interfaces are “tabbed”. The value for the tab parameter specifies which tab.
  3. The “screen”;
    A particular tab may have a set of operations that can be operated. This specifies which one. Screen was the wrong choice, will go for op instead.

So, the idea is that the student controller’s process function has to examine the value of the parameter tab and then the parameter op to figure out what to do. Given this is what each controller will do, makes sense to put this into the base controller class and get the constructor to do it automatically….if that’s how php OO features work. Let’s test. Yep, that’s how it works.

Of course, this raises the point that perhaps somewhere in here, checking the valid values for tab and op can be semi-automated. That includes the idea of actually calling the appropriate function to handle the task based on the value of tab and op. e.g. what was used in the perl-based system I worked on was a hash of hashes leading to a function name. If there wasn’t a value for the particular combination of tab and op an error was produced. If there was, the function name was called to produce the necessary output. (The question fast approaching here will be how this works with the form processing in Moodle).

Ahh, the data structure approach to calling methods seems to work in PHP

    function process()  {
        $methods = array( "hello" => "doit" );
       $this->$methods['hello']();     
    }

    function doit() {

Playing around a bit more I get the following for the student controller


    function process()  {
        $methods = array(
            "default" => array( "default" => "activity_details" ),
            "activity" => array( "default" => "activity_details" ),
            "questions" => array( "default" => "questions" ),
            "posts" => array( "default" => "posts" )
        );

        if ( isset( $methods[$this->tab][$this->op] )) {
            $function = $methods[$this->tab][$this->op];
            $this->$function();
        } 
    }

The idea is that the methods array defines the set of valid methods and parameters for the student controller. So, if tab=activity and op=default then the activity_details method would be called. I’ve added in some more smarts into the base controller class. If tab or op are empty strings, it automatically sets them to default.

The actual code for calling the functions should probably be in the base controller class with the method data being specified in the constructor in the specific controller. Wonder if that will work? Yep, that works. So the “isset” stuff is in the base controller and the student controller has a constructor that sets up methods.

This is almost certainly reinventing the wheel (with a few corners) and sounding like a waste of time. But the theory is that this bit of work at the beginning will make for a more flexible bim2. i.e. it will be quicker to improve and change bim2. This is fast becoming an experiment on whether this is likely to happen. It feel’s like I’m trading the complexity of large procedural functions for the complexity of class relationships.

A “working” bim2 for students

So with this basic infrastructure in place, time to move onto getting the methods in place to display some appropriate information for the students.

Putting the MVC structure for bim2 in place

So, bim2 is up and going, at least in terms of being able to create an instance of the activity within a course. The trouble is that it can’t do anything. This post starts the process of implementing the design of the user interactions with bim2. The intent is to go with a Model-View-Controller type structure in the hope that this will improve flexibility and reuse.

The plan is to reuse some of the very early work that was done with the indicators module (work that has yet to be completed). The plan here is hopefully to have the basic structure of the MVC approach working in bim2, however, it won’t actually do anything real. The idea is that once the structure is in place, I can work on each of the user groups separately.

Users and state machines

The fundamental assumption of this approach is that the way in which a user can interact with bim2 can be described as a state machine. The idea is that there are a given set of web pages any user can see and a specific set of possible transitions from one web page to the next. In addition, with bim2 there are groups of users. The state machine used by a user depends on the group they belong to and perhaps where they are up to in using bim2.

For example, initially a student must complete the “register a feed” process (state machine). Once that’s complete, they will be able to view details. A staff member marking blogs has one process to go through while the staff member in charge of the course has another.

The intent is to model the state machines for each group of users as a separate controller implemented using some simple models and views. The student state machine is the simplest, so I’ll start with it. By doing so most of the structure will be put in place.

Controller factory

But first, before doing that I need to put in place the structure to create the controllers. At the moment, the view.php script for bim has the following code at the core

if ( has_capability( 'mod/bim:coordinator', $context)) {
    // administrator can the configure stuff
    show_coordinator( $bim, $userid, $cm, $course );
}else if (has_capability('mod/bim:student', $context)) {
    // student can see details of their registered blog
    show_student($bim, $userid, $cm, $course );
} else if ( has_capability( 'mod/bim:marker', $context )) {
    show_marker( $bim, $userid, $cm, $course );
} else {
  error( "No capability to access this page" );
}

All this basically does is check to see what type of user is trying to use the activity and if this is determined, call an appropriate function to handle what they may want to be doing.

I’m hoping I can change this, and much of what precedes it (in total view.php in bim has 108 lines of code) into something much smaller, something like this.

$factory = bimtwo_ControllerFactory::create( $context );
if ( $factory !== NULL ) {
    $factory->process();
}

($context in the above may not make sense in a Moodle module.) Also need to identify how error checking should be done properly, doubt that testing for NULL is the way to go.

Coding standards

All of the above work was done yesterday while I was without a network connection. So some of it probably doesn’t follow the Moodle coding style. Time to revisit the work so far and bring it into line. This includes the error checking/exceptions.

First off is that class names should be lower-case english words separate by underscores.

Ahh, class member variables need to be declared. Also passing in DB, OUTPUT etc should probably be done via global.

Capabilities – identifying type of user

The type of user within a bim2 activity is determined by the bim2 capabilities the user has. So, first I need to become familiar with how capabilities have changed in Moodle 2 (if they have) and then figure out what changes need to be done to bim2 in order to get the appropriate controller being created.

Yea, have got the old bim capabilities working fine within bimtwo. No changes required from Moodle 2.0. Just had to update for the new name of bimtwo. After lunch, shall use this to get the various controllers going – it’s just doing “prints” at the moment.

Getting the controller stuff working

So, a touch more tweaking and the controller structure appears to be working. I’ll describe it below. There is a strong chance that the first reaction of many will be along the lines of “Isn’t that all just a waste of time, adding yet more abstraction/indirection?”. I’d be lying if I said it doesn’t feel like that at times. I wonder if I’m wasting my time. However, my prior experience was positive with this approach, so I remain hopeful. Time will tell.

The main view.php file, this is what Moodle calls when a user clicks on the bim2 activity, looks like this now.


require_once(dirname(dirname(dirname(__FILE__))).'/config.php');
require_once(dirname(__FILE__).'/lib.php');

require_once( $CFG->dirroot.'/mod/bimtwo/factory/controller.php' );

$factory = new bimtwo_controller_factory();
$controller = $factory->produce();
$controller->process();

That’s it, and that’s all it should ever be.

The idea is that the bimtwo_controller_factory examines the input and determines what type of user is making the request. Based on the type of user it then creates a $controller appropriate for that user. The process function for each controller then examines the input a bit more to figure out what the user is trying to do. It then calls the appropriate functions – implemented through a model and controller – to carry out that activity.

Determining what type of user is done using capabilities in the produce function of the factory class. It looks like this.

public function produce() {

    global $CFG;
    $path = $CFG->dirroot."/mod/bimtwo";

    if ( has_capability( 'mod/bimtwo:coordinator', $this->context)) {
        // administrator can the configure stuff
        require_once "$path/coordinator/controller.php";
        return new bimtwo_coordinator_controller( $this );
    } else if (has_capability('mod/bimtwo:student', $this->context)) {
        // student can see details of their registered blog
        require_once "$path/student/controller.php";
        return new bimtwo_student_controller( $this );
    } else if ( has_capability( 'mod/bimtwo:marker', $this->context )) {
        require_once "$path/marker/controller.php";
        return new bimtwo_marker_controller( $this );
    } else {
        require_once "$path/factory/controller_error.php";
        return new bimtwo_error_controller( $this );
    }

At the moment, the controllers for each group of user simply produces some simply output indicating what type of user it thinks it is.

The next major task will be getting some models and views working, perhaps for the student as its the simplest class of user. But before that, I should probably return to some of the outstanding prior work.

Ahh, help files and help strings. Changes committed to git, onto help.

Adding a bim2 activity – development progress

Okay, so after fixing up the naming problems with bim2 etc, it’s time to actually get the code going.

To do

A list of things to do once I get back online

  • DONE mod_form.php needs to be modified to use the new editor element for Moodle 2.0
    Actually, this looks to have been created by a typo or other problem within the bim2 mod_form.php. It is now working.
  • DONE Check the location/process for help files.
    Seems like in Moodle 2.0, help files are being converted to strings and reside in the language file.
  • DONE Update lib.php:add_instance to call grade_item_update
  • See what Rolley can do about making the bim icon transparent.

mod_form.php

When someone chooses to add a bim2 activity into a Moodle course, the first thing they see is the form provided by mod_form.php. I’m hoping/wondering if this can essentially stay the same as that used in bim. So let’s copy that across. No, empty page.

Ahh, I have to get the database for bim2 up and going. Seems the transition to bimTwo as the internal Moodle name for bim2 doesn’t work entirely. The table name regular expression check doesn’t like table names with uppercase characters, so for the tables it will have to be bimtwo

So, the tables are created now. Does the mod_form.php work? No still empty. Something not working here, solving this should be interesting as I’m currently without Internet access. How about commenting out the entire bim2 contents from mod_form.php. Seems the problem is a bit earlier.

~/course/modedit.php is where this is run from, let’s have a look there. Let’s stick some debugging stuff in and find out where we get up to. Or, alternatively you could try running the mod_form.php file through PHP from the commmand line and discover where the syntax error is in the file. i.e.

david-joness-macbook-pro-2:~ david$ php mod_form.php

Parse error: syntax error, unexpected ',' in mod_form.php on line 89

This is why, on one-hand, it would be good to be developing in PHP/Moodle more often. I wouldn’t be making so many newbie misassumptions and mistakes.

Ahh, nice, I think. Fixed up the syntax error and no get this error in the browser

Coding error detected, it must be fixed by a programmer: MFORMS: Coding error, text formats are handled only by new editor element.

My immediate assumption here is that this is being caused by the original bim code including some Moodle 1.x specific code around the use of the HTML editor and its inclusion in forms. I’m offline so can’t check the syntax for this, will solve for now by commenting out the offending elements.

Next step is to update the get_string data. This is how Moodle separates text to be displayed on a web page into separate language files. I haven’t updated the bim2 english language file to include the labels used in mod_form.php.

Somewhat related to this are the help files, most of these should be able to come over, at least at the start. Ahh, appears the naming/directory structure may be a little different (or I’ve made a simple tranlsation mistake)

So, the form is basically working (minus the HTML editor field). Can I submit, well no, that’s the next step.

add_instance

The add_instance function in ~/mod/bimTwo/lib.php defines what should happen when the mod_form.php is submitted. Currently, it is empty/boilerplate. Will have to update it. This is again getting into the area of “Moodle 2 conversion problems”. As the database API is one place I believe that has undergone some change.

Actually, the NEWMODULE stuff looks like it might already have been updated. But I’m getting the error

Coding error detected, it must be fixed by a programmer: moodle_database::insert_record_raw() no fields found.

This is happening in this statement

$DB->insert_record('bimTwo', $bimTwo);

$bimTwo has the contents from the form, and it all appears good. So, some problem in the insert_record function. Ahh, wonder if this is where the database naming problem crops up, the ‘bimTwo’ that is the first parameter, should probably be without the upper case T

Yep, that appears to have fixed up the original error, now I’m getting Incorrect function. Ahh, wasn’t returning the id. Done. Now a problem Error reading from database I think that may well be another table naming problem.

course/modedit.php

The error is cropping up when this file is being run. Yep, almost certainly the problem with the different names. Am going to have to revert back to bimtwo as the name for everything.

Yep, that’s fixed it. It is now possible to add a bim2 activity (not that it will do anything useful) to Moodle 2. As you can see in the following image.

And the edit button basically works as well, in that it shows the mod_form.php output yet again and allows changes.

Ahh, but the information about the BIM settings is not being saved from the form to the database. Something is missing. Mmmm, most of the bim specific fields are missing from the basic bimtwo table, have to update that in xmldb. The browser form memory remembers the fields, but it appears that I didn’t hit the magic ‘Save’ in xmldb

Yep, that did it.

Evidence of bim2 activity in Moodle 2

To do

Have a lot of clearing up to do when I can get back online.

The next major step, however, is to start implementing the main user interface of bim2. i.e. the process and output that staff and students see when they actually try to use the bim2 activity, rather than simply create it.

It is here where I’m hoping that I will be making the largest changes between bim2 and bim. It’s also where I’m hoping the changes will be worthwhile and not introduce new and interesting problems.

A Theory-Driven Design Framework for Social Recommender Systems

I’m becoming increasingly interested in how the design of e-learning systems can be improved through insights from behaviour change literature and related work (e.g. I think game design principles have some connections with behaviour change. A while ago I started some thinking about this. The following is a summary of/reflection on

Ofer Arazy, Nanda Kumar, Bracha Shapira (2010), A theory-driven design framework for recommender systems, Journal of the Assocation for Information Systems, 11(9):455-490

This might sound a bit too specific, however, the following from the abstract has me interested

We enhance Walls et al.’s (1992) IS Design Theory by introducing the notion of “applied behavioral theory” as a means of better linking theory and system design. Our second objective is to apply our theory-driven design methodology to social recommender systems, with the aim of improving prediction accuracy. A behavioral study found that some social relationships (e.g., competence, benevolence) are most likely to affect a recipient’s advice-taking decision.

Aspects of recommender systems resonate with the task facing e-learning systems, especially some of the work around academic analytics. i.e. an attempt to recommend approaches/information that can help teachers and students.

The following starts with a overview of what I took from the paper. This is followed by a summary of the major sections of the paper.

In the end, not quite as interesting as I hoped. But still sufficient to spark some thinking.

Overview

Two main aims

  1. Show how design research can be improved through filling the gap between kernel theories in an ISDT and the subsequent design principles with an applied behavioural model.
    i.e. a traditional behavioural model/theory that tries to better approximate the design need/problem.
  2. Illustrate how social recommender systems (with specific example within movie recommendations) can be improved using this type of approach.

They suggest that this is just one approach to bridging this gap. I tend to agree that this is an area of some complexity. But I also think this complexity is the source of value of design research. It is the interesting solutions within this problem area that arise from creativity that create research value. I would hope that there would be many different approaches, some of which can’t be captured in a sequence of steps.

Another way of looking at this is that they are simply suggesting the more formal development of an improved kernel theory that will be used to inform system design. Not sure it is necessary that this be yet another component of an ISDT.

There is an interesting point here about how the design principles/ISDT can in turn influence the kernel theories, or at least the interpretation of these into the “gap filler”.

There are some interesting insights from the advice-taking literature that could be useful in e-learning system design. For example

Work dating to Pelz and Andrews (1966), Mintzberg (1973), and Allen (1977) indicates that people prefer to turn to other people, rather than to documents, when seeking information. Recommendations often are received through word-of-mouth, and such communication tends to flow through interpersonal channels based on shared interests and friendship (Arndt, 1967), both offline and online (Cross and Sproull, 2004).

So, an e-learning system that attempted to connect people (teachers and students) to other people, rather than help documents, might offer some interesting outcomes.

Introduction

Introduces what recommender systems are..”reducing information overload by providing users with relevant information and a key component of successful online stores”. References literature, talks about two approaches to recommender design and the three sequential steps: identify sources for user; analysis of user’s profile; generation of recomendations

SRS == Social Recommender Systems. Introduce classification of SRS. Research on SRS using relationship information in early phases with inconclusive results, modest accuracy improvement in limited sets of cases. Limitation suggested that under-specification of the nature of social relations, ad-hoc design and limited use of behavioural theory is the cause.

Two primary objectives

  • Develop an applied theoretical model;
    i.e. this is used to link kernel theories in ISDT and the design principles. The model is a behavioural framework.
  • Improve the design of social recommender systems.

Design problem: sources in SRS

Collaborative filtering systems associate sources based on similar consumption profiles. Presents mathematical formula.

Social-network-enhanced RS have arisen from people prefering what their friends like and the availability of open social networks. Another mathematical formula. References literature showing limited improvements from this approach.

Argues this is because the discussion of social relationships in SRS has lacked theoretical grounding.

Grounding systems design in behavioural theory

This is where they attempt to argue the need for an extra component in ISDTs to link kernel theories and principles of design. Interestingly they don’t like the use of theory for these principles.

Use Venable (2006) and Kuechler et al (2007) as evidence that the explication of the theoretical basis for make design effective is often not there. I wonder about how strong the evidence for this is, where it comes and how well the following recommendations address that problem.

In particular, am interested in the suggestion that Gregor and Jones (2007) don’t necessarily see the case for grounding design in behavioural theory. It’s my recollection that we argued that it is possible for design principles to work without knowing why (e.g. science of aeronautics arising after people were flying), but that have theory to ground principles in is still a good/preferable thing to have. After all, justifactory knowledge is included as one of the core components of an ISDTAnd I quote

The sixth component of justificatory knowledge needs to be added, to provide an explanation of why the design works.

.

It was also argued that both IT and human behavioural knowledge is required

To further define terms as they are used in this paper, an IS design theory shows the principles inherent in the design of an IS artifact that accomplishes some end, based on knowledge of both IT and human behaviour.

The point about the connection between kernel theories and design principles not always being explained well, is a valid one. One that has been made elsewhere.

Authors argue that engineering has solved this problem and uses the example of wing design being based on aerodynamics. This only happened after some time. Also uses HCI as an example of a field being driven by kernel theories.

Now propose four challenges in briding the gap between kernel behavioural theories and system design

  1. Difficulty in finding relevant kernel theories for a specific design problem;
    Drawing on Walls et al (2004) they suggest that one of the problems here is the disconnect between behavioural and design researchers.
  2. Kernel theory scope is too narrow, with no single theory accounting for all constructs relevant to a design problem.
  3. Granularity of constructs in kernel theories don’t math requirements of design problem.
  4. Kernel theories specify the direction of effects, where design requires consideration of the effects’ magnitude

Talk about Card and Newell’s work (1983 and 1985) that addresses these problems by developing applied pyschological theoretical models (called “engineering-style theory”) rather than borrowing existing kernel theories. It’s from there that they deisgn interfaces. Some criticism of the work, including Carroll and Kellog (1989) “It may be simplistic to imagine deductive relations from science to design, but it would be bizarre if there were no relation at all”

This is perhaps part of my problems so far with this paper. Part of the reason I think there aren’t clear guidelines for linking kernel theories and design is that creating these linkages is the major creative aspect of design research. While it may be possible to identify some common processes or steps this remains a creative exercise. Perhaps more in common with abductive logic than deductive or inductive?

however, the authors think that the Card and Newell approach can provide some benefit to design research. And essentially argue that this applied behavioural model can be added in.

Linking behavioural theory to systems design

Specify steps to be used with this extension to address the four challenges listed above. Done with the context of social recommender systems.

  • determine whether the application of psychological or social theories is warranted in a particular design problem;
    Suggests SRS is an obvious fit given the large stream of literature from social theory. Suggests the the collaboration in HCI and CSCW communities may serve as a model.
  • survey the relevant theoretical domain to identify constructs that map well to the design goals;
  • specify an applied theoretical model that is based on kernel theories;
    Identify factors that would be antecedents of the dependent variable in the applied theoretical model and important to achieving the design goal. A mapping between design factors and theory based constructs. Issue of scope becomes critical. The question of competing, complimentary, multiple kernel theories.

The applied theoretical model is developed using standard behaviourla methods. i.e. a set of links between explaining and outcome variables. The following sounds strange to me This model can be useful for udnerstnding the complex relationship between constructs, but may be too complicated for guiding design decisions. ???? In this example, they had to move from a multi-stage path model to a simpler one-step regression model due to the difficulty of getting data for all the constructs within the context of a SRS.

Kernel theoris of advice taking

This is the section where they review kernel theories from advice literature and derivce some key constructs for SRS.

Reference one of the authors earlier papers that identify the types of social data available online and suggest that these map onto several theoretical constructs: homophily, tie-strength, trustworthiness. Then from a synthesis of advice-taking literature they develop some central variables for an applied theoretical model to understand the recipients willingness to accept a source’s advice: cognitive homophily, tie strength, and competence- and benevolence-based trustworthiness.

Some of the insights from this literature

  • People prefer to ask people, rather than use documents.
  • Strong ties between people impact willingness to accept a recommendation, important conduit of useful knowledge.
  • Weak ties useful as sources of novel information, instrumental in the diffusion of ideas and receipt of work-related advice
  • Tie strength is multi-dimensional: closeness/emotional intensity, time
  • Trust and tie strength are different.
  • Perceived trustworthiness is closely related, but different to trust.
  • Trusting relationships lead to greater knowledge exchange.
  • Trustworthiness is multi-dimensional: benevolence, integrity, competence.
  • Homophily is different to tie strength
  • homophily can impact advice taking through the mediating role of tie strength
  • homophily has two dimensions: socio-demographic and cognitive
  • Cognitive homophily is “presumed to shape our orientation to future behaviour
  • Socio-demographic homophily is seen as an antecedent of cognitive homophily

Applied theory of advice taking to guide SRS design

This is where they developed the model from the above that will guide their system design. It shows the path model, the evaluation and then a simplified linear regression model to directly inform system design.

This consists of a range of hypotheses, e.g.

H 1a: Cognitively similar individuals will maintain relationships that are longer temporally
H 1b: Cognitively similar individuals will interact more frequently.

which are then brought together in the multi-path model.

Then describes a survey methodology to test the hypotheses. Applied to 116 undergraduate students. PLS data analysis. Result fairly good, with some not supported.

Then tested with Hopophily + one of the other relational constructs. Since design of a system would need to be simpler.

Design principles for SRS

Use the model from the last section to develop a Walls et al ISDT for SRS

Recommender system evaluation

A prototype implemented to test some aspects. Same set of students. Lots of stats. Result…

Simulation results demonstrate that alternative types of social relationship data impact recommender system accuracy differently. While some relationships (namely competence and benevolence-based trustworthiness) enhance accuracy, other relationships (i.e., interaction duration and frequency) add noise and impede system performance.

Problems with naming of bim2

The last post covered the initial steps in starting bim2. Including the choice of the name bim2. But there is a problem.

The problem

It’s starting to look like the choice of bim2 as a name might not have been great. It appears Moodle may not like a digit in the name of a module. Confirmed

When creating a new module, the new name of the module must not contain numbers or other special characters!

The end result is that the “Add an activity” menu in Moodle only ever shows bim and not bim2 which means adding the activity won’t work.

The name will have to change. At least within Moodle.

This is just a bit of a bugger. Will mean I have to change the name of the git repository and a whole lot of other mucking around. I can’t really go back to use bim as the repo name, as that name is already taken by the Moodle 1.9 version of bim. I really don’t like this, both the need to change and the limited knowledge of mine resulting in the need for the change.

Name change?

So, should the name be bimTwo? It’s probably the best compromise. But still ugly. Especially since the #bim2 tag is already being used and makes the most sense.

Solution? For now, I think the plan will be to use bimTwo internal to Moodle, but encourage and use bim2 elsewhere. Maybe bim_two instead?

What do you think? Is there a better solution?

Actually, it will have to be bimtwo due

  • underscore being a special character and not working within a Moodle module name;
  • uppercase characters don’t work/aren’t supported in table names in the Moodle database.

First coding steps for bim2

The following records some of the initial steps in actually coding bim2. It includes

A new name?

bim2 is going to be very different from version 1 of bim. Beyond working for a different version of Moodle, I’m hoping bim2 will be a significant improvement in terms of code design and provide a foundation for some interesting stuff. Consequently, I want to keep the distinction between the two systems clear.

Hence, as you can probably guess, I’m using the title bim2 for version 2.0. This matches the name of the github repo and subsequently the directory on the Moodle server. Am hoping the consistency will work well…..time will tel.

New github repo for bim2

The code for bim2 will be/is available from a new github repository. There’s only the README there at the moment, however, as I progress I will be updating the repo.

I’m using github, because the experience with bim was just so simple and effective.

Resources for Moodle 2 development

The first step is finding out just how different Moodle 2 module development is from Moodle 1.9. My vague understanding is that it isn’t that different, however, I am planning to start from scratch with bim2, rather than port BIM into Moodle 2. The main reason for this is that I want to experiment with a better design for the structure of bim2.

What I’m really after is enough information to get a test/dummy Moodle 2 module up and going ASAP. The skeleton/foundation for bim2.

Category:Moodle 2.0 seems to be the place for an overview of available documentation.

As with my initial Moodle experience, I am finding it hard to get my head around the apparently disjointed collection of resources and insights on the moodle.org site. It appears that the NEWMODULE.zip approach might work with Moodle 2.0. So, I’ll move onto that.

Initial coding steps for bim2

So, this has essentially become the process for following the NEWMODULE.zip readme and getting a dummy bim2 up and going.

  1. Get all the files NEWMODULE.zip files into the bim2 directory.
  2. Change newmodule to bim2 in all the files.
  3. Rename the lang/en_utf8/newmodule.php file to bim2.php.
  4. Log into Moodle as admin.
  5. Remember about modifying version.php to have a version number that represents the current date.
    Not sure I need this, at the moment, but I got bitten by this mistake with BIM.
  6. Success “bim2″ installed.
  7. Let’s add a course and see if I can add an activity?
    Mmm, not liking the manual enrol for users in a course. No obvious save/submit/ok button when finished enrolling. I have to hit the close window widget, which (for me at least) suggests losing changes.
  8. Yep, it’s there, but error about database table modules. This matches the instructions in NEWMODULE.zip. Need to modify the module’s tables. Ahhh, death by XMLDB….
  9. The current plan is to re-use the existing BIM database tables. Let’s see if I can brave XMLDB to do that. All done. Success.

That will do for now. Next step will be to start actively modifying the NEWMODULE stuff into bim2 specific code.

A solution for BIM and special characters?

The main long term issue in the use of BIM has been student’s creating blog posts that contain “special” characters. This is typically done when they create their post in Word and then copy and paste it into their blog. The interaction between BIM, SimplePie and database engines has not been a good one. It results in blog posts either not being stored in the Moodle database or being cut off at the special character.

A couple of days ago I got a report of this type of problem from a course using BIM. Previously, all of the recent problems associated with special characters have been specific to this university’s version of Postgres. I couldn’t re-create the problems with my test Moodle install with MySQL or Postgres. This latest report is different. It causes problems on my install using MySQL.

More interestingly, it also doesn’t cause a problem with Moodle 2′s external blog feature. This is interesting because Moodle 2′s feature is using SimplePie, just like BIM. It appears that Moodle and/or the install of Moodle 2 I have is doing something that addresses the special character problem. The aim is to investigate and identify what this is and see if it can be incorporate into BIM.

In the end, this evolved into a solution for BIM v1 that has been put into the git repository. Now onto BIM v2.

The problem

Some evidence of the problem. First, what the problem post looks like on the student’s blog. Note the little square.

The problem post

This causes the a problem in BIM, once the special character is reached, nothing else is stored. The same post above in BIM. (Click on the image to see a larger version).

The problem post in BIM

And evidence that it is working in Moodle 2. Note: Moodle 2 only stores a sub-set of the post, not the complete content. But you can see that it does include the square and some of what follows.

Problem post in Moodle 2

Is Postgres making the difference?

My Moodle 2 install is using Postgres, so there’s a chance that this is the source of the different outcome. Must test that.

No, it appears that it does fail in Moodle 1.9 + BIM + Postgres. However, it fails differently than for MySQL. As above, MySQL only cuts off everything after the first special character. It still inserts an entry for the post. Moodle 1.9 + BIM + Postgres doesn’t create an entry at all for the post.

So there appears to be a real difference in how Moodle 2 is doing this, what is it?

How does Moodle 2 do it?

So, the aim here is to go through the Moodle 2 code and try and determine what it is doing that is making this work.

Registering an external blog is starts in Moodle 2 with the ~/blog/external_blog_edit.php file. This presents the form to enter the details of the external blog. It also processes the form. It uses a Moodle class that wraps around SimplePie to get the data.

The first step is to look at the data it gets to check if this is where the special character handling occurs?

$rss = new moodle_simplepie($data->url);

print "<xmp>";
print_object( $rss );
print "</xmp>";
die;

Without the die this code simply updates the database and reports back success on a different page without giving a chance to see the dump. Looking at the dump, you can see that SimplePie is getting the complete posts from the feed.

Which is also what happens in Moodle 1.9 + BIM + Postgres. So the question is what is different about the Moodle 2.0 database queries that result in ignoring the special characters?

This is done in the function blog_sync_external_entries. Which as expected, loops through the entries in the feed and inserts them in the database. It does this by creating an object, setting up the fields and using the insert_record. This is essentially the same as BIM. So where’s the difference?

Is it in the insert_record function?

The abstract classs is in ~/lib/dml/moodle_database.php. There are then separate implementations for each database type, including pgsql.

It appears to be using a PHP function pg_query_params to populate the parameters into the SQL statement, possibly handling quoting. Two questions

  • Is this where it happens?
  • Is it used in Moodle 1.9?

The final solution?

This post has been on the go for a few days as real life intrudes on BIM v1.0 work. In the end folk needed a solution for v1 and it looks like I found one and it has been committed into git.

$content = iconv( "ISO-8859-1", "UTF-8//IGNORE", $raw_content );

Which, as I understand it, essentially ensures that all the characters in the content string (content of a blog post) are in the UTF-8 character set. i.e. the character set being used by the database. Doing this ensures that the database doesn’t complain or fail on insert.

The drawback of this solution is that when the content is displayed it shows up (on many?all? browsers with funny characters. The advantage is that it appears to work. Even on the problem posts used above.

Let me know if you have any problems. Am waiting for a local university to try this in production, if it works there, I’m hoping it will work anywhere.

Becoming aware of the existence of different perceptions

One of the ideas proposed, or at least reportedly proposed, in Shekerjian (1990) is that the act of becoming aware that other people hold different perceptions of some task helps you think about your own strategy. I like this idea and tend to believe that being aware of diversity of opinion can help.

My question then is why does the implementation of most Learning Management Systems in universities preclude the ability to become aware of a diversity of perceptions? Access to most course websites is generally limited to the staff and students associated with the specific course. The very design of most of the tools and services within LMS are designed so that they make no mention of how the service is being used by other folk.

Actually, why is probably a combination of factors. It’s easier to program this way. Complete transparency between courses would worry some folk and could potentially create problems. Not to mention that being away of different perceptions and being able to accept them is not always that easy.

I do think, however, that modifying the design and implementation of LMS is one interesting avenue into interventions that can help modify the teaching environment into one that enables and encourages improvement.

The Moodle 2.0 Community Hub approach is one concrete example of this happening already. However, I think there are at least two limitations of this approach. First, it appears to be at the course level. I think this might end up being too coarse grain and not as useful as some form of transparency below the course level. Second, I think it will be interesting how many universities configure the installations of Moodle to participate in the community hub approach. Not to mention the reasons why they make this decision and how such a decision is implemented in terms of academic buy-in, support etc.

A lack of awareness of the different perceptions of teaching and associated processes is one of the limitations I think may be holding back improvements in university teaching. Especially different perceptions that are represented as concrete strategies currently being implemented within a specific institutional context. It’s this concreteness and its specific connection to the institutional context which makes it more like to have impact than more abstract approaches such as learning designs and staff development presentations from outside experts or “good” teachers.