Check out the LimeSurvey source code on GitHub!
Welcome, Guest
Username: Password:
  • Page:
  • 1
  • 2

TOPIC: Expression Manager: Nested Equations?

Expression Manager: Nested Equations? 3 years 7 months ago #90558

  • DenisChenu
  • DenisChenu's Avatar
  • Online
  • Moderator Lime
  • Posts: 9304
  • Thank you received: 1330
  • Karma: 386
Mazi wrote:
This is implemented for the numeric question types to make large numbers easier to read when inputting them.
Hello Marcel,

I look at 2.1 code, and don't see this system, and EM function are var numRegex = new RegExp('[^-' + LEMradix + '0-9]','g'); : no thousand seperator here .

Are you sure it's in 2.1 actually ?

Denis
Assistance on LimeSurvey forum and LimeSurvey core developpement are on my free time (Say thanks ?).
A bug not reported is a bug not corrected. | Please, read the documentation | La doc en français à besoin de vous
The administrator has disabled public write access.

Expression Manager: Nested Equations? 3 years 7 months ago #90563

  • Mazi
  • Mazi's Avatar
  • Offline
  • LimeSurvey Team
  • Posts: 5984
  • Thank you received: 368
  • Karma: 260
Hi Denis,

this should be in 2.1 already. Please contact Sam about the details, he has coded that.

Best regards/Beste Grüße,
Dr. Marcel Minke
(Limesurvey Head of Support)
Need Help? We offer professional Limesurvey support
Contact: marcel.minke(at)limesurvey.org'"
The administrator has disabled public write access.

Expression Manager: Nested Equations? 3 years 7 months ago #91266

  • Fred
  • Fred's Avatar
  • Offline
  • Expert Lime
  • Posts: 147
  • Thank you received: 5
  • Karma: 3
A follow up to one of my earlier comments. I said a couple of weeks ago...
This survey actually has over 500 of these equations, and now we are doubling the number of questions. Although the display questions don't create a column in the survey_NNN table at least. It's a good thing I am using Excel and your awesome Excel importer to create all the questions.

Actually I discovered that LS actually DOES create a column in the survey responses table for Text Display (Boilerplate) questions. This may have been introduced between 1.91 and 1.92 according to Denis? It's only varchar(1) so fortunately it doesn't take up too much room. But if you have a large survey, you may want to factor this into your estimates:
docs.limesurvey.org/General+FAQ#regarding_survey_size

It does seem a little silly to have all these empty columns in the responses. Usually sparseness is a quality you want to avoid in DB. But if Thomas White did this, I'm sure there was an excellent reason!
The administrator has disabled public write access.

Expression Manager: Nested Equations? 3 years 7 months ago #91267

  • TMSWhite
  • TMSWhite's Avatar
  • Offline
  • LimeSurvey Team
  • Posts: 758
  • Thank you received: 83
  • Karma: 37
As far as I remember, 1.91 did also create a varchar(1) for each boilerplate question even though it could never contain anything. I left it in for backwards compatability.

However, I'd vote to remove those columns in version 2.1

/Tom
The administrator has disabled public write access.

Expression Manager: Nested Equations? 3 years 7 months ago #91269

  • Fred
  • Fred's Avatar
  • Offline
  • Expert Lime
  • Posts: 147
  • Thank you received: 5
  • Karma: 3
Fortunately, for the big survey I was working on, even with the extra overhead of many text display questions for equation formatting, everything worked out great so far.

I built everything in Excel, coding all the expressions using Excel formulas, concatenate, etc. There are probably 1000 expressions including equations and relevance. This took a few weeks. Then I imported it using the Tab-delimited Text import utility. The import and table build took about 2 seconds and worked perfectly. And I can run through the survey without crashing, too :)

There is absolutely no way this could have been done without Expression Manager and the Text importer!

1744 rows in text import file
1558 columns in Survey_NNN table
Question groups: 35
Questions: 1494
Answers: 102
Subquestions: 60
Question attributes: 4145

The MySQL table schema has this data, but I'm not sure how to interpret. The data length sounds too little and the max length sounds too big?

AVG_ROW_LENGTH 2468
DATA_LENGTH 2468
MAX_DATA_LENGTH 281,474,976,710,655
INDEX_LENGTH 12288
The administrator has disabled public write access.
The following user(s) said Thank You: TMSWhite

Expression Manager: Nested Equations? 3 years 7 months ago #91272

  • DenisChenu
  • DenisChenu's Avatar
  • Online
  • Moderator Lime
  • Posts: 9304
  • Thank you received: 1330
  • Karma: 386
TMSWhite wrote:
As far as I remember, 1.91 did also create a varchar(1) for each boilerplate question even though it could never contain anything. I left it in for backwards compatability.

However, I'd vote to remove those columns in version 2.1

/Tom
I rememeber some time when boilerplate question type doesn't create a column, maybe in 1.87 then ???

2.0 still create a column. And like Thomas: vote to "don't add it".
Assistance on LimeSurvey forum and LimeSurvey core developpement are on my free time (Say thanks ?).
A bug not reported is a bug not corrected. | Please, read the documentation | La doc en français à besoin de vous
The administrator has disabled public write access.

Expression Manager: Nested Equations? 3 years 7 months ago #91278

  • Mazi
  • Mazi's Avatar
  • Offline
  • LimeSurvey Team
  • Posts: 5984
  • Thank you received: 368
  • Karma: 260
Thanks for your valuable feedback, Fred.

It's nice to hear that EM can handle that large amount of data and expressions and that the Excel import works so great.

Best regards/Beste Grüße,
Dr. Marcel Minke
(Limesurvey Head of Support)
Need Help? We offer professional Limesurvey support
Contact: marcel.minke(at)limesurvey.org'"
The administrator has disabled public write access.

Expression Manager: Nested Equations? 3 years 7 months ago #91716

  • Fred
  • Fred's Avatar
  • Offline
  • Expert Lime
  • Posts: 147
  • Thank you received: 5
  • Karma: 3
I think there may be a bug in Expression Manager number_format. If you have an equation with result is a number greater than minus1000 or less than 1000, and try to number_format () it displays NAN. So any 1, 2, or 3-digit positive or negative and I get the NAN.

(I would report a bug but my account never works on the bugs site)

Funny I came across this php bug discussion about PHP number_format where Rasmus himself comments and gets in an argument with users
bugs.php.net/bug.php?id=50696
The administrator has disabled public write access.

Expression Manager: Nested Equations? 3 years 7 months ago #91722

  • Mazi
  • Mazi's Avatar
  • Offline
  • LimeSurvey Team
  • Posts: 5984
  • Thank you received: 368
  • Karma: 260
A very "interesting" discussion at the PHP Bugtracker...

Fred, can you attach a sample survey? I'm not sure how this is implemented in detail at the EM but would like to test before submitting a ticket. Maybe the code is handled by PHP after being parsed by EM and thus the PHP bug causes the problem (just guessing))?!

Best regards/Beste Grüße,
Dr. Marcel Minke
(Limesurvey Head of Support)
Need Help? We offer professional Limesurvey support
Contact: marcel.minke(at)limesurvey.org'"
The administrator has disabled public write access.

Expression Manager: Nested Equations? 3 years 7 months ago #91740

  • DenisChenu
  • DenisChenu's Avatar
  • Online
  • Moderator Lime
  • Posts: 9304
  • Thank you received: 1330
  • Karma: 386
It's not a number_format (not really).

number_format(10) return 10.

But if you do :
"some text"+number_format(10) : EM test if ("some text" AND number_format(10)) are string. And seems number_format(10) are not a string.

Think EM must do this:

10+10 = 20
"some text"+10 = "some text10".

And have a solution to do:
"10"+"10"="1010"

ACtually, EM test is strval(floatval("10"))=="10" and put is numeric if yes: think there are a conceptual bug here.

Denis
Assistance on LimeSurvey forum and LimeSurvey core developpement are on my free time (Say thanks ?).
A bug not reported is a bug not corrected. | Please, read the documentation | La doc en français à besoin de vous
The administrator has disabled public write access.

Expression Manager: Nested Equations? 3 years 7 months ago #91770

  • Fred
  • Fred's Avatar
  • Offline
  • Expert Lime
  • Posts: 147
  • Thank you received: 5
  • Karma: 3
Thanks you guys!

A little bit off-topic, but I talked with Denis about creating a "format_money" function for EM. This would open up LimeSurvey to the wonderful world of finance. We need something that is like Excel currency masks and formatting.

Start with: -1234567.89
Turn it into: $(1,234,568) -- for example. there could be other

Currently you can write a function in EM to do this but there are a lot of steps. Especially when you can't count on number_format() even.
The administrator has disabled public write access.

Expression Manager: Nested Equations? 3 years 7 months ago #91772

  • Fred
  • Fred's Avatar
  • Offline
  • Expert Lime
  • Posts: 147
  • Thank you received: 5
  • Karma: 3
Also correction from earlier, it is not really a BUG in EM. Just a different expectation of how something will work.

Here is a pertinent quote from that PHP.net bug discussion:

[2010-01-08 23:20 UTC] This email address is being protected from spambots. You need JavaScript enabled to view it.
Wow, a classic case of how not to treat unpaid volunteers who provide
critical pieces of your money-making infrastructure.
The administrator has disabled public write access.

Expression Manager: Nested Equations? 3 years 6 months ago #91787

  • DenisChenu
  • DenisChenu's Avatar
  • Online
  • Moderator Lime
  • Posts: 9304
  • Thank you received: 1330
  • Karma: 386
Think it's a bug or misfeature in EM.

bugs.limesurvey.org/view.php?id=7236

Denis
Assistance on LimeSurvey forum and LimeSurvey core developpement are on my free time (Say thanks ?).
A bug not reported is a bug not corrected. | Please, read the documentation | La doc en français à besoin de vous
The administrator has disabled public write access.
  • Page:
  • 1
  • 2
Moderators: ITEd
Time to create page: 0.931 seconds
Imprint                   Data Protection Statement                  Revocation information and revocation form