web-cat / pythy

Pythy – the Cloud-Based IDE for Novice Python Programmers
18 stars 3 forks source link

Student code view should remember the last cursor/scroll position #60

Open allevato opened 10 years ago

allevato commented 10 years ago

I read this in the Pythy SIGCSE paper:

Every time a student returns to a code page they have written, it appears the same way they last left it.

Let's make this even better by having Pythy store the user's current cursor position (line and column) in AssignmentRepository and ScratchpadRepository every time it auto-saves the content. Then, when the code page is reloaded, CodeMirror should automatically jump back to that position.

We could do this for AssignmentReferenceRepository too for instructors. The only black sheep is ExampleRepository, since those are viewable by multiple users, and you'd need another relationship to store each individual user's positions. The slight inconsistency is probably worth avoiding the extra work.