VerticalChoiceBoxConfig
This element generates a vertical block with answers.
VerticalChoiceBoxConfig also supports WriteInConfig element that allows for implementing open-ended questions.
Declaration
VerticalChoiceBoxConfig element is declared as an instance of VerticalChoiceBoxConfig
class. Reference Aspose.OMR.Generation.Config.Elements.Parents
, Aspose.OMR.Generation.Config.Elements
and Aspose.OMR.Generation.Config.Enums
namespaces to use VerticalChoiceBoxConfig
types without specifying the fully qualified namespace:
using Aspose.OMR.Generation.Config.Elements;
using Aspose.OMR.Generation.Config.Elements.Parents;
using Aspose.OMR.Generation.Config.Enums;
The question text / label is specified in the Name property.
Answers are provided as a list of AnswerConfig objects in the Children property.
new VerticalChoiceBoxConfig() {
Children = new List<BaseConfig>() {
/*
* Put one or more AnswerConfig elements here
*/
}
}
Required properties
Name | Type | Description |
---|---|---|
Children | List<BaseConfig> |
A list of AnswerConfig objects representing the answers. |
Optional properties
Name | Type | Default value | Description |
---|---|---|---|
Name | string |
n/a | Used as an element’s identifier in recognition results and as a reminder of the element’s purpose in template source; for example, "Preference" .This text is not displayed on the form. |
Threshold | int |
45 | Set the recognition accuracy for the answer bubbles, from 0 to 100. Lower values allow even the lightest marks to be recognized, but may cause dirt or paper defects to be treated as marks. Higher values require a more solid fill and may cause pencil marks or small checks to be ignored. |
TopPadding | int |
0 | The vertical spacing (in pixels) before the first AnswerConfig element. |
BubblePosition | string |
The bubble position relative to the answer text:
|
|
BubbleType | string |
The bubble design:
|
AnswerConfig element
This element declares an answer to the VerticalChoiceBoxConfig question.
AnswerConfig element is declared as an instance of AnswerConfig
class.
Each AnswerConfig element can include the following elements (as well as their combinations) in its children property:
Required properties
Name | Type | Description |
---|---|---|
children | List<BaseConfig>() |
A list of ParagraphConfig, ContentConfig, or WriteInConfig elements that form the answer text. |
Optional properties
Name | Type | Default value | Description |
---|---|---|---|
Name | string |
n/a | Used for identifying the marked answer in recognition results. |
BubblePosition | string |
auto | Override the bubble position relative to the answer text:
|
BubbleType | string |
"round" |
Override the bubble design:
|
Selectable | bool |
true | Whether to display the bubble for the answer. Setting this attribute to false removes the bubble in the generated form. This results in the answer cannot be chosen by the respondents. |
BubbleOffsetX | int |
auto | Bubble offset relative to the left (for LTR layouts) or right (for RTL layouts) of the answer element. By default, the bubble is positioned to the left (for LTR layouts) or to the right (for RTL layouts) of the answer element. |
BubbleOffsetY | int |
auto | Bubble offset, relative to the top of the answer element. By default, the bubble is centered along the cross-axis of the first line of the answer element. |
Combining with WriteInConfig elements
The AnswerConfig element may contain a WriteInConfig element to allow respondents to provide free-form answers to an open-ended question. You can add several write-in fields per VerticalChoiceBoxConfig element.
If the bubble is marked, the contents of the corresponding WriteInConfig element are saved to Images collection. It will work even if the Required
property of the WriteInConfig is set to false
.
Example
TemplateConfig templateConfig = new TemplateConfig() {
Children=new List<BaseConfig>() {
new PageConfig() {
Children = new List<BaseConfig>() {
new ContainerConfig() {
Children= new List<BaseConfig>() {
new BlockConfig() {
BorderType = BorderType.Square,
BorderSize = 5,
Children = new List<BaseConfig>() {
new ContentConfig() {
Name = "What does OMR stand for?",
FontSize = 12,
FontStyle = FontStyle.Bold
},
new VerticalChoiceBoxConfig() {
Name = "Definition",
TopPadding = 100,
Children = new List<BaseConfig>() {
new AnswerConfig() {
Name = "1",
Children = new List<BaseConfig>() {
new ContentConfig {
Name = "Optical mark recognition",
FontSize = 10,
FontStyle = FontStyle.Bold
}
}
},
new AnswerConfig() {
Name = "2",
Children = new List<BaseConfig>() {
new ContentConfig {
Name = "Optical character recognition",
FontSize = 10,
FontStyle = FontStyle.Bold
}
}
},
new AnswerConfig() {
Name = "3",
Children = new List<BaseConfig>() {
new ContentConfig {
Name = "Own answer",
FontSize = 10,
FontStyle = FontStyle.Bold
},
new WriteInConfig() {
Name = "Own answer"
}
}
}
}
}
}
}
}
}
}
}
}
};