Moodle

Completion Tracking - Hack to core

Details

  • Database:
    Any
  • Affected Branches:
    MOODLE_19_STABLE
  • Fixed Branches:
    MOODLE_20_STABLE

Description

This code was posted by David Peachey in the developer forum: http://moodle.org/mod/forum/discuss.php?d=130675&parent=575949
I added capabiltiy to show completion status for Database & Feedback modules and replaced the MYSQL specific functions to follow the Moodle API
The code still makes use of querying the log tables for resources and lessons which will have a performance impact on large sites.

Issue Links

Activity

Hide
Dan Marsden added a comment -

Hi Barry - as Sam and Tim mention in that forum posting - this feature has been implemented in 2.0

it's unlikely that this particular patch will make it into 1.9 - if completion tracking does end up in 1.9 it will be a backport of the code already in 2.0 - so that user experience is the same, and so that upgrades work correctly.

Show
Dan Marsden added a comment - Hi Barry - as Sam and Tim mention in that forum posting - this feature has been implemented in 2.0 it's unlikely that this particular patch will make it into 1.9 - if completion tracking does end up in 1.9 it will be a backport of the code already in 2.0 - so that user experience is the same, and so that upgrades work correctly.
Hide
Anthony Borrow added a comment -

Barry - Could you speak a little of the relation between MDL-20212 and CONTRIB-1787. They seem to be similar if not duplicates. I would be willing to consider creating this as a patch for 1.9 if you are willing to maintain it. Just let me know how I can be supportive of your efforts. Peace - Anthony

Show
Anthony Borrow added a comment - Barry - Could you speak a little of the relation between MDL-20212 and CONTRIB-1787. They seem to be similar if not duplicates. I would be willing to consider creating this as a patch for 1.9 if you are willing to maintain it. Just let me know how I can be supportive of your efforts. Peace - Anthony
Hide
Elizabeth Senger added a comment -

Does this support journals?

Show
Elizabeth Senger added a comment - Does this support journals?
Hide
Barry Oosthuizen added a comment -

Anthony - just saw your comment now. I logged this issue as CONTRIB-1787 because I thought it would be more appropriate as a CONTRIB entry so I guess this one can be closed. I will be very happy to maintain the patch.

Elizabeth - Currently this does not support journals (something on not really familiar with). Could you give me some background info? i.e. How would you want it to work? If it's straightforward enough I'll look at adding it.

Show
Barry Oosthuizen added a comment - Anthony - just saw your comment now. I logged this issue as CONTRIB-1787 because I thought it would be more appropriate as a CONTRIB entry so I guess this one can be closed. I will be very happy to maintain the patch. Elizabeth - Currently this does not support journals (something on not really familiar with). Could you give me some background info? i.e. How would you want it to work? If it's straightforward enough I'll look at adding it.
Hide
Elizabeth Senger added a comment -

For the journals, the grade is based on the entries made in the journal. I guess it would be consider complete (checked) if one or more entry was made in the journal. It would just need to query mdl_journal_entries to see if an entry existed for that journal id and the userid.

Show
Elizabeth Senger added a comment - For the journals, the grade is based on the entries made in the journal. I guess it would be consider complete (checked) if one or more entry was made in the journal. It would just need to query mdl_journal_entries to see if an entry existed for that journal id and the userid.
Hide
Barry Oosthuizen added a comment -

Hi Elizabeth,

try adding the following to the patch in CONTRIB-1787 (assuming you'll know how) and let me know if it works:

// Show completion status for journal module
if ($mod->modname == "journal") {
$instance = $mod->instance;
$select = "journal = '$instance' AND userid ='$USER->id'";

if (record_exists_select('journal_entries', $select)) { echo "<img src='".$CFG->pixpath."/i/tick_green_big.gif' />  "; } else { echo "<img src='".$CFG->pixpath."/i/cross_red_big.gif' />  "; }
}

Cheers,

Barry

Show
Barry Oosthuizen added a comment - Hi Elizabeth, try adding the following to the patch in CONTRIB-1787 (assuming you'll know how) and let me know if it works: // Show completion status for journal module if ($mod->modname == "journal") { $instance = $mod->instance; $select = "journal = '$instance' AND userid ='$USER->id'"; if (record_exists_select('journal_entries', $select)) { echo "<img src='".$CFG->pixpath."/i/tick_green_big.gif' />  "; } else { echo "<img src='".$CFG->pixpath."/i/cross_red_big.gif' />  "; } } Cheers, Barry
Hide
Anthony Borrow added a comment -

I'm resolving MDL-20212 as fixed for 2.0 since the requested functionality is more thoroughly implemented in 2.0. For those who want to do a quick patch of 1.9 they can use the patch mentioned in CONTRIB-1787 which is essentially a duplicate of this issue on the contrib side. Peace - Anthony

Show
Anthony Borrow added a comment - I'm resolving MDL-20212 as fixed for 2.0 since the requested functionality is more thoroughly implemented in 2.0. For those who want to do a quick patch of 1.9 they can use the patch mentioned in CONTRIB-1787 which is essentially a duplicate of this issue on the contrib side. Peace - Anthony

People

Vote (1)
Watch (3)

Dates

  • Created:
    Updated:
    Resolved: