Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions doc/en/Developer/Development_track.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ Issues with [github milestone 4.13.0](https://github.com/maths/moodle-qtype_stac
1. Remove all "cte" code from Maxima - mostly install.
2. Support for Maxima 5.47.0, 5.48.0, and 5.49.0. This includes a fix for issue #1281 from 5.48.0.
3. Question tests can now test the whole route through a PRT, rather than just the final node. This is a significant improvement on the ability to test questions. This is back-compatible with older questions.
4. Move chemistry data and some core functions into the Maxima supported code. Load these with `stack_chemistry_declare(true);` in the question variables.

--------------------------------------

Expand Down
8 changes: 3 additions & 5 deletions doc/en/Topics/Chemistry/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,9 @@ STACK provides a comprehensive chemical data sheet for use in numerical problems

To include chemical data use the following within your STACK question (question variables).

stack_include_contrib("chemistry.mac");
stack_chemistry_declare(true);

Developer notes:

* During development to load the code local to your development server use `stack_include("contribl://chemistry.mac");`
(Older questions used an optional library `stack_include_contrib("chemistry.mac");` which has been moved to the core.)

## Using chemical data

Expand Down Expand Up @@ -49,7 +47,7 @@ Notes.
1. Names of elements are always given as strings. E.g. to access data for hydrogen use `"H"`.
2. Field names are always given as strings, e.g. `"AtomicMass"` is a string (not an atom `AtomicMass`).
3. The utility functions filter the `"Name"` field to give the name of the element with the local language selection. STACK uses the global `%_STACK_LANG` variable. If no local name is defined the `"Name"` in English is returned. If you really want _all_ the data, just use `assoc(element, %_STACK_CHEM_ELEMENTS)` rather than ` chem_data_all(element)`.
4. Note that, for efficiency reasons, data is stored in flat table and the above arrays are reconstructed from the flat table, the list of field names and any languages available. Language data is separated which makes it easier to add a new language. Chemical names are _not_ part of Moodle's normal language pack and need to be added explicitly to `chemistry.mac`. See [github](https://github.com/maths/moodle-qtype_stack/blob/master/stack/maxima/contrib/chemistry.mac) for examples. As of Nov 2025, English, Finnish and German names are available.
4. Note that, for efficiency reasons, data is stored in flat table and the above arrays are reconstructed from the flat table, the list of field names and any languages available. Language data is separated which makes it easier to add a new language. Chemical names are _not_ part of Moodle's normal language pack and need to be added explicitly to `chemistry.mac`. See [github](https://github.com/maths/moodle-qtype_stack/blob/master/stack/maxima/chemistry.mac) for examples. As of Nov 2025, English, Finnish and German names are available.

TODO: write a maxima function which gives an annotated atomic symbol in LaTeX, based on the chemical data e.g. \(^{25}_{12}\mbox{Mg}^{2+}\).

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ M=
<text>2025080100</text>
</stackversion>
<questionvariables>
<text><![CDATA[stack_include_contrib("chemistry.mac");
<text><![CDATA[stack_chemistry_declare(true);
stack_unit_si_declare(true);

/* Each element must be a list of atoms and numbers. */
Expand Down
4 changes: 4 additions & 0 deletions stack/cas/security-map.json
Original file line number Diff line number Diff line change
Expand Up @@ -7347,6 +7347,10 @@
"function": "t",
"built-in": true
},
"stack_chemistry_declare": {
"function": "s",
"contextvariable": "true"
},
"stack_matrix_col": {
"function": "?",
"contextvariable": "true"
Expand Down
Loading
Loading