fixed the inability to view students' survey

Previously if you are an administrator and have access to the course,
the system still returns an error message that it is an invalid id
when you are trying to access a survey. The reason is the system only
checks whether you are an instructor of the course or not. To fix this
problem, I have changed it to check whether the logged in user has
access to the course if they are trying to access the surveys not as
a student.

Conflicts:

	app/controllers/evaluations_controller.php
Fixed problem with exporting evaluation results to csv

I have discovered that when we export all results from evaluation
events that do not have the self evaluation option turned on, we
still receive rows of empty result for self evaluation.

For example, if we have no self-evaluation event and we exported all
the results we still get a row that have no results (as expected) for
Ed Student from Ed Student.

Conflicts:

	app/controllers/components/export_base_new.php
Fix API return 404 when no department is setup

When no department is setup, the return value should be empty array [],
instead of 404.
Fix missing Content-length in response of API call

When the Content-length header is missing from the response, web server
will treat response as dynamic length response and will insert the
"Transfer-Encoding: chunked" in response header and may
insert extra numbers in the beginning and ending of the response body.
If the client couldn't handle chunked transfer encoding
(http://en.wikipedia.org/wiki/Chunked_transfer_encoding), the parsing
will fail.
Remove the orphan entries in mixeval_question_descs
Fix #543 remove the criteria hint text from rubric

Removed "Level of Mastery" from the rubric form as it is not relevant to
students.
Fix #556, use relative URL for css background image

If use absolute URL, it will cause problem when the site is not on root
of the web server, e.g. image missing
Fix #554, confirm button on upgrade page on firefox
Fix #555, merge user search failed when installed on subdirectory
Refactor rubric form to show header in view page
Refactor mixeval to use unified preview

The preview section shows the same as what student sees
Fix #558, 404 when student submitting evaluation

This only happens when iPeer is installed under a sub directory.
Revert a change made by previous commit that failed the tests
Fix mixeval result rendering error

The radio value result was rendered off by 1 on mixeval result rendering
page. e.g. 4 was rendered as 3
Fix the previous commit, attempt 2
Catch the exception with more information printed

Default element WaitTimeOut exception doesn't give much information
about the element. It was very difficult to debug after the exception is
thrown. Now it's printing the element search method and value.
Update guard plugin
Fix #542

The bug was in the conditions used in the find function.
Fix #557, filters are failed on lists on dreamhost

mysql_real_escape_string was used to escape the filters. However, it
seems making a connection to db when it's called. On dreamhost, the
default connection seems broken (to socket file
/No-MySQL-hostname-was-specified, happens only on some hosting servers)
So remove the escape function for now. The values are already escaped by cake.
Modified build script to run in Vagrant and Ticket #548

I have modified the build script to use sh command so that it can
also be run in the Vagrant environment. The exact same modification
has already been made in the dev branch.

I have also implemented the minor enhancement of Ticket #458 to have
the event template list in the events add/edit page to be sorted,
so that users can find their desired template more easily.