Commit graph

101 commits

Author SHA1 Message Date
Colin Kuskie
be37f12ab1 Clone stopped working in several tests in 5.14.2. Remove it in favor of Storable::dclone.
Clone handles being passed scalar data, but dclone does not.
2012-10-23 10:00:53 -07:00
Colin Kuskie
200494b28d Fix an edge case where invalid JSON is written the database. Fixes bug #12303. 2011-11-20 22:24:14 -08:00
Patrick Donelan
280e902c09 Fixes to Survey reporting and performance improvements
Fix: Survey export simple/transposed results to csv or tab
Fix: loadTempReportTable handling of revisionDates (and documentation)
Fix: returnResponseForReporting handling of mc questions
NYTProf performance improvements
Added some very basic Survey reporting tests
2009-08-23 05:15:32 +00:00
Patrick Donelan
2cc10d2953 Survey JSON performance warning for non-wre-standard JSON modules/versions
If you have funny combinations of JSON, JSON::XS and JSON::PP installed,
JSON can start deciding to use JSON::PP instead of JSON::XS, which equals
bad performance on very large Survey instances.

This commit adds a new warning to the Edit Survey page if JSON->backend
is detected to be something other than JSON::XS.
2009-08-09 06:25:49 +00:00
Patrick Donelan
84d8b24cec Add missing POD to SurveyJSON
Also fix a bug I noticed while updating POD - when removing a
multiple-choice bundle the question should have its questionType
set to the generic "Multiple Choice' question type rather than
leaving it set to the now-deleted bundle questionType.
2009-07-12 03:28:54 +00:00
Patrick Donelan
b5186bfbab fixed #10565: Survey: add question doing double-create 2009-06-22 07:08:08 +00:00
Patrick Donelan
cbc308c55a SurveyJSON size reduction/optimization
SurveyJSON was storing a lot of redundant information (every setting on
every single section/question/answer, which, in most cases, will simply
take on the default values). This was bloating the surveyJSON property in
the db, and equally as importantly, slowing down Survey because it had to
do a lot of JSON parsing on the serialised surveyJSON object.

We now factor out and store the current section/question/answer defaults
along with the surveyJSON data itself, which means that we only needs to
store properties that differ from the defaults. This results is a massive
reduction in the size of the serialized surveyJSON stored in the database,
as well as a speed-up in json parsing time.

