I am trying to give students feedback in an activity through CL text. Some of the questions require that students input their answers as fractions, but I want to limit my feedback ouput to just 4 decimal places. How can I code this?
Here is an example of my code:
content: “{question} {feedback}” (note: missing strings are really there in the code)
question = "A recent survey of American adults found that 638 of 840 have a favorable opinion of the current presidential administration. Develop a confidence interval for the actual proportion of American adults that have a favorable opinion of the administration.
What is the sample proportion \hat{p}
?"
answerlow = 0.75
answerhigh = 0.761
feedback =
when Input21.submitted and Input21.numericValue< answerhigh and Input21.numericValue> answerlow “\n\n\n✅Good job. ${Input21.numericValue} is correct.”
when Input21.submitted “\n\n\n❌ Nope. Remember, we are now looking for a sample proportion. This is simply the number of adults who approve of the president divided by the number that were asked.”
otherwise “”
I want the output for the correct answer “\n\n\n✅Good job. ${Input21.numericValue} is correct.” to be limited to a certain number of decimal places (in this case 3). How can I make this happen?
Thanks in advance.