.. _CONTROL Overview: #################### CONTROL Component #################### .. _synchronizeAllForms Overview: Function synchronizeAllForms ============================= .. js:autofunction:: synchronizeAllForms .. figure:: images/control/allforms1.png :width: 500px :height: 250px :scale: 85 % :alt: alternate text :align: center The block diagram of synchronizeAllForms function .. warning:: Update the schema with the latest names of the functions .. blockdiag:: :desctable: blockdiag { beginpoint [shape = beginpoint]; endpoint [shape = endpoint]; beginpoint [description = "Begin Point"]; endpoint [description = "End Point"]; A [description = "extractKoboForms()"]; B [description = "UPDATEUSERNAME()"]; C [description= "extractAllTemplates()"]; D [description = "extractMetaFiles()"]; E [description = "countDataSubmissions()"]; beginpoint -> A -> B -> C -> D -> E -> endpoint; B -> C [folded]; group { label="Control" color="#D5E8D4" A; } group control{ label="Control" color="#D5E8D4" C; D; E; } group user{ label="User managment" color="#FF9999" B; } } .. literalinclude:: ../scripts/CONTROL_library_common.js :language: js :lines: 8-37 :emphasize-lines: 18-19,21,23,25,27 :linenos: .. _countDataSubmissions Overview: Function countDataSubmissions ============================= .. js:autofunction:: countDataSubmissions .. blockdiag:: :desctable: blockdiag { beginpoint [shape = beginpoint]; beginpoint [description ="Begin Point"]; endpoint [shape = endpoint]; endpoint [description="End Point"]; input_control [shape = flowchart.input]; input_control [description = "data from Contol sheet"]; input_bsurvey [shape = flowchart.input]; input_bsurvey [description = "data from BSURVEY sheet"]; condition [shape = flowchart.condition]; condition [description ="Loop through Control Data"]; A [description ="data array from Beneficiary survey"] B [description ="data array from Partner survey"] C [description ="count BASELINE"] D [description ="count ENDLINE"] E [description ="count MIDLINE"] F [description ="save data on CONTROL sheet"] beginpoint -> input_control -> input_bsurvey -> condition -> A -> B -> C -> D -> E -> F -> endpoint; input_bsurvey ->condition [folded]; B -> C [folded] ; condition -> A [label="TRUE"] ; group general { label="General" color="#99FFFF" input_control; input_bsurvey } group general1 { label="General" color="#99FFFF" A; B; } group general2 { label="General" color="#99FFFF" F; } group control{ color="#D5E8D4" C; D; E; } } .. literalinclude:: ../scripts/CONTROL_library_common.js :language: js :lines: 46-166 :linenos: .. _calculateCleaningProgress Overview: Function calculateCleaningProgress ================================== .. js:autofunction:: calculateCleaningProgress .. blockdiag:: :desctable: blockdiag { beginpoint [shape = beginpoint]; beginpoint [description ="Begin Point"]; endpoint [shape = endpoint]; endpoint [description="End Point"]; conditionControl [shape = flowchart.condition]; conditionControl [description =" Control data > 0"]; conditionAllforms [shape = flowchart.condition]; conditionAllforms [description =" Alldata >0 "]; conditionNumber [shape = flowchart.condition]; conditionNumber [description ="number of cleaned data is changed"]; A [description ="data Control sheet"] B [description ="Benefeciary Data"] C [description ="Alldata sheet"] D [description ="% of cleaned data"] E [description ="Update Country Analysis Note "] beginpoint -> A -> conditionControl -> B -> C -> conditionAllforms -> D -> conditionNumber -> E ->endpoint; A -> conditionControl [folded]; C -> conditionAllforms [folded]; D -> conditionNumber [folded]; A -> conditionControl [label="TRUE"]; C -> conditionAllforms [label="TRUE"]; D -> conditionNumber [label="TRUE"]; group general { label="General" color="#99FFFF" A; } group general2 { label="General" color="#99FFFF" E; } } .. literalinclude:: ../scripts/CONTROL_library_common.js :language: js :lines: 177 - 268 :linenos: .. _extractKoboForms Overview: Function extractKoboForms ======================== .. js:autofunction:: extractKoboForms .. blockdiag:: :desctable: blockdiag { beginpoint [shape = beginpoint]; beginpoint [description ="Begin Point"]; endpoint [shape = endpoint]; endpoint [description="End Point"]; conditionAPI [shape = flowchart.condition]; conditionAPI [description="Template"]; conditionAPI2 [shape = flowchart.condition]; conditionAPI2[description="BSURVEY"]; A [description ="Jsondata from KOBO"] B [description ="data array [headers] from sheet"] C [description ="links json data with sheet headers"] D [description ="KOBO enketo form"] E [description ="links template and bsurvey by year"] beginpoint -> A -> B -> C -> conditionAPI -> D -> conditionAPI2 -> E -> endpoint; C -> conditionAPI [folded]; D -> conditionAPI2 [folded]; conditionAPI -> D [label="TRUE"] conditionAPI2 -> E [label="TRUE"] group general { label="General" color="#99FFFF" A; } group general2 { label="General" color="#99FFFF" D; } } .. literalinclude:: ../scripts/CONTROL_library_common.js :language: js :lines: 276-336 :emphasize-lines: 1,23,36,54 :linenos: .. _extractAllTemplates Overview: Function extractAllTemplates ============================== .. js:autofunction:: extractAllTemplates .. figure:: images/control/alltemplate.png :width: 300px :height: 250px :scale: 85 % :alt: alternate text :align: center The block diagram of ALLTEMPLATE_SUBMITED function .. literalinclude:: ../scripts/CONTROL_library_common.js :language: js :lines: 340 - 473 :linenos: .. _extractMetaFiles Overview: Function extractMetaFiles =========================== .. js:autofunction:: extractMetaFiles .. literalinclude:: ../scripts/CONTROL_library_common.js :language: js :lines: 477-518 :emphasize-lines: 3,4 :linenos: .. _openSidebar Overview: Function openSidebar ====================== .. js:autofunction:: openSidebar .. literalinclude:: ../scripts/CONTROL_library_common.js :language: js :lines: 524-526 :linenos: .. _showSidebar Overview: Function showSidebar ==================== .. js:autofunction:: showSidebar .. literalinclude:: ../scripts/CONTROL_library_common.js :language: js :lines: 532-537 :linenos: