Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
en:create:functions [23.07.2018 21:47] – [Modify How to Display a Questionnaire Page] adminen:create:functions [19.04.2023 22:23] (current) admin
Line 5: Line 5:
 At the very end of this page will be a helpful information how the documentation of the PHP-functions can be read: [[#function_in_detail|Function in Detail]] At the very end of this page will be a helpful information how the documentation of the PHP-functions can be read: [[#function_in_detail|Function in Detail]]
  
-===== Basic fuctions for filteringquestions and text =====+===== Basic Fuctions for FilteringQuestions and Text =====
  
 See also [[filters|filter questions und filters]]. See also [[filters|filter questions und filters]].
Line 30: Line 30:
   * ''[[:en:create:functions:buttoncode|buttonCode()]]'' -- Create-HTML-Code for next/back button   * ''[[:en:create:functions:buttoncode|buttonCode()]]'' -- Create-HTML-Code for next/back button
   * ''[[:en:create:functions:buttonhide|buttonHide()]]'' -- Do not show back/next buttons at the page's bottom   * ''[[:en:create:functions:buttonhide|buttonHide()]]'' -- Do not show back/next buttons at the page's bottom
-  * ''​[[:en:create:functions:library|library()]]''​ -- Make a JavaScript or PHP library available+  * ''​[[:en:create:functions:library|library()]]''​ -- Make a JavaScript or PHP library available
   * ''[[:en:create:functions:pagecss|pageCSS()]]'' -- Add CSS instructions to a single questionnaire page   * ''[[:en:create:functions:pagecss|pageCSS()]]'' -- Add CSS instructions to a single questionnaire page
 +  * ''[[:en:create:functions:pagehead]]'' -- Store meta-information about the questionnaire page
  
 ===== Functions for Randomization ===== ===== Functions for Randomization =====
Line 42: Line 42:
   * ''[[:en:create:functions:random_p|random_p()]]'' -- Random number in correlation to likelihood   * ''[[:en:create:functions:random_p|random_p()]]'' -- Random number in correlation to likelihood
   * ''[[:en:create:functions:random_items|random_items()]]'' -- Randomly select items from a list   * ''[[:en:create:functions:random_items|random_items()]]'' -- Randomly select items from a list
 +  * ''[[:en:create:functions:randomuse]]'' -- Storing slips of paper from a random number generator
   * ''[[:en:create:functions:urndraw|urnDraw()]]'' -- Draw out from urn (random selection without replacement)   * ''[[:en:create:functions:urndraw|urnDraw()]]'' -- Draw out from urn (random selection without replacement)
   * ''[[:en:create:functions:urnputaway|urnPutAway()]]'' -- Put away the chit drawn via ''urnDraw()''   * ''[[:en:create:functions:urnputaway|urnPutAway()]]'' -- Put away the chit drawn via ''urnDraw()''
Line 47: Line 48:
  
  
-===== Advanced programming =====+===== Advanced Programming =====
  
   * ''[[:en:create:functions:registervariable|registerVariable()]]'' -- Register PHP-Variable for following sites   * ''[[:en:create:functions:registervariable|registerVariable()]]'' -- Register PHP-Variable for following sites
Line 65: Line 66:
   * ''[[:en:create:functions:serialcheck|serialCheck()]]'' -- Ask for serial number   * ''[[:en:create:functions:serialcheck|serialCheck()]]'' -- Ask for serial number
   * ''[[:en:create:functions:readget|readGET()]]'' -- Read converted variable from link   * ''[[:en:create:functions:readget|readGET()]]'' -- Read converted variable from link
-  * ''[[:en:create:functions:readapi|readAPI()]]'' -- Access a third parties API+  * ''[[:en:create:functions:sendjson|sendJSON()]]'' -- Send HTTP request in JSON format (REST API
 +  * ''[[:en:create:functions:sendjson|sendPOST()]]'' -- Send HTTP request in POST format (REST API) 
 +  * ''[[:en:create:functions:sendjson|sendXML()]]'' -- Send HTTP request in XML format (REST API)
   * ''[[:en:create:functions:getanswermissing|getAnswerMissing()]]'' -- Information for site repeat if questions was obligated   * ''[[:en:create:functions:getanswermissing|getAnswerMissing()]]'' -- Information for site repeat if questions was obligated
   * ''[[:en:create:functions:listfails|listFails()]]'' -- List of not responded obligation questions   * ''[[:en:create:functions:listfails|listFails()]]'' -- List of not responded obligation questions
Line 75: Line 78:
   * ''[[:en:create:functions:getlanguage|getLanguage()]]'' -- Determine language   * ''[[:en:create:functions:getlanguage|getLanguage()]]'' -- Determine language
   * ''[[:en:create:functions:setlanguage|setLanguage()]]'' -- Change language   * ''[[:en:create:functions:setlanguage|setLanguage()]]'' -- Change language
 +
 +
 +===== Coordination of Several Questionnaires ======
 +
 +  * ''[[:en:create:functions:gotoquestionnaire]]'' -- Jump from one Questionaire to the next (once)
 +  * ''[[:en:create:functions:gotoparent]]'' -- Go back to the formerly Questionaire
 +  * ''[[:en:create:functions:multileveldown]]'' -- Start a sub-questionaire inside the main questionaire (if necessary also several times)
 +  * ''[[:en:create:functions:multileveldata]]'' -- Get data specified in ''multiLevelDown()''
 +  * ''[[:en:create:functions:multilevelreturn]]'' -- Return from the sub-questionnaire to the main questionnaire  
 +  * ''[[:en:create:functions:multilevelresponse]]'' -- Get data specified in ''multiLevelReturn()'' 
 +  * ''[[:en:create:functions:multilevelput]]'' -- Write a value directly into the higher-level record
 +  * ''[[:en:create:functions:multilevelurl]]'' -- Create a URL for a sub-questionnaire to be used later
 +
  
 ===== Databank for Contents ===== ===== Databank for Contents =====
Line 80: Line 96:
   * ''[[:en:create:functions:dbget|dbGet()]]'' -- Read data from date base   * ''[[:en:create:functions:dbget|dbGet()]]'' -- Read data from date base
   * ''[[:en:create:functions:dbkeys|dbKeys()]]'' -- List key for data base   * ''[[:en:create:functions:dbkeys|dbKeys()]]'' -- List key for data base
 +  * ''[[:en:create:functions:dbload|dbLoad()]]'' -- Call all entries with defined prefix from the contents database 
   * ''[[:en:create:functions:dbset|dbSet()]]'' -- Safe data in data base   * ''[[:en:create:functions:dbset|dbSet()]]'' -- Safe data in data base
   * ''[[:en:create:functions:dbtouch|dbTouch()]]'' -- Refresh time-stamp for data base entry   * ''[[:en:create:functions:dbtouch|dbTouch()]]'' -- Refresh time-stamp for data base entry
  
 +
 +=====Record Control =====
 +
 +  * ''[[:en:create:functions:dropvalue]]'' -- Delete a single variable from the current interview
 +  * ''[[:en:create:functions:dropcase]]'' -- Mark the current interview for deletion
 +  * ''[[:en:create:functions:drophistory]]'' -- Delete the page history of the current interview
  
 ===== Analysis of all data ===== ===== Analysis of all data =====
Line 88: Line 111:
   * ''[[:en:create:functions:statistic|statistic()]]'' -- Simple statistical analysis of all data   * ''[[:en:create:functions:statistic|statistic()]]'' -- Simple statistical analysis of all data
   * ''[[:en:create:functions:diagram|diagram()]]'' -- Simple diagram (e. g. frequency) for all analyzed data   * ''[[:en:create:functions:diagram|diagram()]]'' -- Simple diagram (e. g. frequency) for all analyzed data
 +
  
 ===== Analyses and Data Handling During an Interview ===== ===== Analyses and Data Handling During an Interview =====
Line 94: Line 118:
   * ''[[:en:create:functions:answersoption|answersOption()]]'' -- Adjust display of answers via ''answers()'' or ''answersPrint()''   * ''[[:en:create:functions:answersoption|answersOption()]]'' -- Adjust display of answers via ''answers()'' or ''answersPrint()''
   * ''[[:en:create:functions:answersprint|answersPrint()]]'' -- Display all questions of a questionnaire segment including the respondent's answers   * ''[[:en:create:functions:answersprint|answersPrint()]]'' -- Display all questions of a questionnaire segment including the respondent's answers
 +  * ''[[:en:create:functions:info]]'' -- Meta informationen about the current interview case or the display mode
   * ''[[:en:create:functions:valuesum|valueSum()]]'' -- Compute sum over scale or variables   * ''[[:en:create:functions:valuesum|valueSum()]]'' -- Compute sum over scale or variables
   * ''[[:en:create:functions:valuemean|valueMean()]]'' -- Compute mean over scale or variable   * ''[[:en:create:functions:valuemean|valueMean()]]'' -- Compute mean over scale or variable
Line 103: Line 128:
  
   * ''[[:en:create:functions:diagram2|diagram2()]]'' -- Create diagram with set data   * ''[[:en:create:functions:diagram2|diagram2()]]'' -- Create diagram with set data
 +  * ''[[:en:create:functions:getqrcodeimage|getQRCodeImage()]]'' -- Integrate QR Code in the questionnaire
   * ''[[:en:create:functions:imagepng_embed|imagepng_embed()]]'' -- Include a PNG graphic without storing it to a file   * ''[[:en:create:functions:imagepng_embed|imagepng_embed()]]'' -- Include a PNG graphic without storing it to a file
  
 ===== Respondent and Mailing Management ===== ===== Respondent and Mailing Management =====
  
-  * ''[[:en:create:functions:mailresume|mailResume()]]'' -- Resume an interview after a given delay +  * ''[[:en:create:functions:mailresume]]'' -- Resume an interview after a given delay 
-  * ''[[:en:create:functions:mailschedule|mailSchedule()]]'' -- Schedule to send a mailing to a single recipient +  * ''[[:en:create:functions:mailschedule]]'' -- Schedule to send a mailing to a single recipient 
-  * ''[[:en:create:functions:mailrevoke|mailRevoke()]]'' -- Cancel a scheduled mailing +  * ''[[:en:create:functions:mailrevoke]]'' -- Cancel a scheduled mailing 
-  * ''[[:en:create:functions:paneldata|panelData()]]'' -- Resolve information on the address record+  * ''[[:en:create:functions:paneldata]]'' -- Resolve information on the address record
  
 ===== PHP-internal functions ===== ===== PHP-internal functions =====
Line 201: Line 227:
     * [[http://php.net/manual/en/function.md5.php|md5]] - Compute MD5-hash      * [[http://php.net/manual/en/function.md5.php|md5]] - Compute MD5-hash 
  
-===== Detailed functions =====+ 
 +===== Restricted Functions ===== 
 + 
 +Some functions pose a security risk or do not work as expected in the context of the questionnaire. Alternatives are listed below. If you need additional features, please let SoSci Survey know. 
 + 
 +  * ''echo'' 
 +    * ''[[:en:create:functions:html]]'' 
 +    * ''[[:en:create:functions:text]]'' 
 +  * ''mysqld_query()'' 
 +    * ''[[:en:create:databank]]'' 
 +    * ''[[:en:create:functions::datasetretrieve|datasetRetrieve()]]'' 
 + 
 + 
 +===== Detailed Functions =====
  
 Reference-syntax for each function, e.g.: Reference-syntax for each function, e.g.:
en/create/functions.1532375240.txt.gz · Last modified: 23.07.2018 21:47 by admin
 
Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Share Alike 4.0 International
Driven by DokuWiki