BAM into Moodle #5 – Coding a block?

Up to Unit 7 of the introduction to Moodle programming course, this one is titled “Replicating a moodle block”. So the programming begins.

Creating a simple block

Looks like we’ll be doing most of the standard stuff, adding tables, using forms CRUD…Staring with this tutorial from the Moodle site. THe process

  • Create a single file in a single directory
    ~/blocks/lowercase name of block is the directory and block_lowercase name of block.php is the file.
  • File format:
    • first line is block class definition – fixed naming convention
    • class must have an init() method – initially to set to class member variables title and version
    • get_content – required before it will display something on screen

Bugger, laptop migration didn’t work 100% with permissions – XAMPP is playing silly buggers, and now so is Moodle. Ahh, CVS wasn’t brought across in the migration either. Bugger, Apple developer CDs – long time to download to get CVS…..

Okay, back to it.

Misc other stuff

  • instance_allow_config method returns true to allow instance configuration
  • config_instance.html – used to specify HTML/PHP/Moodle functions to implement form to allow configuration
  • can’t use config variables in init section of blocks
  • specialization method is automatically called after init – used to apply config i.e. to specialize the block
  • instance_allow_multiple method allows multiple instances of the block for a single course – if it returns true
  • has_config – indicates global configuration exists if it returns true – i.e. allows application of config to all instances in all courses.
  • config_global.html – specify HTML form for global configuration

Skip to Unit 9 – requirements documents

While that’s downloading, time to move on. Will need to think about a requirements document some time soon to keep the organisational hierarchy happy and it will probably not require any code. Onto unit 9 – requirements documents.

Ahh, believes a requirements document will reduce feature creep – philosophically I disagree with this. It allows the developer to ignore the user’s growing knowledge of what they’d like to do with the application. It closes off possibilities – or at least that is how it is used.

It’s all fairly standard requirements document guff, little specific to Moodle. Most of it is just really limited in being of any use in a real situation.

This section of the Moodle developer docs seems to be a bit more useful and talks about creating a specification in Moodle docs. This one is used as the example.

. Some other alternatives include: specification of Workshop 2.0, blog improvements.

This will have to come later.

What’s next?

Looks like the reinstall of Moodle is going to take a while. Running out of time today. Not all that productive – but that’s what you get for changing laptops.

At this stage, it looks like it will be time to move onto the planning and documentation. Which also implies doing a presentation at CQU to generate more requirements. The interesting part of this will be working out which of the types of plugins (or how many of them) BAM will required.

For example, for students, registering their blog and checking marking progress could be thought of as activities. Configuring BAM for a course could, as it stands, be for an assignment. However, I’m not sure I want to limit use of BAM only for assessment. Why not use it as a basis for a course blog – aggregate – oops, is this feature creep?

BAM into Moodle Step #4 – Learning more about Moodle

In the previous step I got to know a bit more about the Moodle code base, libraries and idioms. Even got to modify a bit of code – nothing much more complex than hello world. Time to continue that journey.

Roles and capabilities

Continuing my journey through Unit 6 of the Moodle Programming Unit. This time with roles and capabilities.

Apparently before v1.7 there were fixed roles. Gee, I learnt that in Webfuse in 1996 – sorry, writing historical chapters of the thesis, revisiting old ground and getting pissy about it all.

Main terms are:

  • Contexts – hierarchical “spaces” in which “permissions” apply
    • Permissions not set within a context are inherited from a more general context.
    • Capacilities – a specific Moodle action that can be executed by a user
      • e.g. ‘moodle/course:update’ – updating course settings
      • e.g. ‘moodle/course:viewhiddencourses’ – guess?
    • Roles – a named set of all the capabilities with associated permissions (which ain’t a great explanation)
      • e.g. student, forum moderator etc.
    • Permissions – describes the ability of a role to perform a certain capability (Que?)
      • permissions for a capbility are set within a context – e.g. course.
      • Four permissions available to be set for a capability of a role within a context:
        • CAP_INHERIT – inherit permission from more general context
        • CAP_ALLOW – guess
        • CAP_PREVENT – deny the capability in the current context and more specific contexts, unless over-ridden
        • CAP_PROHIBIT – deny a capability and don’t allow it to be over-ridden.

      Functions for roles and capabilities

      • require_login – require user to be logged in and perform some other checks
      • get_context – returns a context instance object containing a context level and an instance id – e.g. CONTEXT_COURSE and a course id. This is needed to do the next step.
      • require_capability
      • has_capability


      PHPDoc used for code documentation – another thing to learn.

Improving CEQ Outcomes

As part of my new position I’m meant to identify opportunities, trends etc around learning and teaching and inform the local institutional community of them. The following is the first of those reports. I’ve attempted to keep the explanation as short as possible as I’m uncertain the type of folk I’m writing this for are likely to read long essays.

It could be interpreted as a fairly questionable approach. However, I have a few theoretically perspectives on how to create sustainable improvement in L&T within a University that suggests that this is a good way to do it. It’s meant to be only the first step.


