Details

    • Type: New Feature
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.9.2, 2.2.1, Future Dev
    • Fix Version/s: 2.8
    • Component/s: Gradebook
    • Labels:
    • Testing Instructions:
      Hide
      1. Create a scale with 1 option (A)
      2. Create another one with more than 1 (B)
      3. Create an activity that is using scale A
      4. Create an activity that is using scale B
      5. Create a grade item that is using scale A
      6. Create a grade item that is using scale B
      7. Grade a student on each of the last 4 fields
      8. Make sure it works as you'd expect
      9. Edit and remove the scales and confirm that it works as expected
      Show
      Create a scale with 1 option (A) Create another one with more than 1 (B) Create an activity that is using scale A Create an activity that is using scale B Create a grade item that is using scale A Create a grade item that is using scale B Grade a student on each of the last 4 fields Make sure it works as you'd expect Edit and remove the scales and confirm that it works as expected
    • Affected Branches:
      MOODLE_19_STABLE, MOODLE_22_STABLE
    • Fixed Branches:
      MOODLE_28_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      MDL-16474-master
    • Sprint:
      FRONTEND Sprint 13
    • Story Points (Obsolete):
      8
    • Sprint:
      FRONTEND Sprint 13

      Description

      The single-item scale, "Useful", used on moodle.org is in demand! See http://moodle.org/mod/forum/discuss.php?d=105515

      Currently only scales of 2 or more items may be created.

        Gliffy Diagrams

          Issue Links

            Activity

            Hide
            dougiamas Martin Dougiamas added a comment -

            It really needs some testing. I'll put it in HEAD first.

            The actual creation of the scale I did directly in the database ... the GUI needs improvements to handle it.

            The main part of what I did was to make these look nice in the forum.

            There will be more work to test the gradebook to make sure everything works as expected there with 1 -point scales ... hopefully there are no assumptions in code about a minimum of two items.

            Show
            dougiamas Martin Dougiamas added a comment - It really needs some testing. I'll put it in HEAD first. The actual creation of the scale I did directly in the database ... the GUI needs improvements to handle it. The main part of what I did was to make these look nice in the forum. There will be more work to test the gradebook to make sure everything works as expected there with 1 -point scales ... hopefully there are no assumptions in code about a minimum of two items.
            Hide
            stronk7 Eloy Lafuente (stronk7) added a comment -

            Adding link to http://moodle.org/mod/forum/discuss.php?d=118821

            where I suggest one simple change I've in some servers. I'd consider it incomplete because it just disables the validation. Instead we should be validating each element, looking for nulls / empties or so.

            Ciao

            Show
            stronk7 Eloy Lafuente (stronk7) added a comment - Adding link to http://moodle.org/mod/forum/discuss.php?d=118821 where I suggest one simple change I've in some servers. I'd consider it incomplete because it just disables the validation. Instead we should be validating each element, looking for nulls / empties or so. Ciao
            Hide
            mudrd8mz David Mudrak added a comment -

            If I remember correctly, there is an issue with aggregation in gradebook. If we have one item scales only, gradebook ends in division by zero in VALUE / (MAX - MIN) or so. Therefore, to have single item scales at the Czech community server, I have this hack:

            I have prepared normal two items scale: "Užite?ný p?ísp?vek, Užite?ný p?ísp?vek" (which is "Useful post" in Czech). Then, I just patched forum to display just the second option:

            diff --git a/mod/forum/lib.php b/mod/forum/lib.php
            index 99022ad..fbd48c4 100644
            --- a/mod/forum/lib.php
            +++ b/mod/forum/lib.php
            @@ -3638,6 +3638,11 @@ function forum_print_rating_menu($postid, $userid, $scale, $myrating=NULL) {
                 if (empty($strrate)) {
                     $strrate = get_string("rate", "forum");
                 }
            +    // hack mudrd8mz - enable one item scale in CSMUG forums
            +    if ((count($scale) == 2) and ($scale[1] == 'Užite?ný p?ísp?vek') and ($scale[2] == 'Užite?ný p?ísp?vek')) {
            +        unset($scale[1]);
            +    }
            +    // end hack
                 $scale = array(FORUM_UNSET_POST_RATING => $strrate.'...') + $scale;
                 choose_from_menu($scale, $postid, $myrating, '', '', '0', false, false, 0, '', false, false, 'forumpostratingmenu');
             }

            This way, users can have either grade==0 (not graded post) or grade==2 on each post and the calculation in Gradebook works.

            Show
            mudrd8mz David Mudrak added a comment - If I remember correctly, there is an issue with aggregation in gradebook. If we have one item scales only, gradebook ends in division by zero in VALUE / (MAX - MIN) or so. Therefore, to have single item scales at the Czech community server, I have this hack: I have prepared normal two items scale: "Užite?ný p?ísp?vek, Užite?ný p?ísp?vek" (which is "Useful post" in Czech). Then, I just patched forum to display just the second option: diff --git a/mod/forum/lib.php b/mod/forum/lib.php index 99022ad..fbd48c4 100644 --- a/mod/forum/lib.php +++ b/mod/forum/lib.php @@ -3638,6 +3638,11 @@ function forum_print_rating_menu($postid, $userid, $scale, $myrating=NULL) { if (empty($strrate)) { $strrate = get_string("rate", "forum"); } + // hack mudrd8mz - enable one item scale in CSMUG forums + if ((count($scale) == 2) and ($scale[1] == 'Užite?ný p?ísp?vek') and ($scale[2] == 'Užite?ný p?ísp?vek')) { + unset($scale[1]); + } + // end hack $scale = array(FORUM_UNSET_POST_RATING => $strrate.'...') + $scale; choose_from_menu($scale, $postid, $myrating, '', '', '0', false, false, 0, '', false, false, 'forumpostratingmenu'); } This way, users can have either grade==0 (not graded post) or grade==2 on each post and the calculation in Gradebook works.
            Hide
            stronk7 Eloy Lafuente (stronk7) added a comment -

            NOTE: This issue was assigned to the STABLE backlog without complete triaging process. Marking it as triaged, but with this note for future reference.

            Show
            stronk7 Eloy Lafuente (stronk7) added a comment - NOTE: This issue was assigned to the STABLE backlog without complete triaging process. Marking it as triaged, but with this note for future reference.
            Hide
            tsala Helen Foster added a comment -

            Adding 2.2.1 as an affected version, as this issue is again being asked for on moodle.org.

            Show
            tsala Helen Foster added a comment - Adding 2.2.1 as an affected version, as this issue is again being asked for on moodle.org.
            Hide
            ghanson Glenys Hanson added a comment -

            I'm one of the people asking for it: specifically for the Lang Teaching course. I don't understand why the clever hack implemented on Using Moodle and the French forum, can't also be installed on Lang Teaching. It seems to me much more in keeping with the Moodle ethos than judgemental scales. I'd also like to be able to use it on other Moodle platforms.

            Show
            ghanson Glenys Hanson added a comment - I'm one of the people asking for it: specifically for the Lang Teaching course. I don't understand why the clever hack implemented on Using Moodle and the French forum, can't also be installed on Lang Teaching. It seems to me much more in keeping with the Moodle ethos than judgemental scales. I'd also like to be able to use it on other Moodle platforms.
            Show
            tsala Helen Foster added a comment - More requests for this feature: http://moodle.org/mod/forum/discuss.php?d=180769 http://moodle.org/mod/forum/discuss.php?d=197048
            Hide
            jennerm Matt Jenner added a comment -

            Would someone mind answering if a single-point scale is introduced via a SQL change (to the scale) the grader report only make NULL/ZERO errors for that item using the one point scale?

            My worry is it causes issues across the course's graded items and not just the single rated entity.

            I don't mind if it just affects itself - I'll just hide it and exclude it from the course grade.

            Show
            jennerm Matt Jenner added a comment - Would someone mind answering if a single-point scale is introduced via a SQL change (to the scale) the grader report only make NULL/ZERO errors for that item using the one point scale? My worry is it causes issues across the course's graded items and not just the single rated entity. I don't mind if it just affects itself - I'll just hide it and exclude it from the course grade.
            Hide
            mudrd8mz David Mudrak added a comment -

            Hi Matt. I just experimentally applied the change to one of my production server and so far I can't see any issues. I haven't checked the grades calculations yet though. Anyway, now I think that the gradebook actually does support one-item scales and the problem with "division by zero" should not occur. Even with single-item scales, the minimal grade is 0 (no grade given) and maximal grade is 1 (graded using the single item scale). So the calculations should work. This requires deeper check and tests though.

            Show
            mudrd8mz David Mudrak added a comment - Hi Matt. I just experimentally applied the change to one of my production server and so far I can't see any issues. I haven't checked the grades calculations yet though. Anyway, now I think that the gradebook actually does support one-item scales and the problem with "division by zero" should not occur. Even with single-item scales, the minimal grade is 0 (no grade given) and maximal grade is 1 (graded using the single item scale). So the calculations should work. This requires deeper check and tests though.
            Hide
            poltawski Dan Poltawski added a comment -

            Hi David,

            Do you know what the status of this is? We're looking at it again for moodle.org in MDLSITE-1877 and I wonder if we could sort this out for the rest of the community at the same time.

            (Note: i'm not really away of the implications )

            Show
            poltawski Dan Poltawski added a comment - Hi David, Do you know what the status of this is? We're looking at it again for moodle.org in MDLSITE-1877 and I wonder if we could sort this out for the rest of the community at the same time. (Note: i'm not really away of the implications )
            Hide
            mudrd8mz David Mudrak added a comment -

            Hi Dan. Thanks for raising this. Since my last comment I did not have much opportunity to look at this closely. However, I believe that we should be brave and simply try to remove the multiple items condition when editing a scale. Gradebook aggregation algorithms should be fine with it as they map "not selected" to 0 and then each scale item gets grade 1, 2, 3 etc. Thence a single-item scale operates over 0-1 interval and there should hopefully be no situation of dividing by zero.

            Show
            mudrd8mz David Mudrak added a comment - Hi Dan. Thanks for raising this. Since my last comment I did not have much opportunity to look at this closely. However, I believe that we should be brave and simply try to remove the multiple items condition when editing a scale. Gradebook aggregation algorithms should be fine with it as they map "not selected" to 0 and then each scale item gets grade 1, 2, 3 etc. Thence a single-item scale operates over 0-1 interval and there should hopefully be no situation of dividing by zero.
            Hide
            mudrd8mz David Mudrak added a comment -

            This issue was assigned to me, however I will not be able to work on this issue in the immediate future. In order to create a truer sense of the state of this issue and to allow other developers to have chance to become involved, I am removing myself as the assignee of this issue. For more information, see http://docs.moodle.org/dev/Changes_to_issue_assignment

            Show
            mudrd8mz David Mudrak added a comment - This issue was assigned to me, however I will not be able to work on this issue in the immediate future. In order to create a truer sense of the state of this issue and to allow other developers to have chance to become involved, I am removing myself as the assignee of this issue. For more information, see http://docs.moodle.org/dev/Changes_to_issue_assignment
            Hide
            timhunt Tim Hunt added a comment -

            Just discussed this at http://docs.moodle.org/dev/Hackfest_UK_2014, and were generally thinking it was a good idea. Michael de Raadt asked me to mark it as a security issue.

            Show
            timhunt Tim Hunt added a comment - Just discussed this at http://docs.moodle.org/dev/Hackfest_UK_2014 , and were generally thinking it was a good idea. Michael de Raadt asked me to mark it as a security issue.
            Hide
            mudrd8mz David Mudrak added a comment -

            For the record, we are using single item scales in production at moodle.org for some time already.

            Show
            mudrd8mz David Mudrak added a comment - For the record, we are using single item scales in production at moodle.org for some time already.
            Hide
            krambambuli Guido Gautsch added a comment -

            Hi David,
            Yes, you are. Any chance of just adding that option to 2.7.1?

            Show
            krambambuli Guido Gautsch added a comment - Hi David, Yes, you are. Any chance of just adding that option to 2.7.1?
            Hide
            mudrd8mz David Mudrak added a comment -

            Even when this seems to be pretty trivial to implement and has been tested in production, I don't think we should change things like that on stable releases - and especially not at LTS branch. So my personal suggestion would be to add it as experimental flag for 2.8.

            Show
            mudrd8mz David Mudrak added a comment - Even when this seems to be pretty trivial to implement and has been tested in production, I don't think we should change things like that on stable releases - and especially not at LTS branch. So my personal suggestion would be to add it as experimental flag for 2.8.
            Hide
            dougiamas Martin Dougiamas added a comment -

            No need for a flag, let's just make it work for 2.8 when you only type one item in the scale.

            We could even backport to 2.7 later, it's really a tiny feature (but useful) that doesn't affect APIs etc.

            Show
            dougiamas Martin Dougiamas added a comment - No need for a flag, let's just make it work for 2.8 when you only type one item in the scale. We could even backport to 2.7 later, it's really a tiny feature (but useful) that doesn't affect APIs etc.
            Hide
            stronk7 Eloy Lafuente (stronk7) added a comment - - edited

            Just to comment that, related with this, MDL-45394 has a implementation about single-item "likes" that is being examined right now.

            Also, other similar issues have been closed as dupe of both this and the "likes" one, FYI.

            Ciao

            Edited: Wrong link fixed.

            Show
            stronk7 Eloy Lafuente (stronk7) added a comment - - edited Just to comment that, related with this, MDL-45394 has a implementation about single-item "likes" that is being examined right now. Also, other similar issues have been closed as dupe of both this and the "likes" one, FYI. Ciao Edited: Wrong link fixed.
            Hide
            fred Frédéric Massart added a comment -

            Sorry Jason, I did not mean to steal your issue, I must have clicked the button to assign it to me after you assigned it to yourself.

            Show
            fred Frédéric Massart added a comment - Sorry Jason, I did not mean to steal your issue, I must have clicked the button to assign it to me after you assigned it to yourself.
            Hide
            phalacee Jason Fowler added a comment -

            S'all good, I should have checked my assigned issues first anyway, I have one on the go in this sprint already. Happy to have you take this off me.

            Show
            phalacee Jason Fowler added a comment - S'all good, I should have checked my assigned issues first anyway, I have one on the go in this sprint already. Happy to have you take this off me.
            Hide
            fred Frédéric Massart added a comment -

            I did not see any problem allowing the scales to have only 1 item. Most cases should still work as they did. I added a small unit tests that confirms that the API is OK with it.

            Show
            fred Frédéric Massart added a comment - I did not see any problem allowing the scales to have only 1 item. Most cases should still work as they did. I added a small unit tests that confirms that the API is OK with it.
            Hide
            cibot CiBoT added a comment -

            Results for MDL-16474

            • Remote repository: git://github.com/FMCorz/moodle.git
            Show
            cibot CiBoT added a comment - Results for MDL-16474 Remote repository: git://github.com/FMCorz/moodle.git Remote branch MDL-16474 -master to be integrated into upstream master Executed job http://integration.moodle.org/job/Precheck%20remote%20branch/4416 Details: http://integration.moodle.org/job/Precheck%20remote%20branch/4416/artifact/work/smurf.html
            Hide
            poltawski Dan Poltawski added a comment -

            +1, thanks Fred (that does actually match our experience of using it on moodle.org)

            Show
            poltawski Dan Poltawski added a comment - +1, thanks Fred (that does actually match our experience of using it on moodle.org)
            Hide
            poltawski Dan Poltawski added a comment -

            Can I suggest expansion of testing instructions to include editing and removing the scale.

            Show
            poltawski Dan Poltawski added a comment - Can I suggest expansion of testing instructions to include editing and removing the scale.
            Hide
            fred Frédéric Massart added a comment -

            Thanks Dan.

            Show
            fred Frédéric Massart added a comment - Thanks Dan.
            Hide
            cibot CiBoT added a comment -

            Moving this issue to current integration cycle, will be reviewed soon. Thanks for the hard work!

            Show
            cibot CiBoT added a comment - Moving this issue to current integration cycle, will be reviewed soon. Thanks for the hard work!
            Hide
            samhemelryk Sam Hemelryk added a comment -

            Thanks Fred this has been integrated now. Yay that it finally lands!

            Show
            samhemelryk Sam Hemelryk added a comment - Thanks Fred this has been integrated now. Yay that it finally lands!
            Hide
            andyjdavis Andrew Davis added a comment -

            Works as described. Passing.

            Show
            andyjdavis Andrew Davis added a comment - Works as described. Passing.
            Hide
            stronk7 Eloy Lafuente (stronk7) added a comment -

            Just in time for incoming releases, well done. And big thanks!

            We must plan for freedom,
            and not only for security,
            if for no other reason than that
            only freedom can make security secure

            –  Karl Popper

            Show
            stronk7 Eloy Lafuente (stronk7) added a comment - Just in time for incoming releases, well done. And big thanks! We must plan for freedom, and not only for security, if for no other reason than that only freedom can make security secure –  Karl Popper
            Hide
            mina Nicolas Martignoni added a comment -

            Good work, thanks you for this.

            Is there any plan to backport this to LTS 2.7?

            Show
            mina Nicolas Martignoni added a comment - Good work, thanks you for this. Is there any plan to backport this to LTS 2.7?
            Hide
            tsala Helen Foster added a comment -

            Just noting that we now have a single-item scale QA test: MDLQA-7167. Please shout if the test needs amending or expanding at all.

            Show
            tsala Helen Foster added a comment - Just noting that we now have a single-item scale QA test: MDLQA-7167 . Please shout if the test needs amending or expanding at all.
            Hide
            marycooch Mary Cooch added a comment -

            Removing docs_required label as this is documented in https://docs.moodle.org/28/en/Scales

            Show
            marycooch Mary Cooch added a comment - Removing docs_required label as this is documented in https://docs.moodle.org/28/en/Scales

              People

              • Votes:
                29 Vote for this issue
                Watchers:
                22 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  10/Nov/14

                  Agile