I think that's pretty much the stance my university takes. We are graded on two things for each assignment. 40% of the grade is how well the program works. 60% is how well we can explain the code. That solves the plagiarism problem very well. I think they almost don't care if I copy the code, because if I can explain it, I have achieved what they wanted me to achieve.