У меня проблема с моими JSON страницами.
Для каждой страницы у меня будут одинаковые JSON вопросы, но в моем случае, когда я изменяю первую страницу, все страницы принимают одинаковое значение первой страницы.
Как я могу создать массив для этого или других решений или предложений, если это возможно, и onComplete берет результаты первой страницы без других страниц?
<div >
{ posts.slice(indexFirstPost, indexLastPost).map((threat,index) => {
return (
<div className="card bg-light col-lg-3 mr-3" key={threat.ID_THREAT}>
<div >
<p } gutterBottom variant="h6" component="h7">
<h2 class="threatcolor">
<b > Threat :
</b> {threat.THREAT_CATA} - {threat.THREAT_DESCP}
<b > Asset : </b> {threat.THREAT_CATEG}</h2>
</p>
<Survey.Survey
id={"survey"}
onComplete={this.onComplete}
showNavigationButtons={this.showNavigationButtons}
onCurrentPageChanged={this.doOnCurrentPageChanged}
showCompletedPage={this.showCompletedPage}
onValueChanged={this.onValueChanged}
model={new Survey.Model(json)}
/>
</div> </div>
)} )}
</div>
и мой JSON это
json = {
elements:[
{
"type": "paneldynamic",
"name": "relatives1",
"title": "Please enter all scenario informations",
"renderMode": "progressTop",
"templateElements":[
{
//"titleLocation": "hidden",
type:"text",
placeHolder:"identify...",
title:"Scenario informations",
name:"identify",
},
{
type:"dropdown",
//"titleLocation": "hidden",
"startWithNewLine": false,
otherPlaceHolder:"1",
width:"150px",
name:"probability",
title:"probability",
defaultValue:'1',
choices:[
{
value:1,
score:1,
text:"Low",
},
{
value:2,
score:2,
text:"Significant",
},
{
value:3,
score:3,
text:"Very High",
},
{
value:4,
score:4,
text:"Almost Certain",
},
]
},
{
type:"dropdown",
//"titleLocation": "bottom",
width:"150px",
"startWithNewLine": false,
name:"thechnical",
title:"thechnical difficulty",
defaultValue:'1',
choices:[
{
value:1,
score:1,
text:"Low",
},
{
value:2,
score:2,
text:"Moderate",
},
{
value:3,
score:3,
text:"High",
},
{
value:4,
score:4,
text:"Very High",
},
]
},
{
"titleLocation": "hidden",
type:"text",
placeHolder:"access...",
title:"Access",
name:"access",
},
{
type:"dropdown",
"titleLocation": "hidden",
width:"150px",
"startWithNewLine": false,
name:"probability1",
defaultValue:'1',
title:"qst1",
choices:[
{
value:1,
score:1,
text:"Low",
},
{
value:2,
score:2,
text:"Significant",
},
{
value:3,
score:3,
text:"Very High",
},
{
value:4,
score:4,
text:"Almost Certain",
},
]
},
{
type:"dropdown",
"titleLocation": "hidden",
width:"150px",
"startWithNewLine": false,
name:"thechnical1",
title:"qst1",
defaultValue:'1',
choices:[
{
value:1,
score:1,
text:"Low",
},
{
value:2,
score:2,
text:"Moderate",
},
{
value:3,
score:3,
text:"High",
},
{
value:4,
score:4,
text:"Very High",
},
]
},
{
"titleLocation": "hidden",
placeHolder:"discover...",
type:"text",
title:"Discover",
name:"discover",
},
{
type:"dropdown",
"titleLocation": "hidden",
width:"150px",
"startWithNewLine": false,
name:"probability2",
title:"qst1",
defaultValue:'1',
choices:[
{
value:1,
score:1,
text:"Low",
},
{
value:2,
score:2,
text:"Significant",
},
{
value:3,
score:3,
text:"Very High",
},
{
value:4,
score:4,
text:"Almost Certain",
},
]
},
{
type:"dropdown",
"titleLocation": "hidden",
width:"150px",
"startWithNewLine": false,
name:"thechnical2",
title:"qst1",
defaultValue:'1',
choices:[
{
value:1,
score:1,
text:"Low",
},
{
value:2,
score:2,
text:"Moderate",
},
{
value:3,
score:3,
text:"High",
},
{
value:4,
score:4,
text:"Very High",
},
]
},
{
"titleLocation": "hidden",
type:"text",
placeHolder:"exploit...",
title:"Exploit",
name:"exploit",
},
{
type:"dropdown",
"titleLocation": "hidden",
width:"150px",
"startWithNewLine": false,
name:"probability3",
title:"qst1",
defaultValue:'1',
choices:[
{
value:1,
score:1,
text:"Low",
},
{
value:2,
score:2,
text:"Significant",
},
{
value:3,
score:3,
text:"Very High",
},
{
value:4,
score:4,
text:"Almost Certain",
}, ]
},
{
type:"dropdown",
"titleLocation": "hidden",
width:"150px",
"startWithNewLine": false,
name:"thechnical3",
title:"qst1",
defaultValue:'1',
choices:[
{
value:1,
score:1,
text:"Low",
},
{
value:2,
score:2,
text:"Moderate",
},
{
value:3,
score:3,
text:"High",
},
{
value:4,
score:4,
text:"Very High",
},
]
}
],
"panelCount": 0,
"panelAddText": "Add Scenario",
"panelRemoveText": "Remove"
},
], "showQuestionNumbers": "off",
};