Quiz

 
 
Picture of Ray Morris
completion when all attempts are used
Group DevelopersGroup Particularly helpful Moodlers

Currently I don't see a way to have a quiz activity complete when all attempts are used.  One can set completion based on a passing grade, but I don't see how a failing grade can be handled well because of multiple attempts. You may not mark the activity as complete on view or on any grade because that might be the first attempt of three, for example.

 

Is there something I'm missing?  If not, I'll submit a patch to add a completion condition of "all attempts used" or something.

 

Edit - thinking about it more, what we really want, I think, is to consider it complete if they either pass or fail the quiz.  Passing is supported - that's just getting a passing grade.  Failing would mean getting a failing grade on all allowed attempts.  Since the OR of conditions isn't quite supported, though it's partially coded, I'm not sure how to proceed. 

 

I'm a little suprised - I would have thought others would have wanted to know when a student pased or failed, but I've not found any discussion in my searches.  We can't be the only institution that wants to tracks when tests are passed and failed while allowing more than one attempt, can we?  Am I missing something?

 

 

 

 

 

 
Average of ratings:Useful (2)
Tim at Lone Pine Koala Sanctuary
Re: completion when all attempts are used
Group DevelopersGroup Documentation writersGroup Particularly helpful Moodlers

I think the relevant documentation is http://docs.moodle.org/dev/Activity_completion_API#Custom_completion_rules. That explains how to create a custom completion rule.

It looks like you will need to make some changes to the standard quiz code to make this work, at least it does if you follow that tutorial.

You may be able to (ab)use a Quiz access rule plugin (http://docs.moodle.org/dev/Quiz_access_rules ) to encapsulate the code.

(P.S. sorry it took me so long to reply to this. If you need more help, please ask.)

 
Average of ratings: -
Picture of Ray Morris
Re: completion when all attempts are used
Group DevelopersGroup Particularly helpful Moodlers

P.S. sorry it took me so long to reply to this. If you need more help, please ask.

Thanks so much for your response. You don't owe me a reply ever so I certainly can't complain if you don't reply the same day!  It certainly is great to get a reply from the module maintainer, just to be sure I wasn't overlooking existing functionality and rewriting what's already there.  (Or otherwise doing something really dumb, considering the existing codebase.)

It looks like you will need to make some changes to the standard quiz code to make this work

Which implies, to me, trying to do it in a way that is likely to get a commit() into standard Moodle. If anyone has any comment on how this should look in order to be most useful to others, please let me know.  Surely we're not the only ones who would want to know when a student passes or fails a test?  Tim, knowing that you can expect a patch coming your way, is there anything in particular you'd like to see from that patch, other than the standard "don't submit garbage" rules?

 

 

 

 
Average of ratings: -
Tim at Lone Pine Koala Sanctuary
Re: completion when all attempts are used
Group DevelopersGroup Documentation writersGroup Particularly helpful Moodlers

Well, I suppose I might be able to elaborate a bit on what is, and isn't, garbage in the Moodle context.

You need to obey http://docs.moodle.org/dev/Coding_style, and https://moodle.org/plugins/view.php?plugin=local_codechecker can help. (But, when changing existing code, don't fix coding style in parts of the file that are not being changed by your patch, since that makes the change much harder to review - actually, the quiz code is currently very clean, so this is not likely to be an issue.)

http://docs.moodle.org/dev/Process is quite scary, at least the diagram is. It might be better to keep an eye on the Integration dashboard in the tracker: https://tracker.moodle.org/secure/Dashboard.jspa?selectPageId=11350, to see what happens in practice.

But, the main thing is to write working code that does something valuable. If you do that, we will help you get it revised and accepted.

 
Average of ratings: -