Hi, JJ!
In my earlier answer there was just general idea - not an exact code.
First: this is not JavaScript code - it is CourseLab action sequence. Switch back to usual CourseLab actions.
Second: _ here is just symbol of action indent (to mark dependant actions)
Third: CurRes_ID must be changed to real Current Result object ID - in your case OBJ_22 (varname also can be changed to more self-explaining name, but it is not so important).
Fourth: values in parenthesis are just parameters of CourseLab actions - I don't know how to put them in the plain text other way.
Finally, there is CourseLab action sequence for your sample:
VARIABLE (name=score, value=$OBJ_22.rawScore)
IF(condition=#score<40)
_ DISPLAY(object=TXT_1, action=display)
_ ELSE
_ _ IF(condition=#score<80)
_ _ _ DISPLAY(object=TXT_2, action=display)
_ _ _ ELSE
_ _ _ _ DISPLAY(object=TXT_5, action=display)
Note again, that underscores are here just to mark the number of indents, generated by right arrow button in CourseLab action editor - one _ is one indent.
Hi, JJ!
In my earlier answer there was just general idea - not an exact code.
First: this is not JavaScript code - it is CourseLab action sequence. Switch back to usual CourseLab actions.
Second: _ here is just symbol of action indent (to mark dependant actions)
Third: CurRes_ID must be changed to real Current Result object ID - in your case OBJ_22 (varname also can be changed to more self-explaining name, but it is not so important).
Fourth: values in parenthesis are just parameters of CourseLab actions - I don't know how to put them in the plain text other way.
Finally, there is CourseLab action sequence for your sample:
VARIABLE (name=score, value=$OBJ_22.rawScore)
IF(condition=#score<40)
_ DISPLAY(object=TXT_1, action=display)
_ ELSE
_ _ IF(condition=#score<80)
_ _ _ DISPLAY(object=TXT_2, action=display)
_ _ _ ELSE
_ _ _ _ DISPLAY(object=TXT_5, action=display)
Note again, that underscores are here just to mark the number of indents, generated by right arrow button in CourseLab action editor - one _ is one indent.