Conditional activities: CICEI Implementation of Conditional Activities

Conditional activities: CICEI Implementation of Conditional Activities

by Borja Rubio Reyes -
Number of replies: 80
Here, in the Center of Innovation for the Information Society (CICEI) at the University of Las Palmas de Gran Canaria (ULPGC, Spain), we have been researching in adaptive e-learning based on conditionals activities on Moodle. In 2005 we presented in a previous discussion of this forum, a conditional activities implementation that was a part of my Master Thesis. Now we have improved and updated to 1.9.4 version of Moodle. With this implementation it is possible that each activity or resource in a course be conditioned to:

  • a participant has or not sent a determined assignment
  • the grade (numerical or scale) obtained by a participant in a determined assignment
  • that a participant has opened or not a determined chat window
  • that a participant has answered or not a determined choice
  • the answer given by a participant to a determined choice
  • the number of discussions (threads) initiated by a participant in a determined forum
  • the total number of messages (the beginnings of discussions or threads also consider messages) sent by a participant to a determined forum
  • the number of answers that the discussions initiated by a participant obtain
  • the grade (numerical or scale) obtained by a participant in a determined forum
  • the number of entries added by a participant to a determined glossary
  • the number of comments done by a participant to terms of a determined glossary
  • the grade obtained by a participant in a determined lesson
  • the answer given by a participant to a "multiple option", "true/false", "short answer" or "numerical" question of a determined lesson
  • the number of correct matches done by a participant in a "matching" question of a determined lesson
  • the mark obtained by a participant in a "essay" question of a determined lesson
  • the grade obtained by a participant in a determined quiz
  • the answer given by a participant to a "short answer", "true/false", "multiple option", "numerical", "calculated" question of a determined quiz
  • the number of correct matches done by a participant in a "matching" question of a determined quiz
  • the number of successes of a participant in a type question "random short-answer matching" of a determined quiz
  • the number of times that a participant has edited a determined wiki
  • the grade obtained by a participant in a determined workshop
  • a participant has access to a resource of different type that label
  • the participant language is different or equal to any of the site languages
  • the participant country is different or equal to any of the list of countries
  • the time passed (in days) since participant's first click in the course
  • the time passed (in days) since course start date
  • the time passed (in days) since determined date
General features:

  • The conditions of an activity must be defined in a new tab that appears in the configuration of the activity. Conditionals can be enabled/disabled in the configuration of each course.
  • Conditionals are included in course backup/restore.
  • This patch in addition allows to highlight the new activities in each course (those in which a participant has never done click) by the label "NEW" or by a personalized label. By default the activities are not highlighted. All that is controlled from the configuration of the course.
  • This patch in addition allows to define any kind of information related to an activity (from a new tab named "Activity information" that appears in the configuration of the activity). This information will appear to a participant in the course main page and above of the activity name until participant click on the activity. Once the participant has acceded to the activity the text disappear it will be possible accede to this information by means of the help button that appears next to the name of the activity.
  • New capabilities are added to roles:
    • Enable/disable conditionals
    • Create conditionals
    • Assign activity info
  • All texts in English and Español-Internacional (es).
  • For installation this patch uses Moodle Local customisation for the modifications in the database and to add new capabilities to the roles.
There is available a course explaining conditionals activities (you must create an account in order to test conditionals with your own account) and another course to test conditional activities as editing teacher (you can use username:teacher password:teacher account to access as teacher and you can use your created account to access as student and take the course).

This patch contains modified Moodle 1.9.4 files. So it only must be used in a Moodle with 1.9.4 version (neither with another version nor with 1.9.4+ version).

You can download it from Moodle (from Modules and Plugins database, it is possible that still it is not available) or directly from our server (login as guest after clicking download link).

It would be of great help for us knowing you opinion about our work and ideas about it.

Regards.
Average of ratings: Useful (5)
In reply to Borja Rubio Reyes

Re: Conditional activities: CICEI Implementation of Conditional Activities

by Diego Oliveira Potapczuk -
Hi, my name is Diego, im from Brazil, i work in SENAI-BA with Moodle. In my environment i use Activity Lock, but is not a trustful plugin, it has some bugs, and the development is very slow, it is very good to have others options.

Congratulations for this great tool for Moodle, and i hope you can get it soon to work with the Moodle 1.9.5

Cheers
Diego Potapczuk
potapczuk@gmail.com
In reply to Borja Rubio Reyes

Re: Conditional activities: CICEI Implementation of Conditional Activities

by Borja Rubio Reyes -
Conditional Activities implementation has been updated to Moodle 1.9.5 code.

You can download from Moodle (Modules and Plugins database, it is possible that still it is not available) both versions (1.9.4 and 1.9.5). Or you can download directly from here:
  • For Moodle 1.9.4: this patch contains modified Moodle 1.9.4 files. So it only must be used in a Moodle with 1.9.4 version (neither with another version nor with 1.9.4+ version). For download: login as guest after clicking download link.
  • For Moodle 1.9.5: this patch contains modified Moodle 1.9.5 files. So it only must be used in a Moodle with 1.9.5 version (neither with another version nor with 1.9.5+ version). For download: login as guest after clicking download link.

There is available a course explaining conditionals activities (you must create an account in order to test conditionals with your own account) and another course to test conditional activities as editing teacher (you can use username:teacher password:teacher account to access as teacher and you can use your created account to access as student and take the course).

Regards.
Average of ratings: Useful (1)
In reply to Borja Rubio Reyes

Re: Conditional activities: CICEI Implementation of Conditional Activities

by Diego Oliveira Potapczuk -
Let me ask something.

One of my coworkers that was testing this implementation said to me that it cant create a rule based on the progression of an SCORM activity, this for me is a great problem, because almost every course we use here use SCORM for its content, and with the activity lock we could create rules like, student can only continue after he read the whole SCORM, one of the biggest advantage of SCORM for me, it track the student progress.

Are you implementing this functionality anytime soon?
In reply to Diego Oliveira Potapczuk

Re: Conditional activities: CICEI Implementation of Conditional Activities

by Borja Rubio Reyes -
Hi Diego,

we don't use SCORM and we do not have in mind implementing this functionality at the moment.

Regards.
In reply to Borja Rubio Reyes

Re: Conditional activities: CICEI Implementation of Conditional Activities

by Yew Hong Ng -
I installed this on 1.9.5, but I can't decide whether it has been successfully installed. The database installations went well, but I do not see a new module, nor a new course format. Am I missing something? How exactly do I add a conditional activity?
In reply to Yew Hong Ng

Re: Conditional activities: CICEI Implementation of Conditional Activities

by Borja Rubio Reyes -
Hi Yew,

to use this patch in a course, first of all you must choose Use conditionals in course configuration page. Then when you edit any created activity/resource you will be able to see a new tab near to main activity configuration tab. Clicking in this tab you will be able to add conditions to that activity/resource.

Regards.
In reply to Borja Rubio Reyes

Re: Conditional activities: CICEI Implementation of Conditional Activities

by baraa abd el-hady -
sorry but i had done all that already but also i still didn't see the lock icon

i had copied the files and go to admin to see the tables modifies
and i activated the Use conditionals option
what else i am so want this do be done please help me.
In reply to baraa abd el-hady

Re: Conditional activities: CICEI Implementation of Conditional Activities

by Borja Rubio Reyes -
Hi Baraa,

you won't see an icon but when you edit any created activity/resource you will be able to see a new tab near to main activity configuration tab. Clicking in this tab you will be able to add conditions to that activity/resource.

Regards.
In reply to Borja Rubio Reyes

Re: Conditional activities: CICEI Implementation of Conditional Activities

by Alex Büchner -
Will this be obsolete once the Conditional Actities in Version 2.0 are released?
In reply to Alex Büchner

Re: Conditional activities: CICEI Implementation of Conditional Activities

by Borja Rubio Reyes -
Hi Alex,

i can't say to you if our implementation will be obsolete once the Conditional Activities in Version 2.0 are released because i don't know. We have been some years working on conditional activities because of our instructional design require so. And we need some features that Moodle 2.0 Conditional Activities don't provide at the moment, such as:
  • posts in a forum
  • answer given to a choice
  • agrupate conditions by means of different logic operator (OR, AND, NOT, BRACKETS)
But we will evaluate in each moment the best way of covering our course design needs.

Regards.
Average of ratings: Useful (1)
In reply to Borja Rubio Reyes

Re: Conditional activities: CICEI Implementation of Conditional Activities

by Borja Rubio Reyes -
An error reported by Marlon Arcila has been fixed in 1.9.4 and 1.9.5 versions. Locked activities were not appearing in Grades, though they had to be visible to the participants according to the conditions.

The problem was in is_hidden function in ...moodle.../lib/grade/grade_item.php file where was $USER-id appearing instead of $USER->id.

To fix this error you can download the code and overwrite all files, overwrite only ...moodle.../lib/grade/grade_item.php file or edit ...moodle.../lib/grade/grade_item.php and change $USER-id to $USER->id in is_hidden function.

Regards.
In reply to Borja Rubio Reyes

Re: Conditional activities: CICEI Implementation of Conditional Activities

by Borja Rubio Reyes -
After installing this conditional activities implementation, if a condition is not working, first of all you should check next things:
  • That conditionals are enabled in the course settings (Use conditionals: Yes).
  • That after creating the condition (for instance, the answer given to a choice) this condition is selected in the Conditions combination (for instance, Conditions combination: 1). You must to select in this way the wished conditions in order to establish the conditional.
  • That the established conditional is not disabled (on the page of Editing conditionals for an activity there is a button to activate/deactivate conditional)
  • That you are logged with the correct role (for instance, teacher or student) and in case of being logged as student that you actually fulfill or do not fulfill the conditions.
Regards.
In reply to Borja Rubio Reyes

Re: Conditional activities: CICEI Implementation of Conditional Activities

by Maurice Bakker -
Hello,

I installed (or copied) the files to my Moodle 1.9.5 folder, all works fine. I am able to create conditions, but I can only see a couple of possibilities in the Editing conditionals tab. I can only choose:

Student language
Student country
Enrolment
Course start
Date

On your test site I can see:

Assignment
Chat
Choice
Forum
Quiz
Resource
Conditionalbook
Student language
Student country
Enrolment
Course start
Date

Where or how do I enable the other options?

Regards,

Maurice
In reply to Maurice Bakker

Re: Conditional activities: CICEI Implementation of Conditional Activities

by Chris Creed -
Hi

I tried Conditional activities and now I have the eyes closed on the activity which denotes that they are hidden and it is impossible to get them open.

It's like my site has slept in a Somerset cider farm.

Help!!! Please

Chris
In reply to Chris Creed

Re: Conditional activities: CICEI Implementation of Conditional Activities

by Borja Rubio Reyes -
Hi Chris,

I am not sure i am understanding well. What activity has the eyes closed?

Regards.
In reply to Borja Rubio Reyes

Re: Conditional activities: CICEI Implementation of Conditional Activities

by Chris Creed -
Hi Borja

All of them on my site.

I may have to wait for 1.9.6 to come out to update Moodle - what do you think?

Something stratnge is happening.

Kind regards

Chris
In reply to Chris Creed

Re: Conditional activities: CICEI Implementation of Conditional Activities

by Borja Rubio Reyes -
Hi Chris,

really something strange is happening because this implementation of conditional activities never close an eye. In fact, if you manually close an eye of an activity the conditions defined on this activity have no effect. The eye of an activity must be opened to conditions defined on this activity apply. In other words the eye prevails over the conditionals. And as i said before conditional activities never close an eye.

Have you installed another module/block/patch that could be responsible of that?

Regards.
In reply to Borja Rubio Reyes

Re: Conditional activities: CICEI Implementation of Conditional Activities

by Chris Creed -
Hi Borja

Well I did try activity locking at around about the same time but I went through the files and deleted both conditional activities and the activity locking files.

Still stuck - eyes wide shut

Kind regards

Chris
In reply to Chris Creed

Re: Conditional activities: CICEI Implementation of Conditional Activities

by Borja Rubio Reyes -
Hi Chris,

i don't know if activity locking implementation close activity eyes in any case. I suggest you to ask about it. CICEI implementation can hide activities to students but never close an eye.


Regards.
In reply to Maurice Bakker

Re: Conditional activities: CICEI Implementation of Conditional Activities

by Borja Rubio Reyes -
Hi Maurice,

when you add a forum to your course then you will be able to see forum conditions, when you add an assignment then you will be able to see assignment conditions, and so on.

Regards.
In reply to Borja Rubio Reyes

Re: Conditional activities: CICEI Implementation of Conditional Activities

by Aleksandr Klyashitsky -
Hi Borja and others,

I was hoping for a quick hint. I am trying to implement course prerequisites and conditions. One condition would be that only one new course can be taken at a time. I have not been able to set conditions on course access, only on activities within a given course. I have also not managed to set conditions on activities within one course based on the results of another course. Am I able to do these things, or do you know of another way to implement what I am looking for?

Thank you for your help,
Aleksandr
In reply to Aleksandr Klyashitsky

Re: Conditional activities: CICEI Implementation of Conditional Activities

by Borja Rubio Reyes -
Hi Aleksandr,

these things can not be done with our implementation. And I am sorry but i don't know the way to do that in version 1.9. Anyway i suggest you to see this post.

Regards.
In reply to Borja Rubio Reyes

Re: Conditional activities: CICEI Implementation of Conditional Activities

by Aleksandr Klyashitsky -
Hi Borja,

I am trying a workaround by implementing the different courses as topics in a single course. It works fine because of the good choice of conditions. I might need to make some modifications in the database though (on a user by user basis), so I was looking at which tables the user access information is stored at but couldn't find it. Could you give me a hint with that? I see where the information on conditions is stored, but I don't understand how (and where in the code and database) it determines whether a user satisfies a given condition. Also, do you know of any problems with using conditions in this way?

On that note, is there any documentation that might describe how the module is built in case I need modify anything?

Thank you for your help,
Aleksandr
In reply to Aleksandr Klyashitsky

Re: Conditional activities: CICEI Implementation of Conditional Activities

by Borja Rubio Reyes -
Hi Aleksandr,

user access information is not stored in database. The conditions are always checked. In this way an activity may appear today and disappear tomorrow.

There is not any documentation. But if you want to add/modify a condition you must edit the next files:
  • ...moodle.../lib/conditional.php
  • ...moodle.../course/conditional/conditionslib.php
  • ...moodle.../course/conditional/conditions.php
and the language strings, if necessary, in the next files:
  • ...lang.../en_utf8/conditional.php
  • ...lang.../es_utf8/conditional.php

