Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Randomize Text Callouts

Guest
Aug 27, 2020 Aug 27, 2020

Hi folks, 

 

I am teaching an anatomy course remotely this semester. To help students learn, I have been using Adobe Acrobat to create labeled diagrams of skeletons and muscles. Right now, I am labeling each bone with its proper name using text callouts, but I am also considering using non-specific labels (A, B, C...) so that students can use these sheets to quiz themselves. 

 

If I were to create ten text callouts, for example, is there any way to randomize the text of each callout? e.g. so that A becomes a random letter? Otherwise, I am worried that the students will just memorize that A = femur and not actual learn how to identify the femur.

 

Thank you,

Tony

TOPICS
General troubleshooting , How to
642
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Aug 27, 2020 Aug 27, 2020

You could create text field that can change random letter on mouse enter or create button to change text field letter on click.

See this video  example and let me know if thats what you looking for.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Employee ,
Aug 29, 2020 Aug 29, 2020

Hi Tony,

As a workaround, you can also consider changing the author name in the RHP comment list.

For example: Please see the attached screenshot I have changed the author for the first three comments and it works as a label for the comment if I guess your requirement.

Screenshot.pngexpand image

Regards,

Arvind

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Aug 29, 2020 Aug 29, 2020

It's possible to do it with a script, but there's an additional complication: It will have to keep a list of all previously used letters, as you probably don't want there to be duplicates... I wrote for you the code that does it. You can execute it from the JS Console or even from a button field:

 

this.syncAnnotScan();
var annots = this.getAnnots();
if (annots!=null) {
	var lettersUsed = [""];
	for (var i in annots) {
		var annot = annots[i];
		if (annot.type=="FreeText") {
			var randomLetter = "";
			while (lettersUsed.indexOf(randomLetter)!=-1) {
				randomLetter = String.fromCharCode(65+Math.floor(Math.random()*26));
			}
			lettersUsed.push(randomLetter);
			annot.contents = randomLetter;
		}
	}
}

If you want to to work only on the comments in a specific page then change this line:

var annots = this.getAnnots();

To:

var annots = this.getAnnots({nPage: 0});

(the value of nPage is the page number to process, but it's zero-based, so 0 is the first page in the file, 1 the second page, etc.)

 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Aug 29, 2020 Aug 29, 2020

PS. Make sure there are no more than 26 items, or it will enter an endless loop...

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Aug 31, 2020 Aug 31, 2020
LATEST

Wow, this is great! Thank you for the help. I will try to implement this for my students upcoming quiz and let you know if there are any complications.

 

IMG_9804-watermarked.jpgexpand image

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines