Posts made by Ray Morris

The new method "when you enenrol someone, you delete all the associated data" is highly dangerous and can easily lead to dataloss.

Agreed, deleting data, without a really good reason to do so and being really sure, is capital B Bad.  It follows that where we can achieve some goal either by either a) deleting data or b) keeping the data, while actively using only relevant data, we prefer b), as the gradebook does.  Do we agree on this?  If so, I'm happily surprised and I must have misread your earlier comment.

 

> it is only possible because the greadbook happens to implement keeping a complete record of grade histories.

 

Good for gradebook. 

> It is no good trying to delete the quiz attempts when a user is re-enroled

> with "do not recover old grades" selected. At least I assume that is the

> case. There are many different ways that users can be re-enroled, in

> addition to doing it through the Moodle UI (e.g. DB enrolment plugins, web services).

 

Assume for the moment the just as gradebook does the right thing, choosing not to delete data that doesn't have to be deleted, Quiz could EASILY do the same thing.  Let's just assume for the moment that your code was well written enough that having te option to preserve that information would be little more than adjusting two WHERE clauses.  No need to delete attempts on unenrol, perhaps, but simply ignore outdated attempts when grading and counting the number of attempts.  That's entirely within the control Quiz, which quiz attempts it counts as relevant.  Putting aside just for the moment whether or not it actually IS that simple, would Gradebook like behavior of preserving data rather than deleting it be desirable in Quiz?

 

Based on looking through the code and testing, I believe your code actually IS written so well that to have it do "the right thing" like gradebook iactually is a matter of tweaking the two WHERE clauses.  Testing shows it does work with the small patch I submitted. Granted, the patch we're actually using is slightly different due to local customizations, but it appears to show that if we wanted to preserve data like gradebook does, while counting only relevant data (from this enrollment), it's simple to do so.

 

 

 

 

Tim, since you "backup and restore", can you then respond to the first half of ?:

http://moodle.org/mod/forum/discuss.php?d=208914#p910869

Do you have a way to work around those problems, or do you just live with them?   Actually I hope neither - ideally these problems would be avoided completely, neither worked around nor lived with.  My proposal was to not create the problems in the first place, but maybe you have another way of avoiding those problems?

 

Can you as maintainer also reply to Emma's excellent insight:

>  If you choose not to restore earlier grades, it still keeps the quiz attempts?

> That to me is definitely counterintuitive.  I think selecting to not restore

> grades should basically reset the entire course for the student.

 

Do you think that makes sense, when the user explicitly chooses to ignore the old data, not to resurrect it, should quiz honor that and disregard the old data?  ( To the best of my knowledge, other modules honor it, not forcing old data into the new enrolment when asked not to. Only quiz and one other module ignore the request and continue to use old data, I believe.)

Is "respect 'recover old grades' selection" a good goal? Since we have the option, should it in fact work, or should it be ignored?  

 

If it should work, does "do not recover old grades" mean we should not be counting old attempts at quizzes from some previous time?

I'd be glad to submit a patch entittled "fix 'do not recover old grades' in Quiz" if you think that should in fact work as documented.

 

Do you have any tricks to share regarding two problems with that ? - 

When we looked at that, it seemed we'd need to duplicate all of the SCORMs, etc., which, aside from the practical problems, inconvenience and such, seemed fundamentally ugly.  It seemed to us that having the exactly same SCORM in the system over and over again was just wrong.  Database people call this second normal form. Coders might see this the same as having the same code repeated over and over, rather than abstracted into a single function.  (Or more accurately, defining the same function repeatedly with the exact same definition, which is wrong to the point that most interpreters and compilers won't allow it.)

Did you end up repeating the same things and over over, having copy after copy of the same SCORMs, or is there a workaround for that as well?

 

Secondly, it seemed "wrong" to us that we couldn't then do even simple things like get the average grade in a course:

SELECT average(grade) FROM course WHERE id=x

This because the same course is repeated over and over again in the database, with different ids. Checking a prerequisite goes from:

SELECT COUNT(*) WHERE course_id=X and student_id=Y

to:
SELECT COUNT(*) WHERE course_id=X or course_id=X or course_id=A or course_id=b or course_id=C or course_id=D and student_id=Y

Do you have a workaround for that, or is that what you're stuck with by duplicating the same course over and over? 

That does arguably break normal form in the database by having the same items (courses, scorms, quizzes) repeated.

 

 

 

> It appears that there is a setting that gives you the option to restore a

> user's grades when reenrolled in a class - I would think it would be a

> logical move that if you decided to not restore the student's grades, then it would also clear any quiz attempts.

 

Great insight. We really already have the option in the UI, don't we. It's just a small matter of making it work as expected. If you decide to enroll them fresh, without restoring the grades, clearly you're intending that they start over. That would include starting the quiz over.   If you want to put them back where they were, you'd restore the grades, including the quiz grade and the associated limit.   

 

 > You would lose all the previous enrollment data and so then it would be

> as though the student had never taken the class before - maybe that is what you are looking for.

 

Choosing not to restore grades makes previous data irrellevant, but does not delete the earlier enrollment, which I think is perfect.

Actually deleting the data would cause problems such as those listed above, but your idea is perfect - treat attempts the same as grades are treated, where administrators can decide which is right for a particular situation.

BTW thanks so much to everyone who has replied so far. It seems Tim was right - there are different views on this and I'm sorry I got a bit snarky with him. 

I really thought it was "obvious". To me it seemed perfectly obvious that "take the class every two years" would include taking the quiz every two years, so I didn't expect and didn't understand his reply in the ticket.  It seems it's not as clear cut as I thought. I really appreciate the discussion. Even if I'm dense and having trouble truly understanding some of the comments, I really appreciate people posting them. 

 

I'm going to have to ponder some of these ideas and see if I can come up with a way to address both points of view, unless of course the fact that it's an option you can set either away already does that.  

Putting aside for a moment which option is BEST, is there any problem with having both options available? For those who want the old behavior where Quiz enforces a lifetime limit, just do nothing. It will continue to work the way you're used to.  For those who prefer not to jump through hoops for retakes (deleting information and the like), they can choose to enable the new option. Are there any issues or concerns with allowing site administrators the choice? (Putting aside which choice one prefers, just asking if ayone sees a problem with making the choice available.)