Okay, this significantly changes the approach, as it moves away from LimeSurvey's native token-based survey distribution model towards a more integrated centralized employee portal.
LimeSurvey itself does NOT have a built-in feature to:
- Provide a single login screen for all employees to access multiple assigned surveys.
- Maintain a central "my surveys" dashboard for employees across different surveys without using tokens.
- Allow admins to "assign" surveys to specific internal users (LimeSurvey users are typically administrators or survey designers, not regular respondents).
Therefore, to achieve this, you will need a hybrid approach:
- LimeSurvey: Used as the backend survey engine (for creating questions, collecting responses).
- A Custom-Built Application (e.g., in PHP, Python/Django, Node.js/Express): This will act as your employee portal and handle the user authentication, survey assignment, status tracking, and the review/rejection workflow.
This is a much more involved development project than just configuring LimeSurvey plugins.
🧭 Roadmap: Custom Employee Portal with LimeSurvey Backend
📌 Phase 1: Planning & Setup
1.1. Core Technologies
- LimeSurvey: The survey engine.
- Custom Portal Framework: Choose a robust web framework (e.g., Laravel for PHP, Django for Python, Express.js for Node.js).
- Database: PostgreSQL or MySQL for the custom portal's data.
1.2. Architecture Overview
- Custom Portal Database:
employees table (id, username, password, email, etc.)
surveys table (id, limesurvey_sid, name, description)
employee_survey_assignments table (id, employee_id, survey_id, status, feedback)
- Custom Portal Application:
- Employee Login Module: Authenticates employees.
- Employee Dashboard Module: Shows assigned surveys, status, and links to fill.
- Admin Dashboard Module: Manages employees, surveys, assignments, and reviews.
- LimeSurvey Installation: Runs separately, but accessible by the Custom Portal.
📌 Phase 2: Custom Portal - Core Functionality
2.1. Set Up Custom Portal Framework
- Install chosen framework (Laravel, Django, Express).
- Set up database connection.
2.2. Employee User Management (Custom Portal)
- Database Table:
employees (username, hashed_password, email, etc.).
- Login Page: HTML form + server-side validation/authentication.
- Logout Functionality.
- Admin Interface (for Custom Portal): Allows creation/management of employee accounts.
2.3. Admin Management (Custom Portal)
- Separate user roles/permissions for "Admin" within the custom portal.
- Admin can:
- Create/edit employee accounts.
- View all surveys.
- Assign surveys to employees.
📌 Phase 3: LimeSurvey Integration (Key Part!)
3.1. Configure LimeSurvey for API Access
- In LimeSurvey, go to Configuration → Global Settings → Interfaces.
- Enable RemoteControl 2 API and note the API URL.
- Create a dedicated LimeSurvey user with appropriate permissions (at least "access surveys", "create/manage tokens", "view responses") for the custom portal to use via API.
3.2. Manage Surveys in LimeSurvey
- Admin creates questionnaires in LimeSurvey as usual (multi-section, questions, logic).
- Important:
- Enable token-based responses for each survey (this is how the custom portal will manage individual submissions securely).
- Set "Allow editing after completion" to "Yes" in survey settings if revisions are needed.
- Disable public access to survey links. The only way employees will access these surveys is through your custom portal.
3.3. Sync Surveys (Custom Portal to LimeSurvey)
- When an admin adds a survey in the custom portal, it should store the
limesurvey_sid (LimeSurvey's internal survey ID).
- Or, the custom portal can list surveys from LimeSurvey using the API:
- LimeSurvey API Method:
list_surveys
- Custom portal displays these and allows admins to "import" or "link" them.
3.4. Generate Tokens (Behind the Scenes)
- When an admin assigns a survey to an employee in the custom portal:
- The custom portal uses the LimeSurvey API to add a new token to that specific LimeSurvey survey's token table.
- The token should be linked to the employee's email/ID for tracking.
- LimeSurvey API Method:
add_participants
- Store the generated
token in your custom portal's employee_survey_assignments table.
3.5. Employee Survey Access (Single Sign-On Like)
- When an employee clicks "Fill Survey" on their custom portal dashboard:
- The custom portal retrieves the unique
token for that employee and survey from employee_survey_assignments.
- It then redirects the employee to the LimeSurvey survey URL with the token embedded:
https://yourlimesurvey.com/index.php/survey/index/sid/{limesurvey_sid}/token/{token}
- The employee fills the survey in LimeSurvey. They never see or manage the token directly.
📌 Phase 4: Workflow Automation & Status Tracking
4.1. Track Status in Custom Portal
- The
employee_survey_assignments table will store:
employee_id
survey_id (from custom portal's surveys table)
status (e.g., 'pending', 'submitted', 'reviewing', 'rejected', 'approved')
feedback (for rejection)
last_submission_date
limesurvey_response_id (optional, for direct linking)
4.2. Update Status on Submission
- Method A (Recommended): LimeSurvey Plugin Hook
- Create a custom LimeSurvey plugin that hooks into
afterSurveySubmit.
- This plugin will, upon submission:
- Get
surveyId and token.
- Make an API call back to your custom portal (e.g., a specific endpoint like
/api/survey-submitted).
- The custom portal endpoint receives the data, finds the corresponding
employee_survey_assignment based on token and survey_id, and updates its status to 'submitted'.
- Method B (Less Real-time): Polling via API
- The custom portal periodically polls LimeSurvey using the
get_response_status or export_responses API method to check for completed responses and update statuses. Less efficient.
4.3. Admin Review Dashboard (Custom Portal)
- Admins log into the custom portal.
- They see a list of assigned surveys and their statuses.
- When clicking on a 'submitted' assignment:
- The custom portal uses LimeSurvey API (
get_response_data or export_responses) to fetch the actual questionnaire responses.
- Displays the responses to the admin for review.
- Provides "Approve" and "Reject" buttons.
4.4. Rejection with Feedback (Custom Portal)
- If Admin clicks "Reject":
- A form appears to input
feedback.
- The custom portal updates the
employee_survey_assignments table:
status to 'rejected'.
feedback column populated.
- Send an email notification to the employee (via custom portal's email system) with the feedback and a link back to their custom portal dashboard.
4.5. Employee Revision
- Employee logs into the custom portal, sees 'rejected' status.
- Clicks "Revise" (or the original "Fill Survey" link).
- The custom portal re-generates the survey URL with the same token. Since "Allow editing after completion" is enabled in LimeSurvey, the employee can revisit and edit their previous submission.
- On re-submission, the
afterSurveySubmit plugin will again notify the custom portal, updating the status back to 'submitted' (or 'resubmitted') for another review.
4.6. Final Approval
- Admin clicks "Approve" in the custom portal.
- Custom portal updates
employee_survey_assignments table status to 'approved'.
- Notifies employee via email.
📌 Phase 5: Deployment & Maintenance
5.1. Hosting
- LimeSurvey and your Custom Portal can be on the same server or separate (recommended for scalability/security).
- Use Docker for easy deployment of both.
5.2. Security
- HTTPS: Essential for both LimeSurvey and Custom Portal.
- API Keys: Securely store LimeSurvey API credentials in your custom portal.
- Input Validation: Sanitize all user inputs in the custom portal.
- Password Hashing: Use strong hashing for employee passwords (e.g., bcrypt).
- Access Control: Implement robust role-based access control in your custom portal.
5.3. Monitoring & Backups
- Regular backups for both databases.
- Monitor server health and application logs.
⚠️ Important Considerations & Complexity
- Significant Development Effort: This is not a simple configuration; it requires full-stack web development skills (frontend, backend, database, API integration).
- Two Systems to Maintain: You'll be maintaining both LimeSurvey and your custom portal.
- Tight Coupling: The custom portal becomes tightly coupled with LimeSurvey's API. Updates to LimeSurvey might require adjustments to your portal.
- Alternative: If this level of development seems too much, reconsider ProcessMaker or Joget DX. They are designed for exactly this kind of workflow automation out-of-the-box and would save immense development time, even if they have a steeper initial learning curve than just LimeSurvey.
This roadmap provides a detailed path forward if you choose to build this custom solution. Let me know if you want to dive deeper into any specific code examples for the custom portal or LimeSurvey plugin!