Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 27 additions & 15 deletions mod/checklist/README.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,48 +2,57 @@ Checklist module
================

==Introduction==
This is a Moodle plugin for Moodle 1.9 & 2.0+ that allows a teacher to create a checklist for their students to work through.
This is a Moodle plugin for Moodle 1.9 & 2.0+ that allows a teacher to create a checklist for their students
to work through.
The teacher can monitor all the student's progress, as they tick off each of the items in the list.
Note: This is the Moodle 2.0+ version.

Items can be indented and marked as optional or turned into headings; a range of different colours can be used for the items.
Students are presented with a simple chart showing how far they have progressed through the required/optional items and can add their own, private, items to the list.
Items can be indented and marked as optional or turned into headings; a range of different colours can be used
for the items.
Students are presented with a simple chart showing how far they have progressed through the required/optional
items and can add their own, private, items to the list.

==Changes==

* 2012-03-05 - Bug fix: grades not updating when new items added to a course (with 'import course activities' on)
== Changes ==
* 2012-04-11 - New functionnalities (documents, outcomes) by Jean Fruitet <jean.fruitet@univ-nantes.fr>
* 2012-01-27 - French translation from Luiggi Sansonetti
* 2012-01-02 - Minor tweaks to improve Moodle 2.2+ compatibility (optional_param_array / context_module::instance )
* 2012-01-02 - CONTRIB-2979: remembers report settings (sort order, etc.) until you log out; CONTRIB-3308 - 'viewmenteereport' capability, allowing users to view reports of users they are mentors for

==Installation==
(Note, due to the way the new plugins database works, if you are downloading this from the Moodle.org website, you will need to download the 'checklist block' and 'checklist grade export' plugins separately)
(Note, due to the way the new plugins database works, if you are downloading this from the Moodle.org website,
you will need to download the 'checklist block' and 'checklist grade export' plugins separately)

1. Unzip the contents of file you downloaded to a temporary folder.
2. Upload the files to the your moodle server, placing the 'mod/checklist' files in the '[moodlefolder]/mod/checklist', (optionally) the 'blocks/checklist' files in the '[moodlefolder]/blocks/checklist' folder and (optionally) the 'grade/export/checklist' files in the '[moodlefolder]/grade/export/checklist' folder.
3. Log in as administrator and click on 'Notifications' in the admin area to update the Moodle database, ready to use this plugin.

IMPORTANT: The 'Check-off modules when complete' option now works via cron, by default. This means that there can be a delay of up to 60 seconds (or more - depending on how often your site runs 'cron' updates), between a student completing an activity and their checklist being updated.
IMPORTANT: The 'Check-off modules when complete' option now works via cron, by default.
This means that there can be a delay of up to 60 seconds (or more - depending on how often
your site runs 'cron' updates), between a student completing an activity and their checklist being updated.

If you are not happy with this delay, then make the changes found in the file core_modifications.txt

Note: if you are upgrading from a previous version, please delete the file 'mod/checklist/settings.php' from the server, as it is no longer needed.
Note: if you are upgrading from a previous version, please delete the file 'mod/checklist/settings.php'
from the server, as it is no longer needed.

==Adding a checklist block==
1. Click 'Turn editing on', in a course view.
2. Under 'blocks', choose 'Checklist'
3. Click on the 'Edit' icon in the new block to set which checklist to display and (optionally) which group of users to display.
3. Click on the 'Edit' icon in the new block to set which checklist to display and (optionally)
which group of users to display.

==Exporting checklist progress (Excel)==
1. In a course, click 'Grades'
2. From the dropdown menu, choose 'Export => Checklist Export'
3. Choose the checklist you want to export and click 'Export Excel'
If you want to change the user information that is included in the export ('First name', 'Surname', etc.), then edit the file 'grade/export/checklist/columns.php' - instructions can be found inside the file itself.
If you want to change the user information that is included in the export ('First name', 'Surname', etc.),
then edit the file 'grade/export/checklist/columns.php' - instructions can be found inside the file itself.

==Usage==
Click on 'Add an activity' and choose 'Checklist'.
Enter all the usual information.
You can optionally allow students to add their own, private items to the list (this will not affect the overall progress, but may help students to keep note of anything extra they need to do).
You can optionally allow students to add their own, private items to the list (this will not affect
the overall progress, but may help students to keep note of anything extra they need to do).

You can then add items to the list.
Click on the 'tick' to toggle an item between required, optional and heading
Expand All @@ -56,10 +65,13 @@ Click on the '+' icon to insert a new item immediately below the current item.
Click on 'Preview', to get some idea of how this will look to students.
Click on 'Results', to see a chart of how the students are currently progressing through the checklist.

Students can now log in, click on the checklist, tick any items they have completed and then click 'Save' to update the database.
If you have allowed them to do so, they can click on 'Start Adding Items', then click on the green '+' icons to insert their own, private items to the list.
Students can now log in, click on the checklist, tick any items they have completed and then click 'Save'
to update the database.
If you have allowed them to do so, they can click on 'Start Adding Items', then click on the green '+'
icons to insert their own, private items to the list.

