A comprehensive polling module for Oqtane that enables site administrators and content managers to create, manage, and publish polls with scheduled start/end times, vote tracking, and real-time result visualization.
- Poll Management: Create, edit, and delete polls with an intuitive admin interface
- Scheduled Polls: Set start and end dates/times to control when voting is available
- Multiple Options: Add unlimited voting options with custom ordering
- Vote Tracking: Track user votes using browser fingerprinting to prevent duplicate voting
- Results Display: View real-time poll results with visual progress bars and vote percentages
- Security: Role-based access control integrated with Oqtane's security model
- Responsive Design: Mobile-friendly UI built with Bootstrap
- Oqtane: 6.2.1 or later
- .NET: .NET 9 or later
- Database: Compatible with any database supported by Oqtane
- Download the latest release from the Releases page
- Extract the module files to your Oqtane modules directory
- Build and run the application (database migrations will be applied automatically)
dotnet add package GIBS.Module.QuickPoll- Navigate to the QuickPoll module
- Click "Add QuickPoll" button
- Fill in the poll details:
- Question: The poll question text
- Start Date/Time: When voting should begin (optional)
- End Date/Time: When voting should end (optional)
- Options: Add voting options with custom display order
- Click "Add" to create the poll
- Edit: Click the "Edit Poll" button on any poll card
- Delete: Click the "Delete" button and confirm the action
- View Results: Results are automatically displayed when:
- The poll has ended (past the End Date/Time)
- The current user has already voted
- Poll is no longer active
Users can vote on active polls by:
- Selecting a voting option via radio button
- Clicking the "Vote" button
- Poll results are immediately displayed after voting
- Not Started: Shows message with scheduled start time
- Active: User can vote if they haven't already
- Ended: Results are displayed; no new votes accepted
- Results: Displays vote counts and percentages with progress bars
The module respects Oqtane's security model:
- Edit Access: Required to create, edit, and delete polls
- View Access: Required to view and vote on polls
Configure the module through Oqtane's module settings interface.
- Index.razor: Main poll listing and voting interface
- Edit.razor: Poll creation and editing form
- QuickPollService: Client-side API communication
- QuickPollService: Business logic and vote validation
- QuickPollRepository: Data access layer
- QuickPollManager: Poll lifecycle management
- QuickPollController: API endpoints
- QuickPoll: Main poll entity with question, dates, and status
- PollOption: Voting options with vote counts and display order
- PollVote: Individual vote records with user fingerprints
Entity Framework Core is used with automatic migrations:
QuickPoll: Stores poll questions and metadataPollOption: Stores voting optionsPollVote: Tracks individual votes
The module uses browser fingerprinting to uniquely identify voters and prevent duplicate voting:
- Fingerprints are generated via JavaScript on the client
- Votes are validated server-side to ensure a user votes only once per poll
- Server-side validation includes user ID and IP address tracking
- Visual Studio 2022 or later
- .NET 9 SDK
- Git
dotnet build- Start the Oqtane development server
- Navigate to the QuickPoll module
- Create a test poll and verify functionality
GIBS.Module.QuickPoll/
├── Client/
│ ├── Modules/GIBS.Module.QuickPoll/
│ │ ├── Index.razor # Main module view
│ │ ├── Edit.razor # Poll editor
│ │ ├── ModuleInfo.cs # Module metadata
│ │ └── Services/
│ │ └── QuickPollService.cs
│ └── ...
├── Server/
│ ├── Services/QuickPollService.cs
│ ├── Controllers/QuickPollController.cs
│ ├── Repository/QuickPollRepository.cs
│ ├── Manager/QuickPollManager.cs
│ ├── Migrations/
│ │ ├── 01000100_AddStartTime_EndTime.cs
│ │ └── EntityBuilders/
│ └── ...
├── Shared/
│ └── Models/
│ ├── QuickPoll.cs
│ ├── PollOption.cs
│ └── PollVote.cs
└── ...
GET /api/QuickPoll/GetQuickPolls/{moduleId}
GET /api/QuickPoll/GetResults/{pollId}/{moduleId}
POST /api/QuickPoll/AddVote
Content-Type: application/json
{
"optionId": 1,
"fingerprint": "unique-device-id"
}
GET /api/QuickPoll/HasUserVoted/{pollId}/{moduleId}/{fingerprint}
The module supports localization through Oqtane's IStringLocalizer<T> interface. Resource strings are maintained in the module's resource files.
- Vote deduplication relies on browser fingerprinting, which is not 100% foolproof
- Browser fingerprints may change if user clears local storage or browser data
- For highly sensitive voting scenarios, consider additional server-side validation
- Verify the user has appropriate module view permissions
- Check server logs for database connection issues
- Ensure database migrations have been applied
- Check browser console for JavaScript errors
- Verify the fingerprint is being generated correctly
- Ensure the database has write permissions
- Confirm the poll's end date/time has passed, or you've already voted
- Refresh the page to reload poll data
- Check that poll options exist in the database
Contributions are welcome! Please follow these guidelines:
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This module is provided as part of the GIBS solution suite. See LICENSE file for details.
For issues, questions, or feature requests, please use the Issues section of this repository.
- Initial release
- Core polling functionality
- Vote tracking and result visualization
- Scheduled poll support
- Oqtane integration
Built for: Oqtane 5.0+ | .NET: 9.0+ | C#: 13.0+