Note:

If you want to create a new page for developers, you should create it on the Moodle Developer Resource site.

Score lock: Difference between revisions

From MoodleDocs
 
(31 intermediate revisions by 4 users not shown)
Line 1: Line 1:
[[Category:Teacher]]
by John Gschnaidner
[[Category:Administrator]]
==Introduction==


=Introduction=
This is an advanced version of Activity Locking v2.4. for Moodle 1.6.x but not other versions earlier or later.  Since there are many different version of this hack, I decided to give this new branch a new name:
This is an advanced version of Activity Locking v2.4. Since there are many different version of this hack, I decided to give this new branch a new name:
:'''Score Lock'''
:'''Score Lock'''
Score Lock will allow you to give students access on activities, resources and complete sections within a course, only after having completed other tasks before that. For example: To get a certificate, the test has to be taken with a minimum result. 
==Features==
==Features==
Already included as in ActivityLocking v2.4:
Already included as in ActivityLocking v2.4:
Line 18: Line 18:
* Separate data base table instead of the log
* Separate data base table instead of the log
* Block for deleting students log
* Block for deleting students log
**Delete all logs from course
**Delete selected (students) logs
** Allow students to delete their own logs
* Install '''and de-install''' function
* Install '''and de-install''' function
* Source code stored and published for further development  
* Source code stored and published for further development
==Major Changes==
'''Current Restrictions:'''
In previous versions of Activity Locking the result, whether a student has accessed a resource has been pulled from the normal log. Because of that, the log files could never have been deleted. Score Lock has its own table, where the accessing of students on resources is saved immediately. With the optional block, teacher can allow the students to delete their own record and/or the teacher may delete all or selected students entries of the course.
*Score Lock v 1.0 beta installation currently supports only mySQL
Score Lock includes a block, that is used for log control and installation.
*Backup and restore will be realized in v 1.1
==Open Issues==
 
There is still a problem, that I have not figured yet:
==How to use Score Lock==
:Since Score Lock is part a hack, you can not update your system without destroying Score Lock and on re-installation upgraded features (of moodle) will be lost. I will try to make up for this with updated versions or even a durable solution, but it may take me a while.
The Score Lock block adds two tabs to the standard general settings for an activity, resource or section.  These tabs determine the condition for entry and how the lock will appear to the student before and after they enter the item.
 
===Basic steps===
{| border="3"
|+ Score Lock Steps
!width="50"| Steps !! Example Course with Score Locks
|-
|
*The teacher must add the Score Lock block to their course (see [[Blocks (teacher)|adding a block]]).
*Select the activity, a resource or a section by clicking the edit icon [[Image:Edit.gif|20px]] or enter the item's settings.
 
*In the example to the right, the teacher can set score lock for either section "1" or resource document "CCC".
[[Image:Score_lock_Resource_setting_tabs.JPG|Score_lock_Resource_setting_tabs.JPG]]
<br>
 
*Use the "Lock by Score" tab to set the conditions of the lock
 
*Use the "Settings" tab to set the how the lock will appear to students
 
*Note: if you are going to test locks in a course, you can only do that as a student, not as a teacher using the student view button.
|[[Image:Score Lock Sample Course TeacherView.JPG]]
|-
|
|Teacher view of Course
|}
 
==="Lock by score" tab===
{| border="3"
|+ Score Lock "Lock by Score" Tab Examples
! Activity-Resource screen !! Section screen
|-
|[[Image:Score Lock Requirements Lesson.JPG]]
 
|[[Image:Score Lock Requirements Section1.jpg]]
|-
| Lesson Lock by score example
|Topic example
|}
 
==="Settings" tab===
The settings tab has two parts:  Completion and Locks. In "Settings" you may adjust, at what condition the module / section is completed plus some settings for visualization of completiton and/or locking.
 
{| border="3"
|+ Score Lock Setting Tab Examples
! Activity-Resource screen !! Section screen
|-
| [[image:Score_Lock_Activity-Resource_Settings2.jpg]]
 
|[[Image:Score Lock Section Settings2.jpg|center]]
|-
| Resource example
|Topic example
|}
 
===Logs===
Be aware that entry into some modules (resources) will trigger completition of that module. To reset this values, you need to delete the logs (moodle log as well as the Score Lock log). You can do that from the Score Lock block shown below.
[[image:Scl_block.gif]]
*First make sure that the option for deleting the Moodle logs is set to Yes (see example below. If it is set to No, the resource will still be counted as completed.
*Also check your Score Lock settings for this course. Click on the edit icon in the score lock block to access settings.
*Click the 'delete' link in the Score Lock block when you want to delete all student logs or specific student logs.
[[Image:Score Lock block conf.jpg]]


=Installation=
==Installation==
Score Lock includes a block, that is used for the first part of the installation: Installing its own tables. Since a part of Score Lock is still a hack, it requires for a modification of other tables and files. This is done in a second step, which is done with a switch in the global settings of the block. This will add to existing tables, backup your existing files and install the modified Score Lock files. Even if the installation (de-installation) should fail, you will be able to recover to your original moodle files. The remaining table adds will cause no problem, but will have to be deleted previous to a new installation.
Score Lock includes a block, that is used for the first part of the installation: Installing its own tables. Since a part of Score Lock is still a hack, it requires for a modification of other tables and files. This is done in a second step, which is done with a switch in the global settings of the block. This will add to existing tables, backup your existing files and install the modified Score Lock files. Even if the installation (de-installation) should fail, you will be able to recover to your original moodle files. The remaining table adds will cause no problem, but will have to be deleted previous to a new installation.
'''Step by step'''
===Download and Forum===
*You can download the actual version of Score Lock from here: [http://moodle.org/file.php/5/moddata/forum/678/255250/ScoreLock_v103beta.tgz ScoreLock_v103beta]
:The current version is 1.0.3 which is compatible with Moodle 1.6.1 and 1.6.2
*If you need assistance or found a problem or a bug please post it here: [http://moodle.org/mod/forum/discuss.php?d=54195#247088 Conditional Activities Forum thread: Score Lock v 1.0 ]
 
===Step by step===
:'''Part 1: Block Installation'''
:'''Part 1: Block Installation'''
*Unpack the ScoreLock file
*Unpack the ScoreLock file
Line 39: Line 107:
You may place this block into a course, but it wont do much, but remind you, that the installation is not finished yet.
You may place this block into a course, but it wont do much, but remind you, that the installation is not finished yet.
:'''Part 2: Hack Installation'''
:'''Part 2: Hack Installation'''
* In global block setup (admin > blocks) open settings of ScoreLock
* In global block setup open settings of ScoreLock
>> Administration >> Configuration >> Blocks
*Check install
*Check install
[[image:GlobalInstall.gif]]
*Open any page, where you have added the ScoreLock block or add it right now.
*Open any page, where you have added the ScoreLock block or add it right now.
*The installation is triggered and you receive a success message (or, hopefully not, an error message in the block).
*The installation is triggered and you receive a success message (or, hopefully not, an error message in the block).
[[image:ScoreLockIsInstalled.gif]]
*ScoreLock is now functional.
*ScoreLock is now functional.
If anything went wrong:
 
===If anything went wrong===
I tested installation and de-installation by now about 50 times and it worked, but you never know ...
I tested installation and de-installation by now about 50 times and it worked, but you never know ...
*'''Don't panic!''' All files are still on your server!
*'''Don't panic!''' All files are still on your server!
Line 50: Line 122:
*To change back simply delete this four characters from the end of the file name.
*To change back simply delete this four characters from the end of the file name.
*Do not forget to check global settings of the block ScoreLock to avoid another unwanted installation attempt.
*Do not forget to check global settings of the block ScoreLock to avoid another unwanted installation attempt.
:'''De-installation:'''
===De-installation===
*Go to the block settings in admin and check de-install from the ScoreLock block.
*Go to the block settings in admin and check de-install from the ScoreLock block.
*Access again any page with the ScoreLock block to trigger the de-installation of the hack.
*Access again any page with the ScoreLock block to trigger the de-installation of the hack.
[[image:ScoreLockIsDeInstalled.gif]]
*Once the hack is removed (see message on the block) you may delete the ScoreLock block at the global block settings.
*Once the hack is removed (see message on the block) you may delete the ScoreLock block at the global block settings.
*Do not forget to delete the folder scorelock from /moodle/blocks and the .scl files from /moodle/course and /moodle/lib
*Do not forget to delete the folder scorelock from /moodle/blocks and the .scl files from /moodle/course and /moodle/lib
Once finished, there is no more part of ScoreLock on your system
Once finished, there is no more part of ScoreLock on your system
==Developer's notes==
===Major Changes===
In previous versions of Activity Locking the result, whether a student has accessed a resource has been pulled from the normal log. Because of that, the log files could never have been deleted. Score Lock has its own table, where the accessing of students on resources is saved immediately. With the optional block, teacher can allow the students to delete their own record and/or the teacher may delete all or selected students entries of the course.
Score Lock includes a block, that is used for log control and installation.
===Open Issues===
There is still a problem, that I have not figured yet:
:Since Score Lock is part a hack, you can not update your system without destroying Score Lock and on re-installation upgraded features (of moodle) will be lost. I will try to make up for this with updated versions or even a durable solution, but it may take me a while.
'''Score locks do not backup and restore their lock settings.''' This is because blocks can't backup their database tables. We have a fix, but first we need the patch in http://tracker.moodle.org/browse/MDL-8270 put into core. Please vote for it:-).
===The future of Score Lock===
*Once the beta has been successfully tested an most bugs are fixed I will release the code of Score Lock on sourceforge.
*I have started on version 1.1, where backing up and restoring of locks and settings is included.
===Copyrights===
Score Lock is under General Public License.
==See also==
*Conditional Activity forum

Latest revision as of 07:44, 10 June 2011

by John Gschnaidner

Introduction

This is an advanced version of Activity Locking v2.4. for Moodle 1.6.x but not other versions earlier or later. Since there are many different version of this hack, I decided to give this new branch a new name:

Score Lock

Score Lock will allow you to give students access on activities, resources and complete sections within a course, only after having completed other tasks before that. For example: To get a certificate, the test has to be taken with a minimum result.

Features

Already included as in ActivityLocking v2.4:

  • Supports module and section locks
  • Parallel locking and completing modules and sections
  • CSS style and checkbox for locking and completing
  • Hide when locked
  • Language support and help
  • Readme for features and installation
  • SQL commands for DB update
  • Info on how to update the CSS style sheets

New features:

  • Separate data base table instead of the log
  • Block for deleting students log
    • Delete all logs from course
    • Delete selected (students) logs
    • Allow students to delete their own logs
  • Install and de-install function
  • Source code stored and published for further development

Current Restrictions:

  • Score Lock v 1.0 beta installation currently supports only mySQL
  • Backup and restore will be realized in v 1.1

How to use Score Lock

The Score Lock block adds two tabs to the standard general settings for an activity, resource or section. These tabs determine the condition for entry and how the lock will appear to the student before and after they enter the item.

Basic steps

Score Lock Steps
Steps Example Course with Score Locks
  • The teacher must add the Score Lock block to their course (see adding a block).
  • Select the activity, a resource or a section by clicking the edit icon Edit.gif or enter the item's settings.
  • In the example to the right, the teacher can set score lock for either section "1" or resource document "CCC".

Score_lock_Resource_setting_tabs.JPG

  • Use the "Lock by Score" tab to set the conditions of the lock
  • Use the "Settings" tab to set the how the lock will appear to students
  • Note: if you are going to test locks in a course, you can only do that as a student, not as a teacher using the student view button.
Score Lock Sample Course TeacherView.JPG
Teacher view of Course

"Lock by score" tab

Score Lock "Lock by Score" Tab Examples
Activity-Resource screen Section screen
Score Lock Requirements Lesson.JPG Score Lock Requirements Section1.jpg
Lesson Lock by score example Topic example

"Settings" tab

The settings tab has two parts: Completion and Locks. In "Settings" you may adjust, at what condition the module / section is completed plus some settings for visualization of completiton and/or locking.

Score Lock Setting Tab Examples
Activity-Resource screen Section screen
Score Lock Activity-Resource Settings2.jpg
Score Lock Section Settings2.jpg
Resource example Topic example

Logs

Be aware that entry into some modules (resources) will trigger completition of that module. To reset this values, you need to delete the logs (moodle log as well as the Score Lock log). You can do that from the Score Lock block shown below. Scl block.gif

  • First make sure that the option for deleting the Moodle logs is set to Yes (see example below. If it is set to No, the resource will still be counted as completed.
  • Also check your Score Lock settings for this course. Click on the edit icon in the score lock block to access settings.
  • Click the 'delete' link in the Score Lock block when you want to delete all student logs or specific student logs.

Score Lock block conf.jpg

Installation

Score Lock includes a block, that is used for the first part of the installation: Installing its own tables. Since a part of Score Lock is still a hack, it requires for a modification of other tables and files. This is done in a second step, which is done with a switch in the global settings of the block. This will add to existing tables, backup your existing files and install the modified Score Lock files. Even if the installation (de-installation) should fail, you will be able to recover to your original moodle files. The remaining table adds will cause no problem, but will have to be deleted previous to a new installation.

Download and Forum

The current version is 1.0.3 which is compatible with Moodle 1.6.1 and 1.6.2

Step by step

Part 1: Block Installation
  • Unpack the ScoreLock file
  • Copy the content of the moodle folder into your moodle folder.
  • Optional you may copy moodledata to your moodle data folder (contains german language files)
  • Log in to your moodle site as administrator and access administration
  • You should get a message of two tables to be installed
  • If you access now the page for block setup you will notice a new block called ScoreLock

You may place this block into a course, but it wont do much, but remind you, that the installation is not finished yet.

Part 2: Hack Installation
  • In global block setup open settings of ScoreLock

>> Administration >> Configuration >> Blocks

  • Check install

GlobalInstall.gif

  • Open any page, where you have added the ScoreLock block or add it right now.
  • The installation is triggered and you receive a success message (or, hopefully not, an error message in the block).

ScoreLockIsInstalled.gif

  • ScoreLock is now functional.

If anything went wrong

I tested installation and de-installation by now about 50 times and it worked, but you never know ...

  • Don't panic! All files are still on your server!
  • All original files in /moodle/course/ and in /moodle/course/format/weeks and /topics, as well as the moodlelib in /moodle/lib have only get renamed with the extension .org.
  • To change back simply delete this four characters from the end of the file name.
  • Do not forget to check global settings of the block ScoreLock to avoid another unwanted installation attempt.

De-installation

  • Go to the block settings in admin and check de-install from the ScoreLock block.
  • Access again any page with the ScoreLock block to trigger the de-installation of the hack.

ScoreLockIsDeInstalled.gif

  • Once the hack is removed (see message on the block) you may delete the ScoreLock block at the global block settings.
  • Do not forget to delete the folder scorelock from /moodle/blocks and the .scl files from /moodle/course and /moodle/lib

Once finished, there is no more part of ScoreLock on your system

Developer's notes

Major Changes

In previous versions of Activity Locking the result, whether a student has accessed a resource has been pulled from the normal log. Because of that, the log files could never have been deleted. Score Lock has its own table, where the accessing of students on resources is saved immediately. With the optional block, teacher can allow the students to delete their own record and/or the teacher may delete all or selected students entries of the course. Score Lock includes a block, that is used for log control and installation.

Open Issues

There is still a problem, that I have not figured yet:

Since Score Lock is part a hack, you can not update your system without destroying Score Lock and on re-installation upgraded features (of moodle) will be lost. I will try to make up for this with updated versions or even a durable solution, but it may take me a while.

Score locks do not backup and restore their lock settings. This is because blocks can't backup their database tables. We have a fix, but first we need the patch in http://tracker.moodle.org/browse/MDL-8270 put into core. Please vote for it:-).

The future of Score Lock

  • Once the beta has been successfully tested an most bugs are fixed I will release the code of Score Lock on sourceforge.
  • I have started on version 1.1, where backing up and restoring of locks and settings is included.

Copyrights

Score Lock is under General Public License.

See also

  • Conditional Activity forum