Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: dynamic table with vtl defined size #21

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
63 changes: 63 additions & 0 deletions sourcedocs/docs/question-bank/dynamic-table.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
# Dynamic table question

## Dynamic table with a size determined by an expression

The size of a dynamic table can be determined by a formula, for instance a VTL expression.

In this case, the `QuestionGrid` object have a `ConditionForContinuation` in the `Roster` of its `GridDimension` of "rank 1".

Example of a questionnaire containing a dynamic table question, whose size is defined by a VTL expression:

```xml
<DDIInstance>
<g:ResourcePackage>
<d:QuestionScheme>

<!-- Dynamic table question -->
<d:QuestionGrid>
<r:Agency>fr.insee</r:Agency>
<r:ID>id-dynamic-table</r:ID>
<r:Version>1</r:Version>
<!-- (...) Question grid name -->
<!-- (...) Out parameters of the question grid -->
<!-- (...) Bindings of the question grid -->
<!-- (...) Question text -->

<!-- Grid dimension of "rank 1" that defines the size of the dynamic table -->
<d:GridDimension displayCode="false" displayLabel="false" rank="1">
<d:Roster baseCodeValue="1" codeIterationValue="1">
<d:ConditionForContinuation>
<r:Command>
<r:ProgramLanguage>vtl</r:ProgramLanguage>
<!-- (...) In parameters of the expression -->
<!-- (...) Bindings of the expression -->
<r:CommandContent><!-- Expression that determines the size of the roster --></r:CommandContent>
</r:Command>
</d:ConditionForContinuation>
</d:Roster>
</d:GridDimension>

<!-- Fake grid dimension of "rank 2" (the size of a dynamic table is only defined by the "rank 1" dimension -->
<d:GridDimension displayCode="false" displayLabel="false" rank="2">
<d:CodeDomain>
<r:CodeListReference>
<r:Agency>fr.insee</r:Agency>
<r:ID>id-dynamic-table-secondDimension-fakeCL-1</r:ID>
<r:Version>1</r:Version>
<r:TypeOfObject>CodeList</r:TypeOfObject>
</r:CodeListReference>
</d:CodeDomain>
</d:GridDimension>

<d:StructuredMixedGridResponseDomain>
<d:GridResponseDomainInMixed>
<!-- Response domains and grid attachments of the question grid -->
</d:GridResponseDomainInMixed>
</d:StructuredMixedGridResponseDomain>

</d:QuestionGrid>

</d:QuestionScheme>
</g:ResourcePackage>
</DDIInstance>
```