Non-core contributed modules

Upgrade Questionnaire module for Roles and Capabilities

Details

  • Type: Improvement Improvement
  • Status: Closed Closed
  • Priority: Minor Minor
  • Resolution: Fixed
  • Affects Version/s: 1.7
  • Fix Version/s: 2.0
  • Component/s: Module: Questionnaire
  • Labels:
    None
  • Affected Branches:
    MOODLE_17_STABLE
  • Fixed Branches:
    MOODLE_20_STABLE

Description

Questionnaire module currently uses the original isteacher() function to test whether a user is allowed to do things like view responses. This improvement will be to create new questionnaire related capabilities, assign them automatically to the standard roles and use them throughout the questionnaire module instead of the current functions.

Issue Links

Activity

Hide
Gareth Morgan added a comment -

I'd like to just check on a point which is puzzling me. Perhaps Mike could answer this?

mod/questionnaire/lib.php, function questionnaire_get_survey_list, near the start has some functionality which is invoked if $courseid == 0. The purpose of the function is to return a list of template questionnaire surveys that can be copied to provide the questions for the new one, or public surveys that can be re-used.

Could somebody please tell me what situation the $courseid == 0 test is supposed to cater for? Presumably this is not a test for the questionnaire being in the site course (which would normally be course ID 1 anyway). I could be wrong, but I'm not aware of any way of creating a questionnaire outside of a course in Moodle, so I would not have thought that this condition would happen.

I'd like to find out, because this clause calls isadmin() which is really something I should replace in the roles and capabilities upgrade.

Show
Gareth Morgan added a comment - I'd like to just check on a point which is puzzling me. Perhaps Mike could answer this? mod/questionnaire/lib.php, function questionnaire_get_survey_list, near the start has some functionality which is invoked if $courseid == 0. The purpose of the function is to return a list of template questionnaire surveys that can be copied to provide the questions for the new one, or public surveys that can be re-used. Could somebody please tell me what situation the $courseid == 0 test is supposed to cater for? Presumably this is not a test for the questionnaire being in the site course (which would normally be course ID 1 anyway). I could be wrong, but I'm not aware of any way of creating a questionnaire outside of a course in Moodle, so I would not have thought that this condition would happen. I'd like to find out, because this clause calls isadmin() which is really something I should replace in the roles and capabilities upgrade.
Hide
Mike Churchward added a comment -

That appears to be a way of getting all surveys, regardless of the course they belong to. The '$courseid' variable is an optional parameter passed into the function that defaults to '0'. If it is zero, then it doesn't select surveys based on a specific course.

Show
Mike Churchward added a comment - That appears to be a way of getting all surveys, regardless of the course they belong to. The '$courseid' variable is an optional parameter passed into the function that defaults to '0'. If it is zero, then it doesn't select surveys based on a specific course.
Hide
Jenny Gray added a comment -

roles upgrade can't be tested here because the postgres upgrade isn't working

Show
Jenny Gray added a comment - roles upgrade can't be tested here because the postgres upgrade isn't working
Hide
Gareth Morgan added a comment -

Please find attached the patch with roles and permissions added to questionnaires.

There have been a lot of changes in these files over the period since I started developing this (which is understandable because I realise I have taken quite a long time over it) - hopefully this will be compatible with the latest code on contrib.

Show
Gareth Morgan added a comment - Please find attached the patch with roles and permissions added to questionnaires. There have been a lot of changes in these files over the period since I started developing this (which is understandable because I realise I have taken quite a long time over it) - hopefully this will be compatible with the latest code on contrib.
Hide
Gareth Morgan added a comment -

I will actually be leaving my current job for a new role after today, and unfortunately it doesn't involve working with Moodle.

Therefore, I regret to say that I won't be tracking this issue in future, but my colleagues here at the OU will, if there are any problems with this improvement.

Thanks,

Gareth Morgan.

Show
Gareth Morgan added a comment - I will actually be leaving my current job for a new role after today, and unfortunately it doesn't involve working with Moodle. Therefore, I regret to say that I won't be tracking this issue in future, but my colleagues here at the OU will, if there are any problems with this improvement. Thanks, Gareth Morgan.
Hide
Gareth Morgan added a comment - - edited

Sorry, everyone - I missed out the most important file, access.php, so have attached that separately!

I've also attached a document stating what each capability does, for reference.

Show
Gareth Morgan added a comment - - edited Sorry, everyone - I missed out the most important file, access.php, so have attached that separately! I've also attached a document stating what each capability does, for reference.
Hide
Joseph Rézeau added a comment -

Roles are now integrated in Moodle HEAD. Will be backported to 1.9 after further testing.

Show
Joseph Rézeau added a comment - Roles are now integrated in Moodle HEAD. Will be backported to 1.9 after further testing.

People

Vote (3)
Watch (2)

Dates

  • Created:
    Updated:
    Resolved: