- Posts: 4
- Thank you received: 0
Welcome to the LimeSurvey Community Forum
Ask the community, share ideas, and connect with other LimeSurvey users!
Datepicker plugin - Prevent multiple entries
- gardalid
- Topic Author
- Offline
- New Member
Less
More
5 years 8 months ago #171907
by gardalid
Datepicker plugin - Prevent multiple entries was created by gardalid
Hello
I am a relatively new developer. I have been tasked with modifying the jquery date-picker for a client. The client wants old entries in the survey date-picker to be disabled, and as such, prevent multiple entries on the same date.
I recon it is possible to gather the data, by registering to specific events and use the API to fetch the data. But is it in anyway possible to pass the data(gathered with php) to the jquery date-picker?
Best regards Sam
I am a relatively new developer. I have been tasked with modifying the jquery date-picker for a client. The client wants old entries in the survey date-picker to be disabled, and as such, prevent multiple entries on the same date.
I recon it is possible to gather the data, by registering to specific events and use the API to fetch the data. But is it in anyway possible to pass the data(gathered with php) to the jquery date-picker?
Best regards Sam
The topic has been locked.
- LouisGac
- Visitor
5 years 8 months ago #171925
by LouisGac
Replied by LouisGac on topic Datepicker plugin - Prevent multiple entries
"The client wants old entries in the survey date-picker to be disabled"
I don't understand: could you expand please, by giving more details about the use case?
I don't understand: could you expand please, by giving more details about the use case?
The topic has been locked.
- gardalid
- Topic Author
- Offline
- New Member
Less
More
- Posts: 4
- Thank you received: 0
5 years 8 months ago #171948
by gardalid
Replied by gardalid on topic Datepicker plugin - Prevent multiple entries
Hi LuisGac
Our client is a group of doctors (allergy specialists), which use the platform to monitor development of their patients. The patients make a daily entry in the system, answering a few questions about their disease and progress. Some patients will fill out more than one survey each day, if they are being monitored for more than one disease.
The patients will inevitably have some days on which they do not have any irritation or bother from the disease, and will mostly forget to make an entry on these days. For that reason we included a date-based question in the first question-group of each survey, to let patients make entries for earlier days. i.e. the days on which they forgot to make an entry. But the clients problem is, that they want their patients to see which days already have entries.
So the question is, whether it is possible to gather the old dates for a token and a particular survey, and save them in an js object, which can be used to disable old entry dates in the date-picker itself.
We are using the system pretty much 'as is', meaning, that we have not made any changes in our installation, but only use the included features at the moment.
Our client is a group of doctors (allergy specialists), which use the platform to monitor development of their patients. The patients make a daily entry in the system, answering a few questions about their disease and progress. Some patients will fill out more than one survey each day, if they are being monitored for more than one disease.
The patients will inevitably have some days on which they do not have any irritation or bother from the disease, and will mostly forget to make an entry on these days. For that reason we included a date-based question in the first question-group of each survey, to let patients make entries for earlier days. i.e. the days on which they forgot to make an entry. But the clients problem is, that they want their patients to see which days already have entries.
So the question is, whether it is possible to gather the old dates for a token and a particular survey, and save them in an js object, which can be used to disable old entry dates in the date-picker itself.
We are using the system pretty much 'as is', meaning, that we have not made any changes in our installation, but only use the included features at the moment.
The topic has been locked.
- DenisChenu
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 13637
- Thank you received: 2491
5 years 8 months ago - 5 years 8 months ago #171955
by DenisChenu
Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
Replied by DenisChenu on topic Datepicker plugin - Prevent multiple entries
beforeQuestionRender
event since you need to get existing values in your Response table you can't use (i think) twig files from this.
Something like (really speedly done, without any control).
Something like (really speedly done, without any control).
Code:
$token = Yii::app()->getRequest()-getPost('token'); $sid = $this->getEvent()->get('surveyId'); $column = $this->getEvent()->get('surveyId').'X'.$this->getEvent()->get('gid')."X".$this->getEvent()->get('qid'); $oResponse = Reponse::model($sid)->findAll("token = :token",array(":token"=>$token)); $listDate = CHtml::listData($oResponse,$id,$column);// Here you have the array of existing date $script = "//TODO"; // Here you do you javascript Yii::app()->getClientScript()->registerScript('filterDate'.$this->getEvent()->get('qid'),$script);
Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
Last edit: 5 years 8 months ago by DenisChenu. Reason: typo + // Here you have the array of existing date
The following user(s) said Thank You: LouisGac, gardalid
The topic has been locked.
- gardalid
- Topic Author
- Offline
- New Member
Less
More
- Posts: 4
- Thank you received: 0
5 years 8 months ago #171994
by gardalid
Replied by gardalid on topic Datepicker plugin - Prevent multiple entries
Hi Denis
On the page with plugin events, it says that the event (BeforeQuestionRender) is available from LS v. 2.05 build 140922. We have the right version, but our build is 140618. Is there any way of updating to a newer build without having to do a version jump?? We would rather not have to redesign our templates(according to the documentation, templates were changed in v 2.5 or 2.6), as our surveys are currently in use. Or is there any other event that could handle our issue and is available in our build? like AfterFindSurvey?
Best regards
On the page with plugin events, it says that the event (BeforeQuestionRender) is available from LS v. 2.05 build 140922. We have the right version, but our build is 140618. Is there any way of updating to a newer build without having to do a version jump?? We would rather not have to redesign our templates(according to the documentation, templates were changed in v 2.5 or 2.6), as our surveys are currently in use. Or is there any other event that could handle our issue and is available in our build? like AfterFindSurvey?
Best regards
The topic has been locked.
- Joffm
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 12916
- Thank you received: 3975
5 years 8 months ago #171996
by Joffm
Volunteers are not paid.
Not because they are worthless, but because they are priceless
Replied by Joffm on topic Datepicker plugin - Prevent multiple entries
Hi,
here you find the older versions.
You can update to 2.06 to keep the structure of your templates.
www.limesurvey.org/downloads/category/24-archived-releases
Joffm
here you find the older versions.
You can update to 2.06 to keep the structure of your templates.
www.limesurvey.org/downloads/category/24-archived-releases
Joffm
Volunteers are not paid.
Not because they are worthless, but because they are priceless
The following user(s) said Thank You: DenisChenu, gardalid
The topic has been locked.
- DenisChenu
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 13637
- Thank you received: 2491
5 years 8 months ago #172004
by DenisChenu
Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
Replied by DenisChenu on topic Datepicker plugin - Prevent multiple entries
Then : with an older version : only solution : make a php script call in ajax.
Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
The following user(s) said Thank You: gardalid
The topic has been locked.
- Mazi
- Offline
- Official LimeSurvey Partner
1 month 2 weeks ago #258241
by Mazi
Best regards/Beste Grüße,
Dr. Marcel Minke
Need Help? We offer professional Limesurvey support: survey-consulting.com
Contact: marcel.minke(at)survey-consulting.com
Replied by Mazi on topic Datepicker plugin - Prevent multiple entries
One option is using a single choice question instead of a date picker. When making use of this plugin you can set a limit of 1 for each option and once that date was selected, the plugin will disable it so others won't be able to pick this option.The client wants old entries in the survey date-picker to be disabled, and as such, prevent multiple entries on the same date.
Best regards/Beste Grüße,
Dr. Marcel Minke
Need Help? We offer professional Limesurvey support: survey-consulting.com
Contact: marcel.minke(at)survey-consulting.com
The topic has been locked.