Moodle

Users that cannot set scale as standard on create can set scale as standard on edit

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Minor Minor
  • Resolution: Won't Fix
  • Affects Version/s: 1.9.4
  • Fix Version/s: None
  • Component/s: Gradebook
  • Labels:
    None
  • Affected Branches:
    MOODLE_19_STABLE

Description

Teachers, for example, by default, can create new grade scales for their classes but cannot designate the scale as standard. The checkbox is disabled. This is good.

The problem is that a teacher can then edit the scale and mark the scale as a standard scale. The checkbox is not disabled. This is bad for us and I doubt that it is the intended functionality.

The defect appears to be in the definition_after_data() function in grade/edit/scale/edit_form.php. The scale editing part of that function contains the following:

} else if (empty($scale->courseid) and !has_capability('moodle/course:managescales', get_context_instance(CONTEXT_SYSTEM))) { $mform->hardFreeze('standard'); The has_capability condition should stand on its own and not be ANDed with the condition that the scale is already a standard scale. If the user does not have the capability to manage scales at the system level, the user should not be able to create a system scale. The solution would be to remove the first part of the AND so that the condition looks like this: } else if ( !has_capability('moodle/course:managescales', get_context_instance(CONTEXT_SYSTEM))) {
$mform->hardFreeze('standard');

That would also make it consistent with the logic for creating a scale in this respect.

Activity

Hide
MB added a comment -

This issue also appears in Moodle 1.92+.

Show
MB added a comment - This issue also appears in Moodle 1.92+.
Hide
Yolanda Ordoñez Rufat added a comment -

We implement this solution and is working fine in our moodle 1.9.5 with a 8.4.0 postgres and 5.2.3 PHP installed in a SUSE Linux Enterprise Server.

Note there's a duplicated bug report MDL-20703

Show
Yolanda Ordoñez Rufat added a comment - We implement this solution and is working fine in our moodle 1.9.5 with a 8.4.0 postgres and 5.2.3 PHP installed in a SUSE Linux Enterprise Server. Note there's a duplicated bug report MDL-20703
Hide
Heiko Schach added a comment -

Resolved in MDL-24682

Show
Heiko Schach added a comment - Resolved in MDL-24682
Hide
Michael de Raadt added a comment -

Thanks for reporting this issue.

We have detected that this issue has been inactive for over a year has been recorded as affecting versions that are no longer supported.

If you believe that this issue is still relevant to current versions (2.1 and beyond), please comment on the issue. Issues left inactive for a further month will be closed.

Michael d;

lqjjLKA0p6

Show
Michael de Raadt added a comment - Thanks for reporting this issue. We have detected that this issue has been inactive for over a year has been recorded as affecting versions that are no longer supported. If you believe that this issue is still relevant to current versions (2.1 and beyond), please comment on the issue. Issues left inactive for a further month will be closed. Michael d; lqjjLKA0p6
Hide
Michael de Raadt added a comment -

I'm closing this issue as it appears to have become inactive and is probably not relevant to a current supported version. If you are encountering this problem or one similar, please launch a new issue.

Show
Michael de Raadt added a comment - I'm closing this issue as it appears to have become inactive and is probably not relevant to a current supported version. If you are encountering this problem or one similar, please launch a new issue.

People

Vote (7)
Watch (4)

Dates

  • Created:
    Updated:
    Resolved: