In principle, it cannot be done. Imagine two situations, one test out of $50$, the other out of $100$.
Case A: You got $50$ on the first test, $25$ on the second. Then the total score is $75$ out of $125$.
Case B: You got $25$ on the first, and $50$ on the second. Again the total score is $75$ out of $125$.
Now let us in each case do your "$25\%$" calculation. On A, you get $25$ on the first, $6.75$ on the second, total $31.75$.
On B, you get $12.5$ on each, total $25$.
Note that on each of scenarios A and B, total achievable scores were the same, and total actual scores were the same. But the "$25\%$" calculations yielded quite different numbers. So we cannot recover the "$25\%$" result just from total score achievable and total score achieved.