Add ORDER BY clause to problems#index query

The problems are not displayed in order.
This query is not vulnerable to SQL injection because there is no string interpolation or even string literals. Apart from the ORDER BY clause itself it is a purely relational expression in which the terms are just relations and attributes already in the database.

There are however two other problems with direct use of SQL. Databases implement it differently; for example, in development, SQLite3 did not enforce the requirement in the SQL Standard that a derived table must be given a correlation name (http://blog.jooq.org/2014/06/24/should-i-put-that-table-alias-or-not/), but Postgres does enforce it. The other problem is that inexperienced people make mistakes like this.

To use the ORM, we would need to declare associations between Submission and Problem. I am not sure how to deal with unsolved problems. I did it in SQL because I didn't know how to do it in Rails.

In short, it is not a security problem but it might be desirable to rewrite it to use the ORM. An SQL statement is already in production, so this pull request does not add any new problems.