View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
03649User patchesStatisticspublic2009-09-04 14:532012-06-21 13:23
Assigned Toelameno 
Product Version 
Target VersionFixed in Version1.91 
Summary03649: LSRC: retrieve results from a survey
DescriptionA function which retrieve results from a survey and gives back the data.

function call could look like this
- sGetResult($user, $pass, $sid, [$format, $startrow, $endrow])

return could be csv and maybe other.

from thread: [^]
TagsNo tags attached.
LimeSurvey build number OR git commit ID
Attached Filesdiff file icon getResults3.diff [^] (80,505 bytes) 2010-02-18 17:06 [Show Content]

- Relationships

-  Notes
elameno (reporter)
2009-12-03 17:18

Hello rakete. I've taken some time to get to know some of the code and I've written a web service call that taps into the spss_export_data routine which works well; however, looking at what you've posted up above as the possible function call it seems you were thinking of tapping into the exportresults.php file? It looks like exportresults.php has a lot of features that would be helpful with the web service export so I'd like to use that code if possible (without duplication).

I've been having trouble running and capturing results from the exportresults.php and figured I'd ask you what your approach would be before banging my head against too many walls here :)
Mazi (developer)
2009-12-03 17:59

Tim, can you take care of this so we can create a nice patch which will be included at the core later on?
elameno (reporter)
2009-12-08 15:43

I've updated my 1.86 release to include a web service call that has the following signature: sGetResults($sUser, $sPass, $iVid, $sFilter, $sFormat, $iFromRecord, $iToRecord)

I ended up using a good portion of exportresults.php and have taken the common code and put it in a exportresults_guts.php file, then included the guts in both the exportresults.php and the exportresults_lsrc.php so there isn't any duplication of all that export logic. The way I have it set up, exportresults.php is mostly just the UI layout and logic to get the information to the "guts".

I'd be happy to put together a patch so you can see what I've done, but it looks like there's active development going on in the trunk on the exportresults.php file that has caused some issues. Should I create a patch from the 1.85 release branch? At the worst I could include a zip of the files that I've edited (there aren't many). Let me know what you prefer.

elameno (reporter)
2010-01-06 19:22

Well, I haven't heard anything so for now I've uploaded a zip containing all the files I've modified from the 1.86 release to get what I have working. I'm sure it needs to tweaking as far as checking input parameters and whatnot, but I wanted to get a copy of what I've been doing out to you guys. Once again, if you'd like a patch let me know where I should patch from.

I'd really like to hear from a developer on changes that should be made or better approaches than the one I've taken.

To get this working, all that needs to be done is to copy the contents of the zip into the root of a 1.86 lime install with the LSRC enabled. It will overwrite a few files and add a couple new ones.
Mazi (developer)
2010-01-06 21:13

Thanks for your feedback! The developer who has created LSRC is very busy at the moment. Your improvements won't get lost, it just takes sometime at open source projects.
2010-01-07 08:00

@ elameno: better than adding the whole files (against v1.86) would be if you could provide a SVN diff-patch against the latest version (=v1.87+) - Thx!
elameno (reporter)
2010-01-20 18:33

Okay...I've made the changes from the [^] repo and have uploaded the diff.

I haven't been able to do extensive testing against this, but I think it will get you the majority of the way there (if not all the way).
elameno (reporter)
2010-02-17 16:39

I had a bug with a mismatch on the column headers and fields that were being returned by the sGetResults web service call. I've fixed that and the patch is in getResults_ColumnFix.diff.
elameno (reporter)
2010-02-18 17:06

Well, I found yet another problem with my 1.87 patch. I had forgotten to import some changes from that 1.86 fix I had put together. The prior patches will disregard the fromRecord and toRecord inputs. I've verified that the patch I'm sending in now works with the export page from the UI and the web service calls. The new file is getResults3.diff. My fingers are crossed that this will give you a good idea of what I'm trying to accomplish. Any suggestions are welcome.

The behavior for the sGetResults web service call is that it will return the header line on every call and, if there are results to return within the to and from range, it will tack on the results. This way you can tell if you've reached the end of the results by checking if there are lines after the header.

The changes to the exportresults.php and the new files are described as follows:
- exportresults.php is now just the mark-up to generate the web interface.
- exportresults_common.php is the routines that create the output for the export.
- exportresults_lsrc.php is a file that the lsrc.server.php sGetResults function calls into to do some additional setup (I suppose this could be moved into lsrc.helper.php?)

All other changes are relatively minor (web service plumbing and whatnot).
c_schmitz (administrator)
2010-03-15 17:43

Elameno, that is a great patch. Would you be interested to join the LimeSurvey team and get direct SVN access? That way we could get your feature into Ls 1.90, too.

Let me know!
elameno (reporter)
2010-03-25 15:29

Hello c_schmitz,
   I would be happy to lend a hand and get this patch in place for a future release. This work has been done as a part of my work hours at the University and, just as an FYI, I don't think that I will have much time to offer outside of the features that we need here. If you're comfortable with that then sign me up :)

