I don't like that someone copy my code for his/her assignment.
Is there any license that prohibit copying the code for assignment?
This question seems to conflate plagiarism with the overlapping but distinct concept of copyright infringement. Briefly:
- plagiarism is the act of presenting someone else's knowledge work as one's own;
- copyright infringement is the act of making unlicensed copies of a given knowledge work, in breach of copyright law.
A given act can be plagiarism, copyright infringement, both, or neither. Here is a Venn diagram showing the intersection between the two concepts:
/ \/ \
/ /\ \
/ / \ \
/ / \ \
| Plagiarism | Both | Copyright |
\ \ / infringement /
\ \ / /
\ \/ /
\ /\ /
For your purposes, preventing plagiarism is all that you need. For the sake of a complete answer, however, I will also discuss the prevention of copyright infringement. This will allow you to take a "belt and braces" approach.
As apsillers already indicated, any reputable educational institution will have policies against plagiarism and will enforce those policies. Any student who cheats by submitting your work as though it were their own should be caught and punished (e.g. by having their grade for that assignment reduced to zero).
In other words, preventing students from committing plagiarism in their assignments is a responsibility that rests with the students and the school, not with you.
Preventing copyright infringement
In most countries, copyright exists in any sufficiently original work that has been placed into a fixed form (e.g. written down). By default, this legally bars people other than the copyright holder (e.g. the author, or the entity that commissioned the work) from copying or adapting that work for any purpose except for the very limited purposes of "fair use" or "fair dealing".
In order to give people greater access to (copies of) that work, the copyright holder must typically license the work in some way.
Proprietary software licenses
With proprietary software, this is done with a EULA, which typically grants very limited rights to the licensee, such as the right to perform (run) the work, for some limited purposes. I personally would not recommend the use of such a license in general, and especially not in your case, as its restrictions would be excessive. Many free software licenses (see below for examples) would meet your needs just as well, and would be more beneficial to the community.
For a student to submit proprietary software as though it were their own would typically be an act of plagiarism and of copyright infringement.
Free software licenses
With free (libre) software, this is done with a license that upholds the Four Freedoms:
- Freedom 0: The freedom to run the program for any purpose.
- Freedom 1: The freedom to study how the program works, and change it to make it do what you wish.
- Freedom 2: The freedom to redistribute and make copies so you can help your neighbour.
- Freedom 3: The freedom to improve the program, and release your improvements (and modified versions in general) to the public, so that the whole community benefits.
None of these freedoms allows a recipient to claim authorship or copyright in the original work. As such, most popular free software licenses (e.g. the AGPLv3, the GPLv3, the ALv2, the 2-, 3-, and 4-clause BSD licences, or the MIT License) are suitable for satisfying a copyright holder's wish that a recipient should not be able to claim authorship or copyright of the work. I would suggest you use one of these licenses: preferably one of the first three, as they are the ones that best account for edge cases.
For a student to submit free software (i.e. software provided to them under such a license) as though it were their own would typically be an act of plagiarism and of copyright infringement.
Public domain: a special case of freedom
The most permissive possible license is a public domain dedication. This waives the right of the author or copyright holder to the fullest extent permitted by law. In the context of software, you could view this as meaning that arbitrary additional freedoms are granted in addition to the Four Freedoms above, i.e. as a very permissive form of free software licensing.
This is still quite rare, but you can do it if you want to, e.g. by applying the CC0 license.
For a student to submit a public domain work as though it were their own would typically be an act of plagiarism, but not of copyright infringement.
A note about GitHub
When publishing code to GitHub, you grant GitHub a license to use that code in certain ways. This license exists in addition to any other license (e.g. the GPLv3) that you might have applied to the work, and has been the subject of debate in the free software community.
For example, if you publish your work to GitHub, other GitHub users are in turn licensed to fork that work on GitHub's website, regardless of any other copyright restrictions on the work.
This is unlikely to affect your concern about plagiarism, for the reasons given earlier. Even so, as you stated you hope to publish to GitHub and expressed concerns about copying of your work, it seemed appropriate to mention it.