Indeed, knee may convey a connotation of tiredness, submission or defeat, not what we are looking for.
Am I correct to believe that "on a knee" means that you had to do something quickly because there was no time, like a hunter who shoots kneeling because they need to do it fast, without the time to find a proper support for the rifle? Of course the result would be less precise (see brief description here) than e.g. leaning the rifle on a tree, being prone, or prone with a bipod, etc.
The connotation here is the time constraint.
In that case, a close equivalent (meaning and connotation) would be in a pinch:
pinch: An emergency situation: This coat will do in a pinch. (American Heritage)
So for the hunter:
In a pinch, use the kneeling position for shooting.
Hence your sentence:
There are lots of bugs in this application! They wrote it in a pinch, they did not even have time enough to perform unit testing...
And the student who had not done her/his homework the day before, did it in a pinch (and thereforeprobably not terribly well!).