JennieHo-HPE / Sapporo

Web App for hosting coding competition
0 stars 0 forks source link

Questions should be displayed by the ordering of question title. #25

Closed joker78980 closed 2 years ago

joker78980 commented 2 years ago

Questions should be displayed by the ordering of question title.

image

joker78980 commented 2 years ago

The ordering is still not correct. image

yilanhung commented 2 years ago

The ordering is still not correct.

Yes, it's correct. The list was sorted by "title" first, which is of text type, so it induced string comparison, char by char. That's why Q11 comes before Q2.

Name your titles to be starting like Q00, Q01, Q02...Q11, or (cleaner) ..., or 00, 01, 02, ... 11, 12...

If you're talking about a specific case, like the one here, "number"s has to be extracted from the "string"s for sorting, I wouldn't hard-code it because specific cases can be many.

For this system, a more reasonable design is allow an admin/author to determine what ordering he/she wants for displaying the problems on an admin UI (remember SharePoint menu editing?), which would be another new feature.

yilanhung commented 2 years ago

0855e9c37e351d260aaa1e43fec2a9b95aaa1b8d