Fixes i made for my company's project

1 view
Skip to first unread message

Filip Franik

unread,
Oct 22, 2008, 9:39:01 AM10/22/08
to PloneSurvey
Hello,
my name is Filip and I'm a web developer from Poland.
My company is currently working on a project that involves
PloneSurvey. I spent last 3 days working on it, and fixing all the
bugs I found.

I rewrote the validate_survey.vpy script because it was unreadable,
and in 40% redundant.
I unified the way that data in all fields are stored (list of strings)
and changed all of templates to save, and understand it. Now my
version of PloneSurvey can save multi selection fields.
I fixed all un i18n'lized text in templates.
I rewrote the CSV file generating section of Survey.py to translate
Likert options.
I added missing messages in Polish translation .po files.
Some more fixes I don't remember right now.

I would like to commit my fixes to your SVN so Your next improvements
can be based on them. My changes are rather drastic, and include many
files in many places.
Please tell me where, and how can I place them in Your SVN.

PS
Why did you create "likertOptions" if "answerOptions" can do same job
with only a bit more work from editor?

Davis, Michael

unread,
Oct 22, 2008, 2:42:17 PM10/22/08
to cmfque...@googlegroups.com

Hi Filip,

Sounds great, thanks for that. Not sure what version you are working from,
but you may find that some of your fixes have already been done in trunk. I
put some effort into tidying up those areas a while ago. Trunk is currently
broken, as I'm having way solving the cookie problem, and have not got round
to adding the survey id into the templates yet. Will work for single page
surveys.

I did LikertOptions for exactly that reason, to make it easier for the
editors. Main focus of PloneSurvey is to make creating a survey easy for
users.

PloneSurvey is in the Plone Collective:

https://svn.plone.org/svn/collective/PloneSurvey

If you don't have collective checkin rights yet, you can get access by
following the instructions here:

http://plone.org/development/info/write-access-collective

Cheers
Michael

Filip Franik

unread,
Oct 23, 2008, 4:45:45 AM10/23/08
to PloneSurvey
Hi Michael,

I'm working on PloneSurvey 1.2.0 It was supposed to be stable, after
some tests I found lacking features, and added them myself. I don't
know if ill have time to make a diff of my modifications with your
trunk, but when ill finish ill send you my product. I'm making tons of
comments in English so it'll be probably easy to Read.
Now I'm waiting for client to specify what features he needs so my
work on PloneSurvey is paused for the moment.

I have a question.
What's the difference in purpose between spreadsheet2 and
spreadsheet3?
I'm trying to modify spreadsheet2 to return linkert options as a text
(i.e. "Very Good, Good, Poor" for multi selection field) but this
created a problem with translations self.translate(text,
domainname="plonesurvey") returns "unicode decode error" no idea why.

I think I'll have to add a new feature, "Disable survey reset for
users". The project I'm working on needs a "Contest module" so when
reseting will be disabled after submission users can no longer modify
their input. This means that site admin will get a tidy CSV file with
answers to contest questions. After that he'll just use Excell or OO.o
filters and random sort to select a contest winner.




On Oct 22, 8:42 pm, "Davis, Michael" <m.r.da...@cranfield.ac.uk>
wrote:
> Hi Filip,
>
> Sounds great, thanks for that. Not sure what version you are working from,
> but you may find that some of your fixes have already been done in trunk. I
> put some effort into tidying up those areas a while ago. Trunk is currently
> broken, as I'm having way solving the cookie problem, and have not got round
> to adding the survey id into the templates yet. Will work for single page
> surveys.
>
> I did LikertOptions for exactly that reason, to make it easier for the
> editors. Main focus of PloneSurvey is to make creating a survey easy for
> users.
>
> PloneSurvey is in the Plone Collective:
>
> https://svn.plone.org/svn/collective/PloneSurvey
>
> If you don't have collective checkin rights yet, you can get access by
> following the instructions here:
>
> http://plone.org/development/info/write-access-collective
>
> Cheers
> Michael
>

Yuri

unread,
Oct 23, 2008, 5:40:42 AM10/23/08
to PloneSurvey
great wrk filip. I also have done some modifications, such as DGF
support, text matrix questions, more advanced branching:
- on a group of multiple answers
- you can go to a branch question even if the branch question has not
been answered to support this kind of cases:

a->b->c
|---------|

(you can go to c by b or branch to c from a directly)

I've sent to Michael the tarball too :P

Davis, Michael

unread,
Oct 23, 2008, 6:37:23 AM10/23/08
to cmfque...@googlegroups.com
Hi Yuri,

Thanks for this. I'll see what I can do with it. Looks like I'm going to have a busy weekend ;-)

Cheers
Michael

Davis, Michael

unread,
Oct 23, 2008, 6:36:50 AM10/23/08
to cmfque...@googlegroups.com
Hi Filip,

Spreadsheet 2 and 3 were a summary spreadsheet, and a full spreadsheet originally. They've been redone in trunk to have more sensible names, and to work more sensibly.

There should be a permission that you can use to prevent users from resetting their own survey. Only Managers should be able to reeset their survey by default.

If you send me your tarball, I'll see if I can integrate your improvements into trunk. I would ideally like to make one more 2.5 compatible release before workign seriously on Plone 3 compatability.

Cheers
Michael

-----Original Message-----
From: cmfque...@googlegroups.com [mailto:cmfque...@googlegroups.com] On Behalf Of Filip Franik
Sent: 23 October 2008 09:46
To: PloneSurvey
Subject: Re: Fixes i made for my company's project


Filip Franik

unread,
Oct 23, 2008, 2:32:43 PM10/23/08
to PloneSurvey
Hello again,

I downloaded and tested the trunk version.

I think if my boss will let me work some of my magic on your trunk
tomorrow.
I'll try to male the trunk version usable, fully translatable and as
universal as i can.

I think putting all of the validation in class methods instead of in
one script can make the validation segment more readable and easier to
manage.
Also setting the submition from 2 layers (form, validate+save) to 3
layers (form, validate, save) would make the code more flexible.

Found some bugs like 2 unused fields in SurveyMatrixQuestion schema i
would like to fix.

If You feel personal about trunk ^_^ and dont want me to mess with
Your code I'll make a branch for myself to play with :)

Davis, Michael

unread,
Oct 23, 2008, 2:45:05 PM10/23/08
to cmfque...@googlegroups.com

Hi Filip,

Not a problem with you working on trunk, I can always revert stuff ;-)

I think I moved some of the validation to class methods called
validateAnswer, but don't think I finished them all off.

One issue with trunk is the survey_id. I changed the code to prevent users
from moving from one page to the next unless the survey_id is in the form,
however, I've not put that in the form yet. I'll try to fix that this
weekend, unless you beat me to it.

Cheers
Michael

Filip Eich

unread,
Oct 29, 2008, 9:20:51 AM10/29/08
to cmfque...@googlegroups.com
Hello,