CQU’s 2009-2012 strategic plan has identified improved outcomes on the Course Experience Questionnaire (CEQ) as a key point in the quality assurance section of the learning and teaching component. This document suggests one approach to achieving that aim. It suggests that CQU improve CEQ outcomes by ensuring that the next cohort of CQU students to complete the CEQ enjoys a positive last learning experience at CQU.

The suggestion is that this be achieved by:

  • Identifying which courses contain the majority of CQU students who will next be completing the CEQ.
  • Resource and work with the course development and delivery teams of the identified courses to make modifications to these courses that:
    • do not require significant change in conceptions of teaching held by academics; and
    • maximise fit with what is known about student expectations of university learning.

The rest of this document details the rationale and assumptions, student expectations, example approaches and risk associated with this suggestion.

Rationale and assumptions

Assumptions underpinning this suggestion include:

  • CQUni has limited resources but a significant interest in improving learning and teaching as measured by the CEQ
  • Large-scale re-design of courses is expensive and likely to fail.
    It is widely established that the conceptions of teaching and learning held by teaching staff are a significant limiting factor in the types of teaching approaches adopted (Samuelowicz and Bain 2001; Gonzalez 2009). Large-scale course re-design typically relies on changes in the conception of teaching and learning held by academics. This is difficult, time-consuming and likely to fail.
  • Recent experience will over-shadow earlier experience on the CEQ.
    As an example of a “level 1” evaluation the CEQ has known limitations. Including the tendency for recent experience to over-shadow earlier experience. Consequently, a significantly positive final experience may/should have an impact on CEQ responses.
  • At least anecdotally, there have been reports of other institutions adopting strategies designed to maximise CEQ results that have worked.
    For example, it has been suggested that at least one NSW-based institution adopted wording in course profiles that match that used in the CEQ around graduate attributes and encouraged widespread use of that terminology. The implication is that a significant proportion of students completing the CEQ are not familiar with graduate attributes and the associated language. The reported institution was ranked at the top of one of the LTPF rankings.
  • Students are fairly conservative in terms of learning approaches.
    For example Hardy et al (2008) report that even students with self-perceived high levels of competence and confidence with information technology remain conservative in their approach to study and prefer traditional face-to-face approaches with online approaches used as on-demand supplements.
  • It is widely known what students want from a learning experience.
    The conservative nature of students combined with a number of reports summarised in the following section provide strongly indicative pointers of what students want from a university learning experience. See the following section.
  • There are a number of matches between what students want and the seven principles for good practice in undergraduate education (7PGPUE) (Chickering and Gamson 1987).
    Table 1 frames results from various reports on student expectations using the 7PGPUE. It offers one way of “ranking” the 7PGPUE on the basis of student expectations.
  • There are approaches already adopted at CQUni that can meet these desires and observations without significant change.
    See the “Example approaches” section.

Student expectations

There is a range of reports and reviews that report upon the expectations students have of their university learning experience. These include reports from CQUni on the expectations of distance education students (Purnell, Cuskelly et al. 1996; Jones 2007), a report on what students say on the CEQ (Scott 2005), a study on student expectations from the United Kingdom (Joint Information Systems Committee (JISC) 2007).
Key findings from this work include:

  • Students are conservative, they do not like approaches to learning that do not meet their expectations of a university education.
    For example, though separated by 11 years the two attempts (Purnell, Cuskelly et al. 1996; Jones 2007) to discover what CQU distance education students want found agreement. In 1996, students request greater use of audio and video-tapes to provide them with access to on-campus lectures. In 2007, the request was for increased use of online lectures.
  • The seven principles for good practice in undergraduate education (7PGPUE) (Chickering and Gamson 1987) provide a good framework for understanding what features students most like.
    Table 1 uses the 7PGPUE to frame the outcomes from the above reports on student expectations and identify potential opportunities for maximum return on investment.
Table 1 – 7PGPUE mapping of student expectations
(A rough and ready analysis)
7PGPUE Scott (2005) Jones (2007)
Student/faculty contact Presence of staff who are capable, accessible and responsive Online lectures, discussion boards
Cooperation among students   Discussion boards
Encourages active learning Designs that use interactive, practice-oriented and problem-based learning methods  
Gives prompt feedback Staff are responsive, even to the extent of improving course design during implementation Quick, effective, polite responses from staff, Online assignment submission, provision of exam results and breakdowns
Emphasizes time on task Course design that is sound and clear. Effective and responsive systems Print documents, Materials that are ready and consistent
Communicates high expectations    
Respects diverse talents and ways of learning Course designs that are flexible  

Example approaches