Regards.
In reply to Borja Rubio Reyes

Re: Conditional activities: CICEI Implementation of Conditional Activities

by Aleksandr Klyashitsky -
Hi Borja,

Thank you for the reply. I'm not sure I understand fully how it works. The part I don't understand is how the software knows which conditions the user satisfies and which he doesn't. I figured that there must be a check for each condition against some user information (which I figured is stored in the database). So for a condition that's based on access to another resource, I assumed that whether or not the user has access to that resource is listed somewhere.

Can you clarify if that is correct, or where I went off track.
Aleksandr
In reply to Aleksandr Klyashitsky

Re: Conditional activities: CICEI Implementation of Conditional Activities

by Borja Rubio Reyes -
Hi Aleksandr,

excuse me but I didn't understand your previous post. You are ok, all the user information is stored in the database. For example, information about forum posts is stored in forum_posts and forum_discussions tables, access to a resource is stored in log table, assignment submission in assignment_submissions table, and so on.

Regards.
In reply to Borja Rubio Reyes

Re: Conditional activities: CICEI Implementation of Conditional Activities

by Borja Rubio Reyes -
Two errors in conditional code have been fixed:
  • If the condition grade obtained by a participant in a determined assignment was used in a a course, then course main page was appearing blank.
  • The restoration of a course using conditionals was failing. Backup was correct, so if you have made any backup it is ok. But if you have restored any course using conditionals you should restore it again.
And some improvements have been done:
  • New condition added: to condition a resource/activity to the role of the participant (this condition has been developed by Eliseo Carrasco).
  • New condition added to forum conditions: number of different discussions in which a participant has posted.
  • Some warnings Fixed (made by Enrique Castro).
  • Other little improvements.
Download the new patch to Moodle 1.9.5.

Regards.

In reply to Borja Rubio Reyes

Re: Conditional activities: CICEI Implementation of Conditional Activities

by Deleted user -
can I use this patch to create a conditional activities in such a way that the system will call a PHP function that will return TRUE or FALSE?

Ries
In reply to Deleted user

Re: Conditional activities: CICEI Implementation of Conditional Activities

by Borja Rubio Reyes -
Hi Ries,

it is a very interesting possibility in which we were thinking about some years ago, but nowadays it is not possible.

Regards.
In reply to Borja Rubio Reyes

Re: Conditional activities: CICEI Implementation of Conditional Activities

by Sandra King -
How do I convince Moodle that I have never installed Conditional Activities, so that it will do a clean reinstall?

Is there a field in the database that records that I have installed it before, and what version? If I delete that field, will conditional activities go back through the install process?

Thank you for your help.
In reply to Sandra King

Re: Conditional activities: CICEI Implementation of Conditional Activities

by Borja Rubio Reyes -
Hi Sandra,

the field in the database that records that you have installed Conditional Activities before is value field in prefix_config table where name = 'local_version'.

You can obtain it doing:

SELECT *
FROM `prefix_config`
WHERE name = 'local_version';

changing prefix_ to your prefix.

But if you delete that field conditional activities don't go back through the install process. You would have to delete another database information manually.

Regards.
In reply to Borja Rubio Reyes

Re: Conditional activities: CICEI Implementation of Conditional Activities

by Sandra King -
Do you mean I would need to delete the database tables mdl_conditional and mdl_conditional_member etc manually before I can reinstall?
In reply to Sandra King

Re: Conditional activities: CICEI Implementation of Conditional Activities

by Sandra King -
The problem seems to be that even with all of the files copied into Moodle I am not seeing the areas where I would edit the conditional activities in lessons quizzes, resources etc.
In reply to Sandra King

Re: Conditional activities: CICEI Implementation of Conditional Activities

by Borja Rubio Reyes -
Hi Sandra,

Installing this patch when you edit any created activity/resource you should see a new tab near to main activity configuration tab. Clicking in this tab you will be able to add conditions to that activity/resource.

Are the folder ...moodle.../course/conditional/ (and all its content) permissions ok?

Regards.
In reply to Borja Rubio Reyes

Re: Conditional activities: CICEI Implementation of Conditional Activities

by Sandra King -
all of the folders within moodle on my server are set to 775 (it is linux)

As far as I can tell, I have uploaded every file in the zip directory, and I have all of the data tables set up correctly but in lessons I see

this in ../mod/lesson/view.php?id=61

viewlesson.gif

and on update lesson at .../modedit.php?update=61&return=1
updatelesson.gif

I don't know what else to do. I have clicked Notifications under admin again, and it agrees that all the tables are installed.
Attachment viewlesson.gif
In reply to Sandra King

Re: Conditional activities: CICEI Implementation of Conditional Activities

by Sandra King -
I see that these fields were added, so I guess I need to delete them too.

In the table 'mdl_course_modules, delete the field 'info'
In the table 'mdl_course' delete the field 'useconditionals'
In the table 'mdl_course' delete the field 'uselabel'
In the table 'mdl_course' delete the field 'personalizedlabel'

