In one of our applications, we have data that we want to strip before displaying in a list or report, e.g., "Medical Terminology Quiz I #22929747-1". We want to remove the numerical id from this field as it is unnecessary.
We have been supplied a function to strip this extra data:
//To remove Quiz ID from the Quiz Name
function formatQuizTitle($quizTitle){
$withoutTrailingNumber = preg_replace('/#[0-9]+-[0-9]+/','',$quizTitle);
return $withoutTrailingNumber;
}
I have tried several different ways to get this to work but have been unsuccessful. Where is this PHP code inserted ... in the Visual Editor, or in the Events section? Also, what command(s)/statements, are required to process the function?
Thanks,
Russ