If you allow a checklist to be updated by teachers (either exclusively, or in addition to students), it can be updated by doing the following:
If you allow a checklist to be updated by teachers (either exclusively, or in addition to students),
it can be updated by doing the following:
1. Click 'Results'
2. Click on the little 'Magnifying glass' icon, beside the student's name
3. Choose Yes / No for each item
Expand Down
120 changes: 120 additions & 0 deletions mod/checklist/README_JF_VERSION.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,120 @@
CheckList - Moodle module
===========================================================================================
// Modifications by jean.fruitet@univ-nantes.fr

I made additions to original code to get some new functionnalities

CheckList Version : $module->release = 'JF-2.x (Build: 2012041100)';
This is a fork of master repositoy


1) Users may comment their Skills and upload files or URL as prove of practice.
----------------------------------------------------------------------------------

a) New DB tables 'checklist_description' and 'checklist_document'

b) New config parameter :
$CFG->checklist_description_display
New script
./mod/checklist/settings.php

c) New scripts
edit_description.php
edit_document.php
delete_description.php
delete_document.php
file_api.php

d) Scripts modification
lib.php :

// MOODLE 2.0 FILE API
function checklist_pluginfile($course, $cm, $context, $filearea, $args, $forcedownload) {
//Serves activite documents and other files.
function checklist_send_file($course, $cm, $context, $filearea, $args) {
// Serves activite documents and other files.

locallib.php : many functions added or modified (Look for "// MODIF JF" tag.)

Class checklist_class {

(...)
// MODIF JF 2012/03/18
/* BEGIN OF FUNCTIONS ADDED BY JF ***** */
(...)
/* END OF FUNCTIONS ADDED BY JF ** */

}


2) Import of Outcomes file (csv format) to get Outcomes as Items in CheckList
------------------------------------------------------------------------------

Teachers may import Outcomes (outcomes.csv) files in CheckList to get these outcomes as Items.
Furthermore any Item of CheckList may be validated by the way of Moodle activity
(Assignment or Quizz for exemple) which uses the same Outcomes.

a) This does not affect any CheckList DB tables

b) New config parameter :
$CFG->checklist_outcomes_input

c) New scripts :

importexportoutcomes.php
import_outcomes.php
export_outcomes.php
export_selected_outcomes.php
select_export.php
cron_outcomes.php

d) Scripts modification
lib.php ::
// MODIF JF 2012/03/18
define ("USES_OUTCOMES", 1); // Outcomes imported as items

locallib.php ::
function view_import_export() {
(...)
// MODIF JF 2012/03/18
if (USES_OUTCOMES && !empty($CFG->checklist_outcomes_input)){
$importoutcomesurl = new moodle_url('/mod/checklist/import_outcomes.php', array('id' => $this->cm->id));
$importoutcomesstr = get_string('import_outcomes', 'checklist');
$exportoutcomesurl = new moodle_url('/mod/checklist/select_export.php', array('id' => $this->cm->id));
$exportoutcomesstr = get_string('export_outcomes', 'checklist');
echo "<a href='$importurl'>$importstr</a>&nbsp;&nbsp;<a href='$importoutcomesurl'>$importoutcomesstr</a>&nbsp;&nbsp;<a href='$exporturl'>$exportstr</a>&nbsp;&nbsp;<a href='$exportoutcomesurl'>$exportoutcomesstr</a>";
}
else{
echo "<a href='$importurl'>$importstr</a> &nbsp;&nbsp;&nbsp; <a href='$exporturl'>$exportstr</a>";
}
(...)
}

autoupdate.php
In function checklist_autoupdate(
// MODIF JF 2012/03/18
if ($module == 'referentiel') {
return 0;
}

New localisation strings

lang/en/checklist.php :: new strings
lang/fr/checklist.php :: new strings and translation

Functions replacement :
In all scripts
error('error_message') -> print_error(get_string('error_code', 'checklist'));


3) Backup / Restore :
------------------------------------------------------------------------------
./mod/checklist/backup/moodle2 scripts completed for new tables

4) Installation
------------------------------------------------------------------------------
./mod/checklist/install.xml
./mod/checklist/upgrade.php


===========================================================================================
113 changes: 113 additions & 0 deletions mod/checklist/add_document.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
<?php

// This file is part of the Checklist plugin for Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.

/**
* Add a new document to a description
* @author David Smith <moodle@davosmith.co.uk>
* @author Jean Fruitet <jean.fruitet@univ-nantes.fr>
* @package mod/checklist
*/


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

require_once(dirname(__FILE__).'/file_api.php'); // Moodle 2 file API
require_once(dirname(dirname(dirname(__FILE__))).'/repository/lib.php'); // Repository API

global $DB;

$id = optional_param('id', 0, PARAM_INT); // course_module ID, or
$checklistid = optional_param('checklist', 0, PARAM_INT); // checklist instance ID
$itemid = optional_param('itemid', 0, PARAM_INT); // Item ID
$userid = optional_param('userid', 0, PARAM_INT); // userID
$descriptionid = optional_param('descriptionid', 0, PARAM_INT); // description ID
$cancel = optional_param('cancel', 0, PARAM_BOOL);


$url = new moodle_url('/mod/checklist/add_document.php');
if ($id) {
if (!$cm = get_coursemodule_from_id('checklist', $id)){
print_error('error_cmid', 'checklist'); // 'Course Module ID was incorrect'
}
$course = $DB->get_record('course', array('id' => $cm->course), '*', MUST_EXIST);
$checklist = $DB->get_record('checklist', array('id' => $cm->instance), '*', MUST_EXIST);
$url->param('id', $id);
} else if ($checklistid) {
$checklist = $DB->get_record('checklist', array('id' => $checklistid), '*', MUST_EXIST);
$course = $DB->get_record('course', array('id' => $checklist->course), '*', MUST_EXIST);
if (!$cm = get_coursemodule_from_instance('checklist', $checklist->id, $course->id)) {
print_error('error_cmid', 'checklist'); // 'Course Module ID was incorrect'
}
$url->param('checklist', $checklistid);
} else {
print_error('error_specif_id', 'checklist'); // 'You must specify a course_module ID or an instance ID'
}


// Description ?
if (!$descriptionid && $itemid && $userid) {
$description = $DB->get_record('checklist_description', array("itemid"=>$itemid, "userid"=>$userid));
if (!empty($description)){
$descriptionid=$description->id;
}
}

$PAGE->set_url($url);
$returnurl=new moodle_url('/mod/checklist/view.php?checklist='.$checklist->id);

require_login($course, true, $cm);

$context = get_context_instance(CONTEXT_MODULE, $cm->id);

if (empty($userid)){
if (has_capability('mod/checklist:updateown', $context)) {
$userid = $USER->id;
}
}


/// If it's hidden then it's don't show anything. :)
/// Some capability checks.
if (empty($cm->visible)
&& (
!has_capability('moodle/course:viewhiddenactivities', $context)
&&
!has_capability('mod/checklist:updateown', $context)
)

) {
print_error('activityiscurrentlyhidden','error',$returnurl);
}


if ($cancel) {
if (!empty($SESSION->returnpage)) {
$return = $SESSION->returnpage;
unset($SESSION->returnpage);
redirect($return);
} else {
redirect($returnurl);
}
}


if ($chk = new checklist_class($cm->id, 0, $checklist, $cm, $course)) {
$chk->add_document($itemid, $userid, $descriptionid);
}

5 changes: 5 additions & 0 deletions mod/checklist/autoupdate.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,11 @@ function checklist_autoupdate($courseid, $module, $action, $cmid, $userid, $url,
return 0;
}


if ($module == 'referentiel') {
return 0;
}

if ($module == 'course') {
return 0;
}
Expand Down
28 changes: 28 additions & 0 deletions mod/checklist/backup/moodle2/backup_checklist_stepslib.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,17 @@ protected function define_structure() {

$comment = new backup_nested_element('comment', array('id'), array(
'userid', 'commentby', 'text'));

// MODIF JF 2012/03/18
$descriptions = new backup_nested_element('descriptions');

$description = new backup_nested_element('description', array('id'), array(
'userid', 'description', 'timestamp'));

$documents = new backup_nested_element('documents');

$document = new backup_nested_element('document', array('id'), array(
'descriptionid', 'description_document', 'url_document', 'target', 'title', 'timestamp'));

// Build the tree
$checklist->add_child($items);
Expand All @@ -62,13 +73,24 @@ protected function define_structure() {
$item->add_child($comments);
$comments->add_child($comment);

// MODIF JF 2012/03/18
$item->add_child($descriptions);
$descriptions->add_child($description);
$description->add_child($documents);
$documents->add_child($document);

// Define sources
$checklist->set_source_table('checklist', array('id' => backup::VAR_ACTIVITYID));

if ($userinfo) {
$item->set_source_table('checklist_item', array('checklist' => backup::VAR_PARENTID));
$check->set_source_table('checklist_check', array('item' => backup::VAR_PARENTID));
$comment->set_source_table('checklist_comment', array('itemid' => backup::VAR_PARENTID));

// MODIF JF 2012/03/18
$description->set_source_table('checklist_description', array('itemid' => backup::VAR_PARENTID));
$document->set_source_table('checklist_document', array('descriptionid' => backup::VAR_PARENTID));

} else {
$item->set_source_sql('SELECT * FROM {checklist_item} WHERE userid = 0 AND checklist = ?', array(backup::VAR_PARENTID));
}
Expand All @@ -80,10 +102,16 @@ protected function define_structure() {
$comment->annotate_ids('user', 'userid');
$comment->annotate_ids('user', 'commentby');

// MODIF JF 2012/03/18
$description->annotate_ids('user', 'userid');

// Define file annotations

$checklist->annotate_files('mod_checklist', 'intro', null); // This file area hasn't itemid

// MODIF JF 2012/03/18
$checklist->annotate_files('mod_checklist', 'document', 'id'); // This file area has itemid

// Return the root element (forum), wrapped into standard activity structure
return $this->prepare_activity_structure($checklist);
}
Expand Down
Loading