LimeSurvey issue tracker
Registration

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
05104User patchesOtherpublic2011-04-11 20:512012-06-21 13:22
ReporterTMSWhite 
Assigned ToTMSWhite 
PrioritynormalSeverityminor 
StatusclosedResolutionfixed 
Product Version1.91RC5 
Target VersionFixed in Version2.00 
Summary05104: Create new question type for stored calculation results, called Equation
DescriptionAssuming 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.
LimeSurvey build number OR git commit ID9992
Attached Files

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

-  Notes
User avatar (15502)
TMSWhite (reporter)
2011-06-19 07:52

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

common_functions.php
export_data_r.php
export_data_spss.php
admin/export_structure_lsrc.php
index.php
qanda.php
admin/questionhandling.php
admin/surveytable_functions.php
admin/update/upgrade-mssql.php
admin/update/upgrade-msqlnative.php
admin/update/upgrade-mysql.php
admin/update/upgrade-postgres.php
User avatar (15748)
TMSWhite (reporter)
2011-07-13 00:02
edited on: 2011-07-13 00:02

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.

User avatar (16566)
TMSWhite (reporter)
2011-10-28 23:04

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


Copyright © 2000 - 2014 MantisBT Team
Powered by Mantis Bugtracker