Note:

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

Course completion: Difference between revisions

From MoodleDocs
(Remove obsolete "Notifications" reference. Ref https://docs.moodle.org/dev/index.php?title=Course_completion&type=revision&diff=34956&oldid=8813)
 
(53 intermediate revisions by 7 users not shown)
Line 1: Line 1:
{{Moodle 2.0}}<p class="note">This is a SPECIFICATION for a feature in Moodle 2.0 that is still under development</p>
<p class="note">'''Note''': up to date information for users is available  in the user documentation on [https://docs.moodle.org/en/Course_completion Course completion].</p>


=Overview=
=Overview=
We need to flag when the "student" has finished a course. :-)


We need to allow several criteria for a "student" to complete a course:
We need to allow several types of criteria to determine how a "student" can complete a course:
* '''Manual self completion''': A "student" can mark her/himself complete a course
* '''Manual self completion''': A "student" can mark her/himself complete a course.
* '''Manual completion by''': An "admin", "teacher", "tutor", etc can mark a student complete for a course
* '''Manual completion by''': An "admin", "teacher", "tutor", etc can mark a student complete for a course.
* '''Course grade''': A "student" meets or exceeds a passing grade in the course
* '''Activity completion''': A "student" completes an activity, building on [https://docs.moodle.org/en/Development:Conditional_activities#Completion_tracking_2 Activity Completion] developed for 2.0 by Sam Marshall from OU.
* '''Unenrol''': A "student" unenrols (useful for external enrolment plugins)
* '''Course grade''': A "student" meets or exceeds a passing grade in the course.
* '''Date''': After a specified date all "students" enroled in the course have completed it
* '''Date''': After a specified date all "students" are marked as completed in a course.
* '''Duration after enrolment''': After a specified about of time (e.g., 3 months)
* '''Duration after enrolment''': After a specified amount of time after enrolment (e.g., 12 weeks), a "student" is automatically marked as complete in a course.
* '''Activity completion''': A "student" completes an activity, building on [https://docs.moodle.org/en/Development:Conditional_activities#Completion_tracking_2 activity completion] feature developed for 2.0 by Sam Marshall from OU.
* '''Unenrol''': After being unenroled, a "student" is marked complete for the course. Useful for external enrolment plugins.


We need to record when/how the course completion criteria are met for a "student". Then we need to flag when the "student" has finished a course. :-)
We need to record when and how a "student" meets each criteria in a course.


We also need reporting to allow:
We need to regularly aggregate the results for the criteria, measure progress, and check to see if a "student" has completed a course.
* A "student" to see how they are progressing in the course
 
* A "teacher" to see how students are progressing in the course
We need to show:
* A "student" the necessary criteria to complete a course
* A "student" how s/he is progressing in a course along the necessary criteria
* A "teacher" how his/her students are progressing in a course and which students have completed it


=Settings=
=Settings=
==Site-level settings==
==Site settings==
[https://docs.moodle.org/en/Development:Conditional_activities#Completion_tracking_2 Activity completion] provides an "Enable completion tracking" setting (found in the Site Administration block's Advanced features / optional subsystems settings page) for activity completion. We need to change the setting's name and add another setting for course completion.
[https://docs.moodle.org/en/Development:Conditional_activities#Completion_tracking_2 Activity Completion] provides an "Enable completion tracking" setting (found in the Site Administration block's Advanced features / optional subsystems settings page) for activity completion. We need to change the setting's name and add another setting for course completion.


'''Proposed changes:'''
'''Proposed changes:'''
Line 27: Line 31:


==Course settings==
==Course settings==
[https://docs.moodle.org/en/Development:Conditional_activities#Completion_tracking_2 Activity completion] provides a fieldset (named "Student progress") which contains a setting (named "Completion tracking") which enables/disables activity completion in a course. We need to rename the setting to describe activity completion and add a setting to enable course completion.
[https://docs.moodle.org/en/Development:Conditional_activities#Completion_tracking_2 Activity Completion] provides a fieldset (named "Student progress") which contains a setting (named "Completion tracking") which enables/disables activity completion in a course. We need to rename the setting to describe activity completion and add a setting to enable course completion.


"Enable completion tracking" setting (found in the Site Administration block's Advanced features / optional subsystems settings page) for activity completion.  
"Enable completion tracking" setting (found in the Site Administration block's Advanced features / optional subsystems settings page) for activity completion.  
Line 35: Line 39:
* Create a new setting named "Course completion tracking" (the setting will make course completion features available in the course)
* Create a new setting named "Course completion tracking" (the setting will make course completion features available in the course)


==Course completion admin settings==
==Course completion settings==
When course completion is enabled in a course (see above), a menu item labeled "Completion" will appear in the course Administration block on the main course page. When a user clicks on the "Completion" link, the course completion admin page will display the criteria described below and shown in the following mockup:
When course completion is enabled in a course (see above), a menu item labeled "Completion" will appear in the course Administration block on the main course page. When a user clicks on the "Completion" link, the course completion admin page will display the criteria described below and in the mockup also below:


[[Image:Edit_course_criteria_settings.png|thumb|600px|Edit course completion settings]]
[[Image:Edit_course_completion_settings.png|thumb|600px|Edit course completion settings]]


==Enabled versus required criteria==
===Criteria enabling===
We need to allow criteria to be enabled (i.e., "optional") or required (i.e., "must be done").
We need to allow criteria to be enabled.


We need some rules about enabled and required criteria in a course:
We need some rules about enabled criteria in a course:
* By default, all criteria are not enabled and not required.
* Each criteria (e.g., "Manual self completion", "Manual completion by", etc) can be enabled
* Each criteria type (e.g., "Manual self completion", "Manual completion by", etc) can be enabled.
* By default, all criteria are not enabled
* Each criteria type (except unenrolment) can be required.
* Each criteria type instance (e.g., a specific user role, or quiz) must be enabled before it can be required (see the screenshot of the criteria admin settings - the "required" check box is greyed out until the criteria is enabled).


'''Note:''' Since each criteria will be stored as a record in the course_completion_items table, "disabled" (i.e., "not needed") criteria will not be tracked or mentioned further.
===Criteria aggregation===
We need to define overall aggregation methods for the criteria type. We also need to a consistent set of aggregation methods for criteria types which have more than one possible option to determine an individual user's course completion:
* "Manual completion by" // more than one role can be enabled to determine if a student has completed the course
* "Activity completed" // more than one activity completion can be selected to determine if a student has completed the course


==Determining completion from combinations of criteria==
Aggregation methods:
We have several types of criteria to determine if a "student" has completed a course. We need to be able to use the criteria in combination. We also need to make use of the enabled and required values (described above). Here are the possible scenarios and the logic we'll use to handle them:


'''More than one criteria, both are required'''
{| border="1" cellpadding="2" cellspacing="0"
* We follow strict 'AND' logic between the required criteria to determine course completion.
|'''Method'''  
Example:
|'''Required to complete the criteria type'''
* Criteria 1 - enabled and required
|'''Example'''
* Criteria 2 - enabled and required
|'''Info'''
Results:
* A "student" must meet Criteria 1 AND Criteria 2 to complete the course.
* We track data for Criteria 1 and 2 for the "student".


'''More than one criteria, at least one is required and at least one is enabled'''
|-
* 'Required' criteria ''trumps'' 'enabled' criteria, and we follow strict 'AND' logic between the required criteria to determine course completion.
|'''All'''
Example:
|All of the enabled child criteria must be completed
* Criteria 1 - enabled, but not required
|Not applicable
* Criteria 2 - enabled and required
|
Results:
 
* A "student" must meet ONLY Criteria 2 to complete the course (Criteria 1 is optional and has no effect on course completion)
|-
* We track data for Criteria 1 and 2 for the "student".
|'''Any'''
|Any one (1) of the enabled child criteria must be completed
|Not applicable
|


'''More than one criteria, both are only enabled'''
|}
* We follow strict 'OR' logic between the enabled criteria to determine course completion.
Example:
* Criteria 1 - enabled, but not required
* Criteria 2 - enabled, but not required
Result:
* A "student" must meet either Criteria 1 OR Criteria 2 to complete the course.
* We track data for Criteria 1 and 2 for the "student".


==Criteria details==
===Criteria types===
===Manual self-completion===
====Manual self-completion====
'''Action:'''
'''Action:'''
* A "student" can manually indicate that s/he has completed the course via the course's Completion progress block.
* A "student" can manually indicate that s/he has completed a course via the course's [https://docs.moodle.org/en/Development:Course_completion#Block Completion progress block].
'''Tracked:'''
'''Tracked:'''
* The day/time when the "student" marked him/herself complete.
* The day/time when the "student" marked him/herself complete.


===Manual completion by===
====Manual completion by====
'''Action:'''  
'''Action:'''  
* A user assigned to the role in the course will see a checkbox in the [https://docs.moodle.org/en/Development:Course_completion#Completion_progress_report Completion progress report], which will allow him/her to manually "Mark complete" each applicable student enrolled in the course.
* A user assigned to the role in the course will see a checkbox in the [https://docs.moodle.org/en/Development:Course_completion#Report Completion progress report], which will allow him/her to manually "Mark complete" each applicable student enrolled in the course.


'''Tracked:'''
'''Tracked:'''
Line 99: Line 96:
'''Notes:'''
'''Notes:'''
# The Completion progress report will respect:
# The Completion progress report will respect:
#* '''Separate groups:''' A "Teacher" will only be able to see and mark complete students in her/his group(s) if separate groups is enabled.
#* '''Separate groups:''' A "teacher" will only be able to see and mark complete students in her/his group(s) if separate groups is enabled.
#* '''Role assignments on the USER-level context:''' A "Tutor" or "Mentor" will only be able to see and mark complete users assigned to him/her.
#* '''Role assignments on the USER-level context:''' A "Tutor" or "Mentor" will only be able to see and mark complete users assigned to him/her.
# The criteria can be met only once by the role:
# The criteria can be met only once by the role:
#* If more than one user is assigned to the role and has the capability of marking the user complete
#* If more than one user is assigned to the role and has the capability of marking the user complete
#* After a "student" has been marked complete one time by a user in the role, the [https://docs.moodle.org/en/Development:Course_completion#Completion_progress_report Completion progress report] will not provide a checkbox in the "Mark complete" column when viewed by any user in the role in the course.
#* After a "student" has been marked complete one time by a user in the role, the [https://docs.moodle.org/en/Development:Course_completion#Report Completion progress report] will not provide a checkbox in the "Mark complete" column when viewed by any user in the role in the course.
# We really making use of a role capability and permissions here.
# We really be relying on role capabilities and permissions for this.


===Activities completed===
====Activities completed====
'''Action:'''  
'''Action:'''  
* A "student" will meet the criteria when completing the specified activity, per the activity's 'Activity Completion' settings.


'''Tracked:'''  
'''Tracked:'''  
Line 116: Line 114:
# The list of activities/resources will contain:
# The list of activities/resources will contain:
#* Each activity/resource in the course with "Completion tracking" enabled within the activity/resource.
#* Each activity/resource in the course with "Completion tracking" enabled within the activity/resource.
#* The type of each activity followed by the activity name (i.e., "[mod name] - [activity/resource name]"). See the mockup on this page (or for a basic example: "Quiz - Derivatives")
#* The type of each activity followed by the activity name (i.e., "[mod name] - [activity/resource name]"). See the mockup on this page (or for a basic example: "Quiz - Derivatives").
# "Activity completion" is disabled for the site and course, the "Activities completed" field set will not appear in the list of criteria. drop-down list and the "required" option should be greyed-out. This message should appear:
# If "Activity completion" is not enabled for the site, the "Activities completed" field set will not appear on the page.
#:''"Activity completion must be enabled for this course (see the setting above)."''
# If "Activity completion" is enabled for the site and not enabled for the course, the "Activities completed" field set will appear and it will only contain this message:
# If "Activity completion" is enabled and there are no activities in the course (either not added or deleted), the drop-down list and the "required" option are should be greyed-out. This message should appear:
#:''"Activity completion must be enabled for this course."''
# If "Activity completion" is enabled for the site and course, and there are no activities in the course, the "Activities completed" field set will appear and it will only contain this message:
#:''"Currently, there are no activities in this course"''
#:''"Currently, there are no activities in this course"''
# If "Activity completion" is enabled, there are activities in the course and none of the activities have defined activity completion settings, the drop-down list and the "required" option should be greyed-out. This message should appear:
# If "Activity completion" is enabled for the site and course, and there are activities but none have activity completion enabled, the "Activities completed" field set will appear and it will only contain this message:
#:''"Currently, none of the activities in this course have defined activity completion settings."''
#:''"Currently, none of the activities in this course have defined activity completion settings."''


===Course grade===
====Course grade====
'''Action:'''  
'''Action:'''  
* A "student" will met the criteria when earning a total course grade above the passing grade.
* A "student" will meet the criteria when earning a total course grade above the passing grade.


'''Tracked:'''  
'''Tracked:'''  
* The day/time when the criteria was deemed complete
* The day/time when the user's course grade was evaluated as having exceeded the passing grade.


'''Note:'''
'''Note:'''
Line 135: Line 134:
* Once a student has completed the course, both the "Passing grade" setting on the course page and the "Grade to pass" setting in the top level category for the course will be locked. A message about locking will appear on the settings page for the top level category for the course.
* Once a student has completed the course, both the "Passing grade" setting on the course page and the "Grade to pass" setting in the top level category for the course will be locked. A message about locking will appear on the settings page for the top level category for the course.


===Date===
====Date====
'''Action:'''  
'''Action:'''  
* A "student" enroled in the course will met the criteria after a specified date.
* A "student" enroled in the course will automatically meet the criteria after a specified date.


'''Tracked:'''  
'''Tracked:'''  
* The day/time when specified day was evaluated as having passed.
* The day/time when specified day was evaluated as having passed.


===Duration after enrolment===
====Duration after enrolment====
'''Action:'''  
'''Action:'''  
* A "student" mets the criteria after the specified number of days after his/her enrolment.
* A "student" will meet the criteria after the specified number of days after his/her enrolment.


'''Tracked:'''  
'''Tracked:'''  
* The day/time when the "student" marked him/herself complete.
* The day/time when the "student" marked him/herself complete.


===Unenrolment===
====Unenrolment====
'''Action:'''  
'''Action:'''  
* A "student" will meet the criteria when being unenroled from the course.


'''Tracked:'''
'''Tracked:'''
* The day/time when the "student" was unenroled from the course.


==Notifications==
===Locking===
===Enable===
If enabled, a "student" will receive notification when s/he has completed the course via the completion criteria.
 
===Notify===
Users assigned to each selected role in the course will receive notification when each "student" completes the course.
 
==Locking completion settings==
When the first student has completed the course, the course completion criteria settings will be locked. The course settings can be unlocked (via an "Unlock course completion options" button), however a warning message will be displayed stating that unlocking the settings requires deleting all prior course completion data for the course. Once the completion data is deleted, the settings become unlocked (i.e., un-greyed out).
When the first student has completed the course, the course completion criteria settings will be locked. The course settings can be unlocked (via an "Unlock course completion options" button), however a warning message will be displayed stating that unlocking the settings requires deleting all prior course completion data for the course. Once the completion data is deleted, the settings become unlocked (i.e., un-greyed out).


Line 169: Line 163:
If activity completion is enabled and activity completion is a criteria for course completion, then all activity completion settings will be locked once a student has completed the course. In this case, unlocking an activity's completion settings will require deleting both the activity's completion data and the course's completion data.
If activity completion is enabled and activity completion is a criteria for course completion, then all activity completion settings will be locked once a student has completed the course. In this case, unlocking an activity's completion settings will require deleting both the activity's completion data and the course's completion data.


=Reporting=
If an activity is being tracked for course completion, we should add a warning/confirmation screen when an "admin" attempts to delete it. The message should say, "[Activity name] is currently a criteria for course completion. Are you sure you want to delete it?" [Delete anyway] / [Cancel]. If the "admin" confirms, the activity will be deleted however completion data for users who completed it will still remain tracked.
==Completion progress report==
[https://docs.moodle.org/en/Development:Conditional_activities#Completion_tracking_2 Activity completion] provides a "Completion progress report". The report can be found via on "Reports" menu item link in the course Administration block and when "Completion tracking" is enabled for the site and course.


The report shows:
Should the activity completion data remain?
* A column for each of the activities/resources in the course with "Completion tracking" enabled"
Should the course completion data be re-aggregated?
* A row for each user enroled in the course
* The completion status for each activity


'''Proposed changes:'''
=Data structures=
* Include in the report all enabled criteria for course completion (e.g., "Manual self completion", "Manual completion by", as well as the activities etc)
[[Image:Course_completion_data_model.png|thumb|400px|Course completion data model]]
* Each user's status for completion of each criteria, indicated by a status icon
* Allow the completion admin page to determine which activities are shown in the report
* Allow the list of users to be sortable, searchable, and filterable (by group, groupings, and/or user profile fields).
* Allow user profile fields (standard and custom) can be added/removed as columns in the list.
* When rolling over the each icon, additional details (including the completion date) will display.


Below is a mockup with all course completion criteria appearing (i.e., all criteria types have been enabled in a course):
===course===
The course table will require the following new fields. 'enablecompletion' will now be used for activity and course completion:


[[Image:Completion_report.png]]
{| border="1" cellpadding="2" cellspacing="0"
!Field
!Type
!Default
!Info


As described further above, display rules for separate groups will apply. If separate groups is enabled for the course, a "teacher" will only see students and completion data for users in the group(s) that she/he is assigned to.
|-
|'''completionnotify'''
|int(1)
|
|Notify users when they complete this course


Options for exporting completion data to CSV, ODF or Excel will be available. Completion dates will be included in the export.
|}
 
A column labeled "Mark complete" will appear containing a checkbox for each student if the user viewing the report is assigned to a role that is allowed to manually indicate that the students have completed the course.
 
Not shown in the mockup, however we should display the specified values under the applicable heading in the report for each of the following feilds:
* Period after enrolment
* Passing grade
* Date (for completion)
 
==Completion in the gradebook==
If course completion is enabled for the course, "Completion status" will also appear as a column in the grader report. If the user viewing the grader report is assigned to a role that is allowed to manually indicate that students have completed the course, a "Mark complete" column will appear to the right of the "Course total" column with a checkbox for each student who has not yet completed the course.
 
Course completion data can also be included in the gradebook exports. Field options will include:
* Completion status (e.g., "Complete", "Not complete")
* Completion date
* Completion criteria met (e.g., "[Role name] approved, [User name]", "passing grade: [passing value/percentage]")
 
==Completion progress block==
If completion is enabled for the site and course, a completion block will be available to be added to the course.
 
The block will allow a "student" to see:
* The completion criteria for the completion the course
* His/her status for completion of each criteria (similar to the Completion progress report)
* His/her overall completion status for the course (complete / not complete)
 
If none of the enabled criteria are required, the introduction text should say:
:''"All of the following criteria are required for completion"''
 
If the enabled criteria are NOT required, the introduction text should say:
:''"Any one of the following criteria is required for completion"''
 
Example progress statements for each type of criteria:
# you have marked yourself completed for this course
# your teacher has not yet marked you completed
# x of y activities completed
# x out of y days remaining
# course grade x% below passing grade of y%
 
If the current user can self complete the course, the block will provide an "I've completed this course" button (if the user has not already marked him/herself complete).
 
Activity completion criteria/status (if enabled for course completion) should be included in the block. See [http://tracker.moodle.org/browse/MDL-16466 MDL-16466] ("Activities on the course page do not convey to student that completion is expected or available for the activity").
 
TODO: create a mock-up of how this would look.
 
=Data structures=


===course===
===course_completion_aggr_meth===
The course table will require the following new fields:
This new table will be populated with the aggregation method for "Overall criteria", "Manual completion by", and "Activities completed".


{| border="1" cellpadding="2" cellspacing="0"
{| border="1" cellpadding="2" cellspacing="0"
Line 248: Line 198:


|-
|-
|'''enablecoursecompletion'''
|'''id'''
|int(1)
|int(10)
|
|Auto incrementing
 
|-
|'''course'''
|int(10)
|
|
|The course is using course completion
|The id of the course that the course completion aggregation relates to


|-
|-
|'''completionnotify'''
|'''criteriatype'''
|int(20)
|null
|The criteria type's integer constant ('role', 'activity') or null if 'overall' course aggregation.
 
|-
|'''method'''
|int(1)
|int(1)
|
|1
|Notify the user who has completed the course
|'1'='all', '2'='any', '3'='fraction', '4'='unit'.
|-


|'''value'''
|number(10)
|null
|null for 'all' and 'any', 0..1 for 'fraction', int > 0 for 'unit'
|}
|}


 
===course_completion_criteria===
===course_completion_items===
This new table will be populated with each criteria in each course for course completion:
This new table will be populated with a each item for course completion:


{| border="1" cellpadding="2" cellspacing="0"
{| border="1" cellpadding="2" cellspacing="0"
Line 281: Line 247:
|int(10)
|int(10)
|
|
|The id of the course that the course completion item relates to
|The id of the course that the course completion criteria relates to


|-
|-
|'''itemname'''
|'''itemname''' (not implemented)
|varchar(100)
|varchar(100)
|null
|null
Line 290: Line 256:


|-
|-
|'''itemtype'''
|'''criteriatype'''
|int(20)
|int(20)
|
|
|The type of item ('self', 'role', 'mod', 'grade', 'enrolperiod', 'date', 'postenrol'). Used for all item types.
|The criteria type's integer constant ('self', 'role', 'mod', 'grade', 'enrolperiod', 'date', 'postenrol').


|-
|-
|'''itemmodule'''
|'''module'''
|varchar(100)
|varchar(100)
|null
|null
|The name of the module (e.g., 'scorm', 'quiz', 'feedback'). Used only if itemtype='mod'.
|The name of the module (e.g., 'scorm', 'quiz', 'feedback'). Used only if criteriatype='mod'.


|-
|-
|'''iteminstance'''
|'''moduleinstance'''
|int(10)
|int(10)
|null
|null
|The id of the activity or resource module. Used only if itemtype='mod'.
|The id of the activity/resource module or role. Used only if criteriatype='mod'.


|-
|-
Line 311: Line 277:
|int(10)
|int(10)
|null
|null
|The number of days after enrolment. Used only if itemtype='enrolperiod'.
|The number of seconds after enrolment. Used only if criteriatype='enrolperiod'.


|-
|-
|'''date'''
|'''date'''
|int(10)
|int(10)
|
|null
|The time stamp of the date for course completion. Used only if itemtype='date'.
|The timestamp of the date for course completion. Used only if criteriatype='date'.


|-
|-
|'''required'''
|'''gradepass'''
|int(1)
|number(10)
|
|null
|The item is required. Used for all item types except unenrol.
|The course grade required to complete this criteria. Used only if criteriatype='grade'.
|}
 
 
===course_completion_notify===
This new table will be populated with the roles which should be notified for this course
 
{| border="1" cellpadding="2" cellspacing="0"
!Field
!Type
!Default
!Info
 
|-
|'''id'''
|int(10)
|
|Auto incrementing
 
|-
|'''course'''
|int(10)
|
|The id of the course that the condition applies to


|-
|-
|'''role'''
|'''role'''
|int(10)
|int(10)
|
|null
|The id of the role that should be sent a notification when a course has been completed
|The role id that can mark 'student's as complete in the course. Used only if criteriatype='role'.
 
|-
|'''message'''
|text
|
|HTML formatted message to be sent to the user assigned to the role.


|-
|-
|'''timesent'''
|'''lock''' (currently unused)
|int(10)
|int(10)
|
|null
|Timestamp of when the notification was sent
|Date this criteria was locked
 
|}
|}


===course_completion===
===course_completion_crit_compl===
This new table will be populated with a record for a user when s/he is enroled in the course. It will be updated as the user meets course completion criteria selected/enabled for a course.
This new table will be populated with records for each user as they complete each course completion criteria.


{| border="1" cellpadding="2" cellspacing="0"
{| border="1" cellpadding="2" cellspacing="0"
Line 388: Line 324:
|
|
|The id of the user who has completed the course
|The id of the user who has completed the course
|-
|-
|'''course'''
|'''course'''
Line 395: Line 332:


|-
|-
|'''progressstate'''
|'''criteriaid'''
|int(10)
|int(10)
|
|
|The user's current course completion progress as a value or percentage. This field is used when displaying student progress if activity completion is a criteria for course completion.
|The id of the completion criteria this references


|-
|-
|'''progressmax'''
|'''gradefinal'''
|int(10)
|
|The maximum progress value. 100 = percentage. This field is also used when displaying student progress if activity completion is a criteria for course completion.
 
|-
|'''gradepass'''
|number(10)
|number(10)
|
|null
|The minimum grade needed to pass the course (if passing grade criteria enabled)
|The final grade for the course (if referenced criteria type='grade').


|-
|-
|'''gradefinal'''
|'''unenroled'''
|number(10)
|int(10)
|null
|null
|The final grade for the course (included regardless of whether a passing grade was required)
|Timestamp when the user was unenroled (if referenced criteria type='unenrol').


|-
|-
|'''activities'''
|'''deleted''' (currently unused)
|text
|int(1)
|null
|null
|Serialized, base64 encoded: "[course_modules_completion->id],[mod->name],[Activity/Resource name],[some kind of activity completion criteria statement] for each activity enabled for completion.
|The course was deleted


|-
|-
|'''completedself'''
|'''timecompleted'''
|int(10)
|int(10)
|null
|null (should be notnull)
|The timestamp of when the user manually self-completed (if manual self-completion criteria enabled)
|Timestamp when the user completed the criteria
|}
 
===course_completions===
This table records a user's course completion state in a course (but not for individual criteria).


|-
{| border="1" cellpadding="2" cellspacing="0"
|'''completedrole'''
!Field
|text
!Type
|null
!Default
|Serialized, base64 encoded: "[user->id],[role->id],[timestamp]" for each user who manually marked the user complete.
!Info


|-
|-
|'''completeddate'''
|'''id'''
|int(1)
|int(10)
|null
|
|A completion date was used as a criteria for completing the course. The date will appear in the timecompleted column.
|Auto incrementing


|-
|-
|'''unenroled'''
|'''userid'''
|int(10)
|int(10)
|null
|
|Timestamp when the user was unenroled
|The id of the user who has completed the course


|-
|-
|'''deleted'''
|'''course'''
|int(1)
|int(10)
|null
|
|The course was deleted
|The id of the completed course


|-
|-
|'''timenotified'''
|'''timeenrolled'''
|int(10)
|int(10)
|
|
|Timestamp when the user was notified
|Timestamp when the user was enrolled in the course. In the case of multiple enrollments, the earliest timestamp for a current enrollment is used. If this is reported as 0, the current time is used instead.


|-
|-
|'''timeenroled'''
|'''timestarted'''
|int(10)
|int(10)
|
|
|Timestamp when the user enroled in the course
|Timestamp when the user first made progress in the course


|-
|-
|'''timecompleted'''
|'''timecompleted'''
|int(10)
|int(10)
|
|null
|Timestamp when the user completed the course
|Timestamp when the user completed the course


|}
|}


=Evaluating completion=
Since the gradebook aggregation is performed via cron, it makes sense that course completion is also evaluated by cron.


This creates an issue in which the progress block will not instantly not show course completion after the necessary criteria has been met by a "student". However, this can be solved by adding some instructional text to say "may take a few minutes to update".


=Role capabilities=
=Role capabilities=
Line 498: Line 436:


|}
|}
=Course reporting=
==Completion progress report==
[[Image:Completion_report.png|thumb|600px|Course completion progress report]]
A course completion report is available when course completion is enabled.The report can be found via on "Reports" menu item link in the course Administration block and when "Completion tracking" is enabled for the site and course.
The report shows:
* A column for each of the activities/resources in the course with "Completion tracking" enabled"
* A row for each user enroled in the course
* The completion status for each activity
'''Proposed changes:'''
* Include in the report all enabled criteria for course completion (e.g., "Manual self completion", "Manual completion by", as well as the activities etc)
* Each user's status for completion of each criteria, indicated by a status icon
* Allow the completion admin page to determine which activities are shown in the report
* Allow the list of users to be sortable, searchable, and filterable (by group, groupings, and/or user profile fields).
* Allow user profile fields (standard and custom) can be added/removed as columns in the list.
* When rolling over the each icon, additional details (including the completion date) will display.
See the mockup to the right with all course completion criteria appearing (i.e., all criteria types have been enabled in a course).
As described further above, display rules for separate groups will apply. If separate groups is enabled for the course, a "teacher" will only see students and completion data for users in the group(s) that she/he is assigned to.
Options for exporting completion data to CSV, ODF or Excel will be available. Completion dates will be included in the export.
A column labeled "Mark complete" will appear containing a checkbox for each student if the user viewing the report is assigned to a role that is allowed to manually indicate that the students have completed the course.
Not shown in the mockup, however we should display the specified values under the applicable heading in the report for each of the following feilds:
* Period after enrolment
* Passing grade
* Date (for completion)
==Gradebook==
# If "Passing grade" is enabled as a criteria for course completion, a grader should have the option of seeing completion status (i.e., "complete" / "not complete") as a column in the grader report.
# If a user assigned to a role that is enabled for "Manual completion by", the user should have the option of manually indicating which students have completed the course, a "Mark complete" column will appear to the right of the "Course total" column with a checkbox for each student who has not yet completed the course.
We should also provide an option to show course completion status in gradebook exports. Field options will include:
* Completion status (e.g., "Complete", "Not complete")
* Completion date
==Completion progress block==
[[Image:Course_completion_progress_block.png|thumb|190px|Course completion progress block]]
If completion is enabled for the site and a course, a completion block will be available to be added to the course.
The block will allow a "student" to see:
* The completion criteria for completing the course
* His/her status for completion of each criteria (similar to the Completion progress report)
* His/her overall completion status for the course (complete / not complete)
If all of the enabled criteria are required, the introduction text should say:
:''"All of the criteria below needed"''
If any of the enabled criteria are required, the introduction text should say:
:''"Any of the criteria below needed"''
If the current user can self complete the course, the block will provide an "I've completed this course" button (if the user has not already marked him/herself complete).
Activity completion criteria/status (if enabled for course completion) should be included in the block. See [http://tracker.moodle.org/browse/MDL-16466 MDL-16466] ("Activities on the course page do not convey to student that completion is expected or available for the activity").
==User (course) profile==
Activity and course completion criteria/status data should appear in a user's "Outline report" and "Complete report" in the user profile area, which is being reworked for 2.0 separately from this spec.
=Site reporting=
==User (site) profile==
[[Image:Course_completion_user_profile_activity.png|thumb|400px|Mockup of the user profile page with Course completion report]]
Activity and course completion criteria/status data should appear in a user's profile area.
It would make sense for courses to be grouped by:
* Courses in progress
* Courses completed
* Courses not yet started
For each course, the required criteria and status should appear.


=Cron=
=Cron=
A cron function will check the criteria and update the course_completion_items table as necessary. Here's a breakdown of the tasks for each criteria, and will need to be optimised for performance and scalability across all courses:
A cron function will check the criteria and update the course_completion_completions table as necessary. Here's a breakdown of the tasks for each criteria, and will need to be optimised for performance and scalability across all courses:


* '''Manual self completion:''' Cron not needed, performed directly from the Completion progress block
* '''Manual self completion:''' Cron not needed, performed directly from the Completion progress block.
* '''Manual completion by:''' Cron not needed, performed directly via the Completion progress report
* '''Manual completion by:''' Cron not needed, performed directly via the Completion progress report.
* '''Course grade:''' If enabled, compare the grade to the pass grade.
* '''Course grade:''' Compare the course grade to the passing grade.
* '''Unenrol:''' If enabled, get all users who are haven't met this criteria and have a timestamp in the timeend field in the role_assignments table.
* '''Unenrol:''' Compare course_completion->unenroled to role_assignments->timeend for the "student" role in the course.
* '''Date:''' If enabled, check if the date exceeds the current date.
* '''Date:''' Compare the current date to the specified date.
* '''Duration after enrolment:''' If enabled, get all users for whom (the timestamp for timestart of the role assignment in the course + the period after enrolment) >= the current timestamp
* '''Duration after enrolment:''' Compare the current date to the role_assignments->timestart + the specified period after enrolment.
* '''Activity completion:''' Get all records in the course_modules_completion table that relate to activities/resources in the course
* '''Activity completion:''' Evaluate the necessary records in the course_modules_completion table.
* '''Course completion:''' Evaluate the completion criteria and values, and update the completion field with the current timestamp if the user has met the necessary criteria
* '''Course completion:''' Aggregate the necessary fields in course_completion table, updating the timecompleted field with the current timestamp if the user has met the necessary criteria.
* '''Notifications:''' Send out them out to the user (if enabled) and to users in the selected role


=Backup and restore=
=Backup and restore=
* The new completion fields in the course table will be included in the backup.
* The new completion fields in the course table will be included in the backup.
* Entries in the course_completion_items table for the course should also be included in the backup.
* Entries in the course_completion_items, course_completion_aggregation_methods, and course_completion_notify tables for the course should also be included in the backup.
* When user data is included in a course backup, the backup will also include records in the course_completion table for the course.
* When user data is included in a course backup, the backup will also include records in the course_completion_completions table for the course.


=Tracking Issues=
=Events=
* http://tracker.moodle.org/browse/MDL-2631 Course credits and tracking of student's completion
The following course completion related events have been added to core:
* course_completed
** Triggered when a user completes a course. Event data is the full course_completions database record.
** Added in version 2.3.2


=Questions=
[[Category:Completion]]
==Weighting completion progress==
* Should the enabled and/or required criteria be weighted to measure progress?
* What weighting options should be available?
==Broader controls==
* Some criteria should be manageable by an "admin" from the site-level for policy / consistency purposes. What should they be? Maybe "completion by unenrolment"?
* Should there be controls on a category level?

Latest revision as of 10:04, 15 December 2015

Note: up to date information for users is available in the user documentation on Course completion.

Overview

We need to flag when the "student" has finished a course. :-)

We need to allow several types of criteria to determine how a "student" can complete a course:

  • Manual self completion: A "student" can mark her/himself complete a course.
  • Manual completion by: An "admin", "teacher", "tutor", etc can mark a student complete for a course.
  • Activity completion: A "student" completes an activity, building on Activity Completion developed for 2.0 by Sam Marshall from OU.
  • Course grade: A "student" meets or exceeds a passing grade in the course.
  • Date: After a specified date all "students" are marked as completed in a course.
  • Duration after enrolment: After a specified amount of time after enrolment (e.g., 12 weeks), a "student" is automatically marked as complete in a course.
  • Unenrol: After being unenroled, a "student" is marked complete for the course. Useful for external enrolment plugins.

We need to record when and how a "student" meets each criteria in a course.

We need to regularly aggregate the results for the criteria, measure progress, and check to see if a "student" has completed a course.

We need to show:

  • A "student" the necessary criteria to complete a course
  • A "student" how s/he is progressing in a course along the necessary criteria
  • A "teacher" how his/her students are progressing in a course and which students have completed it

Settings

Site settings

Activity Completion provides an "Enable completion tracking" setting (found in the Site Administration block's Advanced features / optional subsystems settings page) for activity completion. We need to change the setting's name and add another setting for course completion.

Proposed changes:

  • Rename the setting "Enable activity completion tracking" (the setting will continue to allow activity completion to be enabled in all courses)
  • Create a new setting named "Enable course completion tracking" (the setting will allow course completion to be enabled in all courses)

Course settings

Activity Completion provides a fieldset (named "Student progress") which contains a setting (named "Completion tracking") which enables/disables activity completion in a course. We need to rename the setting to describe activity completion and add a setting to enable course completion.

"Enable completion tracking" setting (found in the Site Administration block's Advanced features / optional subsystems settings page) for activity completion.

Proposed changes:

  • Rename the setting "Completion tracking" to "Activity completion tracking" (the setting will continue to make activity completion features available in the courses)
  • Create a new setting named "Course completion tracking" (the setting will make course completion features available in the course)

Course completion settings

When course completion is enabled in a course (see above), a menu item labeled "Completion" will appear in the course Administration block on the main course page. When a user clicks on the "Completion" link, the course completion admin page will display the criteria described below and in the mockup also below:

Edit course completion settings

Criteria enabling

We need to allow criteria to be enabled.

We need some rules about enabled criteria in a course:

  • Each criteria (e.g., "Manual self completion", "Manual completion by", etc) can be enabled
  • By default, all criteria are not enabled

Criteria aggregation

We need to define overall aggregation methods for the criteria type. We also need to a consistent set of aggregation methods for criteria types which have more than one possible option to determine an individual user's course completion:

  • "Manual completion by" // more than one role can be enabled to determine if a student has completed the course
  • "Activity completed" // more than one activity completion can be selected to determine if a student has completed the course

Aggregation methods:

Method Required to complete the criteria type Example Info
All All of the enabled child criteria must be completed Not applicable
Any Any one (1) of the enabled child criteria must be completed Not applicable

Criteria types

Manual self-completion

Action:

Tracked:

  • The day/time when the "student" marked him/herself complete.

Manual completion by

Action:

  • A user assigned to the role in the course will see a checkbox in the Completion progress report, which will allow him/her to manually "Mark complete" each applicable student enrolled in the course.

Tracked:

  • The roleid of the user who marked the "student" complete.
  • The userid of the user who marked the "student" complete.
  • The day/time when the user marked the "student" as complete in the course.

Notes:

  1. The Completion progress report will respect:
    • Separate groups: A "teacher" will only be able to see and mark complete students in her/his group(s) if separate groups is enabled.
    • Role assignments on the USER-level context: A "Tutor" or "Mentor" will only be able to see and mark complete users assigned to him/her.
  2. The criteria can be met only once by the role:
    • If more than one user is assigned to the role and has the capability of marking the user complete
    • After a "student" has been marked complete one time by a user in the role, the Completion progress report will not provide a checkbox in the "Mark complete" column when viewed by any user in the role in the course.
  3. We really be relying on role capabilities and permissions for this.

Activities completed

Action:

  • A "student" will meet the criteria when completing the specified activity, per the activity's 'Activity Completion' settings.

Tracked:

  • The cmid, module type, and activity/resource name for each activity.
  • The day/time when the criteria was detected as complete.

Note:

  1. The list of activities/resources will contain:
    • Each activity/resource in the course with "Completion tracking" enabled within the activity/resource.
    • The type of each activity followed by the activity name (i.e., "[mod name] - [activity/resource name]"). See the mockup on this page (or for a basic example: "Quiz - Derivatives").
  2. If "Activity completion" is not enabled for the site, the "Activities completed" field set will not appear on the page.
  3. If "Activity completion" is enabled for the site and not enabled for the course, the "Activities completed" field set will appear and it will only contain this message:
    "Activity completion must be enabled for this course."
  4. If "Activity completion" is enabled for the site and course, and there are no activities in the course, the "Activities completed" field set will appear and it will only contain this message:
    "Currently, there are no activities in this course"
  5. If "Activity completion" is enabled for the site and course, and there are activities but none have activity completion enabled, the "Activities completed" field set will appear and it will only contain this message:
    "Currently, none of the activities in this course have defined activity completion settings."

Course grade

Action:

  • A "student" will meet the criteria when earning a total course grade above the passing grade.

Tracked:

  • The day/time when the user's course grade was evaluated as having exceeded the passing grade.

Note:

  • The passing grade can also be updated via the course's "Grade to pass" setting found in the Grader report's edit page for the top level category for the course.
  • Once a student has completed the course, both the "Passing grade" setting on the course page and the "Grade to pass" setting in the top level category for the course will be locked. A message about locking will appear on the settings page for the top level category for the course.

Date

Action:

  • A "student" enroled in the course will automatically meet the criteria after a specified date.

Tracked:

  • The day/time when specified day was evaluated as having passed.

Duration after enrolment

Action:

  • A "student" will meet the criteria after the specified number of days after his/her enrolment.

Tracked:

  • The day/time when the "student" marked him/herself complete.

Unenrolment

Action:

  • A "student" will meet the criteria when being unenroled from the course.

Tracked:

  • The day/time when the "student" was unenroled from the course.

Locking

When the first student has completed the course, the course completion criteria settings will be locked. The course settings can be unlocked (via an "Unlock course completion options" button), however a warning message will be displayed stating that unlocking the settings requires deleting all prior course completion data for the course. Once the completion data is deleted, the settings become unlocked (i.e., un-greyed out).

This is consistent with activity completion in 2.0, in which activity completion settings are locked when a user first completes an activity. Activity completion settings can be unlocked after all completion activity is deleted.

Activity settings

If activity completion is enabled and activity completion is a criteria for course completion, then all activity completion settings will be locked once a student has completed the course. In this case, unlocking an activity's completion settings will require deleting both the activity's completion data and the course's completion data.

If an activity is being tracked for course completion, we should add a warning/confirmation screen when an "admin" attempts to delete it. The message should say, "[Activity name] is currently a criteria for course completion. Are you sure you want to delete it?" [Delete anyway] / [Cancel]. If the "admin" confirms, the activity will be deleted however completion data for users who completed it will still remain tracked.

Should the activity completion data remain? Should the course completion data be re-aggregated?

Data structures

Course completion data model

course

The course table will require the following new fields. 'enablecompletion' will now be used for activity and course completion:

Field Type Default Info
completionnotify int(1) Notify users when they complete this course

course_completion_aggr_meth

This new table will be populated with the aggregation method for "Overall criteria", "Manual completion by", and "Activities completed".

Field Type Default Info
id int(10) Auto incrementing
course int(10) The id of the course that the course completion aggregation relates to
criteriatype int(20) null The criteria type's integer constant ('role', 'activity') or null if 'overall' course aggregation.
method int(1) 1 '1'='all', '2'='any', '3'='fraction', '4'='unit'.
value number(10) null null for 'all' and 'any', 0..1 for 'fraction', int > 0 for 'unit'

course_completion_criteria

This new table will be populated with each criteria in each course for course completion:

Field Type Default Info
id int(10) Auto incrementing
course int(10) The id of the course that the course completion criteria relates to
itemname (not implemented) varchar(100) null The name of the item (e.g. "Mark yourself complete", "Teacher marks you complete", "[Activity name]", "[postenrol] days after enrolment", "Official Date: [date]". Used for all item types except unenrol.
criteriatype int(20) The criteria type's integer constant ('self', 'role', 'mod', 'grade', 'enrolperiod', 'date', 'postenrol').
module varchar(100) null The name of the module (e.g., 'scorm', 'quiz', 'feedback'). Used only if criteriatype='mod'.
moduleinstance int(10) null The id of the activity/resource module or role. Used only if criteriatype='mod'.
enrolperiod int(10) null The number of seconds after enrolment. Used only if criteriatype='enrolperiod'.
date int(10) null The timestamp of the date for course completion. Used only if criteriatype='date'.
gradepass number(10) null The course grade required to complete this criteria. Used only if criteriatype='grade'.
role int(10) null The role id that can mark 'student's as complete in the course. Used only if criteriatype='role'.
lock (currently unused) int(10) null Date this criteria was locked

course_completion_crit_compl

This new table will be populated with records for each user as they complete each course completion criteria.

Field Type Default Info
id int(10) Auto incrementing
userid int(10) The id of the user who has completed the course
course int(10) The id of the completed course
criteriaid int(10) The id of the completion criteria this references
gradefinal number(10) null The final grade for the course (if referenced criteria type='grade').
unenroled int(10) null Timestamp when the user was unenroled (if referenced criteria type='unenrol').
deleted (currently unused) int(1) null The course was deleted
timecompleted int(10) null (should be notnull) Timestamp when the user completed the criteria

course_completions

This table records a user's course completion state in a course (but not for individual criteria).

Field Type Default Info
id int(10) Auto incrementing
userid int(10) The id of the user who has completed the course
course int(10) The id of the completed course
timeenrolled int(10) Timestamp when the user was enrolled in the course. In the case of multiple enrollments, the earliest timestamp for a current enrollment is used. If this is reported as 0, the current time is used instead.
timestarted int(10) Timestamp when the user first made progress in the course
timecompleted int(10) null Timestamp when the user completed the course

Evaluating completion

Since the gradebook aggregation is performed via cron, it makes sense that course completion is also evaluated by cron.

This creates an issue in which the progress block will not instantly not show course completion after the necessary criteria has been met by a "student". However, this can be solved by adding some instructional text to say "may take a few minutes to update".

Role capabilities

Feature Description Capability
Progress block Mark self-complete in progress block block/progress:markselfcomplete
Progress report View course progress report coursereport/progress:view
Progress report Mark users complete in course progress report coursereport/progress:markcomplete

Course reporting

Completion progress report

Course completion progress report

A course completion report is available when course completion is enabled.The report can be found via on "Reports" menu item link in the course Administration block and when "Completion tracking" is enabled for the site and course.

The report shows:

  • A column for each of the activities/resources in the course with "Completion tracking" enabled"
  • A row for each user enroled in the course
  • The completion status for each activity

Proposed changes:

  • Include in the report all enabled criteria for course completion (e.g., "Manual self completion", "Manual completion by", as well as the activities etc)
  • Each user's status for completion of each criteria, indicated by a status icon
  • Allow the completion admin page to determine which activities are shown in the report
  • Allow the list of users to be sortable, searchable, and filterable (by group, groupings, and/or user profile fields).
  • Allow user profile fields (standard and custom) can be added/removed as columns in the list.
  • When rolling over the each icon, additional details (including the completion date) will display.

See the mockup to the right with all course completion criteria appearing (i.e., all criteria types have been enabled in a course).

As described further above, display rules for separate groups will apply. If separate groups is enabled for the course, a "teacher" will only see students and completion data for users in the group(s) that she/he is assigned to.

Options for exporting completion data to CSV, ODF or Excel will be available. Completion dates will be included in the export.

A column labeled "Mark complete" will appear containing a checkbox for each student if the user viewing the report is assigned to a role that is allowed to manually indicate that the students have completed the course.

Not shown in the mockup, however we should display the specified values under the applicable heading in the report for each of the following feilds:

  • Period after enrolment
  • Passing grade
  • Date (for completion)

Gradebook

  1. If "Passing grade" is enabled as a criteria for course completion, a grader should have the option of seeing completion status (i.e., "complete" / "not complete") as a column in the grader report.
  2. If a user assigned to a role that is enabled for "Manual completion by", the user should have the option of manually indicating which students have completed the course, a "Mark complete" column will appear to the right of the "Course total" column with a checkbox for each student who has not yet completed the course.

We should also provide an option to show course completion status in gradebook exports. Field options will include:

  • Completion status (e.g., "Complete", "Not complete")
  • Completion date

Completion progress block

Course completion progress block

If completion is enabled for the site and a course, a completion block will be available to be added to the course.

The block will allow a "student" to see:

  • The completion criteria for completing the course
  • His/her status for completion of each criteria (similar to the Completion progress report)
  • His/her overall completion status for the course (complete / not complete)

If all of the enabled criteria are required, the introduction text should say:

"All of the criteria below needed"

If any of the enabled criteria are required, the introduction text should say:

"Any of the criteria below needed"

If the current user can self complete the course, the block will provide an "I've completed this course" button (if the user has not already marked him/herself complete).

Activity completion criteria/status (if enabled for course completion) should be included in the block. See [https://tracker.moodle.org/browse/MDL-16466 MDL-16466] ("Activities on the course page do not convey to student that completion is expected or available for the activity").

User (course) profile

Activity and course completion criteria/status data should appear in a user's "Outline report" and "Complete report" in the user profile area, which is being reworked for 2.0 separately from this spec.

Site reporting

User (site) profile

Mockup of the user profile page with Course completion report

Activity and course completion criteria/status data should appear in a user's profile area.

It would make sense for courses to be grouped by:

  • Courses in progress
  • Courses completed
  • Courses not yet started

For each course, the required criteria and status should appear.


Cron

A cron function will check the criteria and update the course_completion_completions table as necessary. Here's a breakdown of the tasks for each criteria, and will need to be optimised for performance and scalability across all courses:

  • Manual self completion: Cron not needed, performed directly from the Completion progress block.
  • Manual completion by: Cron not needed, performed directly via the Completion progress report.
  • Course grade: Compare the course grade to the passing grade.
  • Unenrol: Compare course_completion->unenroled to role_assignments->timeend for the "student" role in the course.
  • Date: Compare the current date to the specified date.
  • Duration after enrolment: Compare the current date to the role_assignments->timestart + the specified period after enrolment.
  • Activity completion: Evaluate the necessary records in the course_modules_completion table.
  • Course completion: Aggregate the necessary fields in course_completion table, updating the timecompleted field with the current timestamp if the user has met the necessary criteria.

Backup and restore

  • The new completion fields in the course table will be included in the backup.
  • Entries in the course_completion_items, course_completion_aggregation_methods, and course_completion_notify tables for the course should also be included in the backup.
  • When user data is included in a course backup, the backup will also include records in the course_completion_completions table for the course.

Events

The following course completion related events have been added to core:

  • course_completed
    • Triggered when a user completes a course. Event data is the full course_completions database record.
    • Added in version 2.3.2