Moodle

Count of ratings forum aggregate type results in click here text

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: 1.9
  • Fix Version/s: 1.9.5
  • Component/s: Forum
  • Labels:
    None
  • Affected Branches:
    MOODLE_19_STABLE
  • Fixed Branches:
    MOODLE_19_STABLE

Description

1. Set forum aggregate type to count of ratings
2. Forum posts which have not yet been rated have the text " Count of ratings: Click here" next to the rate dropdown menu

Issue Links

Activity

Hide
Anthony Borrow added a comment -

Petr - I will not have a chance to look at this soon so I am reassigning to you as I do not want to hold things up. However, feel free to re-assign it back to me if you want. Since you have been working on the forum code I thought it might be best for you to handle it. In either case, I need your two cents on how best to handle it.

I see this has a fairly minor bug as it only affects (AFAIK) when the user is doing a count and the scale is using the scale "Separate and Connected Knowing" (which happens to be the default). This combination does not make sense - i.e. to count this scale so it should be a rare situation. In any case, it would be nice to check for this. I am getting a PHP notice:

Notice: Undefined offset: 0 in /home/arborrow/Moodle/code/19stable/mod/forum/lib.php on line 2880

(it's related to the forum_get_ratings_count function)

That particular scale produces an array with elements [1], [2], and [3]. In other words the scale does not start with 0 as the current code assumes. Perhaps the simplest approach would be to test that if the $forum->scale == -1 and the count of the ratings is 0 then return the first element of the array although this seems to be misleading.

Another idea is to simply not allow the counting of this particular scale and give the user a warning. Or we could rely on the user's common sense to not select a combination that does not make sense.

Peace - Anthony

Show
Anthony Borrow added a comment - Petr - I will not have a chance to look at this soon so I am reassigning to you as I do not want to hold things up. However, feel free to re-assign it back to me if you want. Since you have been working on the forum code I thought it might be best for you to handle it. In either case, I need your two cents on how best to handle it. I see this has a fairly minor bug as it only affects (AFAIK) when the user is doing a count and the scale is using the scale "Separate and Connected Knowing" (which happens to be the default). This combination does not make sense - i.e. to count this scale so it should be a rare situation. In any case, it would be nice to check for this. I am getting a PHP notice: Notice: Undefined offset: 0 in /home/arborrow/Moodle/code/19stable/mod/forum/lib.php on line 2880 (it's related to the forum_get_ratings_count function) That particular scale produces an array with elements [1], [2], and [3]. In other words the scale does not start with 0 as the current code assumes. Perhaps the simplest approach would be to test that if the $forum->scale == -1 and the count of the ratings is 0 then return the first element of the array although this seems to be misleading. Another idea is to simply not allow the counting of this particular scale and give the user a warning. Or we could rely on the user's common sense to not select a combination that does not make sense. Peace - Anthony
Hide
Michelle Moore added a comment -

Anthony--
"Forum posts which have not yet been rated have the text " Count of ratings: Click here" next to the rate dropdown menu"

I'm actually seeing this on a custom scale I've created as well-when I set the forum aggregate type to count and use a custom scale, I see "Count of ratings: Click here" next to dropdown menu. I also see this though, on forum posts I have rated-and the rating that I've given is displayed in the drop-down box. When I click the "Click here" link on an item without ratings, it says "No ratings for this post" but if I have ratings, then it will display the rater's name with the rating given.

In talking with Helen, I've since learned that custom scales only work with the min, max, and average forum aggregate types. So, I think your idea to not allow counting (and sum) of ratings for the Separate scale and custom scales would be a good idea. While I understand why those features wouldn't work, the way things are currently set up lead me to believe they might, so I tossed my common sense out the window. ( I can go into detail if you need more information.) At the minimum, please add information to the help file on the forum aggregate type to let users know that the count and sum functionality do not work for the Separate . . . scale and custom scales.

Show
Michelle Moore added a comment - Anthony-- "Forum posts which have not yet been rated have the text " Count of ratings: Click here" next to the rate dropdown menu" I'm actually seeing this on a custom scale I've created as well-when I set the forum aggregate type to count and use a custom scale, I see "Count of ratings: Click here" next to dropdown menu. I also see this though, on forum posts I have rated-and the rating that I've given is displayed in the drop-down box. When I click the "Click here" link on an item without ratings, it says "No ratings for this post" but if I have ratings, then it will display the rater's name with the rating given. In talking with Helen, I've since learned that custom scales only work with the min, max, and average forum aggregate types. So, I think your idea to not allow counting (and sum) of ratings for the Separate scale and custom scales would be a good idea. While I understand why those features wouldn't work, the way things are currently set up lead me to believe they might, so I tossed my common sense out the window. ( I can go into detail if you need more information.) At the minimum, please add information to the help file on the forum aggregate type to let users know that the count and sum functionality do not work for the Separate . . . scale and custom scales.
Hide
Ray Lawrence added a comment -

Confirming that the behaviour is still present and with custom scales.

Show
Ray Lawrence added a comment - Confirming that the behaviour is still present and with custom scales.
Hide
Ray Lawrence added a comment -

Changing priority as the new(ish) options here have introduced issues are are not accurately documented.

Show
Ray Lawrence added a comment - Changing priority as the new(ish) options here have introduced issues are are not accurately documented.
Hide
David Mudrak added a comment -

Fixed in CVS

Show
David Mudrak added a comment - Fixed in CVS
Hide
David Mudrak added a comment -

Sorry, not working yet. I am off to go now but shall fix tonight.

Show
David Mudrak added a comment - Sorry, not working yet. I am off to go now but shall fix tonight.
Hide
David Mudrak added a comment -

Should be fixed properly now. Actually there were two problems:

1) in case of numerical scale, the displayed grade values (eg. "56/100") was used as scale index. Now using correct "56"
2) now works for scales as well (even it usually does not makes sense to do). There was a bug trying to display $scale[0] in case of no rating given and to display the one before the best scale item in case of the count of rating exceeds the scale items count.

I use this at my customized site with one-scale-item support.

Show
David Mudrak added a comment - Should be fixed properly now. Actually there were two problems: 1) in case of numerical scale, the displayed grade values (eg. "56/100") was used as scale index. Now using correct "56" 2) now works for scales as well (even it usually does not makes sense to do). There was a bug trying to display $scale[0] in case of no rating given and to display the one before the best scale item in case of the count of rating exceeds the scale items count. I use this at my customized site with one-scale-item support.

People

Vote (2)
Watch (3)

Dates

  • Created:
    Updated:
    Resolved: