Image Target Question - No Image When Editing

Image Target Question - No Image When Editing

by Phillip Brough -
Number of replies: 19
I hope someone can help. I am developing a site using moodle 1.9 beta 4 and I am trying to make use of the Image Target question type. Unfortunately it is not working too well for me. I am able to specify an image and it shows up on the question preview and I can drag the bullseye over the image. The problem is when I am trying to edit the question. No image appears so no target area can be defined. I have tried this now on several different machines with different browsers so I am guessing that there is a problem with the setup.

The installation was done by simply copying the imagetarget directory in to the question\type folder on the web server. The installation instructions don't seem to require anything else and the cropper module seems to be loaded from this directory as well.

If anyone can help I would be most grateful

Cheers
Phil
Average of ratings: -
In reply to Phillip Brough

Svar: Image Target Question - No Image When Editing

by Bent Nikolaisen -
I have the same problem. Can someone suggest a solution ?
In reply to Bent Nikolaisen

Re: Svar: Image Target Question - No Image When Editing

by Nicolas Dunand -
Picture of Core developers Picture of Plugin developers
Hello,

I have to report exactly the same problem here. That is, everything seems to be working fine, except that I can't add any targets to the image.

As far as I know, this is not a browser problem, as the problem is the same with Firefox 2, IE 7 and Safari 3.

My system is a Moodle 1.9 + (Build: 20080507), running on Apache 2.0.52 with PHP 4.3.9, using a Red Hat Enterprise Linux 4.0 Advanced Server.

I will try and install it on another system (Debian / Apache2-PHP5) and let you know if anything comes out of it.

Regards.
In reply to Nicolas Dunand

Re: Svar: Image Target Question - No Image When Editing

by Nicolas Dunand -
Picture of Core developers Picture of Plugin developers
I just installed it all on a new Debian 4.0, using Apache 2.2.3 and PHP 5.2.0-8. The Moodle version is slightly different as well : Moodle 1.9.1+ (Build: 20080604).

And ... everything works fine ! grand sourire

Now all I have to do is to check whether this a Moodle version issue or not. (My concern is that, for this to run on my institution's Moodle, it HAS to run on a Red Hat Linux.)

[edit]updating my 1.9+ Red Hat installation to Moodle 1.9.1+ doesn't seem to solve the problem[/edit]
In reply to Nicolas Dunand

Re: Svar: Image Target Question - No Image When Editing

by Tim Hunt -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
I wonder if it is PHP4/5 that makes the difference. Do you have an easy way to test that? It is really great the detailed information you have give so far, but it would be good to pin down exactly what the think is that makes a difference.

In reply to Tim Hunt

Re: Svar: Image Target Question - No Image When Editing

by Adriane Boyd -
Tim is right! It doesn't work with PHP4. I don't know why I hadn't thought to test that sooner. I don't know why it doesn't work yet (no obvious PHP errors to be seen), but I can finally replicate the problem.
In reply to Adriane Boyd

Re: Svar: Image Target Question - No Image When Editing

by Tim Hunt -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
Just guessing here, but the most likely thing is that when you pass an object to a function, in PHP 5 it is always passed by reference, while in PHP 4 it is copied, so any changes to the object in the function are lost.
In reply to Tim Hunt

Re: Svar: Image Target Question - No Image When Editing

by Nicolas Dunand -
Picture of Core developers Picture of Plugin developers
Well, I'm not that much into PHP 4/5, but thanks for pointing this out Adriane. The most important for me is how to make this work ("why" comes later ;) )

I will then update my Moodle server to PHP 5 when doing the summer update.

Thanks a lot for solving this.

smile
In reply to Nicolas Dunand

Re: Svar: Image Target Question - No Image When Editing

by Victor Santos -
Hello,

Did anyone come up with a solution for the non showing image?

GoodLuck big grin
In reply to Phillip Brough

Re: Image Target Question - No Image When Editing

by Jean-Michel Védrine -
Hello,
Have you visited Moodle Administration to create the table after copying the files to your server ?
In reply to Jean-Michel Védrine

Svar: Re: Image Target Question - No Image When Editing

by Bent Nikolaisen -
Yes, otherwise I don't think the questiontype would be available. The weird part is that I can make a question with an image (it seems to work in studentview), but in the editor I can't see the image or add a clickable area to it.
In reply to Bent Nikolaisen

Re: Svar: Re: Image Target Question - No Image When Editing

by Adriane Boyd -
I've heard about this error from a couple people, but I haven't been able to reproduce it, so I can't figure out what's going on. Could you let me know (by email if you'd prefer not to clutter the forum) details about your configuration that might be relevant?

I think that browser problems have been ruled out. Apparently the source of the edit page looks fine except that the bit of HTML/javascript to add the image cropper is completely missing. I've tested this question without ever seeing this problem with various versions of 1.9 and most recently with 1.9+ and 2.0 dev at the beginning of April, and I am baffled by this error.
In reply to Adriane Boyd

Re: Svar: Re: Image Target Question - No Image When Editing

by Peter Lawson -
I am also having problems with this question type... I add the image but nothing is showing in the spot where I am to select the area to be targeted.  When I preview the question... I get no images showing and no matter where I drag the target I get the incorrect result obviously... Hope someone can help with this
In reply to Peter Lawson

Re: Svar: Re: Image Target Question - No Image When Editing

by Peter Lawson -

This is driving me nuts...

Just to be clear as to what I have done to date
1 - The moodle is version 1.9
2 - I extracted imagetarget zip file into the .../question/type folder which created files and folders inside .../question/type/imagetarget
3 - I have created a teacher and used that account to make the question
4 - I select the image to use for the question and click the button so select the area
5 - I get no image displayed to select an area.
6 - If I preview the question I get no image at all

Have I failed to install something? Have I done something wrong? Can someone help or offer advice?

Thanks in advance

In reply to Peter Lawson

Re: Svar: Re: Image Target Question - No Image When Editing

by Tim Hunt -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
Do you need to do step

2 1/2. Go to the admin notifications page to allow the question type to install itself?
In reply to Peter Lawson

Svar: Re: Svar: Re: Image Target Question - No Image When Editing

by Bent Nikolaisen -
I have made a clean install with the latest 1.9 and no extras whatsoever. Added the imagetarget and installed it. No go....So far it seems to be something with the serversetup. I use Clarkconnect 4.1 (CentOs Linux) with Apache/Mysql.

Java seems to work as filemanager in webmin is javabased, but nothing I have tried with the combination Moodle/Java have worked.
In reply to Bent Nikolaisen

Re: Svar: Re: Svar: Re: Image Target Question - No Image When Editing

by Tim Hunt -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
Well, that sounds like quite an ordinary set-up, so it is surprising it does not work. It really needs someone to sit down with your broken version and do some debugging to work out what is going wrong.

Thank you for going to the trouble of setting up a clean install. That is a really helpful test to have done. It confirms that there is something wrong with the question type. But why does it only affect some people and not everyone?
In reply to Tim Hunt

Svar: Re: Svar: Re: Svar: Re: Image Target Question - No Image When Editing

by Bent Nikolaisen -
I have given admin-access to this site to A. Boyd. It is only a testsite, so if you need access, just pm me.
In reply to Phillip Brough

Re: Image Target Question - No Image When Editing

by philippe petitqueux -
Hello,

Same problem for me on Moodle 1.9.5 (20092010).

It's not a theme problem and not a browser problem.

The strange thing is that I can see the image for half a second sometimes and then it disappears. The old image target questions work.

anyone a solution?

Thanks.

In reply to philippe petitqueux

Re: Image Target Question - No Image When Editing

by Ivan Kosak -
I found that image target select area doesn't work on Google Chrome browser but on Mozilla Firefox and Internet Explorer 8 does.