Page d'assistance WaihonaPedia

ExportResearchCSVMacro


Usage

  • When a user is viewing a Research page and the export button (Send the answers) is pressed, the macro {{exportResearchToCSV /}} is called by the page WaihonaCode/researchSheet
  • The macro can be also called on any wiki page that contains a 'WaihonaCode.researchClass' object 
  • This macro can be inserted from the Wysiwyg editor: Edit>Wysiwyg>Macro>Insert Macro>exportResearchToCSV

Options

  • This macro does not have any parameters in this version.

Code

You can see code page under WaihonaMacros/ExportResearchCSVMacro (this page). The following actions are performed:

  • Initially we get from the current research document, the 'WaihonaCode.researchClass' object and all the properties from the it. As we do not need all the information, some of these properties are skipped.
    • The names of the remaining properties and the other 4 meta elements are inserted in the table header's cells, forming the columns, respectively, the values of each property and the values of the metas are inserted in the table body cells on each row.  
  • Secondly, we grab all the questionnaires information from the research in order to populate the table.
    • For all the questionnaires from a research, we get the object of questionnaire class type (which is created dynamically depending on the questionnaire name/type) and a new row header is created with the names of obtained object properties. The values of the page properties are inserted in the cells of table body.
  • Finally, after the button is pressed, we enable the flag on send data (datasend variable) for the current user participating in the current research

Results

  • One CSV file is generated and available for download. This file needs to be opened using semicolon (;) as separator and UTF-8 as character set.

À propos du contenu du site Web

Toutes les informations contenues dans ce site Web sont uniquement destinées à des fins éducatives. Pour obtenir des conseils, des diagnostics et des traitements médicaux spécifiques, adressez-vous à votre médecin. L'utilisation de ce site est strictement à vos propres risques. Si vous trouvez quelque chose qui, selon vous, nécessite une correction ou une clarification, veuillez nous en faire part à l'adresse suivante : 

Envoyez un courriel : info@cdlsWorld.org