Description:
I want to use code snippets containing programming languages in my CredSpark assessments, but they seem to interfere with the functionality of the assessment.
Answer:
When using double curly brackets ( {{ ) as part of your question in the assessment, it can interfere with the functionality of the assessment. CredSpark has a feature called Piping Logic, which uses double curly brackets to insert the answer to a previous question.
When you use double curly brackets for other purposes, these have to be escaped by placing a backslash ( \ ) before the first curly bracket. The backslash is not rendered in the assessment, you only see it as an editor, but it stops the assessment from trying to render it as Piping Logic.
Example:
<a href={exampleUrl} innerHTML={{__html: <b>{exampleUrl}</b>}} />
Should be added as:
<a href={exampleUrl} innerHTML=\{{__html: <b>{exampleUrl}</b>}} />