presnick / RunestoneServer

Interactive books for computer science
http://interactivepython.org
Other
26 stars 46 forks source link

Assignment List Parsing and Grader Clean Up #9

Closed nickdotreid closed 10 years ago

nickdotreid commented 10 years ago

I created a simple method of grouping active code examples. This change takes place on admin/list_assignments.

I also cleaned up the gradeassignments page, by making skulpt run and sticking all assignment text into a modal (which is easier to read). I also included a form to filter by section on this page

Sections will be required.

presnick commented 10 years ago

This looks promising, but when I clicked to filter assignments by section id, I got an error (stacktrace below). Looks like line 157 in gradeassignment section_form.vars.section_id is not defined.

Traceback

Traceback (most recent call last): File "/home/web2py/gluon/restricted.py", line 217, in restricted exec ccode in environment File "/home/web2py/applications/runestone/controllers/admin.py", line 354, in File "/home/web2py/gluon/globals.py", line 372, in self._caller = lambda f: f() File "/home/web2py/gluon/tools.py", line 3239, in f return action(_a, _b) File "/home/web2py/applications/runestone/controllers/admin.py", line 157, in gradeassignment (auth.user.course_id,acid,section_form.vars.section_id)) File "/home/web2py/gluon/dal.py", line 8140, in executesql adapter.execute(query) File "/home/web2py/gluon/dal.py", line 1836, in execute return self.log_execute(_a, _b) File "/home/web2py/gluon/dal.py", line 1830, in log_execute ret = self.cursor.execute(command, _a[1:], _b) File "/home/web2py/gluon/contrib/pg8000/dbapi.py", line 246, in _fn return fn(self, _args, _kwargs) File "/home/web2py/gluon/contrib/pg8000/dbapi.py", line 317, in execute self._execute(operation, args) File "/home/web2py/gluon/contrib/pg8000/dbapi.py", line 322, in _execute self.cursor.execute(new_query, new_args) File "/home/web2py/gluon/contrib/pg8000/interface.py", line 398, in execute self._stmt = PreparedStatement(self.connection, query, statement_name="", [{"type": type(x), "value": x} for x in args]) File "/home/web2py/gluon/contrib/pg8000/interface.py", line 138, in init self._parse_row_desc = self.c.parse(self._statement_name, statement, types) File "/home/web2py/gluon/contrib/pg8000/protocol.py", line 943, in _fn return fn(self, _args, *_kwargs) File "/home/web2py/gluon/contrib/pg8000/protocol.py", line 1104, in parse return reader.handle_messages() File "/home/web2py/gluon/contrib/pg8000/protocol.py", line 929, in handle_messages raise exc ProgrammingError: ('ERROR', '42703', 'column "section_id" does not exist') Error snapshot
<class 'gluon.contrib.pg8000.errors.ProgrammingError'>(('ERROR', '42703', 'column "section_id" does not exist'))

nickdotreid commented 10 years ago

That's an embaressing error -- I wonder why it didn't throw errors at me.

I updated the SQL query, and switched it away from a SQL string to DAL ~ which matches the rest of the architecture (and is slightly less ugly) -- the query is almost the same ~ but slightly simpler (and shows the same results)

because of this I had to update the view HTML