300-835 · Question #84
Refer to the exhibit. An administrator is creating a script using the Python xAPI over WebSockets(xows) library. The goal of this script is to monitor the volume of the endpoint and set the volume…
The correct answer is D. async def volume_callback(volume): if volume.Level > 60: await xows.xCommand.Audio.Volume.Set(Level=60).execute() xows.xFeedback.Event.Audio.Volume.on_changed(volume_callback). Option D is correct because in the xows library, the on_changed callback for xFeedback.Event.Audio.Volume receives a volume data object - not a raw integer - and its level property is accessed as .Level (PascalCase, as xAPI properties follow PascalCase naming conventions)…
Question
Exhibits
Options
- Aasync def volume_callback(volume): if volume > 60: await xows.xCommand.Audio.Volume.Set(Level=60).execute() xows.xFeedback.Event.Audio.Volume.on_changed(volume_callback)
- Basync def volume_callback(volume): if volume.level > 60: await xows.xCommand.Audio.Volume.Set(Level=60).execute() xows.xFeedback.Event.Audio.Volume.on_changed(volume_callback)
- Casync def volume_callback(event): if event.Level > 60: await xows.xCommand.Audio.Volume.Set(Level=60).execute() xows.xFeedback.Event.Audio.Volume.on_changed(volume_callback)
- Dasync def volume_callback(volume): if volume.Level > 60: await xows.xCommand.Audio.Volume.Set(Level=60).execute() xows.xFeedback.Event.Audio.Volume.on_changed(volume_callback)
How the community answered
(42 responses)- A5% (2)
- B7% (3)
- C14% (6)
- D74% (31)
Explanation
Option D is correct because in the xows library, the on_changed callback for xFeedback.Event.Audio.Volume receives a volume data object - not a raw integer - and its level property is accessed as .Level (PascalCase, as xAPI properties follow PascalCase naming conventions). Option D correctly names the parameter volume to reflect what's being passed, accesses volume.Level with the proper casing, and calls the Set command with the correct Level=60 keyword argument.
Why the others fail:
- A treats
volumeas a raw integer by comparingvolume > 60directly, which would raise a TypeError since it's an object. - B accesses
volume.levelwith a lowercasel- Python is case-sensitive, so this attribute lookup fails; the correct property is.Level. - C uses
event.Levelwhich is functionally valid Python, but usingeventas the parameter name is a generic/imprecise choice that Cisco's exam marks as incorrect since the callback receives a volume object, not a generic event - the exam tests knowing what the callback actually receives.
Memory tip: Think "xAPI = PascalCase Properties" - whenever you access xAPI data in Python, attribute names like Level, Mute, and InputConnector always start with a capital letter, just like the xAPI XML/JSON schema they're derived from.
Topics
Community Discussion
No community discussion yet for this question.