Are there any others?
In reply to Sandra King

Re: Conditional activities: CICEI Implementation of Conditional Activities

by Borja Rubio Reyes -
Hi Sandra,

besides all database information that you have mentioned, there is roles information, concretly next capabilities:
  • moodle/local:assigncomments
  • moodle/local:createconditionals
  • moodle/local:useconditionals
So if you have all the database information that we have mentioned and you have overwritten files, all should work. I would try to fix the problem before thinking in reinstall. What is the problem exactly?

Regards.
In reply to Borja Rubio Reyes

Re: Conditional activities: CICEI Implementation of Conditional Activities

by Sandra King -
I think I may have found part of the problem, I have tried turning on use conditionals 3 times, and saved the course settings each time, but it keeps reverting to Use conditionals=no.

Now I have to figure out how to get it to update the database when I change that setting. - it should be automatic, unless somehow something is set wrong on the data table... right?
In reply to Sandra King

Re: Conditional activities: CICEI Implementation of Conditional Activities

by Sandra King -
I have now read the xml file and put back the earlier deleted fields in the database, as far as I can tell, all roles have been verified, all files are in the correct place with 755 permissions, all data tables and fields are as shown in install.xml and update.php

I have verified in phpmyadmin that the useconditionals field in course did update (shows 1 instead of 0)

any idea what I am missing? I still can't see the conditionals tabs.
In reply to Sandra King

Re: Conditional activities: CICEI Implementation of Conditional Activities

by Borja Rubio Reyes -
Hi Sandra,

What you have done is perfect, all is ok.

Tabs are shown by ...moodle.../admin/roles/tabs.php file. And at the moment I only can ask you if that file is correctly overwritten?

Today and tomorrow i am very busy, but on wednesday i will try to better analyze the problem.

Regards.
In reply to Borja Rubio Reyes

Re: Conditional activities: CICEI Implementation of Conditional Activities

by Sandra King -
I just re-uploaded the tabs.php and verified 775. It didn't seem to be working, so I switched users to editing teacher and it was there - I have now switched back to my normal admin role and it is still there. Thank you. I am not sure what finally fixed it, but I appreciate all of your help.
In reply to Sandra King

Re: Conditional activities: CICEI Implementation of Conditional Activities

by Borja Rubio Reyes -
Hi Sandra,

fantastic!! I am glad that now you can use it.

Regards.
In reply to Borja Rubio Reyes

Re: Conditional activities: CICEI Implementation of Conditional Activities

by Borja Rubio Reyes -
Hi,

three new conditions have been added:

  • Participant picture: participant has changed his/her picture.
  • Number of started dialogues (dialogue module): the number of started dialogues by a participant is [<, <=, >, >=] than a number.
  • Instant messages: the number of instant messages sent by a participant is [<, <=, >, >=] than a number.

On the other hand, a diff file has been created (cicei_conditional_activities.diff) to apply conditionals and another diff file (cicei_conditional_activities_es_utf8.diff) to apply es_utf8 (Español-Internacional) language. They are in moodle cvs, in /contrib/patches/cicei_conditional_activities.

I have tested it with 1.9.6 version and it works. And it should work with 1.9.5+ and 1.9.6+ too (please, if somebody test it with these versions lets us know).

Regards.
In reply to Borja Rubio Reyes

Re: Conditional activities: CICEI Implementation of Conditional Activities

by Borja Rubio Reyes -
Hi,

Some problems fixed with sql sentences and PostgreSQL in ...moodle.../course/conditional/conditionslib.php and ...moodle.../lib/conditional.php files.

Download from moodle cvs or from our server.

Regards.
In reply to Borja Rubio Reyes

Re: Conditional activities: CICEI Implementation of Conditional Activities

by José Álvarez Huete -
Antes que el saludo, debo dicerte Borja que este es un trabajo impresionante. Enhorabuena. smile

Ahora el saludo. Os pido disculpas por escribir en español, mi inglés no es tan bueno como quisiera, aunque prometo traducir.

Al grano; ten en cuenta que soy un poco lego en tecnología porque te pregunto lo siguiente: si tu código toca código del core al actualizar a una versión superior de la 19.5 ¿qué ocurre? Intuye que no es posible.
Alguna pista de la que pueda tirar, serías tan amable de ponerla.

Reitero mi enhorabuena.

Saludos. smile
In reply to José Álvarez Huete

Re: Conditional activities: CICEI Implementation of Conditional Activities

by Borja Rubio Reyes -
Hola José,

me alegro mucho de que te guste. Y extiendo la enhorabuena al equipo del CICEI, porque yo soy el desarrollador y por eso el que suele aclarar los aspectos técnicos en los foros, pero hay un equipo detrás más amplio que es el que ha identificado la necesidad de los condicionales y otros desarrollos, de acuerdo al diseño instruccional del CICEI.

Por otra parte, comentarte que hay un foro en español para dudas relativas a los condicionales.

