Capabilities mod/lesson:edit and mod/lesson:manage

Capabilities mod/lesson:edit and mod/lesson:manage

by Gisela Hillenbrand -
Number of replies: 11
Picture of Documentation writers
Hi,

can anyone explain what the difference between the capabilities mod/lesson:edit and mod/lesson:manage is?

In default role configuration the settings are:

editingteacher: allowed for edit and manage
teacher: not set for edit, allowed for manage
student: not set for edit and manage

TIA,

Gisela
Average of ratings: -
In reply to Gisela Hillenbrand

Re: Capabilities mod/lesson:edit and mod/lesson:manage

by Joseph Rézeau -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers Picture of Translators
Hi Gisela,
As far as I understand the (complicated) capabilities settings in Moodle, not set means inherit. So in the case at hand "teacher: not set for edit, allowed for manage" means in fact "teacher: allowed for edit and allowed for manage".
The best way to see which capabilities are actually set to allowed for a particular role within a particular environment is to use a visual theme which clearly shows that setting, as e.g. standard theme (but not, unfortunately most other themes).
Joseph
Attachment image00.jpg
In reply to Joseph Rézeau

Re: Capabilities mod/lesson:edit and mod/lesson:manage

by John Isner -
Joseph,
Actually Moodle currently uses both terms "Not set" and "Inherit," and they do not mean exactly the same thing.

The first column is labeled "Inherit" when you override a role. The first time you override a role, all radio buttons in the first column are marked. That means that if you leave a particular row unchanged, you will inherit the value of that capability from the parent context. Specifically, you will inherit the highlighted value. If there is no highlighted value, it means the capability is not set in any higher context.

The first column is labeled "Not set" when defining or editing a role (only an Administrator can do this). "Inherit" would be meaningless here, because ... inherit from what? You are already at the highest context, System.

As to the original question, only editing teachers can edit activities -- that is, change them in any way. For example, only an editing teacher can change the Lesson settings or change the Lesson content (e.g., add a branch table). Non-editing teachers can manage student interaction with Lessons. For example, they can grade essay questions.
In reply to John Isner

Re: Capabilities mod/lesson:edit and mod/lesson:manage

by Joseph Rézeau -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers Picture of Translators

Hi John,

Thanks for shedding some light on the - still to me and many moodlers - obscure innerworkings of the roles/capabilities in Moodle. Although my terminology might have not been quite right, would you agree however that what is important/useful for anyone wanting to check actual capabilities or over-ride them to have a visual theme which clearly highlights the current "allowed" setting (as shown in my screenshot)?

Unfortunately a number of themes currently distributed with Moodle do not have the .capcurrent class highlighted, which does not help at all.sad

Joseph (who believes what he can see).wink

In reply to Joseph Rézeau

Re: Capabilities mod/lesson:edit and mod/lesson:manage

by John Isner -
I definitely agree about the issue you raise with themes. I did not mean to ignore it. In fact, the first time I read about highlighting, I happened to be using a site that had a theme that made the highlighting invisible, and I was very confused. Do you know what the offending themes are? If so, let's create a tracker issue.
In reply to Joseph Rézeau

Re: Capabilities mod/lesson:edit and mod/lesson:manage

by Gisela Hillenbrand -
Picture of Documentation writers
Hi Joseph,

thanks for your answer. You put the focus on the settings allow / not set.

My question actually was: what means "edit a lesson" and what means "manage a lesson".

As far as I understand: "Edit a lesson" means - a person which has this capability set to allowed can created a new lesson, add new lesson pages, edit and delete existing lesson pages. Is this correct?

A what is the difference to "manage a lesson"?

This is what I'm actually trying to understand.

Gisela


In reply to Gisela Hillenbrand

Re: Capabilities mod/lesson:edit and mod/lesson:manage

by Joseph Rézeau -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers Picture of Translators
Hi Gisela,
  1. Manage a lesson with capability set as PREVENT means that that person
    1. can:
      1. edit page content
      2. create a new lesson (but cannot add question pages to it, so this setting seems pretty useless)
    2. cannot:
      1. add question pages
  2. Edit a lesson with capability set as PREVENT means that that person
    1. can:
      1. view the contents of all question pages (in Edit mode) but can't edit them
      2. create a new lesson (but cannot add question pages to it, so this setting seems pretty useless)
    2. cannot:
      1. Update lesson
      2. edit page contents
Actually the only way to get a complete list of "cans" and "cannots" is to set the capabilities for a given role and to try all actions. It does take a lot of time. It would be nice if somewhere in Moodle such lists already existed (maybe they do?)
Joseph
In reply to Joseph Rézeau

Re: Capabilities mod/lesson:edit and mod/lesson:manage

by Gisela Hillenbrand -
Picture of Documentation writers
Hi Joseph,

I find it easier to understand when telling people what a person can do if lesson:edit and lesson:manage is set to ALLOWED:

So here comes what I found out directly from the code (using grep -R "lesson:manage" <moodledir>/* and grep -R "lesson:edit" <moodledir>/* and then looking for leeson:edit and lesson:manage in the files found by the grep command):

1. lesson:manage set to ALLOWED: this means that a user
  • has the help icon in the Lesson header to get information about what a lesson is
  • can see the results of lesson attempts in the "Reports" tab of the lesson page
This are usually things which a non-editing teacher should do or be allowed. In some sense it also means that the user "is not a students", i.e. it is not supposed to attempt a lesson and therefore does not get displayed things like a timer for timed lessons, progress bar etc.

2. lesson:edit set to ALLOWED: this means that a user
  • has the help icon in the Lesson header to get information about what a lesson is
  • has the "Update lesson" button to update lesson settings
  • can add / edit / remove any type of pages to the lesson
  • can import questions
  • can see the results of lesson attempts in the "Reports" tab of the lesson page and delete student attempts on this page
  • can grade essay questions (if any) in the "Grade essays" tab of the lesson page
This are usually things which an editing teacher should do or be allowed. Note that it does not make sense to set the lesson:edit capability to ALLOWED but the lesson:manage capabality to "NOT SET" because in the script mod/lesson/edit.php (which handles editing lesson pages) you find "require_capability('mod/lesson:manage', $context);"

Maybe, someone involved in the MoodleDocs project (Helen Foster?) can add this to the capabilities page in MoodleDocs.

Gisela
In reply to Gisela Hillenbrand

Re: Capabilities mod/lesson:edit and mod/lesson:manage

by John Isner -
I just experimented with this. mod/lesson:edit controls the ability to edit the Lesson settings, while mod/lesson:manage controls the ability to change the lesson structure. For example, if you have manage only, you can add new pages to the lesson, while if you have edit only, you get an "Update this Lesson" button and can change settings like grading options, but you can't change the lesson structure.
In reply to John Isner

Re: Capabilities mod/lesson:edit and mod/lesson:manage

by Gisela Hillenbrand -
Picture of Documentation writers
Hi John,

what do you mean with "edit the Lesson settings"? I guess you mean the button "Update this lesson" in the right upper corner of any lesson page to edit the lesson settings like name of the lesson, description, flow control, grading etc.
Whether this button is displayed for a role or not is controlled by the capability "moodle/course:manageactivities". It is not controlled by the capability mod/lesson:edit. You can check this by looking at the code.
Or do you mean edit the content of the lesson pages?

Gisela