@@ -27,7 +27,7 @@ Using this tool, teachers and students can write small Python code
2727snippets together and see what happens to the data structures when the
2828code gets executed.
2929
30- Try it out live at: http://people.csail.mit.edu/pgbovine/python /
30+ Try it out live at: http://www.onlinepythontutor.com /
3131
3232======
3333System architecture overview:
@@ -49,16 +49,32 @@ back-end, and then rendering that trace as data structure
4949visualizations. The front-end code resides in these files in the
5050current directory:
5151
52- index.html
52+ tutor.html
53+ question.html
5354 edu-python.js
55+ edu-python-tutor.js
56+ edu-python-questions.js
5457 edu-python.css
55- jquery-1.3.2.min.js
5658 jquery.textarea.js
5759 .htaccess - to increase the size of allowed Apache HTTP responses
5860
61+ (there are also other 3rd-party JavaScript library files)
62+
63+ Note on .htaccess: If your server limits the size of responses received
64+ from HTTP requests, then you might need to use the following .htaccess
65+ file included in your top-level (front-end) directory, to allow the
66+ Online Python Tutor to receive traces from the back-end:
67+
68+ <IfModule mod_security.c>
69+
70+ # Set a ~2MB limit for response headers (bigger than default 512K limit)
71+ SecResponseBodyLimit 2000000
72+
73+ </IfModule>
74+
5975
6076The back-end is a server-side CGI application that takes Python script
61- source code as input, executes the entire script (up to 100 executed
77+ source code as input, executes the entire script (up to 200 executed
6278lines, to prevent infinite loops), and collects a full trace of all
6379variable values (i.e., data structures) after each line has been
6480executed. It then sends that full trace to the front-end in a
@@ -68,37 +84,22 @@ through execution.
6884
6985The back-end resides in the cgi-bin/ sub-directory in this repository:
7086
71- cgi-bin/web_exec.py - the CGI entrance point to the back-end
72- cgi-bin/pg_logger.py - the 'meat' of the back-end
73- cgi-bin/pg_encoder.py - encodes Python data into JSON
74- cgi-bin/demjson.py - 3rd-party JSON module, since Python 2.5
75- doesn't have the built-in 'import json'
76- cgi-bin/create_db.py - for optional sqlite query logging
77- cgi-bin/db_common.py - for optional sqlite query logging
78- cgi-bin/.htaccess - for Apache CGI execute permissions
79- cgi-bin/run_tests.py - back-end regression tests
87+ cgi-bin/web_exec.py - the CGI entrance point to the back-end
88+ cgi-bin/web_run_test.py - the CGI entrance point to the question
89+ grading back-end
90+ cgi-bin/pg_logger.py - the 'meat' of the back-end
91+ cgi-bin/pg_encoder.py - encodes Python data into JSON
92+ cgi-bin/demjson.py - 3rd-party JSON module, since Python 2.5
93+ doesn't have the built-in 'import json'
94+ cgi-bin/create_db.py - for optional sqlite query logging
95+ cgi-bin/db_common.py - for optional sqlite query logging
96+ cgi-bin/.htaccess - for Apache CGI execute permissions
8097
8198
8299Due to the AJAX same-origin policy, the front-end and back-end must be
83100deployed on the same server (unless you do some fancy proxy magic).
84101
85102
86- ======
87- Misc. notes
88-
89- If your server limits the size of responses received from HTTP requests,
90- then you might need to add the following .htaccess file in your
91- top-level (front-end) directory, in order to allow Online Python Tutor
92- to receive traces from the back-end:
93-
94- <IfModule mod_security.c>
95-
96- # Set a ~2MB limit for response headers (bigger than default 512K limit)
97- SecResponseBodyLimit 2000000
98-
99- </IfModule>
100-
101-
102103======
103104Original founding vision (from January 2010):
104105
0 commit comments