I am having a problem trying to generate a SpeakItem at run time.
The transformer SSML input needs to be generated randomly from a list of questions so is not known when the document is rendered.
My idea was to use SetValue to update the inputPath's SSML however it does not overwrite the value set when the document is rendered.
Setting the text property works fine but the updated value is not converted to SSML.
My logic flow should be
Say and display a randomly generated question
Accept the user's answer
Say and dispay the correct/incorrect response followed by the next randomly generated question
{ "type": "APL", "version": "1.6", "onMount": [], "mainTemplate": { "parameters": [ "quiz" ], "item": { "type": "Container", "id": "topContainer", "width": "100%", "height": "100%", "items": [ { "type": "Pager", "navigation": "wrap", "id": "quizPager", "height": "100%", "width": "100%", "data": "${quiz.properties.pagerData}", "items": { "type": "Container", "direction": "row", "id": "quizPageContainer", "width": "100%", "height": "100%", "alignItems": "center", "items": [ { "type": "Text", "id": "${data.id}", "text": "${data.text}", "speech": "${data.textSpeech}", "width": "100%", "fontSize": 80, "textAlign": "center" } ] } } ] } } }
{ "quiz": { "type": "object", "properties": { "pagerData": [ { "text": "Question one", "id": "Q1", "pageText": "<speak>This is question one.</speak>" }, { "text": "Question two", "id": "Q2", "pageText": "<speak>And this is question two.</speak>" } ] }, "transformers": [ { "inputPath": "pagerData[*].pageText", "outputName": "textSpeech", "transformer": "ssmlToSpeech" } ] } }
I know this can be achieved using RenderDocument but my aim is to provide a smoother visual experience.