Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Configuration not saved correctly when creating a submission as teacher #72

Open
wo14580 opened this issue Nov 10, 2023 · 6 comments
Open
Assignees

Comments

@wo14580
Copy link

wo14580 commented Nov 10, 2023

Hi there,
We noticed an issue about the mahara configurations when we create a submission as teacher.
To reproduce:

  • Be logged as teacher without the permission assignsubmission/maharaws:configure
  • force_global_credentials = true
    Create a submission with the Mahara submission type and save it.
    Then if you check in the database, in assign_plugin_config table, I can only see the configuration enabled to 1.
    The config for the url, the key and the secret are not saved.
    The config archiveonrelease is not saved too.

Then if I connect as Student and if I try to submit something, I can't because the configuration is not correct.

On the other hand, if I'm connected as admin (or with the permission assignsubmission/maharaws:configure), when I create a new Mahara submission, it is working correctly. All the configuration are saved.

Let me know if you can do something about it ?

Thank you.

@danmarsden
Copy link
Member

Hi @wo14580 - there were several changes to the way this works recently - can you please confirm which version of the maharaws plugin that you have installed on your site? - if it's not the latest (2023110900) can you please update to the latest version and see if it fixes your issue? - please let us know.

@wo14580
Copy link
Author

wo14580 commented Nov 13, 2023

Hi @danmarsden,
Sorry I forgot to mention.
Yes I saw the recent modifications (2023110900) and I tested it with it.

@danmarsden
Copy link
Member

when force global config is turned on, it doesn't save the settings at the assignment level (in assign_plugin_config) - that's expected behavior - as you mention you're digging around at the db level - did you test the student submission process as well with the latest code? - if you have can you please provide more information about that? - can you enable debugging and watch the error log and report exactly what happens when a student tries to submit something to that assignment?

thanks!

@wo14580
Copy link
Author

wo14580 commented Nov 13, 2023

Hi,
Yes I tested as Student with the last version as well.

After some investigation the issue is related to the config "username_attribute".
This configuration is not saved when the submission is created by a Teacher (another one missing).
So if you check this following method "get_views":
https://github.com/catalyst/moodle-assignsubmission_maharaws/blob/main/locallib.php#L528
It is not possible to get the username because it doesn't know the name of the username field. This name come from the configuration.
The method $this->get_config('username_attribute') return false when it should return the "email".
So then we are not able to connect to Mahara to get all the views related to the Student.

When the force global config is turned on I agree that we should not saved those following configurations:

  • url
  • key
  • secret

But if I'm correct, I think the others should be saved ?
Like these :

  • username_attribute
  • archiveonrelease
  • lock
  • Maybe others ... ?

What do you think ?

Thanks

@wo14580
Copy link
Author

wo14580 commented Nov 22, 2023

Hi @danmarsden,
Sorry I know you are really busy.
I'd like to know if you have a plan for this issue ?
Just to find out how we're going to proceed on our end.

Thanks

@danmarsden
Copy link
Member

danmarsden commented Nov 29, 2023

Hi @wo14580 if you have a Mahara enterprise subscription agreement you can raise this as an issue and have it prioritised via that process, or if you have internal development capabilities feel free to send a pull request for us to review, otherwise I'll try to come back to this at some point as it does sound like something might be missing there!

thanks,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants