I think you want to use CBCDesignLevelText or CBCDesignLevelValue. The former will return the text of the level; the latter will return the position of the level. Here's an example of each in SSI Script:
[% CBCDesignLevelText(CbcExer_Random1, 1, 1) %]
[% CBCDesignLevelValue(CbcExer_Random1, 1, 1) %]
Or how they would be used in unverified Perl:
CBCDESIGNLEVELTEXT('CbcExer_Random1', 1, 1)
CBCDESIGNLEVELVALUE('CbcExer_Random1', 1, 1)
In either case, "CbcExer" should be replaced with the exercise name and "Random1" should be replaced with the current question in the exercise.
If you tell me more about what you need this Perl code to do, I'd be happy to help you write up the code.