Cannot create a new Peerwork activity

Issue #56 closed
Yezi Yang created an issue

I installed the plugin in latest version just now. And I found I cannot create new Peerwork activity. I am using Moodle 3.9.1. Could you help to solve this problem soon, please? 

It shows an error message (also see the error message in the attachment): 

'Cannot find data record in database table Peerwork.

SELECT * FROM {Peerwork} WHERE id=?
[array (
0=>189,
)]
Error code: invalidrecord

Comments (20)

  1. Amanda Doughty

    I have tried to replicated this issue and I cannot. Did you follow the instructions I put on the plugin page?

    Could you try navigating to the plugin settings and saving them again: /admin/settings.php?section=modsettingpeerwork

  2. Amanda Doughty

    @Yezi Yang I have tried again:

    1. I installed v2020031500 r1.0.0 on Moodle v3.9
    2. I created a Peerwork activity.
    3. As a student I submitted.
    4. As admin I graded and released the grades.
    5. I updated to v2020111300 r2.2.0
    6. I created a Peerwork activity.

    Could you tell me if I am missing any step you have taken? I am not able to replicate this error.

  3. Yezi Yang reporter

    Dear Amanda,

    After upgrade to version 2.2.0, I can create a new peerwork activity. Then, when access to the peerwork as a teacher, he gets an error message, saying he is not in any group. If the teacher is added into a group, then he can see what a student can see. So generally, the plugin regards the teacher as a student.

    Best Regards,

    Yezi Yang

    Educational Technologist

    Educational Technologist Team

    Centre of Knowledge and Information

    Xi'an Jiaotong-Liverpool University

    Tel: 0512-8188-8712

  4. Yezi Yang reporter

    @Amanda,

    After upgrade to version 2.2.0, I can create a new peerwork activity. Then, when access to the peerwork as a teacher, he gets an error message, saying he is not in any group. If the teacher is added into a group, then he can see what a student can see. So generally, the plugin regards the teacher as a student.

  5. Amanda Doughty

    @Yezi Yang thank you for the quick response. This sounds as though you are using different permissions to us. I will look now and try to recreate it.

  6. Amanda Doughty

    @Yezi Yang to see the activity as a teacher then the user must have the permission mod/peerwork:grade

    This has not changed from r1.0.0. Have you made any changes to permissions?

  7. Yezi Yang reporter

    @Amanda There is only one permission related to peerwork, which is mod/peerwork:addinstance. I cannot find the permission you mentioned. Could you tell me where I can find the permision you nmentoned, please?

  8. Yezi Yang reporter

    @Amanda I checked the permission of teacher in /admin/roles/define.php?action=edit&roleid=3. In the test server that only installed in peerwork v2.2.0 without any previous versions, it has the permission that you mentioned above.

    Our live server installed a customised peerwork (https://bitbucket.org/FMCorz/moodle-mod_peerwork/branch/xjlu) that we paid to develop. Then we upgrade to peerwork v1.0 (released in Nov in Moodle official website). Then we cannot create new Peerwork activity. Then we uninstalled it and upgrade to peerwork v2.2.0 (the latest version in Moodle official website). It has the permission problem, as shown in the attachment. And we do not have the permission setting that you mentioned above.

    I also tried to install peerwork v2.2.0 in a fresh Moodle 3.9 system. It has the permission about grade in that system. It seems the customised version make some strange changes to our Moodle system. So we do not have the mod/peerwork:grade permission now. Do you know how we can solve it? We really need to solve this problem quick. Thank you very much for your support!

  9. Amanda Doughty

    @Yezi Yang can you send me the results of this query from your live database:

    SELECT * FROM <your prefix>capabilities where component = "mod_peerwork";

    Also can you tell me how you uninstalled it? You said you had existing Peer Work activiities that would have been lost if you uninstalled?

  10. Yezi Yang reporter

    @Amanda Below is the result I get from the query. It only has one line in the result.

    Usually, when we upgrade the plugin, we first put the upgrade code folder in the server, then click upgrade in the Moodle website. So the Peerwork activities in the system are kept. But because we met problems when we do the upgrade, so we thought maybe uninstall the plugin and reinstall it can clean all the data and start fresh. So we uninstalled it and removed all the activities. The process is first click uninstall in the Moodle website and then remove the plugin folder in the server.

  11. Amanda Doughty

    @Yezi Yang So this problem has occurred with a fresh install of the plugin version 2.2.0 on Moodle 3.9.1. And you performed the same install on your test system with the same versions with no problem?

    Maybe there was a problem that prevented the install from completing. If you have no activities set up, could you try to uninstall and reinstall again?

  12. Yezi Yang reporter

    @Amanda I want to try uninstall the peerwork plugin and reinstall the early version that has no problem in our Moodle system. But because we have installed peerwork v2.2.0, I do not know whether I can uninstall it and reinstall an early version. So I think a more safe solution is I change the version number of the early version to a numebr a little bit higher than the current latest version, so that the system can regard it as a new version. As a result, my question is which files I need to change the version number? Thank you for your help.

  13. Amanda Doughty

    @Yezi Yang if you uninstall the plugin then you will be able to reinstall any version. Moodle only complains when a higher version number exists in the DB. But if you uninstall then all data is deleted from the DB.

    You would have problems if you edited the version number because there would be fields in the DB which expect values. Editing the version number would not remove the new fields.

  14. Yezi Yang reporter

    @Amanda The problem is not solved. I am trying to reproduce the problem. The situation is in November, we did two upgrade of peerwork and both of them are v.1.0.0. One of them replaced another very quickly. Then we upgraded to v.2.2.0. Currently, we only have one v.1.0.0. So when we did the upgrade in the test server, we cannot reproduce the problem. So could you send me the code of two v.1.0.0 that are published in Moodle official plugin page, please? Then I can try to reproduce the problem.

  15. Amanda Doughty

    @Yezi Yang I have now tagged every release that appeared in the Plugins DB plus the enhancements that you paid for.

    06/01/20 Release 1.0.0 - tag v1.0.0

    15/03/20 Release 1.0.0 - tag v1.0.0-xjlu (Paid for)

    02/10/20 Release 2.0.0 - tag v2.0.0 (Major upgrade)

    30/10/20 Release 2.0.0 - tag v2.0.1 (Fixed regression in upgrade.php)

    09/11/20 Release 2.1.0 - tag v2.1.0 (Minor upgrade)

    09/11/20 Release 2.1.0 - tag v2.1.1 (Minor bug fix)

    11/11/20 Release 2.1.0 - tag v2.1.2 (Major bug fix #55)

    13/11/20 Release 2.2.0 - tag v2.2.0 (Updated version number)

    All of these can be downloaded here:

    https://bitbucket.org/covuni/mod_peerwork/downloads/?tab=tags

  16. Log in to comment