Skip to content

Contributing Exercise Solutions

martin-henz edited this page Oct 14, 2019 · 4 revisions

You can contribute in two ways: (1) using an Issue in this repository, and (2) using Git and XML via Pull Request.

Regarding (1): Uing an Issue in this repository

Go to Issues and click on "New Issue". Then just enter your solution. We will take a look and include it in the textbook if it's correct. It's very useful to add test cases, which we can then include as examples in the textbook.

Regarding (2): Using Git and XML, via Pull Request

If you want to contribute to exercise solutions via Git and XML, using a Pull Request, you need to know the basics of Git, and the structure of SNIPPET tags. Here are the components:

  • NAME: optional; at most one; allows other SNIPPETs to refer to and "require" this program. Example: <NAME>my_program</NAME>
  • REQUIRES: optional; multiple allowed; allows this SNIPPET to recursively include other snippets by including their name. Example: <REQUIRES>my_other_program</REQUIRES>. All "required" programs are placed before the snippet when displayed in the Source Academy. The "required" programs are not displayed in the textbook editions.
  • EXAMPLE: optional; at most one; allows this SNIPPET to recursively include another SNIPPET by including its name. Example: <EXAMPLE>my_example_program</NAME>. The "example" program is placed after the snippet when displayed in the Source Academy. The "example" program is not displayed in the textbook editions.
  • SCHEME: optional; here goes the Scheme version; feel free to ignore
  • JAVASCRIPT: required for all practical purposes: Include the JavaScript version here.

Attributes of SNIPPET tags include:

  • HIDE = yes: (default: no) The program is not displayed in the textbook editions.
  • LATEX = yes: (default: no) The program contains LaTeX formulas using $$ syntax.
  • EVAL = no: (default: yes) The program is not clickable.
Clone this wiki locally