I did more fixes, and product is now working A.O.K. I changed
getQuestionOptions method to return options ALWAYS as IntDisplayList
(Likert or non Likert) and null value is always (0, 'null value
here'). That saved tons of If's in user interface.
I fixed the strange behavior of csv files (csv files didn't show some
answers, and they didn't open in Excel 2007 corectly)
Plus older fixes - validation to .py files, and saving data to
saveAnswer method in same .py files.

Unfortunatly i couldn't force i18n to work in generating the csv files
so the answers are english only for likert options.


W dniu 23 października 2008 19:45 użytkownik Davis, Michael
<m.r....@cranfield.ac.uk> napisał:

--
-= i come in peace =-

Davis, Michael

unread,
Oct 29, 2008, 7:11:08 PM10/29/08
to cmfque...@googlegroups.com

Hi Filip,

Sounds good. Sorry for not getting back to you earlier.

I had a go at integrating your changes, but there were some failing tests,
and you didn't send me a svn copy, so I couldn't create a diff.

Could you send me the svn copy you've been working from, or tell me which
version number you checked out, so I can recreate a working copy.

Cheers
Michael

--~--~---------~--~----~------------~-------~--~----~
You received
> this message because you are subscribed to the Google Groups "PloneSurvey"
> group.
To post to this group, send email to cmfque...@googlegroups.com
To
> unsubscribe from this group, send email to
> cmfquestions...@googlegroups.com
For more options, visit this group
> at
> http://groups.google.com/group/cmfquestions?hl=en
-~----------~----~----~----~
> ------~----~------~--~---



Davis, Michael

unread,
Oct 29, 2008, 7:11:08 PM10/29/08
to cmfque...@googlegroups.com

Hi Filip,

Sounds good. Sorry for not getting back to you earlier.

I had a go at integrating your changes, but there were some failing tests,
and you didn't send me a svn copy, so I couldn't create a diff.

Could you send me the svn copy you've been working from, or tell me which
version number you checked out, so I can recreate a working copy.

Cheers
Michael


On 29/10/08 13:20, "Filip Eich" <pacy...@gmail.com> wrote:

Yuri

unread,
Oct 30, 2008, 4:29:56 AM10/30/08
to PloneSurvey


On 29 Ott, 14:20, "Filip Eich" <pacyf...@gmail.com> wrote:
> Hello,
>
> I did more fixes, and product is now working A.O.K. I changed
> getQuestionOptions method to return options ALWAYS as IntDisplayList
> (Likert or non Likert) and null value is always (0, 'null value
> here'). That saved tons of If's in user interface.

what about textual options?

I've use cases where the survey matrix is filled with text (replacing
the radio button with text input button), can this fit in it?

Filip Eich

unread,
Oct 30, 2008, 4:53:55 PM10/30/08
to cmfque...@googlegroups.com
Hello.

I have no idea what svn revision i checked out ( SVN clien failure :( )
It was trunk from last friday i think im pretty sure that there ware
no changes in trunk in any of the files except i18n.
( all files I modified should have a nice .py~ backup file created by
my KWrite :) )

the getQuestionOptions is only in SurveySelectQuestion and
SurveyMatrix and before my moddification when you used likert options
it returned:
IntDisplayList [(1, 'Very Good'), (2, 'Good') ... (0, 'ull value')]
and if the options ware textual it returned
DisplayList [ 'Yes', 'No' ] - not returning null value, it had to
be added in validator.

After my mods the second case would be like:
IntDisplayList [(1, 'Yes'), (2, 'No'), (0, 'ull value')]
So the function returns same type of data for likert and textual options.

Every question in SurveyMatrix saves data independently, and possibly
save it same way as SurveyTextQuestion.

The version i sent You some time ago was not finished yet.
This one is last of 'basic plone' compatible version i can give you.
Now ill have to modify it to cooperate with other custom products
already made for the project im making for my company.

I would be happy to help You in any way I can in my free time to get
at least some of my mods to trunk.

My sources are open to You :)

2008/10/30 Yuri <yurj....@gmail.com>:

--

Davis, Michael

unread,
Oct 30, 2008, 5:34:57 PM10/30/08
to cmfque...@googlegroups.com

Hi Filip,

I'll see what I can do to get most of your changes in, hopefully this
weekend. I may need to unpick it line by line though ;-(

I don't agree with your change to make text select options return as int
lists. This would cause a problem is a survey owner wanted to add a new
option. So, if they changed the options to yes, maybe, no, then all previous
survey returns that selected no would then be registered as maybe. It's not
a limitation that I think should be put in, even though it makes things more
consistent.

If you can get a better svn client, then I would be happy for you to work on
trunk, especially when we start on plone 3 compatbility :-)

Cheers
Michael

Filip Eich

unread,
Oct 30, 2008, 5:55:12 PM10/30/08
to cmfque...@googlegroups.com
Likert options are a NIGHTMARE especially to i18n them. Every way I
try to translate them I get unicode decode error.
Translating is necessary in csv files. (There was none so far)
There might be another way then to unify likert and nonlikert options.
Instead of hardcoded sets of likert options there could be just a
field that uses javascript to fill the "Options" field with default
data.

Like you select in "Likert options" field "Good vs Bad" option and
javascript fills "Options" field with Very Good, Good ... Bad, V. Bad

Unification of likert and nonliker options will make code in other
places readable and templates will render faster.

2008/10/30 Davis, Michael <m.r....@cranfield.ac.uk>:

--

Davis, Michael

unread,
Oct 30, 2008, 6:09:21 PM10/30/08
to cmfque...@googlegroups.com

Hi Filip,

i18n is something I am not very good at, and would appreciate all the help I
can get on it. Several people have put some effort into the i18n side of
things, but I think they use different aspects of the product, so it's not
consistent. I think I will need to take a hard look at this aspect of it,
and see if it can be improved with your changes, without removing the
ability to add new text options in.

I think most users are willing to accept that the edit form is not fully
i18'd, but that won't suit all users, so I'll see what I can do. I think the
best approach at the moment is to get a final 2.5 release out, so we can
start working on a fully i18n'd plone 3 release.

Cheers
Michael

Deichi

unread,
Nov 25, 2008, 4:15:06 AM11/25/08
to PloneSurvey
Hallo all,

I myself rewrote some parts of SubSurvey yesterday to remove what I
think are unnecessary complicated checks in getNextPage (apart from
that ugly loop with while 1==1 ...)

But before I commit that changes to trunk:
Were there any thoughts that made it necessary to jump to the next
question related to what the branch condition of the current sub
survey is? Actually to NOT do that makes the concept more flexible.
Instead of splitting the questions to a tree of subsurveys (which
actually isn't possible too right now...) you can have multiple sub
surveys depend on one question. And while I was at it, I allowed
multiple required questions and multiple required answers to allow
continuing with the next sub survey if ANY of the answers (separated
by ";") apply. One could certainly improve that concept by allowing to
select more complex "if one these answers are given, but not these or
all of this..."-type branching.
Another thing I came over is the fact that the "getNextPage" method
only looks for SubSurveys ... which would skip all questions that live
directly inside the survey. Is that a bug or are deeper thoughts
behind that?

Regards,
Sven

Filip Franik schrieb:

Yuri

unread,
Nov 25, 2008, 9:20:28 AM11/25/08
to PloneSurvey


On 25 Nov, 10:15, Deichi <deichm...@werkbank.com> wrote:
> Hallo all,
>
> I myself rewrote some parts of SubSurvey yesterday to remove what I
> think are unnecessary complicated checks in getNextPage (apart from
> that ugly loop with while 1==1 ...)
>
> But before I commit that changes to trunk:
> Were there any thoughts that made it necessary to jump to the next
> question related to what the branch condition of the current sub
> survey is? Actually to NOT do that makes the concept more flexible.
> Instead of splitting the questions to a tree of subsurveys (which
> actually isn't possible too right now...) you can have multiple sub
> surveys depend on one question.

I've done it, read past posts in this group under my nick :)

BTW, I've added the addAnswer method & co to SubSurvey.py, so I can
store the path the user has followed and if the user has correctly
filled the subsurvey. Next I'll implement the back button.

Michael Davis

unread,
Nov 25, 2008, 6:07:16 PM11/25/08
to cmfque...@googlegroups.com
Hi Sven,

I agree that some parts of the code are really clunky. There's now three
people working on the same parts for pretty much the same aims. Sorry, Filip
and Yuri, I could not fathom out your changes enough to get them checked in.
Can someone cut a branch to work on this aspect?

The initial concept was simply to give a page of questions the ability to
appear or not appear based on simple logic. To do it on a question level, I
think, would lead to a difficult user interface to enter the criteria. The
ability to branch on complex logic, that is multiple answer choices across
multiple questions would be the ultimate aim to give the most flexibility.
I'm not sure that a push methodology, making the question set answered drive
the next question set, rather than a pull methodology, requiring the next
question set to choose whether to appear or not, is better. Assuming a
linearity driven by the folder contents order, I would assume a pull is
better.

The only deep thought behind only checking for sub surveys is to keep the
interface for creating surveys simple. Branching logic is complex, and
adding this to a question level, rather than a page level would add to the
complexity of creating a survey.

I'm quite happy for you guys to check stuff in, and I would appreciate input
on this aspect, as I simply do not have much time to work on this product.
However, I think we need to make the final release in the plone 2.5 series
soon, so we can start work on a plone 3 compatible release.

So, if you could create a branch for doing this, that would be great. Then
you guys could work on that branch getting that sorted, and fold it into
trunk as soon as the next release is made.

Cheers
Michael

Yuri

unread,
Nov 26, 2008, 3:56:48 AM11/26/08
to PloneSurvey
I agree on the Sub Survey part, adapting it has been fun and
productive, so I think the logic is ok :)

On the changes, we should first set up a team, and decide the final
target, then we can discuss about the software architecture.

Davis, Michael

unread,
Nov 26, 2008, 5:21:35 AM11/26/08
to cmfque...@googlegroups.com
Hi Yuri,

Do you want me to give you permissions on the Software centre, so you
can write a plip?

Cheers
Michael

-----Original Message-----
From: cmfque...@googlegroups.com
[mailto:cmfque...@googlegroups.com] On Behalf Of Yuri
Sent: 26 November 2008 08:57
To: PloneSurvey
Subject: Re: Fixes i made for my company's project


Yuri

unread,
Nov 26, 2008, 6:50:21 AM11/26/08
to PloneSurvey
I don't have the whole picture, but I'll join asap your proposal if
you write it.
Reply all
Reply to author
Forward
0 new messages