Moodle

Forum AJAX rating

Details

  • Type: New Feature New Feature
  • Status: Closed Closed
  • Priority: Minor Minor
  • Resolution: Fixed
  • Affects Version/s: 2.0
  • Fix Version/s: 1.9.4
  • Component/s: Forum, Usability
  • Labels:
    None
  • Affected Branches:
    MOODLE_20_STABLE
  • Fixed Branches:
    MOODLE_19_STABLE

Description

Implement AJAX forum rating

  1. ajax_forum_ratings_19.patch.txt
    30/Nov/08 9:19 AM
    23 kB
    Eloy Lafuente (stronk7)
  2. ajax_forum_ratings.patch.txt
    23/Nov/08 9:50 PM
    17 kB
    Eloy Lafuente (stronk7)

Issue Links

Activity

Hide
Eloy Lafuente (stronk7) added a comment - - edited

Attaching patch (for HEAD) that implements AJAX forum ratings.

Notes:

  • Minimum changes in current forum code. Just added the $return parameter to one function, enclosed the ratings summary into one needed <span> and added simple condition to decide between normal and ajax behaviour.
  • Uses YUI 100% of course.
  • rate_ajax.js, where all the JS lives.
  • rate_ajax.php, server-side script to handle them (90% equivalent to rate.php).

Future improvements:

  • Put all the common code in rate.php and rate_ajax.php in some function to be used by both.
  • wrap all js functions into some object.

Seems to be working, ok. Security implemented by sesskey only (and enough I think). Please review.

Ciao

Show
Eloy Lafuente (stronk7) added a comment - - edited Attaching patch (for HEAD) that implements AJAX forum ratings. Notes:
  • Minimum changes in current forum code. Just added the $return parameter to one function, enclosed the ratings summary into one needed <span> and added simple condition to decide between normal and ajax behaviour.
  • Uses YUI 100% of course.
  • rate_ajax.js, where all the JS lives.
  • rate_ajax.php, server-side script to handle them (90% equivalent to rate.php).
Future improvements:
  • Put all the common code in rate.php and rate_ajax.php in some function to be used by both.
  • wrap all js functions into some object.
Seems to be working, ok. Security implemented by sesskey only (and enough I think). Please review. Ciao
Hide
Eloy Lafuente (stronk7) added a comment -

Attached better (less intrusive) version. Ciao

Show
Eloy Lafuente (stronk7) added a comment - Attached better (less intrusive) version. Ciao
Hide
Eloy Lafuente (stronk7) added a comment -

And here it's the patch to have ajax forum ratings in 19_STABLE. I've had to tweak it more than the HEAD version because of the lack of some nice javascript things only in HEAD (thanks Tim), but should be working.

For review if anybody is interested on that... ciao

Show
Eloy Lafuente (stronk7) added a comment - And here it's the patch to have ajax forum ratings in 19_STABLE. I've had to tweak it more than the HEAD version because of the lack of some nice javascript things only in HEAD (thanks Tim), but should be working. For review if anybody is interested on that... ciao
Hide
Eloy Lafuente (stronk7) added a comment -

(adding txt extension for easier browsing)

Show
Eloy Lafuente (stronk7) added a comment - (adding txt extension for easier browsing)
Hide
Eloy Lafuente (stronk7) added a comment -

Resolving as fixed. Implemented both in 19_STABLE and HEAD. Controlled by a new forum module setting. Ciao

Show
Eloy Lafuente (stronk7) added a comment - Resolving as fixed. Implemented both in 19_STABLE and HEAD. Controlled by a new forum module setting. Ciao
Hide
Nicolas Connault added a comment -

Getting a notice when viewing a forum as admin, with rating set to Average:

Notice: Undefined property: stdClass::$assesstimestart in /srv/www/htdocs/moodle_19/mod/forum/lib.php on line 3016

Show
Nicolas Connault added a comment - Getting a notice when viewing a forum as admin, with rating set to Average: Notice: Undefined property: stdClass::$assesstimestart in /srv/www/htdocs/moodle_19/mod/forum/lib.php on line 3016
Hide
Helen Foster added a comment -

