Unless I am mistaken, student "discussions" in the context of a qanda forum do not make sense. Under activity completion a course writer might infer from the settings that a student's initial reply to the question constitutes his discussion and any replies to other students would be the reply. However, the coding assumes a post without a parent to be the discussion, so in a qanda forum requiring any number of discussions would result in an invalid configuration, i.e. the condition would never be met.
Shouldn't "require discussions" be disabled if the forum type is qanda? Alternatively, the notion of a discussion in qanda forums should be adjusted so that the direct children of the initial question are regarded as discussion and replies to these are considered replies.