Ten en cuenta que desde el cvs de moodle te puedes descargar un parche para aplicar los condicionales en las últimas versiones, y no sólo la 1.9.5. En la 1.9.7 y la 1.9.7+ no lo hemos probado aún, aunque probablemente funcione. Y si alguien detecta que no funciona nos avisa y actualizaríamos el parche.

Y respecto a la actualización, puedes actualizar a una nueva versión volviendo a aplicar los condicionales en el código de la nueva versión.

Saludos.
In reply to Borja Rubio Reyes

Re: Conditional activities: CICEI Implementation of Conditional Activities

by José Álvarez Huete -
Muchas gracias:

allá que me voy, al foro español, digo. Por supuesto, gracias al equipo también, no quiero que me pase como al presidente con los integrantes del equipo de Copa Davis ;)


Saludos
In reply to José Álvarez Huete

Re: Conditional activities: CICEI Implementation of Conditional Activities

by Mitchell Kennard -
Has anyone successfuly run this on 1.9.7+? I have a production server and am afraid of breaking things if I put it up.
In reply to Mitchell Kennard

Re: Conditional activities: CICEI Implementation of Conditional Activities

by Borja Rubio Reyes -
Hi Mitchell,

I think that things should be always run on a test server first.

Saludos.
In reply to Borja Rubio Reyes

Re: Conditional activities: CICEI Implementation of Conditional Activities

by Borja Rubio Reyes -
Hi,

two new conditions have been added to conditional activities patches, both related to LSTest (Learning Styles Test) module. They are the next:

  • Participant has taken a particular test.
  • Prevalent learning style in participant is equal/different from any of the learning styles determined by a particular test.
Patches can be downloaded from cvs or from our server.

Saludos.
In reply to Borja Rubio Reyes

Re: Conditional activities: CICEI Implementation of Conditional Activities

by Ayari Cuevas -

Hi there!


Maybe this is a very stupid question but I don't know a lot about computers. Could you please give me detailed instructions to install the patch? My moodle installation is on a commercial hosting service.

Thanks in advance.


Hola!


Quizás esta es una pregunta muy tonta pero no conozco mucho acerca de computadoras. ¿Me podrían dar instrucciones detalladas de como instalar el parche por favor? Mi instalación de Moodle esta en un servicio de hosting comercial.

Muchas gracias de antemano.
In reply to Ayari Cuevas

Re: Conditional activities: CICEI Implementation of Conditional Activities

by Chris Collman -
Hi Ayari,
The readme.txt file gives some instructions. Be careful, I see warning in the readme file about how exact the Moodle version number has to be. Posts in this thread may indicate it is will work but if you don't know about computers, I would not do it on a production moodle site. It is likely that to provide these great features, the code will replace standard moodle code files and change the structure of existing tables in the MySQL (or what ever) database. If it does not work, going back maybe a task way over your head smile

Hosted servers use different methods you can use to access the code. Writing detail instructions for every hosting service is a pain smile Some use cpanel, if so then look for file manager, which has the look and feel to Windows Explorer. You will have to find your moodle directory. Basically you want to add the contents of the moodle folder in the zip/tar folder to the moodle code on your server. This will add or overwrite any existing files.

My advice, create a local host on you computer via one of the complete install packages available in downloads. It should be the same version as your production site. Add some content to your local host, then try installing the CICEI via the operating system's file manager. This will be a similar (but not exact) process to what you will have to do on your hosted server.

Chris

In reply to Chris Collman

Re: Conditional activities: CICEI Implementation of Conditional Activities

by Borja Rubio Reyes -
Hi Ayari,

I would like to add to what Chris said that the patch can be installed in latest 1.9.7+ versions by means of these patchs. And depending on your hosting you might have to apply the patch in a local machine and then upload the code to the server.

Regards.
In reply to Borja Rubio Reyes

Re: Conditional activities: CICEI Implementation of Conditional Activities

by Borja Rubio Reyes -
Hi,

two new conditions have been added:
Patches can be downloaded from moodle cvs or from our server and have been tested in Moodle 1.9.9+

Regards.
In reply to Borja Rubio Reyes

Re: Conditional activities: CICEI Implementation of Conditional Activities

by Alvin Shaffer -

Borja

Which package do I download from your site for 1.9.9+ compliance?

In reply to Borja Rubio Reyes

Re: Conditional activities: CICEI Implementation of Conditional Activities

by Frank Dixon -
What would be needed to add the checklist plugin to the list of available modules?

http://moodle.org/mod/data/view.php?d=13&rid=3582
In reply to Frank Dixon

Re: Conditional activities: CICEI Implementation of Conditional Activities

by Borja Rubio Reyes -
Hi Frank,

