Posts made by Ray Morris

> question tagging and metadata, in other words... if there are customizable extra fields for each question that I can add to better store and retrieve the question, combined with a search function... This could be Great. 

That would be very useful. I'm picturing something that appears to the user similar to the extra profile fields that can be added for users.  The search side is mostly done, via the new API we recently added. I made a plugin to search questions by tags and it's just a few dozen lines of code.  It could be easily adapted to search by any field.


I think it could be done fairly easily now that we have the search/display API (to search on custom fields) and we have an API for adding columns to the question bank display.  Between the two, they provide a significant portion of the support needed for custom fields. I believe what remains is to support custom fields on the question edit/create page and backup/restore.


That covers at least "custom fields" where the field name is decided by a plugin.  I suspect it would be just a small additional step for the plugin to let the user choose field names and types. Only for a plugin to do it, though - putting that functionality directly in core means doing it with an exceptionally high level of quality; very carefully thinking through the database structure, performance considerations, writing unit tests, etc.  I'd guesstimate we're 10-20 hours of work from making it work at a proof of concept / private plugin level, and 80 hours from getting it in core.



Average of ratings: Useful (2)

There is a typo in the above. The word "not" should not appear in the description of complete_passed and complete_failed.  it should be:


INCOMPLETE:           The student has not completed the activity.

COMPLETE_PASSED  The student has completed the activity. Also, the student achieved a passing grade on the activity.

COMPLETE_FAILED   (optional)  The student has completed the activity. Also, the student had a failing grade on the activity.

COMPLETE_COMPLETED The activity has been completed. No passing grade was set.


A tracker issue for this now exists here:

https://tracker.moodle.org/browse/MDL-47232

This is a bug fix / improvement that I think should be done, and I can do it (very easily), but it's a change from how part of Moodle used to work.  Therefore I wanted to get some feedback on how to make the adjustment with minimal surprise to any users who may be relying on the old behavior.  Maybe we put a setting somewhere.  Some users think the new / corrected behavior is what one would expect, so no setting is needed - just make it do what it says it does.


Activities can have four possible completion states:

INCOMPLETE:           The student has not completed the activity.

COMPLETE_PASSED  The student has not completed the activity. Also, the student achieved a passing grade on the activity.

COMPLETE_FAILED   (optional)  The student has not completed the activity. Also, the student had a failing grade on the activity.

COMPLETE_COMPLETED The activity has been completed. No passing grade was set.


For most (all?) activities, the user can choose to not allow COMPLETE_FAILED by requiring a passing grade in order to mark it complete (ie quiz) or requiring a specific grade (ie scorm). So complete_failed is generally optional - the user can choose settings to only allow completion if it's passed.

Within "conditional activities", criteria work as the language indicates: requiring an activity to be completed before another is visible means it's not visible if the prerequisite is still INCOMPLETE, it becomes visible when the prerequisite is marked COMPLETE_*, when it's completed, regardless of what the grade was. 

In conditional activities, if you want to require that it's completed and passed, you simply either set the prerequisite to not be completed unless it's passed, or set a specific grade to be required.

Course completion, on the other hand, does not work as one might expect. If a course requires that the student complete the pretest, study module, and final, it does not mark the course as complete when those three activities are marked as complete. Instead, the course will only be marked complete if the student both completes the pretest and also achieves a passing grade.  This means that in the completion report, the teacher may see that all of the required activities are marked complete, but the course isn't marked complete.

I propose that course completion should work like activity completion does. "Require these activities to be complete" should mean that when those activities are marked as complete, the course is marked complete. This would be a very simple one-line fix. Note again, if a user wants the old behavior of requiring that an activity be passed in order to be considered complete, they still have that option.  I'm not suggesting anything be removed. I'm proposing that we not force / override that in the course completion aggregation code, but rather honor the setting that was set on the activities completion settings. 


Is anyone relying on the old behavior of course completion, of "completed" really meaning "both completed and also have a passing grade"?  Are there any suggestions for how to make this improvement without affecting users who may be relying on the old behavior?



Average of ratings: -

The attached module, tested with Moodle 2.3 and 2.7, will allow you to DELETE ALL OF THE INFORMATION about a user's activity in a course. That may be helpful for them to retake the course. There is no "undo" button, no recycle bin*. Once you click the button, all record of the student having been in that class is gone. No progress is saved.


Look at locallib.php line #9 - line #32 to see what all it is set to delete. If you use different types of activities than we do, you may need to add more tables to that list.


* Theoretically the logs in backup_csv/ should allow a smart admin to recover the information. There is no guarantee that will actually work.

If you accidentally reset a user you didn't mean to reset, stop and think. Don't DO anything for a minute. Then make a backup of your database.

Then ask your database administrator to look at backup_csv/.



Average of ratings: Useful (1)
Coming in Moodle 2.8 (or next week's master) will bea more elegant way to do this, some options designed for exactly what you're trying to do. It'll look like this:



You'll set quiz to complete when they either pass or fail (use up all of the attempts).  The next activity, the lesson, will be available when they complete the quiz, by either passing or failing to pass.


If you happen to have need to backport the feature to an earlier version of Moodle, whoever is doing that will ant this link:

https://tracker.moodle.org/browse/MDL-37993