Skip to content

Meclib tutorial: Add Meclib feedback functions

mkraska edited this page Mar 6, 2024 · 2 revisions

Back to My first Meclib question

Feedback functions are provided for detailed adaptive feedback without complex potential response trees. This way it is easy to equip many questions with enriched standard feedback.

The feedback functions are included using links to the Meclib github repository.

The code for inserting them is found under Meclib question setup. In our case, we need the feedback for numeric or algebraic values.

Feedback for Numeric Input

Question variables

  • Insert the link to fb_value.mac
stack_include("https://raw.githubusercontent.com/mkraska/meclib/main/Maxima/fb_value_EN.mac");

Potential response tree Hnum

  • Node 1
    • Quiet: Yes (suppress standard feedback of the answer test)
    • Make sure that text format of the "true feedback" and "false feedback" text fields is set to HTML (failing to do so suppresses the yellow feedback background)
    • false feedback: {@fb_unit(S_Hnum, Hnum*cm, 0.05)@} This is Meclib standard feedback for numerical values with or without units. The numeric value matches the tolerance of the answer test.

Preview

  • Press Save changes and continue editing
  • Press Preview
  • Press Fill in correct responses
  • Change cm to m in the third input field
  • Press Check

image

This is an example of the feedback that the function fb_unit can provide.

Add Feedback for the Algebraic Input fields

Potential response tree Ha

  • Node 1
    • Make sure that text format of the "true feedback" and "false feedback" text fields is set to HTML (failing to do so suppresses the yellow feedback background)
    • false feedback: {@fb_vars(S_Ha,Ha)@} This is Meclib standard feedback for algebraic expressions. Basically it compares the sets of variables in student's and teacher's answer.

Potential response tree H

  • Node 1
    • Make sure that text format of the "true feedback" and "false feedback" text fields is set to HTML (failing to do so suppresses the yellow feedback background)
    • false feedback: {@fb_vars(S_H,H)@}

Preview

  • Press Save changes and continue editing
  • Press Preview
  • Press Fill in correct responses
  • Modify the first two inputs as shown
  • Press Check

image

Note that we see interference of the unit definitions with the formatting of algebraic expressions. $A$ and $L$ should be italic.

Nonetheless this type of feedback handles some very basic errors in wrong usage of variables. There may be cases where the feedback would give away too much of the solution. Usually it does not harm to add the feedback functions shown here to every algebraic or numeric input.

Back to My first Meclib question

Tryout Space

In order to try code snippets in jsfiddle,

  1. copy the code from the wiki page to the clipboard
  2. follow the link for the JSXGraph version you want to try
  3. Replace the code in the HTML section (contents of <p hidden id="init">) with the content of the clipboard
Clone this wiki locally