Most law students spend their time writing case studies of hypothetical legal problems. But an assignment at the University of Pennsylvania Law School was a little more practical - helping to draft the world's first modern Islamic criminal code for a sovereign nation in the midst of sweeping democratic reforms.
The school faculty includes Paul Robinson, a former member of the US Sentencing Commission and an expert in criminal law who consults for various US states.
When the United Nations asked him to help draft a new criminal code for the Maldive Islands, he said he had thought his students would find it "quite educational".
He recalled his own time as counsel for a Senate subcommittee planning a US federal criminal code as "the single most educational experience I've had outside law school".
"I have frequently thought back on that experience and how that might translate into a law school opportunity," he said.
When he offered his students the chance to work with him on what has since become known as the Maldivian project, Professor Robinson got 50 applications for the 12 places in the class.
The students "have an energy level that is unbelievable", Professor Robinson said. "They are devoted to the process. They are extremely smart, they're the best of the best of our students, and we have a pretty good student population generally."
He said the class acted like a law firm. "We treat it as here's a client and we're hired as experts to provide technical expertise."
But the challenge went beyond training students in advanced criminal law.
First, the class had to research existing Maldivian criminal law, which Professor Robinson said was "a bit of a trick, because they don't really have a penal code; they have scattered criminal statutes that touch on penal law".
Law in the Maldives is based on Sharia, so the students had to master that before doing anything else. A Penn professor of Islamic studies lectured on Islam and Islamic law.
"The cultural norms are quite different," Professor Robinson said. "What the Maldives will want to criminalise and the ranking of the seriousness of offences will be different in many ways (from the US system). They criminalise adultery, for example, whereas most American jurisdictions have dropped it."
There are also "gender differences" over issues such as bigamy and rules on whether a wife must consent to her husband's marriage to another woman.
"Some of these provisions have symbolic religious significance more than practical importance," Professor Robinson said. "I've never actually heard of anybody who has more than one wife, though it may well be that there are some somewhere."
Some students have travelled to the Maldives to present their work to an advisory committee there. The proposed criminal code is still subject to Maldivian parliamentary approval.