JVE : doesn't make an average notation figure like 4,3

1 year 7 months ago #10494 by boucdur
Hi,

The notation is not very accurate as the average is never with a "," like 3,6 for example.
It would be nice to add this in the next releases.

1 year 7 months ago #10496 by Vitja
Hi Boucdur,

as I've told in the other thread:

I use the core functionality to count and load the ratings. It does not support decimals, only integers.

The ratings are loaded in the model (components/com_content/models/article.php) in the function getItem

// Join on voting table
$query->select('ROUND(v.rating_sum / v.rating_count, 0) AS rating, v.rating_count as rating_count')
    ->join('LEFT', '#__content_rating AS v ON a.id = v.content_id')
    ->where('a.id = ' . (int) $pk);

As you can see, it uses the ROUND function ( dev.mysql.com/doc/refman/5.7/en/mathemat....html#function_round ) without decimals. So, as long as the core component does not support decimals, it is unlikely that JVE will have this feature. Of course, I could load the values directly from the database but I don't want to bypass the correct way (like the core does it).

Ones could also increase the accuracy by increasing the maximum best value, e.g. to 10. But the problem is that the core component does not allow ratings higher than 5. See function storeVote in the same model class:

if ($rate >= 1 && $rate <= 5 && $pk > 0)

This means that ratings higher than 5 wouldn't be counted.

Greetings

Kubik-Rubik Joomla! Extensions

Please support my work with a review in the Joomla! Extensions Directory: extensions.joomla.org/profile/profile/details/61997
1 year 7 months ago #10500 by Vitja
After a thought about it, I think it would be okay to load the data directly from the database and make it possible to display decimal numbers. But this should be an optional option. I will update the plugin soon! :-)

Kubik-Rubik Joomla! Extensions

Please support my work with a review in the Joomla! Extensions Directory: extensions.joomla.org/profile/profile/details/61997
1 year 7 months ago #10501 by Vitja
Hi Boucdur,

I've just released a new version with the wished feature. I've also mentioned you in the changelog, hope this is okay for you!

joomla-extensions.kubik-rubik.de/jve-joomla-vote-extended

Thank you for your valued input.

Greetings

Kubik-Rubik Joomla! Extensions

Please support my work with a review in the Joomla! Extensions Directory: extensions.joomla.org/profile/profile/details/61997
1 year 7 months ago #10502 by boucdur
Ouahhhh I didn't expect you would add this feature that quick. Great !!!
Thanks for the mention I m honored héhé
Time to create page: 0.165 seconds