Welcome to the LimeSurvey Community Forum

Ask the community, share ideas, and connect with other LimeSurvey users!

scheduling maintenance mode

  • 3278142
  • 3278142's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
2 years 5 months ago #221865 by 3278142
scheduling maintenance mode was created by 3278142
Hello.  First of all, thanks for all of the help.  I am running LS on my first cloud server with me first nginx/monicadb stack and am having great success.

My last question for the community: in theory our survey should only receive responses during business hours and we do not want people to pop in after hours and stuff the box.  We have a lot of employees on personal phones, so a whitelist for our own network will block half of our people. 
  1. At this moment it looks like I can manually put it in/out of system maintenance mode using the general menu of the global settings where there is a switch.
  2. Is there a way to schedule the system so that it activates at 8am and closes at 330p?  It would be like the activate/deactivate survey feature but be repeated every day.
  3. Worst case scenario I need to edit out spurious responses that have a start time recorded outside the window, but I am trying to reduce manual steps and work.
Thanks for any thoughts on this.  I could also turn the server on and off easily with cron, but that would probably generate support tickets when people cant see the server.  Thanks for helping me brainstorm this.  ck
The topic has been locked.
  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
2 years 5 months ago - 2 years 5 months ago #221900 by Joffm
Replied by Joffm on topic scheduling maintenance mode
My first idea was to create two small scripts (php) and switch the value of "maintenancemode" accordingly
UPDATE lime_settings_global SET maintenancemode='hard'
UPDATE lime_settings_global SET maintenancemode='off'

and run the scripts by a cron job.

But also, maybe an easier approach, you could have a first question of type equation in your survey, where you check the time
Participants outside the allowed time window are screened out by a quota.
But the disadvantage is, you may get a lot of screenouted responses, which you have to delete. Though it is not a big thing.

Joffm

 

Volunteers are not paid.
Not because they are worthless, but because they are priceless
Last edit: 2 years 5 months ago by Joffm.
The topic has been locked.
  • 3278142
  • 3278142's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
2 years 5 months ago #221984 by 3278142
Replied by 3278142 on topic scheduling maintenance mode
The first sounds like a good option for me. I have never run php through cron, any good examples in the ls docs? It has been years since I touched php code, but have sudo access so could make it happen with a recipe. Thanks. Ck
The topic has been locked.
  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
2 years 5 months ago #221990 by Joffm
Replied by Joffm on topic scheduling maintenance mode

any good examples in the ls docs?

No, you do this outside of LS.
And you may use any web language you like.
I only mentioned php because I am most familiar with this.

But it's very easy.

Connect to the LS database by PDO or mysqli or something else
Run the query
Disconnect from the database

And this php script you can run by a cron job. There are many providers where you can run cron jobs for free.

Joffm
 

Volunteers are not paid.
Not because they are worthless, but because they are priceless
The following user(s) said Thank You: DenisChenu, 3278142
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose