cloudcoderdotorg / CloudCoder

A web-based programming exercise system.
GNU Affero General Public License v3.0
71 stars 60 forks source link

support direct link to exercise #63

Closed daveho closed 10 years ago

daveho commented 10 years ago

It should be possible to link directly to an exercise.

One idea is to use an anchor (#foo/bar/baz) on the URL, have the webapp check for this, and navigate automatically to the development mode to work on that exercise (once the user has logged in.)

daveho commented 10 years ago

I've made some progress on this. The url-page-links branch in my repository has an initial proof of concept that works for links to exercises.

The next step is to generalize this by supporting links to all internally-navigable pages. Here is the idea: each CloudCoderPage has a set of objects that need to be in the session in order for the page to operate. We make these an explicit prerequisite for activating the page: for example, the DevelopmentPage needs the CourseSelection and Problem. The URL fragment in the page link can specify the ids of these objects so that they can be loaded in a generic fashion when there is a direct link to the page.

When a page is reached via internal navigation, it should set the URL fragment to indicate the ids of the objects it needs, so that the user can copy the URL and navigate back to that page (or post it for others to follow).

As a side benefit, this will allow the overall CloudCoder UI to work nicely with the browser forward and back button, since the URL will provide adequate context to get the user back to where she was.

daveho commented 10 years ago

More progress - my url-page-links branch has a general mechanism for loading page objects based on parameters in the URL fragment. Works for DevelopmentPage - needs to be implemented for the other pages.

daveho commented 10 years ago

Page object loading should now work for all pages. Merged onto master branch, so I'm closing the issue.