Home > database > ensemble_form_report.m

ensemble_form_report

PURPOSE ^

Prints out a report of forms and questions used in an experiment

SYNOPSIS ^

function expDataStruct = ensemble_form_report(expDataStruct,params)

DESCRIPTION ^

 Prints out a report of forms and questions used in an experiment
 This is sort of a wrapper for ensemble_print_metadata, in that it 
 filters out the forms you want and restructures the data in the
 tree structure that ensemble_print_metadata can read

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function expDataStruct = ensemble_form_report(expDataStruct,params)
0002 % Prints out a report of forms and questions used in an experiment
0003 % This is sort of a wrapper for ensemble_print_metadata, in that it
0004 % filters out the forms you want and restructures the data in the
0005 % tree structure that ensemble_print_metadata can read
0006 %
0007 %
0008 
0009 fnames = expDataStruct.vars;
0010 if (~ismember('form',fnames))
0011   error('This data structure does not contain form data');
0012 end
0013 
0014 metaFieldConst = set_var_col_const(fnames);
0015 formDataStruct = expDataStruct.data{metaFieldConst.form};
0016 
0017 formFilter = params.filt;
0018 
0019 
0020 for(fIdx = 1:length(formDataStruct))
0021   formDataStruct{fIdx} = ensemble_filter(formDataStruct{fIdx},formFilter);
0022 end
0023 
0024 %assign filtered forms back to expDataStruct
0025 expDataStruct.data{metaFieldConst.form} = formDataStruct;
0026 
0027 
0028 expTree = ensemble_datastruct2tree(expDataStruct);
0029 
0030 
0031 printParams.report.tables.write2file = 1;
0032 printParams.report.tables.fname      = '/tmp/mymeta.csv';
0033 printParams.report.tables.columns = {{},...
0034             {'form_name'},...
0035             {'question_text','enum_values'}};
0036 ensemble_print_metadata(expTree,printParams);

Generated on Wed 20-Sep-2023 04:00:50 by m2html © 2003