Quiz history interfering with Quiz plug in

Quiz history interfering with Quiz plug in

Rahul S-mit -
Antal besvarelser: 19

I am using a quiz plug in called the "reattempt checker" which doesn't allow a student to take a quiz after he/she passes it. I am currently testing the quizzes on a fake student account and I noticed that the plug in started giving me the wrong response on some of the quizzes, and worked correctly on some others. My guess was that the quiz plug in was giving the wrong feedback since the quizzes with attempts had history which moodle was saving, and it effectively interfered with the plug in. The plug in still malfunctioned after I went in admin and manually deleted the quiz attempt for the specific quiz I was testing.  

To test this theory, I made a new fake student account (which had no previous attempts on quizzes) and the plug in worked perfectly. So I know the problem is that the quiz history is still stored, but I cant figure out how to delete that history. I tried "purge all caches" and "reset course" but neither worked. Does anyone know how to delete the quiz history?

Thanks!

Gennemsnitsbedømmelse: -
I svar til Rahul S

Re: Quiz history interfering with Quiz plug in

Joshua Bragg-mit -

Could you describe in more detail what you mean by "giving me the wrong response"?

I doubt that a plugin could cause that behavior.

I svar til Joshua Bragg

Re: Quiz history interfering with Quiz plug in

Rahul S-mit -

So I have a rule set up which says that if a student passes the quiz (80% or higher) the plug in should stop them from having another attempt at the quiz even if the quiz allows 2 attempts (how I have set the quizzes up). If the student fails, they can "reattempt quiz" one more time, and if they fail again, they are prevented from taking the quiz because of my two attempt rule.

The problem comes in when I take the quiz for the first time. One of my courses has 7 quizzes, so I took them all to test the plug in, and out of 7, 4 of them failed and only 3 worked as it should have. What I mean by failing, is that I would purposely fail the quiz (below 80%) and the plug in would say "you have passed this quiz and may not make any further attempts" and it takes me back to the course page. When in reality, it should've said "reattempt quiz" since I failed it. Most of the times the plug in malfunctions in the same way: I fail the quiz and it says I passed it. I even go into the admin account and delete all previous attempts on that quiz before taking it, but it still gives me a wacky response.

Would you have any idea how to approach this? the plug in is really a great idea, and if it worked correctly it would go a long way to help me make my course testing better.

I svar til Rahul S

Re: Quiz history interfering with Quiz plug in

Mary Cooch-mit -
Documentation writers-ip assinga Moodle HQ-ip assinga Particularly helpful Moodlers-ip assinga Testers-ip assinga Translators-ip assinga

Rahul - have you got in touch with the maintainer of the reattempt checker plugin? https://moodle.org/plugins/view/quizaccess_reattemptchecker

I svar til Mary Cooch

Re: Quiz history interfering with Quiz plug in

Rahul S-mit -

Mary,

I sent him a message 2 days ago, and he hasn't responded to me yet. Any advice for me? I can abandon the plug in in the worst case scenario, but I'd love to keep it if it does its job.

Thanks

I svar til Rahul S

Re: Quiz history interfering with Quiz plug in

Joshua Bragg-mit -

Ahh... I misinterpreted what you wrote earlier.  That definitely sounds like a problem with the access rule.

I haven't looked at the code and I'm not a developer so this next part is a wild guess.  The only other thing that I can think of that might interfere is activity completion.  If your fake student got the quiz marked as complete from an earlier attempt then that might be interfering with the plugin.  But that's total guesswork on my part.

I svar til Joshua Bragg

Re: Quiz history interfering with Quiz plug in

Rahul S-mit -

Joshua,

The access rule is an issue with the code of the plug in right? Is that something that is simple to change with knowledge of PHP?

I svar til Rahul S

Re: Quiz history interfering with Quiz plug in

Joshua Bragg-mit -
The Reattempt Checker is a type of quiz access rule plugin.  That's what I was referring to.
I svar til Joshua Bragg

Re: Quiz history interfering with Quiz plug in

Wendi Daniels-mit -

I am trying to remove reattempt-checker from my site, but I cannot see how. I found it does not work well with Linux.


I deleted the file mod/quiz/accessrule/reattemptchecker

and I deleted the table in phpmyadmin for quiz_reattemptchecker


I am still having the error code, and I need to know how else I get rid of this plugin. Please advise. It is still listed in site admin>plugins>plugins overview, but it is listed as a broken file.


I svar til Wendi Daniels

Re: Quiz history interfering with Quiz plug in

Wendi Daniels-mit -

This is so aggravating. This plugin broke my site, and I can't find a way to get it off of my site. I have it disabled, but not uninstalled. I need to uninstall it, and the maker apparently won't respond, did not leave a way to uninstall it, or instructions. I removed everything from the php files that I could see, and I cannot find anything else. Please help!



This is the error, given after the test is submitted:


Exception - The server was unable to process the request due to an internal error. For more information about the error, either turn on IncludeExceptionDetailInFaults (either from ServiceBehaviorAttribute or from the configuration behavior) on the server in order to send the exception information back to the client, or turn on tracing as per the Microsoft .NET Framework SDK documentation and inspect the server trace logs.

I svar til Wendi Daniels

Re: Quiz history interfering with Quiz plug in

Joshua Bragg-mit -

Here is the process you should have followed: https://docs.moodle.org/29/en/Installing_plugins#Uninstalling_a_plugin

I'm not sure what the best way to go about fixing this is.  Do you have a backup from before the deletion?  If so, roll it back to there and then try to follow the proper procedure.

If not, then I'd take a backup now so that if any of your attempts at fixing things don't work then you have a backup plan.  Then I'd refer to this post and really that entire thread for some help.

I svar til Wendi Daniels

Re: Quiz history interfering with Quiz plug in

Jean-Michel Védrine-mit -

Hello Wendi,

As you have now learned the hard way you should NEVER try to remove a plugin by deleting the files !

For other types of plugins a good thing to try  would be to reinstall the files you have deleted and see if you can remove the plugin properly in Site Administration > Plugins > Plugins overview but unfortunately this will not work here as there are open tracker issues  (MDL-38230, MDL-38259) about quiz access rules not being uninstallable.

So I guess your only choice is to reinstall your website as it was before you added that plugin trist

Can somebody explain me how this plugin is different from the passgrade access rule plugin ?

Another way would be if you find somebody knowing what is done when a plugin is installed to manually undone these changes in the database, but sorry, I can't help here as I don't know how the plugins installation mechanism is working.

By the way, Tim is on (well deserved) holidays, so we are on our own to solve quiz and questions problems for some weeks.

I svar til Jean-Michel Védrine

Re: Quiz history interfering with Quiz plug in

Tim Hunt-mit -
Core developers-ip assinga Documentation writers-ip assinga Particularly helpful Moodlers-ip assinga Peer reviewers-ip assinga Plugin developers-ip assinga

Yes. We really need to fix those tracker issues.

I svar til Tim Hunt

Re: Quiz history interfering with Quiz plug in

Jean-Michel Védrine-mit -

Hello Tim,

Are your Holidays already finished ?

Yes I think we should solve this.

I can work on it if I know what to do. Certainly we must change the is_uninstall_allowed function

We can hardcode a list of non un-installable access rules

    public function is_uninstall_allowed() {
        global $DB;

        if (in_array($this->name, array('delaybetweenattempts', 'ipaddress', 'numattempts', 'openclosedate', 'password', 'safebrowser', 'securewindow', 'timelimit'))) {
            return false;
        }
        return true;
    }
And carefully examine if some of standards access rules can be safely uninstalled (I guess most of them can't), or we can decide that only third party access rules are   un-installables

    public function is_uninstall_allowed() {
        if ($this->is_standard()) {
            return false;
        }
        return true;
    }

But something is unclear to me : other than this (and upgrading quiz version number) what else needs to be done ? I was under the impression that all problems were solved by the work in MDL-39087 but the fact that MDL-38259 was never finished or closed is puzzling.

I svar til Jean-Michel Védrine

Re: Quiz history interfering with Quiz plug in

Tim Hunt-mit -
Core developers-ip assinga Documentation writers-ip assinga Particularly helpful Moodlers-ip assinga Peer reviewers-ip assinga Plugin developers-ip assinga

The $this->is_standard() approach is right. However, there is no need for an if statement. Just do

return !$this->is_standard();

I don't know if anything else needs to be done. Please can you try it and see if it work. Thanks.

I svar til Tim Hunt

Re: Quiz history interfering with Quiz plug in

Jean-Michel Védrine-mit -

I made some tests and this seems to work well.

I have commited a fix to MDL-38230 waiting for peer review.

To test this patch I had to install (and uninstall smiler ) some quiz access rules and I think I know why quizaccess_reattemptchecker (and quizaccess_passgrade too I really think these 2 plugins are the same under 2 different names !) are not working in all cases

    public function prevent_new_attempt($numattempts, $lastattempt) {

        global $DB;

        if ($numattempts == 0) {

            return false;

        }

        // Check if preventonpass is set, and whether the student has passed the minimum passing grade.

        $previousattempts = $DB->get_records_select('quiz_attempts',

                "quiz = :quizid AND userid = :userid AND timefinish > 0 and preview != 1",

                array('quizid' => $this->quiz->id, 'userid' => $lastattempt->userid));


        if (quiz_calculate_best_grade($this->quiz, $previousattempts) >= $this->quiz->reattemptchecker) {

            return get_string('accessprevented', 'quizaccess_reattemptchecker');

        }

        return false;

    }

You see: they use quiz_calculate_best_grade but it return a rawgrade (sum of question grades) and they have forgotten to scale it for instance by using quiz_rescale_grade(quiz_calculate_best_grade($this->quiz, $previousattempts), $this->quiz, false).


I svar til Jean-Michel Védrine

Re: Quiz history interfering with Quiz plug in

Jean-Michel Védrine-mit -

Hello Wendi,

can you explain your sentence "it doesn't work well with linux" ? I can't understand the relation between the problems of this plugin and Linux.

I svar til Jean-Michel Védrine

Re: Quiz history interfering with Quiz plug in

Jean-Michel Védrine-mit -

I have pushed to my github account https://github.com/jmvedrine/moodle-quizaccess_reattemptchecker a version where I think I have fixed the problem with quiz grade not properly scaled.

I will try to contact the author (I will also try to contact the quizaccess_passgrade plugin authors to sort out the mess between these 2 plugins).

If you try my modified version please report if my fix work or not for you.


I svar til Jean-Michel Védrine

Re: Quiz history interfering with Quiz plug in

Rahul S-mit -

Hello everyone,

I did the same thing as Wendi, and I deleted the files but the plug in would just not go away. It didn't have an uninstall option like others did. I just disabled it. I sent the developer a question, but never received a response. I am just going on without the plug in, but I wish it worked since it was a great idea. I just couldn't figure out how to fix it or why it was acting up the way that it did.