Online exams or quizzes can be created in a variety of ways, from writing your own questions to importing exam questions from a publisher.
Tips for discouraging cheating
Use an honor statement at the beginning of each test, requiring students to check "yes" or "no" that they understand the academic dishonesty policy, and they have not received assistance.
Set a time limit so the quiz or test must be completed in one sitting within the specified time-frame
Create a test bank of questions and have Moodle randomly select a set number of questions for each exam.
Randomize the order of questions
Instructions on how to create an exam in Moodle are available online.