python in education
TRANSCRIPT
Jussi Kasurinen, D.Sc. (SE)
Lappeenranta University of Technology
PYTHON IN
EDUCATION
WHY WE WENT THERE
Jussi Kasurinen, D.Sc. (Software Engineering)
Author of some of the first Finnish Python manuals
General topics ”Python –ohjelmointiopas” (2006)
Python Imaging library (2007)
Tkinter and GUIs (2007)
Cryptography toolkit (2008)
Book, Python 3 –ohjelmointi, Docendo/WSOYPro 2009
Back in 2006, Python really had not broken through to the mainstream in Finland.
One book in Finnish, subchapter along with Java and Prolog
Our group was looking for a new programming language to replace old and tired C-based programming course
WHO ARE YOU TO TALK ABOUT PYTHON?
Decision to adopt Python for Fall of 2006 introductory programming was made.
Started, or at least preceded the “boom” of Python programming courses at the Finnish universities
Good chance that if you have studied Python in Finland, you have been doing it with our material, or material based on our material.
Online courses, student assessment models, introductory robotics, visualization tools…
Today I am going to give a discussion and a short history trip to the early years of Python in Finland, and talk about using the language in education (and what we did whit it).
WHO ARE YOU TO TALK ABOUT PYTHON?
Students do nothing
Or at least fail the larger project or exams
Attendance percentages low
Programming is not interesting
Course drop-out percentages high, no interest to have effort on understanding
the concepts.
Failure to see the link between the programming tasks and the actual IT stuff
everyone uses.
Programming is difficult
Even if the motivation is good, programming is still hard.
Unfamiliar tools, unfamiliar operating environment if not Windows
More time spent on learning the tools than learning the language.
THE PROBLEM (IN CONTEXT OF 2006)
Excellent ”activity for lines of code”-ratio
Free, simple Windows-platform tools that actually
worked
– Same tools for Linux, OSX
Real platform independence
– One set of instructions, all platforms covered.
WHY WE ADOPTED PYTHON? (IN CONTEXT OF
2006)
Simple, clean syntax
Easy to teach, no unnecessary details
Push to remove unnecessary redundancy from syntax
structures (I am looking at you Ruby!)
Ability to data mine student submissions and make
models
Easily extensible
PIL for manipulating images and drawing stuff
Serial adaptors to work with robots
Py2EXE to wrap stuff up
Not a toy, real programming work with full, usable language
WHY WE ADOPTED PYTHON? (IN CONTEXT OF
2006)
It takes 10 years to become expert in programming. (Winslow
1996)
Several concepts, structure understanding required.
Application of dedicated software to ease the learning process.
Motivational aspects
Data manipulation and command line operations not interesting for the Internet-generation. (Guzdial and Soloway 2002)
Media literature
Programming should be universal skill in information society.
Video and sound, adjustments for different focus groups
Architects, distance learners, liberal arts…
FUNDAMENTALS
Programming is hard to learn: students have to learn several concepts and structural rules before they can create anything interesting.
Programming is learned by first understanding the structures themselves, and later by combining these structures to create more and more complex functionalities.
Programming languages offer different “building blocks” – structures – of varying complexity to enable this behavior.
However, there are usually several similar or redundant structures (iteration, condition). Some structures can overtake activities (conditions, exception handlers)
So What Do The Newcomers See When Getting Started With Programming Languages?
FUNDAMENTALS
• Earlier studies show, that the infrastructure has major impact over
course performance.
Results with our earlier course; badly fragmented set of different tasks that
has no relation to each other.
Case studies with art students, at engineering classes etc.
• Usability is an issue, usability over performance should be used at the
first courses
•An argument was made that the first programming course should be the most
difficult one to “cull the herd” and teach the students to approach problems
properly. Why?
• Simple tools which allow all that is necessary but do not require anything
that has no self-evident purpose
“Just trust me, we’ll get back to that later.”
SO WHY PYTHON?
CLASSICAL EXAMPLE
Python
#-*- coding:cp1252 -*-
print(”Hello, world!”)
Java
class HelloWorld
{
public static void main(String[] args)
{
System.out.println("Hello, world!");
}
}
How many concepts do you have to explain to cover all these syntax words?
Students seem to start favor some structures over another, to a point where personal preferences supersede practicality. Besides practicality, there are also undesirable issues like shortcuts or
disregard of good programming manners.
However, the way the students program can be used to assess their programming knowledge: What structures are they using?
Do they understand all of the structures?
Are they using the structures correctly?
What kind of errors are they encountering?
CONCERNING STUDENT LEARNING
Structure mapping was done with Python program reading database dump: Search for syntax keywords from non-commented lines.
Only functional source codes in the dump!
Python syntax a huge asset in the development of evaluation tools.
Five categories were tested: while should be used if the number of iterations is not known, otherwise for.
Every input should be taken as a string with raw_input and converted to a suitable type.
Each open file should be closed after use.
Functions (def) should be used to implement recurrent behavior or refactor large bodies of code.
Each type conversion to a numeric value and file openings for reading should be secured with an exception handler.
Final calculations for the BKT-analysis were done with external tools.
STUDENT MODELING
STUDENT MODELING
1.
Collection
2. Filtering
3.Error
analysis
For the
error log
4.Structure
analysis For the
submission
log
5. BKT-
modeling
Unlearned
Invalid
1-p(L0)
Learned
Valid
p(L0)
Valid Invalid
p(T)
p(G) p(S)
STUDENT MODELING
4270
15361193
659413 357 335 311 183 155
80
500
1000
1500
2000
2500
3000
3500
4000
4500
Synta
x
Nam
e
Type
Inden
tatio
n
Index
Attr
ibute IO
Value
Unbound
0-div
Import
XML or CSV dump for all user data
<student id>::<assignment id>::<source>
Load data to 3-dimensional list
Sanity checks
Profile the source codes for applied features
Non-commented applications for profiles
Compare the application against the ”should have used”-list
Calculate the profile for each structure for each student based on all the
assignments where certain structure was expected
RECIPE FOR THE PROFILES
MAKING MODELS
94100
48
9592
92
41
0
20
40
60
80
100
10/1 10/2 11/1 11/2 12/2 13/1 13/2
Week/Assignment
% o
f s
ub
mis
sio
ns
71
8
73
54
5 10
23 22
0
20
40
60
80
100
10/2 11/1 11/2 12/2 13/1 13/2 13/3 14/2
Week/Assignment
% o
f s
ub
mis
sio
ns
How students handle
file operations
How they handle
exceptions
MAKING MODELS
67 67
46
48584948 52
6263
0
10
20
30
40
50
60
70
80
90
100
While For Functions Exceptions Files
% -
of
stu
de
nts
Threshold p= 0.05 Theshold p = 0.1
How students learned
Comparison of two
different courses
USING VIRTUAL LEARNING ENVIRONMENT
We used Viope virtual learning environment (VLE) to collect student submissions. www.viope.com 3732 source codes and 9420 errors
VLE also provided additional services: Submission validation: the source code worked as intended
(input/output matching)
Hinting service: “First aid” service to help students in a need of assistance.
Plagiarism detection: similarity testing with prior submissions.
Student statistics: teachers could observe how much time students had used, what kind of errors they had encountered, in which time of the week/day they are actively working etc…
Visualization tool to assist teaching
Not only tool, also an API exercise
for students
VISUAL TOOLS, KILPPARI
import control import visualization control.MyCommands = ["square"] def Parser(command): if command == "square": for i in range(0,4): visualization.TurnLeft() for j in range(0,2): visualization.TakeStep() return command else: return "Invalid command:"+command
Python proved to be an excellent platform to control a small robot.
Kit build, gives students some idea on how to work “outside the grey
box”
Related to the Karel the Robot (Guido van Robot) concept
ROBOT TOOLS
import serial portti = serial.Serial(3) portti.write(b"1\c") portti.close()
…. And there she goes!
Students work at night.
VLE system is needed, as students tend to work at all hours
Also, automation to do basic sanity checks on student submissions
Nobody does anything during the weekends.
Some people just don’t get programming (over 150h spent on exercises
of 14 week course)
No common sense; students use brute force to get the results they need.
Engineering students do not like visualization tools
”Toys for elementary school”
Robots are cool.
Recording the lectures and putting them to web is really easy task to
add.
WHAT WE LEARNED ABOUT STUDENTS?
Python was definitely the right choice.
Visualization tools divide opinions, but for truly introductory level they can
be successful.
Python syntax makes it easy to model students with Bayesian models
Same content, different outcomes
Predict learning, easy to collect topics that should be revisited
Steering hardware with the software should be taken more into the
course syllabus (motivational reasons).
Course book is a must!
Not a large 1000-page 200 USD brick that explains everything
Cheap (free?) manual that covers all of the course topics
IDLE was really all that was needed.
SO WHAT DID WE LEARN IN GENERAL?
Immigration to Python 3
More open-source material to allow self-study in Python
topics
Introduction to Python-wiki, by University of Oulu
Viope develops the Python web-course to cover new markets
in Africa and Asia.
CURRENT WORK
Jussi Kasurinen, D.Sc. (SE)
Lappeenranta University of Technology
QUESTIONS?
...Or drop me an email at