The compression/uncompression happens transparently to the rest of Survey.
2009-06-19 08:07:18 +00:00
Graham Knop
66843db604 string evals are evil 2009-05-29 21:41:52 +00:00
Patrick Donelan
3a25e806c6 Survey bug fixes
Fixed bugs in the handling of logical sections,
creating of responses and counting of responses.
Added in a bunch of new tests.
Jslinting of all survye js files
2009-05-23 09:54:03 +00:00
Patrick Donelan
59329e9718 Survey tweaks
Added Survey 'Tagged' question type, which builds its answers dynamically from tagged data
Made Survey test suite more forgiving about JSON parsing
2009-05-19 02:45:45 +00:00
Patrick Donelan
4d181da7f9 SurveyJSON bug fixes
Fixed bug in SurveyJSON::update to stop it updating questionType when not asked
Fixed unsafe reference bug in SurveyJSON::getMultipleChoiceBundle
Added more Survey Test Suite tests
2009-05-16 07:24:55 +00:00
Colin Kuskie
edb842e7ae Fix a POD whitespace problem in SurveyJSON. 2009-05-13 02:28:08 +00:00
Patrick Donelan
5f80ac35f6 Fixed Survey "copy" button on Edit Survey page 2009-05-11 05:20:27 +00:00
Patrick Donelan
5d6b4093be Survey Expression Engine validation++
Survey Expression Engine now detects invalid variable names passed to value(), score(), etc..
Also now detects situations where you have jump targets/expressions defined at multiple levels - thus causing precedence rules to kick in (normally this indicates a mistake)
Fixed Survey edit page bug where TextEditor would not move after gotoExpression textarea resize caused items to move
2009-05-10 07:45:14 +00:00
Patrick Donelan
494efe1cf1 Added Country question type to Survey
Refactored WebGUI::Form::Country so that it can be used to return a list of countries
2009-05-06 02:38:26 +00:00
Kaleb Murphy
54063ae9f6 Survey sections now have logical section type, which is never shown to the user, only used for silently checking gotos. 2009-04-30 20:43:23 +00:00
Kaleb Murphy
a0d41dc5ae Survey slider answer updates, now update all the answers for max,min,step settings since only the first answers values are used anyways. 2009-04-23 19:33:10 +00:00
Patrick Donelan
6c58e1de81 Added Survey meta-targets NEXT_SECTION and END_SURVEY to allow for more
convenient jumping
Improved processGotoExpression tests
2009-04-22 07:19:23 +00:00
Patrick Donelan
99855719d0 Survey bug fixes: Verbatim responses now properly recorded
Added useText option to responseValuesByVariableName so that it can be
used for both branch expressions and [[var]] text substitution correctly
Added extra verbatim handling to [[var]] text substitution
All survey test now pass, except for one involving True/False
multi-chocie bundle, soon to be fixed by updating bundle
2009-04-22 05:16:29 +00:00
Kaleb Murphy
caffe2751a Preliminary check in for new Survey text number type and validation. 2009-04-17 17:08:42 +00:00
Kaleb Murphy
234914c3e2 Survey drag-and-drop now returns the edit box for the item just drug. 2009-04-10 20:03:29 +00:00
Kaleb Murphy
8cd5588f10 Survey [[question variable]] now returns the shown answer text for multiple choice questions, and the recorded value for non-multiple choice questions. 2009-04-10 17:46:17 +00:00
Kaleb Murphy
99a1418714 Default Survey Question settings now save 100% of the answer configuration data. This will not affect previous Surveys, but allow new defaults to be more complex if desired. 2009-04-10 16:06:20 +00:00
Patrick Donelan
f714f212af Added new Survey validation check - jump expressions defined when
enableSurveyExpressionEngine disabled site-wide
2009-04-09 07:58:01 +00:00
Patrick Donelan
571ca5db06 Fixed small bug in Survey validation where invalid branch expressions
wouldn't be shown
Improved and i18n'ed Survey validation warning container
2009-04-09 07:57:37 +00:00
Patrick Donelan
9ea4f1cd20 Replaced Survey parseGotoExpression with dedicated ExpressionEngine.
Improved gotoExpression validation error reporting
Added lots more tests
2009-04-08 08:12:14 +00:00
Patrick Donelan
c1b18ea9bb Some fixes to the way Survey handles recordedAnswer, value, etc.. 2009-04-07 07:15:33 +00:00
Patrick Donelan
c1ac5b9761 Fixed SurveyJSON->questions which was short-changing getGotoTargets 2009-04-02 05:55:23 +00:00
Patrick Donelan
57dae409c7 Further improved Survey validation checking 2009-04-02 05:55:00 +00:00
Patrick Donelan
be4133d72c Improved Survey validation messages 2009-04-02 05:04:23 +00:00
Kaleb Murphy
1ad5303267 Validates goto syntax on all objects now. 2009-03-31 05:00:22 +00:00
Kaleb Murphy
e515817053 Added limited goto expression syntax validator. Needs to do a bit more. 2009-03-31 04:58:00 +00:00
Kaleb Murphy
272283e75d Adding template and js to show warnings. 2009-03-31 04:39:48 +00:00
Kaleb Murphy
e73a7645a7 Survey now shows warnings if bad goto, bad gotoExpressions, no question text, survey looping,
or no question answers are found.
2009-03-31 04:08:44 +00:00
Colin Kuskie
4e2a8bab91 Bump up the version for Clone, since the new version works with
perl 5.10.
Have SurveyJSON use it instead of dclone.
2009-03-30 19:47:27 +00:00
Kaleb Murphy
046dae4f31 Moved multiple choice questions to the data base, and they can now be edited globally from the Survey edito 2009-03-26 21:02:30 +00:00
Kaleb Murphy
cafd31f87a New Question type. Just a Month-Year type with a month drop down and a 4 digit year text box. 2009-03-22 18:18:38 +00:00
Patrick Donelan
7ec5cab126 Merge branch 'master' into survey
* master: (121 commits)
  Fix a POD typo.
  correct inbox message from user preface
  Fix a typo in the Default gallery view template
  Documentation bug in buildArrayRefOfHashRefs
  changed screenshots in Matrix Listing view to popup
  matrix privileging fixes
  Fix an i18n typo in the Post user defined variables.
  Remove debugging code.
  approval workflow fix
  matrix upgrade and privileging fixes
  fixed: Template parser cannot be set
  forward porting gallery bug fixes
  preparing for 7.7.0 dev
  parser should be a selectbox, not a selectlist.
  labeling survey as beta
  fixeding my borkes to the changelog
  fixed #9852: Users can accept private messages from Visitor, but Visitor cannot send messages
  preparing for 7.6.14 release
  fix AdSpace, Ad tests
  Restore the original properties for the profile category that was modified for test.
  ...

Conflicts:
	docs/gotcha.txt
	docs/upgrades/upgrade_7.6.10-7.6.11.pl
	lib/WebGUI/Asset/Wobject/Survey.pm
	lib/WebGUI/Asset/Wobject/Survey/SurveyJSON.pm
2009-03-11 15:26:07 +11:00
Kaleb Murphy
0db9be4512 Added goto to sections and questions. Order of precedence is answer, question, then section. 2009-03-09 17:23:06 +00:00
Colin Kuskie
67f3f98731 Fix a Survey typo in the name of a political party. 2009-02-26 18:05:22 +00:00
Graham Knop
24da723629 updating copyright year 2009-02-20 23:47:30 +00:00
Patrick Donelan
50091e8e3a Started working on Survey Multiple Choice bundle management. 2009-02-16 00:13:58 +00:00
Kaleb Murphy
a350398f41 Logic is corrected, but the JS should probably be rewritten to be more like the WG PageLayout drag and drop so that it isn't so finicky. 2009-02-13 18:28:52 +00:00
Patrick Donelan
d882181fd1 Started refactoring the Survey.pm Wobject class
Refactored www_jumpTo and added tests
Added Params::Validate
Improved docs
Made call to SurveyJSON->createSurveyOrder() unnecessary
Turned ResponseJSON->nextResponse a mutator
2009-02-11 09:25:42 +00:00
Patrick Donelan
b0c5c09461 Merge branch 'master' into survey
* master: (127 commits)
  Prefill in the email address in the ITransact credentials form from the user's Shop address.
  fixed Matrix best/worst rated lists
  Fix bad form variable for phone number in EMS Badge address info.
  - Added a switch to allow the use of non-WebGUI objects with the Workflow
  fixing a problem with previous survey fix
  fixed #9671: Survey - breaks admin bar
  fixed a Matrix sql problem
  i18n the image labels and title for the asset manager, manage screen.
  Prevent an imported package from changing the a current asset's status from pending to anything else.
  Remove trailing comma in Shop/Transaction JS so IE6 works.
  fixed documentation
  fixed a bug when a matrix listing didn't have a forum attached
  small char encoding fix to merged upgrade
  fix small issue in addChild
  adding merge point
  Fix a problem with purging an EMS.
  Update this template so that it passes the template i18n test.
  Fix a broken i18n label in answer edit template for the Survey.
  Unify all Survey CSS into 1 file, and use it.
  Adding/fixing Survey i18n and Help
  ...

Conflicts:
	lib/WebGUI/Asset/Wobject/Survey.pm
	lib/WebGUI/Asset/Wobject/Survey/ResponseJSON.pm
	lib/WebGUI/i18n/English/Asset_Survey.pm
	www/extras/wobject/Survey/editsurvey/object.js
2009-02-10 07:57:42 +00:00
Patrick Donelan
fa6976fb40 More ResponseJSON refactoring.
Finished refactoring nextQuestions()
Added recordedResponses sub
Added getTemplatedText sub
Added sectionId, questionId, answerId, sIndex, qIndex, aIndexes
abstraction subs
2009-02-06 05:15:26 +00:00
Patrick Donelan
932a033b58 More ResponseJSON refactoring
Removed unnecessary $session argument from recordResponses
Refactored nextQuestions to return a list rather than an arrayref
Lots more documentation for ResponseJSON
More param validation for ResponseJSON
Refactored recordResponses
Updated tests
2009-02-06 01:55:56 +00:00
Patrick Donelan
6fb325699f Refactored createSurveyOrder in ResponseJSON
Added lastSectionIndex, lastQuestionIndex, lastAswerIndex convenience
methods to SurveyJSON to simplify iterations over Sections, Questions
and Answers
2009-02-04 00:16:26 +00:00
Patrick Donelan
66a2adcbe5 Moved ResponseJSON data hash to private variable, for security and
consistency with SurveyJSON

Added some more accessors/mutators, and param validation
2009-02-03 08:32:40 +00:00
Patrick Donelan
57fb3cb238 Refactored SurveyJSON for perlcritic compliance.
Simplified some code, refactored out some C-isms.
2009-02-03 08:32:06 +00:00