AJAX forum ratings are great on moodle.org! Thanks Eloy

Just one small thing though, the link to the rating help popup looks odd on it's own at the bottom of the page. Perhaps it could be moved next to the rating dropdown menu, as suggested in MDL-13371.

Show
Helen Foster added a comment - AJAX forum ratings are great on moodle.org! Thanks Eloy Just one small thing though, the link to the rating help popup looks odd on it's own at the bottom of the page. Perhaps it could be moved next to the rating dropdown menu, as suggested in MDL-13371.
Hide
Helen Foster added a comment -

Nicolas, thanks for your comment.

Unfortunately I'm unable to reproduce the problem you describe either on moodle.org or on my local 1.9.3+. Have you any ideas of anything I could try?

Show
Helen Foster added a comment - Nicolas, thanks for your comment. Unfortunately I'm unable to reproduce the problem you describe either on moodle.org or on my local 1.9.3+. Have you any ideas of anything I could try?
Hide
Martin Dougiamas added a comment -

Loving this, just two small buglets to report (filing as subtasks)

Show
Martin Dougiamas added a comment - Loving this, just two small buglets to report (filing as subtasks)
Hide
Helen Foster added a comment -

Lots of people are appreciating this new feature:

http://moodle.org/mod/forum/discuss.php?d=114500

Show
Helen Foster added a comment - Lots of people are appreciating this new feature: http://moodle.org/mod/forum/discuss.php?d=114500
Hide
Eloy Lafuente (stronk7) added a comment -

All subtasks resolved so re-resolving this again. Ciao

PS: Nice to see it's useful (like the ratings) :-P

Show
Eloy Lafuente (stronk7) added a comment - All subtasks resolved so re-resolving this again. Ciao PS: Nice to see it's useful (like the ratings) :-P
Hide
Helen Foster added a comment -

Eloy, thanks for fixing the subtasks Any chance you could also fix the rating help popup (as mentioned above) too?

Show
Helen Foster added a comment - Eloy, thanks for fixing the subtasks Any chance you could also fix the rating help popup (as mentioned above) too?
Hide
Eloy Lafuente (stronk7) added a comment -

Hi Helen,

not sure why I didn't received that message (the one talking about the help button) by email. Strange.

In any case... I'd keep this resolved and perhaps continue the discussion in the original bug (MDL-13371). IMO there are various alternatives open there (help icon near each menu, inline scale description...) and we should agree about them there. More now, if we want to show things differently between AJAX/no AJAX ratings.

Perhaps we can address MDL-13371 for 1.9.5 and introduce there the AJAX/no AJAX variants to see if the discussion evolves (there or in moodle.org forums). Does this sound ok?

Show
Eloy Lafuente (stronk7) added a comment - Hi Helen, not sure why I didn't received that message (the one talking about the help button) by email. Strange. In any case... I'd keep this resolved and perhaps continue the discussion in the original bug (MDL-13371). IMO there are various alternatives open there (help icon near each menu, inline scale description...) and we should agree about them there. More now, if we want to show things differently between AJAX/no AJAX ratings. Perhaps we can address MDL-13371 for 1.9.5 and introduce there the AJAX/no AJAX variants to see if the discussion evolves (there or in moodle.org forums). Does this sound ok?
Hide
Helen Foster added a comment -

Using MDL-13371 for the rating help popup sounds fine to me.

Eloy, thanks again for implementing AJAX forum rating - it's very cool!

Show
Helen Foster added a comment - Using MDL-13371 for the rating help popup sounds fine to me. Eloy, thanks again for implementing AJAX forum rating - it's very cool!
Hide
Anthony Borrow added a comment -

Eloy - Just an FYI, the error language string 'mustbeloggedin' does not exist in 19STABLE so I created MDL-18790 and assigned to Koen. Peace - Anthony

Show
Anthony Borrow added a comment - Eloy - Just an FYI, the error language string 'mustbeloggedin' does not exist in 19STABLE so I created MDL-18790 and assigned to Koen. Peace - Anthony

Dates

  • Created:
    Updated:
    Resolved: