Question Authors' Forum

Sample Python Question

Picture of chris maker
Sample Python Question
by chris maker - Tuesday, 8 August 2017, 12:44 PM

Hi, I am new to Coderunner.

I am trailing a simple python questions in Moodle, for example write a program that calculates the area of a square

l = int(input("length? "))
w = int(input("width? "))
area = l * w
print("the area is"+' '+str(area))

However, when I configure and preview the question and click the 'check' button, no feedback is given. Is there a couple of same questions in Moodle I can look at to see what I am doing wrong?


Tim at Lone Pine Koala Sanctuary
Re: Sample Python Question
by Tim Hunt - Tuesday, 8 August 2017, 9:49 PM

Inside Coderunner, there is a 'samples' folder:

You can import those into your question bank somewhere using Question bank -> Import, and selecting Moodle XML format.

simpledemoquestions.xml is probably the file you want.