django-survey
django-survey copied to clipboard
Logged users can't answer a survey more than one time
So, this basically is not a bug but i would like my users to answer the questionnaire more than once!! How can that be done? As when a user logs in and answer the survey it is stored with a unique key, but when the same user come back to take the same survey the previous data come on the form and when he submits it it is updated in the database!! I want the user to reply to the survey again and it should save it with a different unique key!!
Can you please help me achieve my condition?
And secondly there are some issues with the exporting commands it seems like the commands are working in the cmd but it does not actually provide a generated file for either csv, pdf or any other form!
Hi,
Without modifying the code you can disable logins (uncheck "need logged user" in your survey admin) and add a question to identify the user. Not ideal but it can work if you trust your users.
A better solution would be to add a selector that would permit to create another "Response" (the name of class in the code) in interface (in templates/survey.html), and then permit to choose from your multiple "Response" if you want to change them. I won't have time to do this but I'd be happy to merge your pull request if you make one.
Could you open another issue for the problem with generating csv or pdf ?
Sure I'd open up a new issue for the problem of generating the csv or pdf! but my point here is I want a survey that only logged in user can answer to with them being able to answer multiple times!
Can that be done?
Yes, but not without modifying the code, see 2nd paragraph of my first answer :)
Then that's what i want to do!! I am actually new at django/python so can you help me out with the code i'll be uploading my code and will share you the link!
I need to assign survey to companies that i created! and only the user that is linked with the company may reply the the surveys multiple times,, other then that no other user can view the survey that is assigned to a different company!!!
Above all thanks for responding so quickly and i appreciate all your hard work here this seems to be pretty damn good except that my requirements are a bit different!
Thanks
Thanks, it seems it would be a great addition to the software. You may want to add an option In the Survey Model (allow multiple answers from the same user) so we can have both requirements working.
If you have questions (especially about design and architecture) do not hesitate to ask, I may not reply that fast every-time but I'll try to answer everything.
https://github.com/developer11092/django-survey
Here's my repo run it and you may find the difference!
Thanks again
It seems you created a whole new repository. Could you fork my repository and make a commit with your modifications ? It would be a lot easier that way because github would show exactly the change made.
Sorry didn't thought of that before, anyway when you will run my code you will know exactly the changes! there are som in models.py and others in the settings.py probably,, and yes have changed the css from bootstrap 3 to 4
Have a look at my code i think by changing the form.py file a little I was able to achieve my goal!
Is it okay what i have done? Have a look!
I'll look at changes if they are made from a fork and I can see commits directly. I don't have time to launch the software and compare output.
The way to do this is to fork django-survey, clone it locally, copy paste your repository in the django-survey directory and to create a commit from those changes.
Reopening because the feature is still needed.
There is an attempt to implement this feature in https://github.com/Fwhiteiv/django-survey/commit/d5d8d0b8c5ae5a1175cd554eabb79e272537c1d0 as far as I can see it simply disables ability to edit previous responses, thus avoid choosing response. Could you please review this version? If you agree with the approach I can add some tests and make a pull request.
(There's a lot of unrelated changes that would need to be removed first on this branch like removing rosetta and adding where to find the code, but) on principle only displaying the latest answers and avoiding adding a selector to edit at the cost of not being able to edit the first answers is better than nothing. I'll add you as contributor to the repository if you make a pull request, I did not do it for the numerous previous contributors but I should have :)