Construct Moodle Computer Science Quizzes.

Posted by:

Reduce Teacher time and “dog work”. One of the most time saving, convenient and valued tools found in an educational LMS (Learning Management System) is the ability for the LMS to present a quiz, mark it automatically, record the grade automatically and give immediate feedback to the learner. This saves teachers valuable time formerly spent grading when that time is better spent preparing future learning activity. This reduces learner anxiety and renders feedback more useful because its immediacy makes it relevant. Reinforce Learning With Feedback. Moodle accepts unique feedback for every choice in a multiple choice question, converting an administrative exercise in into a constuctive learning experience. When creating a Moodle multiple choice quiz, Moodle allows the teacher to set the quiz to “adaptive mode” and give the student multiple attempts at one or more items. The teacher can also differentially weight every choice of an item. Computer Science is unique. Computer Science content has much in common but also differs significantly from content of other subjects. The common begs reinforcement; the differences beg explication. This blog addresses both generic and Computer Science specific issues arising when composing a Multiple Choice quiz using Moodle 1.9. Much that follows also applies to later versions of Moodle and other formats of questions as well. This particular blog contains technical information. It is intended to be read while actually working with Moodle’s quiz module, preferably while entering a Moodle quiz. The content of this particular blog would have saved me hours of frustration when I created my first Computer Science Moodle quiz, but it will bore to tears anyone looking for a nice, evaluative overview. On the other hand, “the devil is in the details.” Excellent documentation for Moodle’s Quiz Module is found at Moodle’s web site. See This blog elaborates upon that documentation by targeting Computer Science content in particular. When adding a new quiz to a course, the teacher is first asked to make a number of decisions. I will give a brief explanation of each set of decisions and then a screen shot from Moodle’s administration section for creating and editing quizzes.  

Timing Options

  Teachers may determine both the timing and duration of a quiz. In “adaptive mode” students may be allowed multiple attempts with each question with feedback after each attempt, but the teacher may also enforce the traditional single attempt per question.  

Display Options

  Here you set the defaults for the number of questions per ‘page” and whether to shuffle the questions and/or the response choices given to the student. Shuffling questions and/or response choices within a question makes it more difficult for students to communicate information concerning the quiz.

Moodle Quiz Display Options


Attempts Options

  Here we see an expression of the Moodle “social constructionist” philosophy of education. The teacher may allow multiple attempts to do the entire quiz. The teacher may also use the “Adaptive Mode” to allow multiple attempts at each question, which is different from multiple attempts at the entire quiz.

Moodle Quiiz Attempts Options

Moodle Quiiz Attempts Options


Grades Options

  The teacher has a choice of recording only the first attempt, last attempt, highest grade or average grade. If there are four response choices to a specific question, Moodle allows the teacher to assign a separate weighted mark for each response on the assumption that more than one response deserves some percentage of the full credit for that particular question. Each response may be worth anywhere from zero per cent to 100 per cent.

Moodle Quiz Grades Options

Moodle Quiz Grades Option


Review Options

  Moodle makes it possible to give different types of feedback immediately after an attempt, later while the quis is still open, and/or after the quiz is closed. These decisions by the teacher will depend, in part, upon the extent for which the quiz is used for learning versus evaluation.

Moodle Quiz Review Options

Moodle Quiz Review Options


Security Options

  There are excellent security precautions that Moodle allows teachers to take. The student may be forced to launch the quiz in new browser window. The student may be required to provide a password just that quiz. The teacher can restrict a Moodle quiz to only computers with specific IP addresses.

Moodle Quiz Security Options

Moodle Quiz Security Options


Common Module Options

  If students have been grouped, then the highest score afor the group will be displayed in the Quiz Results block. A teacher may choose to show or hide the quiz from students.

Moodle Quiz Common Module Options

Moodle Quiz Common Module Options


Overall Feedback Options

  The teacher may give varying feedback to students, depending on the range within which their grade falls on the quiz.

Moodle Quiz Overall Feedback Options

Moodle Quiz Overall Feedback Options

Once decisions have been recorded for the foregoing options, the actual items and foils for the quiz may be built. The Quiz module of Moodle 1.9 and earlier has been criticized as being difficult to work with. I can see where that criticism comes from, but the fact that the Quiz module allows use of HTML means that a designer can render the presentation of questions and choices in a clear and readable format. The ability to use HTML means that text can be emphasized and shaped as wished by the designer with a rudimentary knowledge of HTML. I will give you that rudimentary knowledge in this blog. HTML continues to be a valued tool of the trade – the trade of presenting material on a web page in an accurate and readable format! Discussing HTML codes that correctly render programming source code in quizzes presented in Moodle 1.9 is pedantic but necessary knowledge for rendering that code in a industry preferred format.

  1. I use two monitors when making a quiz in Moodle. On the left monitor I work with Moodle in a browser. On the right monitor I have the source text of the questions, usually in WORD, and a text editor. The Moodle 1.9 Multiple Choice interface only presents a small window for each choice. The window is too small to see all of the text in context at once. I frequently copy a published question and its choices from WORD to my text editor where I massage the question and relevant choices with HTML tags before copying the reworked choices into their respective Moodle choice text windows.
  2. Place items in a “category” named to identify the topic that the quiz will examine; for example: “Quiz 3 – Introduction to Classes & Objects”.
  3. generic viagra online

  4. Name each question indicating its placement in the topic/text that the quiz will examine; for example: “2.4 Q1 – Displaying Text with printf” It may later be correlated with that part of the topic and added or deleted or left as was when editing the quiz in the future.
  5. Preview each question immediately after entering it. The choices are scrambled and not distinguished by numbers or letters because the student need only select a radio button. It is more difficult to later compare the original text of a question and choices with the Moodle rendition.
  6. Force line breaks with the <br> tag.
  7. Use HTML’s <pre> and </pre> tags to retain the original shape of source code in the question. Unfortunately this does not work for Moodle’s choices. There you must use other HTML codes to retain the shape of the source code. GOTCHA: Place the opening <pre> tag immediately on the same line just before the first character on that first line of the programming language code. Placing the opening <pre> tag on the preceding line can introduce unwanted spaces that may otherwise follow the <pre> tag when it is on its own line, but you won’t know because … well, they are spaces after all. For a similar reason, always place the closing </pre> tag immediately following the last character on the same line as that last character of the programming language code.
  8. Increase the size of fonts by one magitude with the font tag: <font size=+1>blah blah</font>.
  9. There is a set of HTML tags called <CODE> and </CODE> that can be used to bracket actual computer code. Most browsers will then render the programming code in a different, proportional font. In a proportional font, all characters are the same width. Computer programming code is usually rendered in a proportional font in text editors in order to maintain a consistent “shape” to the code, such as ensuring that all indentation at the same “level” is the same width. A consistent shape makes programming code much easier to read. But wait! The resulting proportional font is usually significantly smaller, often too small for easy reading. The solution then is to increase the size of the proportional font with the tags. Here is an example taken directly from a Moodle quiz question that I entered: <code><font size=+1>int[] n = { 1, 2, 3, 4, 5 };</font></code>. Here is what it then looks like: int[] n = { 1, 2, 3, 4, 5 };. The <CODE> and </CODE> set of tags are extensively useful in Moodle quiz choices, but generally unnecessary in the Moodle quiz question box itself because there you can use the HTML <pre> and </pre> tags themselves, which tend to retain the original “nonproportional font” shape of the text.
  10. Add an extra blank line using <br> at the end of each choice to create white space between choices for greater readability. The blank line more clearly separates the choices.
  11. When working with the default proportional fonts, indent code with six “half-spaces” using the HTML space code: &nbsp;. I use a sequence of six “half-spaces” to force indentation of three full spaces on a line: &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; However, if and when you do force a non-proportional font, as when using the set of <code> and </code> tags, then the &nbsp; code forces a full space, so just use three &nbsp; tags in that event.
  12. Sometimes Moodle’s HTML editor will mis-translate a sequence of ordinary characters into a smiley or emoticons, generating a “thumbs down” or other unwanted graphic instead of the desired sequence of characters. When that happens, I create the question in HTML format and substitute the ordinary “offending” characters with their corresponding HTML numbers. For example, I discovered that the characters “(n)” in the expression “a(n)” generated an unwanted “thumbs-down” emoticon. At a site such as I found that &#40; is the HTML code for an open parenthesis and that &#41; is the HTML code for a closing parenthesis. I used the HTML format, substituted the opening and closing parentheses with their corresponding HTML codes, and it “fixed” the problem. I entered the expression “a(n)” as “a&#40;n&#41;” and magically, in the Moodle question, the HTML codes later disappeared but so did the emoticon! I think that it may be a “divine mystery”. I just know that it worked. Welcome to the arcane world of coding!
  13. Always check the option “Shuffle the choices?”. Restate wording of traditional choices that presumed a set order.
    • Restate the choice, “All of the above.” to state “All of these choices.”
    • Restate the choice, “None of the above.” to state “None of these choices.”
    • Restate the choice, “Both A and B.” to contain the entire content of the two referenced choices.
    • Restate the choice, “Neither A nor B.” to contain the entire content of the two referenced choices.
  14. Prefer “No numbering” when given the option of how to “number” an item’s choices. Numbering or lettering optional choices was done in the past to correlate choices presented on one document with responses recorded on another document, such as when paper quizzes were used with scantron cards. This practice is no longer useful for administering a quiz. It may be that a teacher wishes to retain the same sequence of questions in a quiz to facilitate identifying a specific item when later reviewing the quiz with the class.
  15. Watch the default value of the “Penalty Factor” which was 0.1 when I generated a batch of quizzes this summer of 2010. Make sure that it is zero canadian viagra (0) in a Multiple Choice question.
  16. Post a quiz in it’s own “Topic”. Do not post a quiz in the “Topic” that it examines for two reasons.
    1. This will leave you the option to administer the quiz without the student having access to the resources in the topic. If the quiz is placed in the same “topic” as the resources for learning what is being tested, then the student must be given access to those resources in order to have access to the quiz. If the quiz is placed in a separate “topic”, then the teacher “hide” access to the topic containing the resources when administering the quiz.
    2. The quiz itself may be “hidden” from view and from access until it is time to administer the quiz

About the Author:

Gerry Donaldson was Calgary’s first high school teacher to use a lab of personal computers. Gerry taught CSE, including CTS, AP and IB Computer Science, for 30 years before teaching and consulting to the Department of Computer Science at the University of Calgary.
  Related Posts


  1. Ryan  April 13, 2011

    Wish I had found this post earlier this year when I started putting stuff into Moodle for my CS classes. Took quite a bit of trial and error for me to figure out what you’ve got written here.

    One suggestion on the smiley problem. We had the guy that maintains our Moodle server disable smilies so that (n) and ); don’t cause problems anymore.


Add a Comment