I found a question in the Precalculus content pack in the starter bundle: clone the question "1.2.1d Try It #2" from "Assignment 1.2 Domain and Range" in lesson "Chapter 01 Functions": Here's a link to the question. (Not sure if the link will work.)
In this question, the students are asked to do precisely what you want your students to do. Edit the question and look at the grade code. A particular library from the Maple repository is used that contains a "gradeInterval()" method. Very easy to use.