The following is a brief list of approaches that have been successfully used at CQU. Most are were used with distance education students. Most do not require any significant changes in the conceptions of learning and teaching held by academics. Some do require significant resources, others do not. They are included here as indicative examples and include:

  • eMail merge emails to all students at important times during the term.
    eMail merge is a tool that enables bulk email to be sent to large numbers of people in a way that makes the message seem to be private. This facility can be used to send email messages to all students at the beginning of term welcoming the student, in the lead up to assignment due dates checking to see if any assistance is required, after assignment due dates to students who have yet submitted and after results have been finalised providing essentially a coordinator’s report to students.
  • Offering a pre-submission check and feedback on assignments.
    Distance education students have been offered a chance to submit draft versions of assignments a week ahead of the due date in order to receive feedback. The feedback includes some specific feedback but also is closely tied with the assignment rubrics. The deadline of a week before the due date rules out most students as they don’t have a draft ready. However, even if they don’t make use of it, the existence of the offer is appreciated and remembered.
  • Assignments returned within 3 working days.
    Marking is designed, organised and resourced to ensure rapid turnaround using effective feedback.

Apart from these somewhat different approaches there are approaches that are normally expected, including:

  • Ensuring that study material is consistent and complete before the start of term.
  • That the marking rubric is available, easy to understand and referred to continuously.
  • All lectures are available in a variety of accessible online formats. Often before the start of term.


The following are some initial risks that may be associated with this suggestion.

Compliance and task corruption

The primary success factor for this suggestion, and any approach to improving learning and teaching, is the level of engagement and commitment on the part of the academic teaching staff. Academic staff who do not engage voluntarily in this project are more than likely to undertake forms of compliance or task corruption. There are also aspects of CQU’s current environment that may increase the risk of compliance behaviours.

Limited engagement on the part of academic staff would limit any chance of positive outcomes.

Changing conceptions

While the suggestion here is to actively avoid challenging established conceptions of learning and teaching held by academics, it is likely that any change will involve an aspect of challenge to existing models. This includes both conceptions held by academics and models embedded in CQU policies and processes. Such change will be difficult.

For example, the current practices around assignment marking at the AICs would be significantly challenged by the above example of returning assignments within 3 working days.

Diversity of students and support structures

CQU has three broadly different groups of students

  1. On-campus students based at a Central Queensland campus.
  2. On-campus students based at an AIC.
  3. Distance education students.

Each of these groups of students may have significant differences in their expectations of university learning. Such differences would impact upon the minor modifications that might be most appropriate.

Identifying appropriate modifications to courses will also need to consider the differences in the support structures and management processes used for each group of students. In particular those used at the AICs.

There may also be significant differences in the percentage of each student group that actually complete the CEQ.

Perceptions of opportunism

The CEQ statement in the strategic plan is located within the section titled “how will we know that we are doing it well?”. This suggestion could be perceived as a form of organisational task corruption. i.e. CQU is opportunistically attempting to directly influence the measure, rather than address underlying systems and practices around learning and teaching.

Responses to that view might include:

  • Other institutions are reportedly doing the same thing.
    Not a strong or perhaps “moral” defense, but a related observation.
  • CEQ itself is a less than appropriate or effective measure of the quality of learning and teaching. It has several significant flaws.
    Perhaps seen as shooting the messenger and not likely to win friends and influence people amongst a higher education sector that broadly, at least in public, accepts the CEQ.
  • The 7PGPUE has formed the basis for CQU’s management plan for learning and teaching for a number of years. This is a logical extension and use of those principles informed by research.
  • It can be argued that this is approach could provide concrete examples of improving learning and teaching which is seen as an important component for encouraging change.
    Cavallo (2004) outlines a successful approach to encouraging large scale change and growth that includes the importance of concrete exemplars. If successful, this suggestion would provide exemplars where significant improvements in student satisfaction and engagement are provided through minimal resource implications.


Cavallo, D. (2004). "Models of growth – Towards fundamental change in learning environments." BT Technology Journal 22(4): 96-112.

Chickering, A. W. and Z. F. Gamson (1987). "Seven principles for good practice in undergraduate education." AAHE Bulletin 39(7): 3-7.

Gonzalez, C. (2009). "Conceptions of, and approaches to, teaching online: a study of lecturers teaching postgraduate distance courses." Higher Education 57(3): 299-314.

Hardy, J., D. Haywood, et al. (2008). Expectations and reality: Exploring the use of learning technologies across the disciplines. 6th Networked Learning Conference. Halkidiki, Greece, Lancaster University.

Joint Information Systems Committee (JISC) (2007). Student expectations study. London, Author.

Jones, D. (2007). "Summary of FLEX student feedback."   Retrieved 24 June, 2009, from

Purnell, K., E. Cuskelly, et al. (1996). "Improving distance education for University students: Issues and experiences of students in cities and rural areas." Journal of Distance Education 11(2).

Samuelowicz, K. and J. Bain (2001). "Revisiting academics’ beliefs about teaching and learning." Higher Education 41(3): 299-325.

Scott, G. (2005). Accessing the student voice: Using CEQuery to identify what retains students and promotes engagement in productive learning in Australian higher education, DEST.