Details

    • Type: New Feature New Feature
    • Status: Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: 1.9.2, 2.2.1, Future Dev
    • Fix Version/s: DEV backlog
    • Component/s: Gradebook, Policy
    • Labels:
    • Affected Branches:
      MOODLE_19_STABLE, MOODLE_22_STABLE
    • Rank:
      659

      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.

        Issue Links

          Activity

          Hide
          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
          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
          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
          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
          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
          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
          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
          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
          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
          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
          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
          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
          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
          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
          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
          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
          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
          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
          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
          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
          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
          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
          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
          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
          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
          David Mudrak added a comment -

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

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

            People

            • Votes:
              27 Vote for this issue
              Watchers:
              16 Start watching this issue

              Dates

              • Created:
                Updated: