Grouping and Differentiating Programming Exercises Using Minimal Programming Constructs
Ka Weng Pan, Bryn Jeffries and Irena Koprinska
School of Computer Science, University of Sydney
Sydney, Australia
{kaweng.pan, bryn.jeffries, irena.koprinska}
@sydney.edu.au
Context: introductory computer programming course
2
Method
3
Example
4
Successful student submissions | Primitive constructs for each submission |
print("1" + "2" + "3") | [imported function call] print, [binary operation] add, function call, [variable] load, [constant] str |
print("123") | [imported function call] print, [variable] load, [constant] str, function call |
print(f"{123}") | [imported function call] print, f-string, function call, [constant] int, [variable] load |
Example (2)
5
Successful student submissions | Primitive constructs for each submission |
print("1" + "2" + "3") | [imported function call] print, [binary operation] add, function call, [variable] load, [constant] str |
print("123") | [imported function call] print, [variable] load, [constant] str, function call |
print(f"{123}") | [imported function call] print, f-string, function call, [constant] int, [variable] load |
Set of minimal primitive constructs for exercise
[constant] int,
[constant] str,
[imported function call] print,
[variable] load,
f-string,
function call
f-string,
function call
Step 1: Identify primitive construct set
6
try:
a = []
print(a[0])
except IndexError:
print("IndexError")
Successful student submission
1) AST
ast.Assign,
ast.Call,
ast.Constant,
ast.ExceptHandler,
ast.Expr,
ast.List,
ast.Load,
ast.Module,
ast.Name,
ast.Store,
ast.Subscript,
ast.Try
2) AST node classes
constant] int,
[constant] str,
[excepthandler] IndexError,
[imported function call] print,
[variable] load,
[variable] store to,
assignment,
function call,
list,
subscript,
try
3) Final primitive set
Step 2: Identify set of minimal primitive constructs
7
Step 3: Compute distance between exercise
8
Case study
9
Number of passed and failed submissions for each exercise:
Extracted sets of minimal constructs
10
Most common constructs in minimal construct sets
11
Per-exercise minimal primitive construct sets�
12
Visualisation using primitive construct map
13
Beginners, Exercise 1-6
Clusters based on minimal primitive constructs
14
Clusters of exercises
Exercise distance vs exercise failure rate
15
No strong correlation observed – many factors influence the difficulty of an exercise
Interesting cases - 1
16
Interesting cases - 2
17
Conclusion
18
Future work
19