View Issue Details

IDProjectCategoryView StatusLast Update
05104User patchesOtherpublic2012-06-21 13:22
ReporterTMSWhite Assigned ToTMSWhite  
Status closedResolutionfixed 
Product Version1.91RC5 
Target VersionFixed in Version2.00 
Summary05104: Create new question type for stored calculation results, called Equation

Assuming we've created a generic equation parser (see Issue 05103), create a new Question Type called "Equation".

$ia[3] (question text) would hold the equation to be parsed.

At design-time, the equation parser would validate the syntax and semantics of the equation (e.g. to ensure that it didn't try to reference values that had not yet been set).

At run-time, the equation parser would evaluate $ia[3] each time the Conditions specified it should be visited. The results of that calculation would be stored in the database, just like any other Question's results.

The results of the calculation could be either a String, a Number, or a Date. If LimeSurvey supports easy casting across those data types (e.g. store as a String, but do run-time casting of it to a Number or Boolean), then we'd only need one Equation type. If it is safer to strongly type the values, then we'd need StringEquation, LongEquation, DoubleEquation, BooleanEquation, DateEquation types.

These Equations would be used for situations where users might want to export the data and run statistics on the values computed for those equations. So, we'd want the ability to implement import/export/statistics on them.

Sometimes it is necessary to create intermediate Equations which are needed for display purposes, or branching logic, but don't need to be in an export to a statistical dataset. I've recommended that users prefix such variables with something like "nd_" to indicate that they do not contain relevant data. That way, when they export their datasets, they can use regular expression matching to exclude variables they don't care about.

TagsNo tags attached.
Complete LimeSurvey version number (& build)9992


related to 05103 closedTMSWhite Support conditional piping/tailoring and complex calculations via embedded equation parser 
related to 05288 closedTMSWhite Optionally replace Assessments with ExpressionManager features 




2011-06-19 07:52

reporter   ~15502

Notes to self - Which functions would need to be edited to add an Equation question type?




2011-07-13 00:02

reporter   ~15748

Last edited: 2011-07-13 00:02

View 2 revisions

This now works in the limesurvey_dev_tms branch - revision 10498.

Equations use type '*' and follow the ExpressionManager syntax.

The are true questions, so the results are stored in the database, and can be used by {INSERTANS:xxx} or ExpressionManager itself.



2011-10-28 23:04

reporter   ~16566

This is available in >= 2.0alpha

Issue History

Date Modified Username Field Change
2011-04-11 20:51 TMSWhite New Issue
2011-05-07 11:58 c_schmitz Status new => acknowledged
2011-06-19 07:52 TMSWhite Note Added: 15502
2011-06-19 18:59 TMSWhite Relationship added related to 05288
2011-06-19 19:03 TMSWhite Relationship added related to 05103
2011-07-13 00:02 TMSWhite Note Added: 15748
2011-07-13 00:02 TMSWhite Note Edited: 15748 View Revisions
2011-10-28 23:04 TMSWhite Note Added: 16566
2011-10-28 23:04 TMSWhite Status acknowledged => resolved
2011-10-28 23:04 TMSWhite Fixed in Version => 2.00
2011-10-28 23:04 TMSWhite Resolution open => fixed
2011-10-28 23:04 TMSWhite Assigned To => TMSWhite
2012-06-21 13:22 c_schmitz Status resolved => closed