"inprog" typically means there's a digest in progress. Calling $scope.$apply() manually is the cause. The only time you should ever need to manually call $scope.$apply() is if it's inside some kind of async-ish call like the callback from $http or a promise.
Assigning a value to the $scope variable "active_question_counter" should automatically trigger a digest. But because you have manually triggered the digest, and within the scope of that digest you are making the change, the result is a "digest already in progress" error.
You shouldn't need to explicitly call $apply() here unless there's some weird behind-the-scenes linking going on that doesn't actively detect that something has changed. If that is the case, a hacky workaround is to wrap the $scope.$apply(...) inside a setTimeout().
I'm not really sure why executing this through angular.elment().scope() in the console works. Maybe the console is running in a separate context?