Jefferson49 / Joomla_plugin_sexypolling_reloaded

Migration of the joomla plugin "Sexy Polling" to joomla 4.x
GNU General Public License v3.0
2 stars 3 forks source link

Feature Request: Permissions for Answers and Votes, and Export/Import Functionality #82

Closed 4creator closed 6 months ago

4creator commented 6 months ago

Hello Jefferson49,

I am currently exploring the use of Sexy Polling Reloaded as an electoral voting tool for my client's site. Previously, I used Extstore's Advanced Poll, but I suspect its developers may have ceased operations.

I'm not sure if my feature requests align with your development philosophy for Sexy Polling Reloaded, but I hope you find them worth considering.

As mentioned, my aim is to use Sexy Polling Reloaded for election purposes. Therefore, I have the following requests:

Permissions (for multiple site administrators)

The introduction of Global Configuration in #81 is a significant step forward and probably sufficient for most cases. However, I have specific needs as outlined below.

When using Sexy Polling Reloaded for elections, it's necessary to impose stricter backend access controls during the election period (restricted to Super Users only). Once the election is over, backend access can return to normal. However, from an electoral standpoint, careful attention must still be paid to access to Answers and Votes. This is because information such as "who voted, for whom, and when" or "who received how many votes" should not always be accessible to all election administrators.

From a system perspective, the current management of Votes is excellent, as it prevents fraud through user ID and IP tracking.

Considering this, implementing "permissions settings for access to Answers and Votes" would be one possible solution to meet my needs.

Export/Import

I would also appreciate a feature to export the contents displayed in the Answers table to a CSV file as is. Being able to export data for a specific Poll, including the Answer Name, Votes, and ID, would enable storing election results in Excel or any format preferred by the user.

Furthermore, having the ability to import Answers into a new Poll would be beneficial. (By the way, my client has over 200 candidates to list on Answers.)

I hope my requests and opinions will be useful for the future development of Sexy Polling Reloaded.

Regards

4creator commented 6 months ago

This could be called a "request for function improvement" rather than just a "feature request."

When the Show Results During Poll setting is set to No, the text from the language string COM_SEXYPOLLING_WORD_26 that says "Your vote has been registered, you may see the results starting" becomes inconsistent with the actual functionality.

To prevent this, I suggest splitting the language string into two separate strings - one that says "Your vote has been registered!" and another that says "You may see the results starting ". That way, whether the Show Results During Poll setting is Yes or No, there shouldn't be any inconsistency. Does this seem like a good idea to you?

Jefferson49 commented 6 months ago

When using Sexy Polling Reloaded for elections, it's necessary to impose stricter backend access controls during the election period (restricted to Super Users only). Once the election is over, backend access can return to normal. However, from an electoral standpoint, careful attention must still be paid to access to Answers and Votes. This is because information such as "who voted, for whom, and when" or "who received how many votes" should not always be accessible to all election administrators.

Well, this sounds a little bit complex and I am not sure how much effort it takes to implement this.

Let's discuss a little bit more, how it could look like:

Does this describe the intended behavior?

Jefferson49 commented 6 months ago

I would also appreciate a feature to export the contents displayed in the Answers table to a CSV file as is.

Well, I have no experience in creating files for download yet. I will try to find out if Joomla offers good support for this. I will try to check and estimate the effort.

As an available solution, you have the option to create CSV (and even EXCEL) exports with phpMyAdmin.

Jefferson49 commented 6 months ago

Furthermore, having the ability to import Answers into a new Poll would be beneficial.

I hesitate about import, because a well-defined import format has to be specified and it is difficult to avoid import errors and avoid inconsistent data in the database.

As a short term solution, it should be possible to import CSV (or SQL) with phpMyAdmin.

Jefferson49 commented 6 months ago

To prevent this, I suggest splitting the language string into two separate strings - one that says "Your vote has been registered!" and another that says "You may see the results starting". That way, whether the Show Results During Poll setting is Yes or No, there shouldn't be any inconsistency. Does this seem like a good idea to you?

What I understand is to show the first string "Your vote has been registered!" in both of the cases (Yes/No) and to show the second string "You may see the results starting" only in one case (Yes = Show results). Is this correct?