c_schmitz (administrator)
2010-10-11 17:45

Please set to resolved when implemented. Thank you!
elameno (reporter)
2011-01-14 17:01

- The core of the export results logic was reimplemented and an sGetResults feature was added to the Lime Survey Remote Control. CSV exporting is now supported via LSRC.

Issue Community Support
This issue is already marked as resolved.
If you feel that is not the case, please reopen it and explain why.
Supporters: No one explicitly supports this issue yet.
Opponents: No one explicitly opposes this issue yet.

- Issue History
Date Modified Username Field Change
2009-09-04 14:53 rakete New Issue
2009-09-04 14:56 rakete Description Updated
2009-12-03 17:18 elameno Note Added: 10423
2009-12-03 17:59 Mazi Note Added: 10425
2009-12-03 17:59 Mazi Status new => feedback
2009-12-08 15:43 elameno Note Added: 10517
2009-12-08 17:14 Mazi Status feedback => assigned
2009-12-08 17:14 Mazi Assigned To => rakete
2010-01-06 19:18 elameno File Added:
2010-01-06 19:22 elameno Note Added: 10725
2010-01-06 21:13 Mazi Note Added: 10726
2010-01-07 08:00 user372 Note Added: 10727
2010-01-20 18:31 elameno File Added: getResults.diff
2010-01-20 18:33 elameno Note Added: 10829
2010-02-17 16:38 elameno File Added: getResults_ColumnFix.diff
2010-02-17 16:39 elameno Note Added: 11118
2010-02-18 17:06 elameno Note Added: 11131
2010-02-18 17:06 elameno File Added: getResults3.diff
2010-03-13 16:13 c_schmitz Status assigned => acknowledged
2010-03-15 17:41 c_schmitz File Deleted:
2010-03-15 17:41 c_schmitz File Deleted: getResults.diff
2010-03-15 17:41 c_schmitz File Deleted: getResults_ColumnFix.diff
2010-03-15 17:43 c_schmitz Note Added: 11359
2010-03-15 17:43 c_schmitz Assigned To rakete => c_schmitz
2010-03-15 17:43 c_schmitz Status acknowledged => feedback
2010-03-25 15:29 elameno Note Added: 11507
2010-04-27 02:26 c_schmitz Assigned To c_schmitz => rakete
2010-04-27 02:26 c_schmitz Status feedback => assigned
2010-10-11 17:44 c_schmitz Assigned To rakete => elameno
2010-10-11 17:45 c_schmitz Note Added: 13075
2011-01-14 17:01 elameno Note Added: 13917
2011-01-14 17:01 elameno Status assigned => resolved
2011-01-14 17:01 elameno Fixed in Version => 1.91
2011-01-14 17:01 elameno Resolution open => fixed
2012-06-21 13:23 c_schmitz Status resolved => closed

Copyright © 2000 - 2016 MantisBT Team
Powered by Mantis Bugtracker