lmolteno / nsn

NCEA Standards Navigator
https://www.notion.so/Fast-access-NZQA-d4f21847f9174bc2954bd6a3e8205363
1 stars 1 forks source link

Add the ability to share standards with a link #25

Closed lmolteno closed 3 years ago

lmolteno commented 3 years ago

So anyone clicking on the URL can see the course. Basically allows people to share courses. You could add a new path for this so you can track how many people use the feature? nsn.nz/share Perhaps pass a standards list as json to the URL? Also add a share button

lmolteno commented 3 years ago

I think I could encode the standard numbers in the url using base64 (using a custom set of characters so that i don't interfere with the URI reserved characters like + and / and stuff, also encoding numbers, not characters) this custom set I think would be ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_ e.g. 91902 would be encoded as 5pu- rather than 5pu+ as normal base64 encoding would describe. I'll separate them by a full stop, because that's an unreserved character, and it'll also make the URL look shorter hehe. This would mean a custom JS function to encode and decode them.

lmolteno commented 3 years ago

After implementing the encode and decode function i decided to rather than separate the encoded numbers with a full stop, i would instead just pad them out to the maximum length one could be (3 characters)

lmolteno commented 3 years ago

I think this has been properly implemented.