GSoC/GCI Archive
Google Code-in 2011 LimeSurvey

Port Expression Manager from 1.92 branch to Yii framework - Integration

completed by: Gautam

mentors: TMSWhite

Port Expression Manager Testing Framework from 1.92 branch to Yii framework

LimeSurvey 2.0a (our latest development release) is based on the CodeIgniter framework. Unfortunately the CodeIgniter license is not compatible to the LimeSurvey GPL license so we need to port the LimeSurvey codebase to a new framework, Yii. We need your help to do this.

General Steps:

  • Install a subversion client and download LimeSurvey 2.0a (that's the version still based on CodeIgniter) using subversion and install it by running http://<yourserver>/limesurvey/index.php/admin
  • Do the same with the new LimeSurvey development branch based on Yii. There is no installer yet so just point the database configuration in /application/config.php to the database you created in step 1.
  • Check out the functionality named in this task title in the CI version. If you have problems to find it please get in touch with us on IRC.
  • Check out the source code and then port the functionality to Yii.
  • Test the new functionality in the Yii version thoroughly.
  • Submit a patch created with subversion and based on the YII branch to this task idea and wait for feedback.

Specific Steps for This Task

  • Review the Expression Manager (EM) documentation and survey-building how-tos, and notes for developers.
  • This tasks assumes that task 7240253 has been completed, but can be done independently of that task.
  • Note that the version of EM incorporated into 1.92 is more sophisticated than that in 2.0a.
  • Download and install the LimeSurvey 1.92
  • Try all of the tests - the path is localhost/limesurvey_dev/classes/eval/test/test.php
  • For this task
    • Initegrate all of the LimeExpressionManager::XXX() functions into Yii.  This is largely a search and cut/paste exercise, but needs to be done with care to ensure that the logic flow from 1.92 is reflected in the Yii-based controllers
    • Note, the main file to port is group.php, which does all of the navigation (effectively replacing and consolidating _CI's Group_format.php, Question_format.php, Survey_format.php, and Save.php).  You will probably need to create some custom views out of that new controller.
    • The main difference between this task and 7240253 is that 1.92 completely removes dependence upon Conditions at run-time, so this task includes ensuring that functions to ConvertConditionsToRelevance() are called at all needed points
    • Also carefully ensure that SetDirtyFlag() is called where needed to optimize caching but not prevent switching among surveys.
    • Also port the createFieldMap() and buildsurveysession() functions, as they no longer query the Conditions table, and set some additional parameters.
  • Ensure that the Yii port and 1.92 branch tests produce identical results.


  • Good PHP knowledge
  • Experience with a PHP MVC framework


  • We want a straight port. Don't start to rewrite big portions of the code.
  • If you can clean up the models it would be great but it is not necessary.
  • It is important that you test your ported code thoroughly before you submit the patch. This will save you and us alot of time. It will take longer to accept your patch if you did not test.