there is not any documentation. But if you want to add/modify a condition you must edit the next files:

  • ...moodle.../course/conditional/conditionslib.php: this file contains the functions for creating and editing conditions. Keep in mind that is made by steps (the sequence of screens that appear when you click on create new condition, then click on continue, ... and finally click on save condition) and there is a function to display the screen of each one of the steps. And within these functions you must add a new case to the switch.
  • ...moodle.../course/conditional/conditions.php: to show the conditions in the conditions table (here we also have to add a new case to the switch).
  • ...moodle.../lib/conditional.php: functions to evaluate conditions when a participant access the course and to decide which activities/resources are shown (and which are not shown).
and the language strings in the next files:

  • ...moodle.../lang/en_utf8/conditional.php
  • ...lang.../es_utf8/conditional.php
Regards.
In reply to Borja Rubio Reyes

Re: Conditional activities: CICEI Implementation of Conditional Activities

by Frank Dixon -
hrm....

Guess I need to do a bit of reading then :D. Thanks, at least I know what goes where now!
In reply to Borja Rubio Reyes

Re: Conditional activities: CICEI Implementation of Conditional Activities

by Frank Dixon -
Ok, got the code for setting the condtional working correctly.

2 things that aren't working and I'm hoping you can help with them.

1st and most important is the condition test function's sql statement causes the page to only load the header.

Here's the code:

mod/checklist/lip.php:

function checklist_get_user_grades($checklist, $userid=0) {
global $CFG;

$sql = "SELECT userid, rawgrade, itemmodule, iteminstance FROM {$CFG->prefix}grade_grades INNER JOIN {$CFG->prefix}grade_items ON itemid = {$CFG->prefix}grade_items.id WHERE itemmodule="checklist" AND iteminstance = {$checklist->id} ORDER BY userid";

$grades = get_records_sql($sql);
}

and the function call in lib/conditional.php:

case 'checklist':
if( $member->subtype == 'grade') {
$checklist = get_record('checklist', 'id', $member->instance);
require_once("$CFG->dirroot/mod/checklist/lib.php");
if ($grades = checklist_update_grades($checklist, $userid)) {
$grade = array_pop($grades);
if (!isset($grade->rawgrade)) {
$expression = str_replace($member->tableid, 'false', $expression);
} else {
if( eval('return '.$grade->rawgrade.' '.$member->op.' ;') ) {
$expression = str_replace($member->tableid, 'true', $expression);
} else {
$expression = str_replace($member->tableid, 'false', $expression);
}
}
} else {
$expression = str_replace($member->tableid, 'false', $expression);
}
}
break;


I adapted the above from the quiz case, but not sure if it's correct or even remotely close to being correct.

2nd issue is the condition description string isn't displaying on the screen where you select which conditions to use. This one isn't a big deal for the time being.


In reply to Frank Dixon

Re: Conditional activities: CICEI Implementation of Conditional Activities

by Borja Rubio Reyes -
Hi Frank,

I have never used checklist package. What is the condition that you want to add? I suppose checklist grade, isn't it?

Did you modify mod/checklist/lib.php for adding a condition? If so, it should not be necessary.

In the case 'checklist': I suppose that you must obtain grades with a function different to checklist_update_grades.

And in line

if( eval('return '.$grade->rawgrade.' '.$member->op.' ;') ) {

i suppose there must be a second member (after operator) with the grade selected while defining condition.

And to define and display a condition on the screen you must edit next files:

  • ...moodle.../course/conditional/conditionslib.php: this file contains the functions for creating and editing conditions. Keep in mind that is made by steps (the sequence of screens that appear when you click on create new condition, then click on continue, ... and finally click on save condition) and there is a function to display the screen of each one of the steps. And within these functions you must add a new case to the switch.
  • ...moodle.../course/conditional/conditions.php: to show the conditions in the conditions table (here we also have to add a new case to the switch).

Regards.
In reply to Borja Rubio Reyes

Re: Conditional activities: CICEI Implementation of Conditional Activities

by Frank Dixon -

need to add

print_footer($course);

to the end (line 70) of activityinfo.php.

In reply to Frank Dixon

Re: Conditional activities: CICEI Implementation of Conditional Activities

by Borja Rubio Reyes -
Thanks! Frank.

I will add it.

Regards.
In reply to Borja Rubio Reyes

Re: Conditional activities: CICEI Implementation of Conditional Activities

by Wifred Jacquet Yeste -
Borja,
lo he implementado con éxito sobre una versión 1.9.9 y es realmente fantástico. Trabajo como profesor en Sils (Girona) y colaboro con una empresa de nueva creación sobre e-learning: Amitiki@.

Felicidades por el trabajo.

Wifred
In reply to Wifred Jacquet Yeste

Re: Conditional activities: CICEI Implementation of Conditional Activities

by Borja Rubio Reyes -
Hola Wilfred,

desde el CICEI agradecemos tus comentarios, ¡que aproveches! smile

Saludos.
In reply to Borja Rubio Reyes

Re: Conditional activities: CICEI Implementation of Conditional Activities

by Paweł Suwiński -

Hi

I am planning to upgrade from moodle-1.9.5 with CICEI Conditionals for 1.9.5 to mdl-1.9.9 with last one path. Does db structure compatible? Would my courses with conditionals work  on the new version as well ?

In reply to Borja Rubio Reyes

Re: Conditional activities: CICEI Implementation of Conditional Activities

by Frank Dixon -

Feature suggestion:

Have the list of conditionals be available at the course level instead of the activity/resource level.  That way, if multiple activities/resources share the same conditional, the user only has to create the condition once and can apply it as needed.

In reply to Frank Dixon

Re: Conditional activities: CICEI Implementation of Conditional Activities

by Borja Rubio Reyes -

Hi Frank,

that feature is something that we have in mind and perhaps someday we'll decide to implement it.

Thanks a lot and regards.

In reply to Borja Rubio Reyes

Re: Conditional activities: CICEI Implementation of Conditional Activities

by Mahtab Hussain -

Hi,

I have installed your provided package for 1.9.5. But I have Moodle 1.9.9+. So I downloaded the patch which is a .diff file. Now, I could not understand what to do with this file. Where do I need to copy it? or what else to do with in to apply this patch for moodle 1.9.9+. I have gone through thread but did not find any help in this regard.

Thanks in advance for your help.

In reply to Mahtab Hussain

Re: Conditional activities: CICEI Implementation of Conditional Activities

by Borja Rubio Reyes -

Hi Mahtab,

once you have downloaded the .diff file from cvs of from our server, you must:

  1. Copy cicei_conditional_activities.diff file into your moodle directory.
  2. From a terminal/console go to your moodle directory.
  3. From a terminal/console run: patch -p1 < cicei_conditional_activities.diff
  4. Click on Notifications.

Then, if any problem, check permissions of all moodle files because of the patch execution may have modified the permissions of some of them. User of server web must have access to all moodle files. And click on Notifications again.

Regards.

In reply to Borja Rubio Reyes

Re: Conditional activities: CICEI Implementation of Conditional Activities

by Tinashe Ruswa -

I am interested at the applicability of this patch in Moodle 2.0.I am trying to appy this patch as it offers the instructors more functionality that the standard conditionals.

 

However I have accessed the pathc and installed it to my 2.0 Moodle installtion with little success

In reply to Tinashe Ruswa

Re: Conditional activities: CICEI Implementation of Conditional Activities

by Borja Rubio Reyes -

Hi Tinashe,

at the moment I cannot say to you if we will update the patch to Moodle 2.0, because I don't know.

Regards.

In reply to Borja Rubio Reyes

Re: Conditional activities: CICEI Implementation of Conditional Activities

by Tinashe Ruswa -

Oh ok thank you very much for the assistance.Its greatly appreciated.Once again thank you very much for a such a tool as it provided a way to look at how things are done in Moodle.

In reply to Borja Rubio Reyes

Re: Conditional activities: CICEI Implementation of Conditional Activities

by Andy Hediger -

Hello Borja

Your Conditional Activities Plugin is really helpful to us, thank you very much for providing this code !

We are preparing an activity-sequence for collaborative scaffolding in tandem-groups. Participants will be guided through a sequence of discussing questions in forums and then answering these questions in quizzes.

We are still polishing some details of the prototype here at the Institute for Research in Open-, Distance- and eLearning (www.ifel.ch) together with our colleagues at the University of Southern Switzerland and we may yet have questions concerning the code and ask you for help.
We will keep you informed anyway.

Thank you and regards from Switzerland
Andy

In reply to Andy Hediger

Re: Conditional activities: CICEI Implementation of Conditional Activities

by Borja Rubio Reyes -

Hi Andy,

First of all I'm very glad it helps you.

Secondly of course I will help you as far as i can.

And we from CICEI will be pleased to know how your work goes.

Thanks and regards.

In reply to Borja Rubio Reyes

Re: Conditional activities: CICEI Implementation of Conditional Activities

by Arvind Saini -

Hi Rubio..

I have installed your module in moodle 1.9 and i am trying to use the enrollment condtion in conditional activities but i am not getting it. I have set this condition on a lesson "Time passed since student enrolment date in course is greater than 1 days" and when i am logging as a student still i can see this lesson but this lesson must be visible after 1 day of enrollment, am i right here?

Plz help...

In reply to Arvind Saini

Re: Conditional activities: CICEI Implementation of Conditional Activities

by Arvind Saini -

My Moodel version is 1.9.14....module is installed correctly and i am able to create conditions but conditions are not working..plz help..

In reply to Borja Rubio Reyes

Re: Conditional activities: CICEI Implementation of Conditional Activities

by Aday Talavera -

CICEI recently updated Conditional Activities patch to Moodle 2.3.

You can download and test this version from https://bitbucket.org/ciceidev/cicei_moodle_conditional_activities/get/MOODLE_23_STABLE.zip

Please report any problems and bugs in our issue tracker located in https://bitbucket.org/ciceidev/cicei_moodle_conditional_activities/issues

Happy testing!

Average of ratings: Useful (1)