exam questions

Exam AI-102 All Questions

View all questions & answers for the AI-102 exam

Exam AI-102 topic 15 question 3 discussion

Actual exam question from Microsoft's AI-102
Question #: 3
Topic #: 17
[All AI-102 Questions]

HOTSPOT -
You are developing the shopping on-the-go project.
You need to build the Adaptive Card for the chatbot.
How should you complete the code? To answer, select the appropriate options in the answer area.
NOTE: Each correct selection is worth one point.
Hot Area:

Show Suggested Answer Hide Answer
Suggested Answer:
Box 1: name.en -
Box 2: "$when": "${stockLevel != 'OK'}"
Product displays must include images and warnings when stock levels are low or out of stock.
Box 3:image.altText.en

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
halfway
Highly Voted 2 years, 3 months ago
1. name[language] 2. "$when": "${stockLevel} != 'OK'" 3. image.altText[language]
upvoted 44 times
nastolgia
3 months, 3 weeks ago
im agree with you. 1) name[language] - in task we app should support 3 languages 2) $when": "${stockLevel} != 'OK' - If item is not in the stock show 3) image.altText[language] - Show alt.text in different languages
upvoted 2 times
...
MarceloManhaes
8 months, 2 weeks ago
I ´m sure if is correct if you see the shopping on the go project requirements for chatbot that says the multi-language approach
upvoted 1 times
...
...
james2033
Highly Voted 1 year, 7 months ago
File JSON { "sku": "b1", "name": { "en": "Bicycle", "es": "Bicicleta", "pt": "Bicicleta" }, "stocklevel": "Out of Stock", "description": { "en": "Bicycle", "es": "Bicicleta", "pt": "Bicicleta" }, "image": { "uri": "https://upload.wordwideimporters.org/bicycle.jpg", "alttext": { "en": "Bicycle", "es": "Bicicleta", "pt": "Bicicleta" } }, "createdUtc": "2020-0214T06:08:39Z", "language": "en" } 1. name.en 2. "$when": "${stockLevel != 'OK'}" 3. image.altText.en
upvoted 8 times
upliftinghut
10 months, 3 weeks ago
This is correct because the structure of original requirement Json is reflected and replaced by $<parameter name>
upvoted 1 times
...
...
mrg998
Most Recent 6 months ago
Let's evaluate why the other options for answer3 are not valid: image.altText.en: This option hardcodes the language to English (en). image.altText.language: This option assumes language is a property under altText. However, language is a variable representing the selected language (e.g., en, es, pt), not a property within altText. image.altText.[“language”]: This option incorrectly uses quotation marks around language, treating it as a literal string rather than a variable. This would attempt to look for an alt text property with the name "language", which does not exist. Correct Option: image.altText.[language] Explanation: This option correctly uses the language variable to dynamically access the appropriate alt text based on the user's selected language. It ensures that the alt text is in the correct language (English, Spanish, or Portuguese) by referencing the variable directly. This fulfills the requirement for a multilingual customer experience.
upvoted 1 times
...
krzkrzkra
8 months, 1 week ago
1. name.en 2. "$when": "${stockLevel != 'OK'}" 3. image.altText.en
upvoted 1 times
...
Toby86
8 months, 1 week ago
Requirement: "Support interactions in English, Spanish, and Portuguese" If you hard set it on english, how can you satisfy this requirement? must be name[language] on top and AltText.[language] on bottom.
upvoted 2 times
...
fba825b
9 months ago
How I understood it: The description in the first table says that the app and the user input is in english => app is in english => adaptive card should be in english In addition to that, the provided JSON has a language property with value 'en'. So, my guess is: 1. name.en 2. "$when": "${stockLevel != 'OK'}" 3. image.altText.en
upvoted 2 times
...
NagaoShingo
9 months, 1 week ago
1. name.en 2. "$when": "${stockLevel != 'OK'}" 3. image.altText.en
upvoted 1 times
...
takaimomoGcup
10 months ago
Is this question still available on May 21, 2024?
upvoted 1 times
...
sl_mslconsulting
1 year, 5 months ago
You don’t want code it in a way that the code just works with en - it’s a bad coding practice.
upvoted 6 times
...
The given answers are correct. The correct answer pairs for box1 and box3 could be- name.en and image.altText.en name["language"] and image.altText["language"] since name["language"] does not exist as an option in box3, we will have to choose the first pair as the correct answer. https://www.w3schools.com/js/js_json_syntax.asp
upvoted 5 times
...
Canyu
2 years, 3 months ago
This is a repeat question, but this time the answer does not give an explanation or reference document. Is this answer correct?
upvoted 3 times
...
ParkXD
2 years, 7 months ago
it seems a repeat question, but with a slight different option. The earlier one with altText.[language], but this altText[language] without . which one is right?
upvoted 4 times
...
sdokmak
2 years, 9 months ago
If there was an option for name.[language] instead of name[language] then I'd use that for more than one language option, otherwise we can't. For name[language], language would have to be an integer but it's a string, wouldn't work. But.. for name.[language], that works. https://stackoverflow.com/questions/882727/is-there-a-way-to-use-variable-keys-in-a-javascript-object-literal
upvoted 2 times
RamonKaus
2 years, 7 months ago
This is a repeat of an earlier question but they changed the answer? Weird.
upvoted 10 times
...
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...
exam
Someone Bought Contributor Access for:
SY0-701
London, 1 minute ago