Re: [Minno.js] Problem with loading images in user-defined AMP

12 views
Skip to first unread message

Mayan Navon

unread,
May 23, 2021, 5:52:35 AMMay 23
to Michael Andreychik, Minno.js
Hi Michael,

Three things:
1. You need to save your script as .js (JavaScript). Currently it is saved as .md. 
2. You need to remove the final forward slash from the images url.
3. You're missing some closing brackets (see my mark):

define(['pipAPI', 'https://cdn.jsdelivr.net/gh/baranan/minno-tasks@0.*/amp/qualtrics/qamp.js'], function(APIConstructor, ampExtension){


        var API = new APIConstructor();


        return ampExtension({
            primeCats :  [
                {
                    nameForFeedback : 'Black people',  //Will be used in the user feedback 
                    nameForLogging : 'Black people', //Will be used in the logging
                    //An array of all media objects for this category.
                    mediaArray : [
                        {image : 'AAF1.bmp'}, 
                        {image : 'AAF2.bmp'}, 
                        {image : 'AAF3.bmp'}, 
                        {image : 'AAF4.bmp'}, 
                        {image : 'AAF5.bmp'}, 
                        {image : 'AAM1.bmp'}, 
                        {image : 'AAM2.bmp'}, 
                        {image : 'AAM3.bmp'}, 
                        {image : 'AAM4.bmp'}, 
                        {image : 'AAM5.bmp'}]


                }, 
                {
                    nameForFeedback : 'White people',  //Will be used in the user feedback 
                    nameForLogging : 'White people', //Will be used in the logging
                    //An array of all media objects for this category.
                    mediaArray : [
                        {image : 'WhFBl1.bmp'}, 
                        {image : 'WhFBl2.bmp'}, 
                        {image : 'WhFBl3.bmp'}, 
                        {image : 'WhFBl4.bmp'}, 
                        {image : 'WhFBl5.bmp'}, 
                        {image : 'WhMBl1.bmp'}, 
                        {image : 'WhMBl2.bmp'}, 
                        {image : 'WhMBl3.bmp'}, 
                        {image : 'WhMBl4.bmp'}, 
                        {image : 'WhMBl5.bmp'}]
                }
            ],


            examplePrimeStimulus : 
            {
                nameForLogging : 'examplePrime', //Will be used in the logging
                //An array of all media objects for this category.
                mediaArray : [{image : 'ampchair.jpg'}, {image : 'amplamp.jpg'}, {image : 'ampumbrella.jpg'}]
            },


            base_url : {//Where are your images at?
                image : 'https://satchmo496.github.io/images'
            }
        });
});

This should solve your issues, Let me know if that helped.

Best,
Mayan

On Fri, 21 May 2021 at 19:51, Michael Andreychik <m.andr...@gmail.com> wrote:
Apologies for what I am almost certain is a question with an incredibly simple fix for someone more knowledgeable about minno.js than I am!

One of my students and I are attempting to create a few different AMPs using minno.js which we will run in Qualtrics. We'll be hosting our scripts and images on github. We are able to get the sample script to work perfectly in Qualtrics. But, once we attempt to change the sample script to load our (image) stimuli rather than those in the sample script, the script will no longer work.

I have to imagine the fix here is a a very simple one but sadly neither of us has much programming experience. For your reference, the script is here.

And, the folder with our images is here.

I suspect the issue relates to how we're entering the base_url, but we've tried a number of variations to no effect.

Thank you in advance for any help you can provide and for making this very useful tool available!

--
You received this message because you are subscribed to the Google Groups "Minno.js" group.
To unsubscribe from this group and stop receiving emails from it, send an email to minnojs+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/minnojs/3f26f9f7-1cec-4ebc-a391-d30ec231ccban%40googlegroups.com.


--
Mayan

Yoav Bar-Anan

unread,
May 25, 2021, 12:00:27 PMMay 25
to Michael Andreychik, Minno.js
Hi Michael,

Your code looks fine to me. The only thing I can think of is that I have never tried to use a bmp file in Minno, so perhaps the file type is the problem. What happens if you download some of the photos from our example into your folder and use them in your script, does the script still break? If yes, you can try to use F12 (Developer tools) to see what exact image urls Minno fails to load, see whether the path seems ok to you, and whether there are any clues in the specific error messages that might help us find the problem.

All the best,
Yoav
Reply all
Reply to author
Forward
0 new messages