4creator commented 6 months ago

Let's discuss a little bit more, how it could look like:

  • In global configuration, add an additional action "Hide answers and votes during an active vote"
  • If selecting this option for a certain user group, the user group shall not be able to view answers and votes
  • In the backend, answers and votes, which belong to an active vote, would not be shown to the user group.
  • Other votes and answers shall still be shown

Does this describe the intended behavior?

I am an absolute beginner in PHP and programming, so I have no idea about the difficulty level of my requests, and I'm worried that I might be causing you confusion.

At present, thanks to your addition of Sexy Polling Configuration and the provision of the Access Administration Interface option, my concerns regarding permissions during the election period have been alleviated. However, for the backend after the election, it would be perfect for me if there were options like "View Answers" and "View Votes" in Sexy Polling Configuration, with the ability to select Inherited/Allowed/Denied.

What I need from the "electoral standpoint" is not the distinction of "during an active vote". This is because, for the frontend, the Show Votes Data option in Polls sufficiently covers it, and for the backend, the Access Administration Interface option does as well.

If Sexy Polling Reloaded could cover usage for elections, then the "View Answers" and "View Votes" options would be very helpful in managing the candidates and vote counts.

4creator commented 6 months ago

As an available solution, you have the option to create CSV (and even EXCEL) exports with phpMyAdmin.

Yes, I can use phpMyAdmin or one of the extensions for Joomla, Alter Reports. This suggestion is not urgent for me, I posted it as an opinion to increase the value of Sexy Polling Reloaded.

The same goes for import (I can do it myself with phpMyAdmin).

4creator commented 6 months ago

What I understand is to show the first string "Your vote has been registered!" in both of the cases (Yes/No) and to show the second string "You may see the results starting" only in one case (Yes = Show results). Is this correct?

Yes, your understanding is correct! (^_^)/

Jefferson49 commented 6 months ago

If Sexy Polling Reloaded could cover usage for elections, then the "View Answers" and "View Votes" options would be very helpful in managing the candidates and vote counts.

I added two actions to the component permission:

I also added a new option/setting "Permission control for viewing answers and votes". Only if this setting is activated, the two permisson actions are evaluated. The background for this is that I fear that otherwise viewing of answers/votes might be denied by default.

permission control for answers and polls

You can test the new features with the attached test version.

com_sexypolling_v5.0.3_688706af.zip

4creator commented 6 months ago

Thank you for providing the prerelease version of v5.1.3 (v5.0.3 is likely a typo).

I tested it in my environment and the improvements are fantastic. With these specifications, I believe I can use Sexy Polling Reloaded as an extension for elections.

I sincerely appreciate that you were able to accommodate my feature request so quickly! (^o^)/

Jefferson49 commented 6 months ago

When the Show Results During Poll setting is set to No, the text from the language string COM_SEXYPOLLING_WORD_26 that says "Your vote has been registered, you may see the results starting" becomes inconsistent with the actual functionality.

To prevent this, I suggest splitting the language string into two separate strings - one that says "Your vote has been registered!" and another that says "You may see the results starting ". That way, whether the Show Results During Poll setting is Yes or No, there shouldn't be any inconsistency. Does this seem like a good idea to you?

I created a seperate issue #85. Further analysis showed that the end date of poll was not correctly checked in the code. It is fixed now.

Jefferson49 commented 6 months ago

I would also appreciate a feature to export the contents displayed in the Answers table to a CSV file as is. Being able to export data for a specific Poll, including the Answer Name, Votes, and ID, would enable storing election results in Excel or any format preferred by the user.

I included a CSV export for all votes/answers/polls in the votes view. Implemented/finalized with 703c78c

Also added a configuration item for the separator. By default it is set to ";" which works best with EXCEL.

Jefferson49 commented 6 months ago

Permissions and CSV export are implemented. Votes import is not planned to be implemented.

Jefferson49 commented 6 months ago

Today, I published the additional features in a new release. It will also be shown by the Joomla update management system.

If you like it, it would be nice if you write a review in the Joomla extension directory.