Conditional activities: Activity Locking v0.2b for Moodle 1.5

Conditional activities: Activity Locking v0.2b for Moodle 1.5

Stuart Mayor -
Колькасьць адказаў: 38
The latest incarnation...

New features include:
  • Improved performance. I believe I should have reduced the number of queries that the locking uses.
  • The ability to show/hide predecessors for activities. Look in Settings for courses.
  • Language strings included (only English atm)
  • One or two other minor bugfixes.
Installation is as before. Unzip into the relevant folders.
To enable show/hide predecessors you need to add a field to the course table:
ALTER TABLE `mdl_course` ADD `showpredecessors` SMALLINT(2) UNSIGNED DEFAULT `1` AFTER `showgrades`

Remember
DO NOT USE THIS ON A PRODUCTION SYSTEM. THIS IS STILL BEING TESTED
Сярэдняе рэйтынгаў: -
У адказ на Stuart Mayor

Re: Conditional activities: Activity Locking v0.2b for Moodle 1.5

Darren Smith -

Hello.

I haven't added the field yet but I got:

Module agreement: /var/www/html/communities/mod/agreement/version.php was not readable

I had a look in the zip and the file does not seem to exist.

Have I done something wrong?

Darren

У адказ на Darren Smith

Re: Conditional activities: Activity Locking v0.2b for Moodle 1.5

Stuart Mayor -
Ooops.
I must have included the view.php file for a module I have been working on here by accident.
To get rid of the error, delete the folder "agreement" in the mod folder of your moodle installation.
У адказ на Stuart Mayor

Re: Conditional activities: Activity Locking v0.2b for Moodle 1.5

Darren Smith -

Ah thanks - getting somewhere now. I couldn't get the SQL to work until I removed the ' ' from around the 1

Anyway, now in the course page I am getting the following all over ...

Table 'alumni.mdl_course_module_locks' doesn't exist

I have been to the admin page to try and trigger it's creation and nothing happens. Also, the table isn't there when I look at mysql through webmin.

Is it because my database is not called moodle or do I need to do something else?

Thanks

Darren

PS - the new screen caps below look very interesting

У адказ на Darren Smith

Re: Conditional activities: Activity Locking v0.2b for Moodle 1.5

Stuart Mayor -
Ah. I seem to have only posted half of the instructions (!). I assumed (wrongly) that people would be upgrading from a previous version.

In the next half hour or so, I am going to be uploading the latest version. It should (almost) install itself.

Watch this space.
У адказ на Stuart Mayor

Re: Conditional activities: Activity Locking v0.2b for Moodle 1.5

Chardelle Busch -
Выява Core developers
Hi Stuart,

I was thinking about this and had an idea. When a predecessor is chosen for an activity the x icon shows up for the locked activity like it is now, but the open square also appears next to the predecessor (with a mouseover such as "Must be completed before attempting: "locked activity"). Then once a predecessor activity is completed, the open square changes to the checked square, inidicating that the required activity has been completed (i.e. "checked off") and the x icon simply disappears (or, do not have the x icon at all since you already have the word "locked"). This seems to me to make more sense than having the checkmark appear next to the locked activity when the predecessor is completed.

Let's say that within a topic/week you have 3 activities that must be completed sequentially before taking the quiz. Each activity has the open square, meaning it is not completed yet. Also each activity that is locked has the x (or just says "locked") meaning you cannot attempt it yet. As you complete each activity, it gets checked off, and the next activity opens up (becomes unhidden and the x and word "locked" go away) giving you a good visual of where you are and what to do next. I hope I've made sense here. What do you think?
У адказ на Chardelle Busch

Re: Conditional activities: Activity Locking v0.2b for Moodle 1.5

Stuart Mayor -
I think I understand what you mean. I've been working on something similar in the latest release (which should appear on here some time today).
I'll give you an outline of what I've been doing:

The open and closed icons have been redrawn. The two icons are now a box with nothing in it (for activities which have not been completed) and a box with a green tick in it (or activities that have been completed).

I have added a new setting in the course settings window with the following options
  • Hide all predecessor info to the student (no boxes are shown)
  • Place a series of boxes after a locked activity (one for each predecessor)
  • Place a box before every activity. This box is ticked when a student successfully completes an activity (this could be anything from simply viewing the activity to getting full-marks)
If I understand correctly I think the last option is what you are looking for. I'll attach a screenshot of what it looks like.

I'll upload the version with the new features soon. I want to automate the creation of the necessary fields/tables before I do.
Укладаньне activity_linking.gif
У адказ на Stuart Mayor

Activity Locking v0.3b for Moodle 1.5

Stuart Mayor -
The saga continues...

This latest version hopefully fixes some of the problems caused by my ineptitude.

Firstly,
DO NOT USE THIS ON A PRODUCTION SYSTEM

Installation
This should now (kind of) install itself.
If you have a previous version of activity locking installed, you need to do the following

  • DROP the table 'course_module_locks'
  • DROP the field 'showpredecessors' from the table 'course'
Once you have done that, simply copy all of the files from the zip to the relevant folders in your moodle installation.
Then, log in as an administrator and go to the admin page. Moodle should then automatically set up the tables in the database for you. Unfortunately, this will only work if you are using a MySQL database. I haven't written the necessary stuff for Postgres as I've never used it. You'll have yo convert the sql file yourself.

Useage
Activity locking now includes an entry in the blocks table. At the moment, this is there simply to automate the creation of tables in the database.
If you do try to add the block "Locks" within your courses, nothing will be displayed (think of it as a dummy block for the moment). I do intend to add something in it in the future. Perhaps info on the number of locks used or the number of activities locked/unlocked. Suggestions please.
Instructions for use are as before.
Log in as an administrator and go into editing mode. You should see a lock icon after each activity. Click on the icon and you will be taken to a lock page. Choose the activities you want to act as predecessors and voila...
There is also an additional setting on the Course -> Settings page. There should be a setting "Show activity tracking". This has 3 options. Have a play with it.

As always, your feedback would be greatly appreciated.
У адказ на Stuart Mayor

Re: Activity Locking v0.3b for Moodle 1.5

Chardelle Busch -
Выява Core developers
Wow Stuart,
This is really getting to be quite cool. I'm so glad you came along. It installed fine. I didn't test this thoroughly, but here are a couple of comments:

1. When choosing an activity to lock, would it be possible to group the activities by week/topic on that page? It can get rather confusing now, especially if you have activities with the same name in several topics (e.g. each topic has a forum named "forum".) Also, this is not really necessary but would be nice if maybe at the top of that page you could add something like: Choose the prerequisite activities for (the activity you are locking)-- since my mind wanders a lot I might forget what I was doingblush.

2. I noticed you were able to lock an activity (e.g. resource) based on no grade (User must access this activity). Would it be possible to add this option to activities that have several grading options? For example, a forum with no rating could be locked until accessed? Also, I noticed that you cannot lock an activity based on a non-numerical scale, e.g. Separate and Connected Ways of knowing), would this also be possible?

3. Couple of minor things: The check image in this latest zip is still black--no green. In course settings you have called it activity tracking (which I understand why) but it might be confusing rather than sticking to calling it activity locking. Why did you add locking to a label? Bernard used the term predecessor since with his code, each locked activity really did have to precede it. But now, it might be more appropriate to go with the more common term "prerequisite".

5. It would be great if you could also add mouseovers to the boxes for the course setting option to show locking before each activity.

That's it for now. Thanks so much for your work on this!!!
У адказ на Chardelle Busch

Locking of entire Topics

Brad Zehr -
Has there been any consideration given to locking an entire topic based on completion of activities in a previous topic?  Say topics 2-9 had a prerequisite of the final quiz for topic 1, then locking the topics would be a lot quicker than assiging the lock to all activities in topics 2-9.
У адказ на Chardelle Busch

Re: Activity Locking v0.3b for Moodle 1.5

Stuart Mayor -
Thanks Chardelle. Some great ideas.

1. I'll look into implementing this asap. I, too, have trouble remembering what activity I am locking. I think lock.php needs a facelift. At the moment it is just functional. Watch this space.

2. Not sure if this is possible. I'll poke around with non-numerical grading and see what I can do. At the moment, forums are not included as an option to be a prerequisite as they are a special kind of module.

3. I must have put the wrong icon in the zip, or at least not updated it. I'll make sure it's in the next release. I added locking to a label simply because it is easier to add locking to all modules rather than a selection of them.
Prerequisite was the word I was trying to think of (does that happen to you?) but I couldn't so I just used "predecessor". I'll change it in due course.

4. By mouseovers, I assume you mean that a tooltip will tell you which activites this actrivity is a prerquisite for? The problem is, that an activity can be a prerequisite for several others. I'm not sure I could display that in one tooltip.

Again, thank you very much for your suggestions.
У адказ на Stuart Mayor

Re: Activity Locking v0.3b for Moodle 1.5

Darren Smith -

Just a quick update. I got it working with the latest code + instructions but it would not create the mysql tables so I had to do that and the ALTER instruction by hand.

Well ... this is very interesting and very useful. I wll look forward to playing with this in more detail.

I agree that prerequisite or similar is better than predecessor. I also like the idea of an ALT tag on the icon telling the students what the activitiy prerequisites are.

I can't get the nice tick icons to display at all. Is this in another version? On that note I notice that locked activities are grey - how about using the padlock icon to the left of the title for the students?

Oh. Also, when viewing an activity using the log on as student option I get

Coding error: isteacher() should not be used without a valid course id as argument. Please notify the developer for this module.

That's it for now big grin. Thanks for this.

Darren

У адказ на Darren Smith

Re: Activity Locking v0.3b for Moodle 1.5

Stuart Mayor -

Oh. Also, when viewing an activity using the log on as student option I get

Coding error: isteacher() should not be used without a valid course id as argument. Please notify the developer for this module.

That would be my sloppy programming. I'll get it sorted

У адказ на Stuart Mayor

Activity Locking v0.32b for Moodle 1.5

Stuart Mayor -
Version 0.32b

Changes
  • The lock.php have been tidied up a fair bit. It now shows the activity you are trying to lock at the top of the page.
    • Activities are now divided into topics/weeks.
    • Forums are now included in the list of prerequisites (a mistake in my coding).
  • "Predecessor" has been replaced with "prerequisite" wherever I have encountered it.
  • The "this activity is locked" page now shows which activities are locking it.
  • Alt text have been added to more icons
Installation
As before.
People upgrading from the previous version need only replace the following files
  • course/lib.php
  • course/lock.php
  • pix/t/open.gif
  • lib/locklib.php
  • lang/en/lock.php
Currently In progress
The ability to lock entire topics/weeks

Enjoy!
У адказ на Stuart Mayor

Re: Activity Locking v0.32b for Moodle 1.5

Chardelle Busch -
Выява Core developers
This is just great Stuart.  This might be due to something I did, but now when clicking on the lock I get the error:  Course ID was incorrect  Can you check this?

A little thing, how about putting a :  after the string "You must complete its prerequisites first"

I'm not sure how it works (need an account?) but maybe you could put this into CVS contrib. 
У адказ на Chardelle Busch

Re: Activity Locking v0.32b for Moodle 1.5

Stuart Mayor -

It seems I made a mistake in the locklib.php file. It should be fixed now.

I've also put the : in this one.

I've though about getting it into CVS, but I'm firewalled at work which makes it all a pain. I'm sure it'll get CVS'd at some stage though.

One last thing to mention. I'm on holiday for the next two weeks, getting married, so there won't be any updates. I look forward to returning to a list of suggestions and bug reports smile

У адказ на Stuart Mayor

Re: Activity Locking v0.32b for Moodle 1.5

Darren Smith -

winkWell things are getting closer but I am still running into problems.

This time when I enable locking for an activity I get stuff like ...


Error: Turn off debugging to hide this error.


SELECT * FROM mdl_log WHERE userid = '2' AND module = 'assignment' AND info = '3'


Found more than one record in get_record_sql !


Array
(
    [3109] => Array
        (
            [id] => 3109
            [0] => 1116866068
            [time] => 1116866068
            [1] => 2
            [userid] => 2
            [2] => 81.135.163.79
            [ip] => 81.135.163.79
            [3] => 9
            [course] => 9
            [4] => assignment
            [module] => assignment
            [5] => 28
            [cmid] => 28
            [6] => add
            [action] => add
            [7] => view.php?id=28
            [url] => view.php?id=28
            [8] => 3
            [info] => 3
        )

    [3196] => Array
        (
            [id] => 3196
            [0] => 1116955619
            [time] => 1116955619
            [1] => 2
            [userid] => 2
            [2] => 81.134.137.6
            [ip] => 81.134.137.6
            [3] => 9
            [course] => 9
            [4] => assignment
            [module] => assignment
            [5] => 28
            [cmid] => 28
            [6] => view submission
            [action] => view submission
            [7] => submissions.php?id=3
            [url] => submissions.php?id=3
            [8] => 3
            [info] => 3
        )

)

                                    
У адказ на Stuart Mayor

Re: Activity Locking v0.32b for Moodle 1.5

Olivier Wong -
Hi Stuart,

Really nice work ! I'm starting to work on something like activity_locking , with some extra features :
- multiple instances of 'locking way' (useful when a teacher wants to change organization involving same 'learning objects')
- evolutive branching using 'conditional' prerequisite (conditions upon score, history, previous attempts in quizz,... )

I've produced some code for these features (not really working for now), and i'll try to make it work with yours усьмешка

Have you already planned such features or can I go on developping these ?


У адказ на Olivier Wong

Re: Activity Locking v0.32b for Moodle 1.5

Bernard Boucher -
Bonjour Olivier,
I am happy to see that you have some spare programming powerwink

Stuart reloaded nicely activities linking in activities locking.

Last version of activities linking included regulate rights wich permit to control the activities in function of calendar events. Here we can see your evolutive branching.

For me the next step is to use the lesson module to control other activities via regulate rights. That way the lesson module will be able to activate/deactivate singles activities or entire sections or topics or weeks based on student's answers. The regulation will be used as an adaptive way to help the student with the appropriate learning objets available when required.

If that orientation interest you let me know.

Bonne cogitation,

Bernard








У адказ на Bernard Boucher

Re: Activity Locking v0.32b for Moodle 1.5

Olivier Wong -
Bonjour Bernard,

I haven't deeply looked into 'regulate rights' code, but I'm happy to see we share some orientations. I've already tryed to use lesson code but there was too much code-forking, and I thought it would be better to really separate the learning objects (activities) from the learning design (adaptative branching) : as there's nothing in moodle code where I could store this learning design, I'm now developping a new module in order to 'store' multiple instances of a 'locking way' (name it 'path' or 'guide'...)
Of course my module would have quite the same properties as lesson module, but it would make it less activity-dependant (separate design from ressources).

Amicalement,
Olivier
ps : has anyone heard about a working IMS-LD php implementation ?
У адказ на Olivier Wong

Re: Activity Locking v0.32b for Moodle 1.5

Bernard Boucher -
Bonjour Olivier,

I start with your p.s.
Maybe you already know it, but a group of Moodlers just finished to study differents ways to integrate learning desing with Moodle. You can find a nice draft report here. They tested some ld tools.

I think they did'nt find tools in php but a relatively tight integration of external programs in any programming language can be done with only one php file in Moodle called by the external application. I use that approach with a visual basic flowcharting program. The same approach can be used with external ld authoring and playing tools.

For the adaptative ( probably a simultanate french translationwink that we use ) or maybe adaptive branching Gustav has added some adaptive items code in moodle 1.5. His description will be much better than mine! That approach is in conjunction with Moodle future orientation.


À la prochaine,

Bernard

У адказ на Bernard Boucher

Re: Activity Locking v0.32b for Moodle 1.5

Olivier Wong -
Bonsoir Bernard,

Thanks for giving informations about other projects. I've tried Gustav adaptive падморгваньне quiz items and they're really great ! (but still a bit beyond our dreams...)
I'd like to have your opinion about this post. According to Martin, LAMS and moodle are going to be able to work together. As branching is scheduled for LAMS 1.2, I wonder if it's really useful to continue working on activity locking ? Do you think this will replace lesson module too ? Or maybe I should ask these questions to Martin (but he seems quite busy now) ?
Anyway, I think I'll try to finish my pieces of code, as it deals with some IMS-LD level B features, it might take some time until LAMS comes to level B ...pensif
У адказ на Olivier Wong

Re: Activity Locking v0.32b for Moodle 1.5

Bernard Boucher -
Bonjour Olivier,

LAMS & Moolde integration and branching are good goal to pursue but they are not panacea these are only starting point.

I don't know your "dreams" but mines are to break the teacher time paradox: more you invest on good activities for the students less you have time for your students.

That is why adaptive materials must be used in Moodle. The new quiz, the lesson, ld engines, scorm, LAMS, activities locking, regulate rights are all possibilities that permit or will permit some form of adaptive activities.

But even if we have all these features in Moodle, imagine the authoring time required for creating all these activities and the navigation required for making them adaptive! And to be adaptive you must follow a certain pedagogy or learner profile or cognitive structure.

That is why I choose to don't use necessary a standard but to design a small simple system that will permit to generate some adaptive content. That one year old too long lonely post resume my toughts and give some simples examples of generated stuff with navigation control.

The lesson module was choosen only as a proof of feasibility but if something else permit branching and support some form of import I will use it.

Now I am concentring my little Moodle development time to the generator wich is the heart of the system. It is based on a modified Bloom taxonomy and adaptation and generation are based on that taxonomy.

One way to understand the generation process is to compare it to a fifth generation programming language: the relations expressed with the taxonomy may be considered as prolog clauses or rules of expert system. The generator will process  the clauses with the goal of generating a tree or a network of multichoice questions importable in a lesson for example with the appropriate navigation.

That generation will help to break the teacher time paradox by letting the teacher to concentrate on the description of a part of his course using the relations of the taxonomy .

What will win Moodle adaptive race? I don't know.

I hope it answer some of yours questions,

Salutations,

Bernard

У адказ на Bernard Boucher

Re: Activity Locking v0.32b for Moodle 1.5

Olivier Wong -
Bonjour Bernard,

First of all, thank you for your very instructive post. I apologize for the delay of my answer but I just came back from MoodleMoot France 2005 and I didn't have time to write earlier.

I think I have to be more precise about 'my dreams'...
I haven't found an e-learning tool wich could help students to learn how to solve problems with many steps (complex branched problems) : at each step of the problem, there are different ways a student can follow to reach solutions. So for one problem, modelling every possible way is a very big task, quite impossible to achieve during real teacher падморгваньне life.

That's why it would be cool if something could model 'upcoming ways' upon what a student has done before. Using conditions at each step like in lesson is great, but these kind of conditions are rather static, and what would be needed are 'dynamic' conditions wich react upon parameters (such as answers to quizz given at previous steps). This would also help us to see more precisely student personal difficulties.

Hem I realize it's very near from the prolog clauses or rules of expert system you're thinking about : with my 'dreamed' tool we would state general rules for each step of a problem instead of treating every particular combination of steps. I'm happy to see we share same point of view about this !

But I think we can achieve this using standards : maybe I misunderstood IMS-LD papers (as usual for me when I read english things) but, from my point of view, 'ways to solve a problem' are actually learning design, so we shoud be able to describe them in this meta-language. That's why I expected LAMS to do that, but it seems there's still a lot of work to do !

I talked with Martin Dougiamas about such features ('expert system' seems a good definition) and he's very interested to help us continue working in this direction : maybe when he'll be back from his moodle world tour, he can give us his thoughts about this (kind of roadmap, or something to help us organize taskforce).

Amicalement,
Olivier

ps : I hope to release an alpha version of my module allowing 'conditional activities' by the end of July, as tomorrow is my last day in front of students for this semester... падморгваньне
У адказ на Olivier Wong

Re: Activity Locking v0.32b for Moodle 1.5

Bernard Boucher -
Rebonsoir Olivier,
                            your dreams are more clear and seem very reasonable.
I agree with you and modeleing every possible ways by hand in any domain is impossible and will let you no time to support your students! That is why we need a versatile tool that will support the students and that will try to break the teacher time paradox!

Last year I made an answer to Timothy about that generation process it may interest you too.

Using the standards is something to poursue but, in my case, it is not the first priority: I think with the same time investment from myself since 2 years, it is better for my students to use many quasi adaptive stuff generated that to wait for only few standards things manually authored.

Before choosing Moodle I read about 200 platforms and tested 10. Most of these want or support standard ( scorm ims ... )  but none mention that they want  to address the teacher time dilemma.

It is very interesting that Stuart and you are interested in producing code that will permit a certain control/branching in Moodle. More you seem interested to do it in a "clean" way.  A good brainstorm with Martin and probably some others will be usefull to define the best way to acheive the control branching part of the work and to make that form of control available to others Moodle modules.

À la prochaine,

Bernard


У адказ на Bernard Boucher

Re: Activity Locking v0.32b for Moodle 1.5

Olivier Wong -
Bonsoir Bernard,

Thanks for the link to your instructive answer to Timothy ; you're thinking about this idea of branching for so many years... You're truly a conditional-activity-Guru падморгваньне

I agree with you about the standards issue : we'd better try to do what we think first and adapt what we've done to make it IMS-LD compliant later. But if it's not difficult to stick to some IMS-LD "specs" I'll try to stay as close to them as possible.

I've benchmarked several platforms before choosing Moodle too, and the main criteria for my choice was modularity. That's why I'd like to stick to this "way of coding" (modular and scalable) and make things "clean". I also hope Martin could help us soon, but maybe we could share ideas about the strategy to develop such things in a this thread ? I started it as a kind of wishlist for our features. I hope it can help us organize how things could be done upon the knowledge of our needs.

Going back to (painful-)coding,
Olivier
У адказ на Olivier Wong

Re: Activity Locking v0.32b for Moodle 1.5

H C -

Hello: I just jump in in the middle.  I try to use the lock function (developed by Stuart) to make the certificate module dependent on the quiz, i.e., student has to pass the quiz before receiving the certificate. I have installed the activity_locking successfully.  I don't know what I did wrong, it seemed not working.  Here is what I did:

I have added the "quiz module" and set up all the quizes, then I added the certificate module below the quiz. 

Next I hide the certificate activity, and then move it (by click the "->" icon).  According to the instruction by Bernard in the thread (http://moodle.org/mod/forum/discuss.php?d=11811), the "predecessor" should appear.  It does not happen to me.  I don't know what I did wrong.  Would anyone who has used the activity_locking with the certificate module share some experience?

Thanks!

Helen

У адказ на Stuart Mayor

Ang: Re: Activity Locking v0.32b for Moodle 1.5

Jens Gammelgaard -
Выява Translators

Hi Stuart,

I am getting this error after uploading your locking hack and saving variables:

Warning: file(/blocks/activity_modules/block_activity_modules.php): failed to open stream: No such file or directory in lib/blocklib.php on line 21

Do any of you have an idea how to solve this?

Kind Regards

Jens

У адказ на Jens Gammelgaard

Re: Ang: Re: Activity Locking v0.32b for Moodle 1.5

Chardelle Busch -
Выява Core developers
Hi Jens,
I know I had problems when trying to install the block.  It is intended to update the database tables, after checking to see that the tables were in my database (they were), I then just went back and deleted that block.
У адказ на Chardelle Busch

Re: Ang: Re: Activity Locking v0.32b for Moodle 1.5

Chardelle Busch -
Выява Core developers
Okay Stuart,

The honeymoon's over.  (I couldn't resist)

Just to let you know, the most recent code is having some problems.  I get the same debug messages that Darrin posted above.  And, you have some underfined variables:
Notice: Undefined variable: action in /home/cbusch/public_html/moodle/course/lock.php on line 38

Notice: Undefined variable: passmark in /home/cbusch/public_html/moodle/course/lock.php on line 130

 

Notice: Undefined variable: locklist in /home/cbusch/public_html/moodle/lib/locklib.php on line 99


У адказ на Chardelle Busch

Ang: Re: Ang: Re: Activity Locking v0.32b for Moodle 1.5

Jens Gammelgaard -
Выява Translators

Hi Chardelle!

Thank you for your instructions.

So it means that I should:

  1. Upload the respective files
  2. Save variables in Moodle backend
  3. Check if the tables are there in the db with fx. phpAdmin, if yes ->
  4. Click to the control panel for blocks in Moodle backend and delete the block for Ativity Locking

Is this the way to read your instructions?

Kind Regards
Jens

У адказ на Jens Gammelgaard

Activity Locking v0.32b for Moodle 1.5

Chardelle Busch -
Выява Core developers
Hi Jens,

Yes, that's it. I think if the table (and update to course table) are in your database, then deleting the block might fix the problems you are having. But, with an install of the latest code in the latest stable 1.5 I'm getting other error messages, so I think the code needs a little tweaking. I'll let you know if I figure anything out.