By: Dr Alan Guedes, School of Mathematical, Physical and Computational Sciences, a.guedes@reading.ac.uk

 

As a computer science lecturer, I am required to show programming source codes in my lectures, particularly for in-class activities like quizzes (e.g. “Determine the output of the following code” or “Identify the logical error within this code”). These quizzes allow me a do an in-class knowledge check for the students.

The recent support for Padlet at the University of Reading prompted me an investigation into an effective approach for displaying a source code in Padlet. However, it became apparent that Padlet is not explicitly designed for this purpose. My initial attempt involved directly placing the source code into a post’s title (image below), but this revealed the limitation of Padlet titles do not support multi-line text. In the following sections, I will share some options I discovered.

Screenshot of a poll creation interface titled “Poll.” The Java code snippet is formatted in a single line with line breaks, showing overloaded add methods and a call to add(2.5, 2). Below the code are multiple-choice options represented by radio buttons arranged in two rows.
Figure 1.1. Pasting source code into the title of a Padlet post

Option 1: Uploading code as a text file

This approach involves using two Padlet posts (image below), where one post is dedicated to an uploaded source code file and other for the poll. The advantage of this method is that it generates syntax colouring for the code, which significantly enhances student readability. However, it presents two drawbacks. First, it requires an additional post solely for the poll, since a single post cannot accommodate both the file and the poll. So, the second post should “refer” to the one before. Second, it suffers from resolution degradation when viewed on mobile devices, what may require students do a second click to “open the file” and improve readability.

Screenshot of a coding question posted by a teacher named Alan Guedes. The question asks, “What is the output of the code below?” followed by a Java code snippet with overloaded add methods for integers and doubles, and a call to add(2.5, 2). Multiple-choice options are 2.5, 2, 4, and 4.5. No votes or comments are present.
Figure 1.2. Using two Padlet posts

Option 2: Code block in the body

This solution involves use only post, which has the code inside its body (Figure 1.3). The post title should remain concise and directly address the quiz query. The source code is then added as a “code block” within the body of the post. This method ensures student readability by preserving indentation and utilizing a monospace font, characteristics common in programming editors.

While this represents a good solution, it has one drawback: it has been observed that Padlet’s default layouts may automatically wrap longer lines of code (Figure 1.4). This can complicate student readability.

Coding question interface showing a multiple-choice question: “What is the output of the code below?” Options are 2.5, 2, 4, and 4.5. The code block includes two overloaded add functions—one for integers and one for doubles—and a call to System.out.println(add(2.5, 2));.
Figure 1.3. Inputting the code block in the body of a post
Screenshot of a coding question displayed in a two-section layout labeled “Section 1” and “Section 2.” Section 1 contains the same Java code snippet and multiple-choice question as Image 1. Section 2 is empty.
Figure 1.4. Code block displayed without text wrapping

To mitigate this issue, the “stream” layout is identified as the optimal configuration. This layout (Figures 1.5 & 1.6) will render content vertically without unnecessary text wrapping, thereby maintaining the readability of the source code.

Screenshot of an application’s appearance settings. Options include wallpaper set to dark, color scheme set to light, font set to Alba, and post size set to standard. Layout format is set to “stream,” with an arrow indicating selection. Group posts by section is toggled on, sorting is set to drag and drop, and new posts appear first. Comments and reactions are enabled.
Figure 1.5. Selecting the text wrapping option
Screenshot of a coding question posted by a teacher named Alan Guedes. The question asks, “What is the output of the code below?” followed by a Java code snippet with overloaded add methods for integers and doubles, and a call to add(2.5, 2). Multiple-choice options are 2.5, 2, 4, and 4.5. No votes or comments are present.
Figure 1.6. The “stream” post with text wrapping enabled

Final remarks

In conclusion, while Padlet may not be inherently designed for showing source code, the file upload and code block options are viable for displaying source code. These methods can be beneficial for lecturers conducting in-class activities involving source code.

If you have a query about the institutional Padlet, please raise a ticket with the TEL Team.


If you’re a University of Reading staff member, you can watch the recording of Alan’s presentation about notation in Padlet by selecting the following link: TEL: Showcase: Power Up your Teaching with Padlet.