You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{chap} is an integer representing the source chapter version. e.g. 1 for Source §1, 2 for Source §2, ... Optional, defaults to the latest chapter if missing or invalid.
{ext} is a string representing the name of the external library to be used. The list of permitted external library names are here. For example, one can specify CURVES to allow usage of the curves library in the playground upon loading the program, ... Optional, defaults to "NONE" if missing or invalid.
{prgrm} is a string representing the hashed program in the editor. Alternatively, the key for this parameter can also be lz, i.e. &lz={lzStr}, for back-compatibility. Required.
The order of the parameters after the hash (#) does not matter.
We use the lz-string javascript library to hash the programs into the prgrm/lz parameter value. It is probably possible to dynamically generate and parse an example program in the textbook into this hashed string, then interpolate it as a valid URL, saving a bunch of manual work (if this is not already implemented).
The text was updated successfully, but these errors were encountered:
@martin-henz Hi Professor, We have added support for external libraries in the links. As such, lib has been renamed to chap due to conflict in naming, and ext is used to specify the external library. I've updated the issue above accordingly.
remo5000
changed the title
Invalid parameter for lib in playground links
Invalid parameter for chapter in playground links
Jul 27, 2018
There is a change in specification for shared playground links, in the new version of source-academy at cadet-frontend.
Shared playground links must take the form,
Where
{host}
is the host of source-academy, e.g. http://stg-cadet-frontend.s3-website-ap-southeast-1.amazonaws.com for the staging server, or https://http://sourceacademy.nus.edu.sg for deployment. Required.{chap}
is an integer representing the source chapter version. e.g.1
for Source §1,2
for Source §2, ... Optional, defaults to the latest chapter if missing or invalid.{ext}
is a string representing the name of the external library to be used. The list of permitted external library names are here. For example, one can specifyCURVES
to allow usage of the curves library in the playground upon loading the program, ... Optional, defaults to "NONE" if missing or invalid.{prgrm}
is a string representing the hashed program in the editor. Alternatively, the key for this parameter can also belz
, i.e.&lz={lzStr}
, for back-compatibility. Required.The order of the parameters after the hash (
#
) does not matter.Examples of Valid URLs
Suggestions
We use the
lz-string
javascript library to hash the programs into theprgrm
/lz
parameter value. It is probably possible to dynamically generate and parse an example program in the textbook into this hashed string, then interpolate it as a valid URL, saving a bunch of manual work (if this is not already implemented).The text was updated successfully, but these errors were encountered: