It is possible to write a Moodle block to do anything you like...
Here is the documentation for developing a new block, https://docs.moodle.org/dev/Blocks
You will need to be (or willing to learn to be) a reasonably skilled PHP developer (at least) to achieve this.