I need to use double quotes within my js. After compiler errors, looked through forum posts here and solution was to use three double quotes
original script
function checkStatus(){
if(document.querySelectorAll('[validationid="controller:learner-transcript-details:::svg:::queue"]').length == 0 &&
document.querySelectorAll('[validationid="controller:learner-transcript-details:::svg:::in-progress"]').length == 0 &&
document.querySelectorAll('[validationid="controller:learner-transcript-details:::svg:::queued"]').length == 0)
return 1;
else return 0;
}
Now adding the additional double quotes that inject javascript activity needs
"function checkStatus(){
if(document.querySelectorAll('[validationid="controller:learner-transcript-details:::svg:::queue"]').length == 0 &&
document.querySelectorAll('[validationid="controller:learner-transcript-details:::svg:::in-progress"]').length == 0 &&
document.querySelectorAll('[validationid="controller:learner-transcript-details:::svg:::queued"]').length == 0)
return 1;
else return 0;
}"
but this escapes the double quotes. So replaced these with three per forum posts
"function checkStatus(){
if(document.querySelectorAll('[validationid="""controller:learner-transcript-details:::svg:::queue"""]').length == 0 &&
document.querySelectorAll('[validationid="""controller:learner-transcript-details:::svg:::in-progress"""]').length == 0 &&
document.querySelectorAll('[validationid="""controller:learner-transcript-details:::svg:::queued"""]').length == 0)
return 1;
else return 0;
}"
Compiler error. Also tried with two double quotes but same issue
"function checkStatus(){
if(document.querySelectorAll('[validationid=""controller:learner-transcript-details:::svg:::queue""]').length == 0 &&
document.querySelectorAll('[validationid=""controller:learner-transcript-details:::svg:::in-progress""]').length == 0 &&
document.querySelectorAll('[validationid=""controller:learner-transcript-details:::svg:::queued""]').length == 0)
return 1;
else return 0;
}"
x_x