Skip to content

Update to response_area_components #22

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 12 commits into from
Jul 14, 2025
Merged
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
10 changes: 5 additions & 5 deletions docs/student/getting_started_student.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,13 @@ See the [Answering Questions](answering_questions.md) page for more help with an

The Workspace provides you with various functionalities to assist you during your learning process:
#### 1. Canvas:
A pane where you can write down your thought process and notes for the previewed question (handwriting, sticky notes & text).
A pane where you can write down your thought process and notes for the previewed question (handwriting, sticky notes & text).

![Canvas Interface](images/canvas_interface.png)
![Canvas Interface](images/canvas_interface.png)

#### 2. Chat:
A chat interface connecting you with helpful AI Chatbots to discuss any questions you have on the current topic you are working on.
A chat interface connecting you with helpful AI Chatbots to discuss any questions you have on the current topic you are working on.

![Chat Interface](images/chat_interface.png)
![Chat Interface](images/chat_interface.png)

Your edits and progress in the Workspace are saved per each Question you preview. So, you will be able to view your old edits for the Question you are currently on.
Your edits and progress in the Workspace are saved per each Question you preview. So, you will be able to view your old edits for the Question you are currently on.
2 changes: 1 addition & 1 deletion docs/teacher/guides/content-sets-questions.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ This guide explains how to use the editor to create and modify [sets](https://la
| **4** | **Master Content** | The main content for the question, which is always visible above the individual parts. This field uses the Lexdown editor. |
| **5** | **Current Part** | **Indicates** which question part you are currently editing. |
| **6** | **Part Content** | Edit the content for the selected question part (i.e., the sub-question).|
| **7** | **Response Area** | The input field where a student submits their answer. Adding a response area is optional. <br> See [here](https://lambda-feedback.github.io/user-documentation/teacher/reference/response_area_components/) for an in-depth explanation.|
| **7** | **Response Area** | The input field where a student submits their answer. Adding a response area is optional. <br> See [**here**](https://lambda-feedback.github.io/user-documentation/teacher/reference/response_area_components/) for an in-depth explanation.|
| **8** | **Question Help Options** | Add optional support materials for students, such as a [**Structured Tutorial**](https://lambda-feedback.github.io/user-documentation/terminology#structured-tutorial), a [**Final Answer**](https://lambda-feedback.github.io/user-documentation/terminology#final-answer), or [**Worked Solutions**](https://lambda-feedback.github.io/user-documentation/terminology#worked-solution). The buttons shown here are the same ones students will see. |
| **9** | **Teacher/Student View Toggle** | Toggle between the teacher editing view ('EDIT') and the student 'PREVIEW' to see how the question will appear to students. |
| **10** | **Edit Guidance** | Add extra details for the question, such as guidance notes, estimated completion time, and skill level. |
Expand Down
2 changes: 1 addition & 1 deletion docs/teacher/guides/gettingstarted.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ A [student guide is here](../../student/index.md). Teachers use the 'below the l
- **Final answer** is self-explanatory.
- **Worked solutions** provides detailed, step-by-step solutions.

All content below the line uses Lexdown functionality. Worked solutions can be branched. Future developments will add branching and response areas to structured tutorials.
All content below the line uses Lexdown functionality. Worked solutions can be [branched](https://lambda-feedback.github.io/user-documentation/teacher/guides/good-practice/#branching), or split into [steps](https://lambda-feedback.github.io/user-documentation/teacher/guides/lexdown/#steps-in-worked-solutions). Future developments will add branching and response areas to structured tutorials.

It is not necessary to include all three methods of help. If you only provide content for one tab, only that button will appear in the published student version.

Expand Down
22 changes: 19 additions & 3 deletions docs/teacher/reference/response_area_components/Expression.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,22 @@ Calculates the difference between the teacher answer (ans) and the student respo

Compares two symbolic expressions for mathematical equivalence, using SymPy. See [SymPy](https://www.sympy.org/en/index.html.md-button) for further information.

## compareExpressions
**Input Symbols**

This is a powerful feature for defining a dictionary of accepted symbols. For each symbol, you define:
* **Symbol:** The LaTeX-rendered symbol (e.g., `$f(x)$`).
* **Code:** The machine-readable variable name (e.g., `fx`). This is what your students will type and what the evaluation function sees.
* **Alternatives:** A list of other codes you want to accept for the same symbol (e.g., `f_x`, `f(x)`, `f`). This allows you to anticipate different ways students might type the same thing.
* **Visibility:** A `TRUE`/`FALSE` toggle. If "Display input symbols" is enabled in the Input tab, this setting determines whether a specific symbol is shown to the student. This allows you to show students common symbols while still accepting less common or alternative ones in the background.

![example](screenshots/input_symbols.png)
![example](screenshots/input_symbols_preview.png)

Tolerances can also be added. These will apply to the numerical parts of the answer (e.g. the $10$ in $10x$).

This is done using the `atol` and `rtol` fields under the Evaluation Function Parameters section.

## Component Parameters

### `post_response_text` (optional)
Expand All @@ -22,11 +38,11 @@ Text block to be displayed to the left of the input field. Markdown and LaTeX ar

Text block to be displayed to the left of the input field. Markdown and LaTeX are allowed following the usual syntax.

### Allow Handwrite (Experimental)
### Enable Handwriting Input

Enables a handwriting canvas in the browser, which allows a student can use to draw their expression, rather than type using Sympy's syntax.
Enables a handwriting canvas in the browser, which allows a student to draw their expression, rather than type using Sympy's syntax.

### Photo (Experimental)
### Enable Photo Upload

Allows a student to upload their expression as an image, as an alternative to handwriting if the student isn't using a phone or tablet.

Expand Down
28 changes: 24 additions & 4 deletions docs/teacher/reference/response_area_components/NumericUnits.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,41 @@

Provides two input fields with `Number` and `Units` placeholder texts. This area will also display its associated grading function (as seen in the screenshot below).

**Note** this area will display how the user's response was interpred using the `interp_string` field provided in the feedback object returned by that function (if it exists).
**Note:** this area will display how the user's response was interpred using the `interp_string` field provided in the feedback object returned by that function (if it exists).

## Component Parameters
### `pre_response_text` (optional)
Text block to be displayed to the left of the input field. Markdown and LaTeX are allowed following the usual syntax.
### `pre_response_text` & `post_response_text` (optional)
Text block to be displayed to the left and right of the input field respectively. Markdown and LaTeX are allowed following the usual syntax.

### Comparing units
This is done using the **compareExpressions** evaluation function.

By ticking the `physical_quantity (boolean)` option in the *Evaluate* tab, answers with different units from the reference answer can be compared.

![physical quantity ticked](screenshots/physical_quantity.png)

For example, if the reference answer is 100 m, the following answers will also be accepted:

* 0.1 km
* 10000 cm
* 10^5 mm

See [here](https://lambda-feedback.github.io/user-documentation/user_eval_function_docs/compareExpressions/#4-checking-the-value-of-an-expression-or-a-physical-quantity) for more information
### Tolerances
This is done using the **compareExpressions** evaluation function.

Tolerances can be added to your answer using the `atol (number)` and `rtol (number)` fields, which denote absolute and relative tolerances respectively.

## Response Structure
*This is how the react component will structure the user's input to the Grading Gateway, when they press the check button.*

In this case, the response is a single string which features the user's response to both fields separated by a space.

!!! example

```json
"response": "150 g"
```

## Example Screenshot
![Screenshot](screenshots/NumericUnits.jpg)
![Screenshot](screenshots/NumericUnits.jpg)
1 change: 1 addition & 0 deletions docs/teacher/reference/response_area_components/Text.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Text
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading