Allow me to speculate on the pix I see above.
1) It appears the two wires (orange and black) with the screw tabs are simply going thru the battery board to an analog meter below. They are not part of the battery circuit.
2) The AA cells are wired in series to make a single 6V battery. This can be seen with the corroded metal that still remains.
2) It appears that the gray wire is used to connect the two batteries together, the AA cells and the D cell. That appears to be a common point.
If that's true, then the purple wire is the 6 volt source.
3) There is a broken gray wire between the two cells. It appears that it should be attached with the other gray wire on the AA battery terminal, but actual visual inspection should be able to prove that.
* The rest of those AA contacts look pretty bad. I would just try to find a way to insert a whole new 4xAA battery holder in there, or even AAA if space is a problem. AAA's will probably work as well but just not last as long.
What remains still has remnants of corrosive material on them, and will continue to corrode if not removed. Get rid of any corrosion, including if there is any on the D cell holder.
* From the schematic offered above, it appears that the D cell's gray wire is the + side of the battery. That means that the purple wire on the AA's is a negative.
I can't say for sure if that schematic is the right one, but if so that confirms that the gray wires are + for the AA's and - for the D cell.
Without seeing where those wires go to, there is no absolute way to know the polarity. My guess is that the schematic is right.