Download the PHP package tonisormisson/limesurvey-relevance-imex without Composer
On this page you can find all versions of the php package tonisormisson/limesurvey-relevance-imex. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download tonisormisson/limesurvey-relevance-imex
More information about tonisormisson/limesurvey-relevance-imex
Files in tonisormisson/limesurvey-relevance-imex
Package limesurvey-relevance-imex
Short Description A LimeSurvey Plugin to allow Import & Export of survey Relevance equations
License MIT
Homepage https://github.com/TonisOrmisson/limesurvey-relevance-imex
Informations about the package limesurvey-relevance-imex
LimeSurvey Structure Import/Export Plugin
A LimeSurvey plugin for importing and exporting survey structure, relevance logic, and quotas via Excel files.
Installation & set-up
Install to plugins folder
Activate plugin from Plugin manager
Find the plugin Import / Export buttons from survey tools menu.
Features
- Questions: Export/import survey question structure with attributes
- Relevance Logic: Export/import conditional logic and expressions
- Quotas: Export/import survey quotas and participation limits
- RemoteControl API (optional): Exposes plugin actions discoverable via
list_plugin_apiand callable viacall_plugin_api(requires globalrpc_plugin_apito be enabled)
See docs/ folder for detailed format specifications. RemoteControl API usage is documented in docs/REMOTE_CONTROL_API.md.
Updating
go to plugin folder
Get updates via git.
git pull or git fetch --all && git checkout my-version-tag
Run install command to make sure dependencies are updated if necessary.
Development & Testing
Testing Overview
This plugin includes both unit tests (using mocks) and functional tests (using real database interaction) to ensure reliability and catch regressions early.
Test Suites
- Unit Tests: Fast tests using mock data, no database required
- Functional Tests: Integration tests with real LimeSurvey database interaction
- Code Quality: PHPStan static analysis
Quick Start - Local Development
Prerequisites
- PHP 8.1+
- MySQL/MariaDB
- Composer
1. Install Development Dependencies
2. Setup Test Database
Copy the environment configuration:
Edit .env with your database settings:
Run the database setup script:
This will:
- Create the test database
- Import LimeSurvey schema
- Verify the setup
3. Run Tests
Coverage. We only can run codecoverage on local env right now. There is an issue that on GH actions, in order to have a LimeSurvey instance for testing we duplicate the plugin code inside the LS isside vendor, so we have something like ./vendor/limesurvey/limesurvey/upload/plugins/StructireImex ... while the root itself is the plugin source. This will create an autoload conflict for the codecoverage process that I have not been able to solve for gh actions. So fir now, run codecoverage on your local env:
CI/CD (GitHub Actions)
The project includes GitHub Actions workflows for:
- Unit Tests: Run on every push/PR
- Functional Tests: Run with MySQL service container
- Code Quality: PHPStan analysis
Environment Variables for CI
The functional tests automatically detect CI environment and use appropriate database settings:
Test Structure
Unit Tests (tests/ExportQuestionsTest.php)
- Uses mock data via
MockSurveyHelper - Tests export functionality without database
- Fast execution (~1 second)
- Validates file structure and content
Functional Tests (tests/ExportImportFunctionalTest.php)
- Tests complete export/import cycle
- Uses real LimeSurvey database
- Validates data persistence and integrity
- Tests warning system and validation
Test Database (tests/DatabaseTestCase.php)
- Base class for database-driven tests
- Automatic cleanup between tests
- Survey import/export utilities
- Database connection management
Writing Tests
Adding Unit Tests
Use MockSurveyHelper for consistent mock data:
Adding Functional Tests
Extend DatabaseTestCase for database tests:
Debugging Tests
Failed Database Connection
If functional tests fail with database errors:
- Check database is running:
mysql -u root -p - Verify connection settings in
.env - Run setup script:
composer test-setup - Check LimeSurvey schema exists
Test Isolation Issues
Each test cleans up after itself, but if you see data pollution:
- Check
tearDown()methods are called - Verify
$this->createdSurveyIdsis populated - Manual cleanup:
DROP DATABASE limesurvey_test; CREATE DATABASE limesurvey_test;
Manual Testing
For manual verification of export/import functionality:
- Create test survey with various question types
- Add question attributes (some default, some custom)
- Export via plugin interface
- Import to new survey
- Verify data integrity and attribute filtering
Contributing
When contributing:
- Write tests for new functionality
- Ensure all tests pass:
composer test - Run static analysis:
composer phpstan - Follow existing code style
- Update documentation as needed
The test suite helps maintain code quality and prevents regressions, ensuring the plugin works reliably across different LimeSurvey versions.
All versions of limesurvey-relevance-imex with dependencies
ext-json Version *
openspout/openspout Version ^4.0
sebastian/version Version ^6