Teammates: Instructor: create session: Improve error message shown when session created with invalid information

Created on 18 Feb 2018  路  11Comments  路  Source: TEAMMATES/teammates

Environment

Development environment.

Steps to Reproduce

  1. Login as Instructor
  2. Go to Sessions tab
  3. Try creating a new Peer Evaluation session with empty session name and empty Submission closing time
  4. The following error is shown

image

Although the error is error message is correct it could be rephrased by doing the following:

  • ~Remove The value of a/an feedback session name should be no longer than 38 characters. because the input validation anyway doesn't allow instructor to input more than 38 characters.~ Correct the grammar of The value of **a/an feedback** session name should be no longer than 38 characters.
  • ADD: Combine the first and 3rd sentence of the error messages to -> The field Session Name should not be empty
  • Since two errors happened here, maybe we could provide bullet points to show the two errors separately.
a-UIX help wanted p.Low

Most helpful comment

I think that's what @damithc meant by duplication - whenever we implement client-side validation, it is a duplication of validation because we already have server-side validation (which is a given, like you said). We favour pure server-side validation, as opposed to client-and-server-side validation.

All 11 comments

@tshradheya Are you working on this or can I take it?

Can I take up this issue?

I am not working on this. ~Since @sukanta-27 asked first, I think he can take up this issue~

@tshradheya Thanks :smile:

@sukanta-27 I'd advise against taking new ones because you're already involved in few other things, particularly related to private sessions.
@junkiattan you can go ahead.

Okie! @wkurniawan07 @tshradheya

Actually for the student side, the input is validated client-side without making requests to the server to validate the message. Should we do the same for the instructor side?

Actually for the student side, the input is validated client-side without making requests to the server to validate the message. Should we do the same for the instructor side?

Our general policy is to favor server-side validation. Although it is slower, it avoid the duplication of validation, once in JS and once in Java.

Remove The value of a/an feedback session name should be no longer than 38 characters. because the input validation anyway doesn't allow instructor to input more than 38 characters.

The error still needs to be there in case the user bypasses the client-side validation.

"Slower" or "duplication" or "favor" is not the issue. Server-side validation is a must (especially in RESTful architecture, which we are not) because it is the only type that users cannot bypass.

I think that's what @damithc meant by duplication - whenever we implement client-side validation, it is a duplication of validation because we already have server-side validation (which is a given, like you said). We favour pure server-side validation, as opposed to client-and-server-side validation.

Was this page helpful?
0 / 5 - 0 ratings