Moodle

Importing to an other course QUIZ or HTML pages containing images : images not displaying because of "broken" link

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Won't Fix
  • Affects Version/s: 1.9.2
  • Fix Version/s: None
  • Labels:
    None
  • Environment:
    Linux
  • Database:
    MySQL
  • Affected Branches:
    MOODLE_19_STABLE

Description

I try to import Quizzes and HTML pages from a course to other course. The link in the HTML code is pointing the original folder instead of the destination folder.

I import QUIZ or HTML page with images (not attached, inserted with HTML editor) from course ID=9 to course ID=6
RESULT : images not displayed for the students because of a link problem
HTML CODE : ".../file.php?file=%2F9/OOWriter/icone.png" instead of ".../file.php?file=%2F6/OOWriter/icone.png"

Hoping that this is not a duplicate. I find that this tracker is not user-friendly !

Moodle 1.9.2+ (Build: 20080924)
MySQL 5.0.60
apache 2.2.9
php 5.2.4

Activity

Hide
broll added a comment -

I found that images files are not imported to the destination folder...

Show
broll added a comment - I found that images files are not imported to the destination folder...
Hide
Eloy Lafuente (stronk7) added a comment -

Hi broll,

can you attach one mini-example backup of the problem? No users no anything else, just some quizz with questions / HTML resource.

The key here is that backup & restore only is able to process those file.php? changes if FULL URLs have been used when creating the image links.

So, something like:

http://oldsite/oldmoodle/file.php?file=oldcourse/whatever

will be transformed automatically to:

http://anothersite/anothermoodle/file.php?file=anothercourse/whatever

But, RELATIVE or ABSOLUTE links won't be transformed at all, so these:

  • /oldmoodle/file.php?file=oldcourse/whatever
    -../file.php?file=oldcourse/whatever

won't be changed, i.e, your problem.

Just need to know how those relative links have arrived to Moodle (because the HTML editor uses to write, always, FULL links - no RELATIVE nor ABSOLUTE).

Ciao

Show
Eloy Lafuente (stronk7) added a comment - Hi broll, can you attach one mini-example backup of the problem? No users no anything else, just some quizz with questions / HTML resource. The key here is that backup & restore only is able to process those file.php? changes if FULL URLs have been used when creating the image links. So, something like: http://oldsite/oldmoodle/file.php?file=oldcourse/whatever will be transformed automatically to: http://anothersite/anothermoodle/file.php?file=anothercourse/whatever But, RELATIVE or ABSOLUTE links won't be transformed at all, so these:
  • /oldmoodle/file.php?file=oldcourse/whatever -../file.php?file=oldcourse/whatever
won't be changed, i.e, your problem. Just need to know how those relative links have arrived to Moodle (because the HTML editor uses to write, always, FULL links - no RELATIVE nor ABSOLUTE). Ciao
Hide
broll added a comment -

I hope this file will help to solve the problem. I found that importing questions works only if files (images) are already in the course folder. Otherwise the links are broken.

Show
broll added a comment - I hope this file will help to solve the problem. I found that importing questions works only if files (images) are already in the course folder. Otherwise the links are broken.
Hide
Margot Schuhmacher added a comment -

I have tried to import quizzes where questions have image links. The image links are not updated in the imported quiz questions. Two methods are used:

1. Export in the Quiz activity and import in quiz activity in new course. In this case files were not copied into Files area and links point to old course

2. Use the Administration->Import function. In this case files were copied into the Files area, but links still point to old course.

When checking html of quiz question, the code is using the FULL url but is not updated. The URL is scr="http://moodle.site.au/file.php/124/quizzes/topic1/images/nar001-1.jpg"

I also found there is another job open on this which seems to be the same problem - MDL-9475

Margot

Show
Margot Schuhmacher added a comment - I have tried to import quizzes where questions have image links. The image links are not updated in the imported quiz questions. Two methods are used: 1. Export in the Quiz activity and import in quiz activity in new course. In this case files were not copied into Files area and links point to old course 2. Use the Administration->Import function. In this case files were copied into the Files area, but links still point to old course. When checking html of quiz question, the code is using the FULL url but is not updated. The URL is scr="http://moodle.site.au/file.php/124/quizzes/topic1/images/nar001-1.jpg" I also found there is another job open on this which seems to be the same problem - MDL-9475 Margot
Hide
Martin Dougiamas added a comment -

Reassigning this to moodle.com for the time being, since Mark Nielsen is not maintaining Lesson any more. Please comment/vote/patch any crucial bugs that affect you for 2.0 to help us prioritise fixes for the upcoming release.

Show
Martin Dougiamas added a comment - Reassigning this to moodle.com for the time being, since Mark Nielsen is not maintaining Lesson any more. Please comment/vote/patch any crucial bugs that affect you for 2.0 to help us prioritise fixes for the upcoming release.
Hide
Michael de Raadt added a comment -

Thanks for reporting this issue.

We have detected that this issue has been inactive for over a year has been recorded as affecting versions that are no longer supported.

If you believe that this issue is still relevant to current versions (2.1 and beyond), please comment on the issue. Issues left inactive for a further month will be closed.

Michael d;

lqjjLKA0p6

Show
Michael de Raadt added a comment - Thanks for reporting this issue. We have detected that this issue has been inactive for over a year has been recorded as affecting versions that are no longer supported. If you believe that this issue is still relevant to current versions (2.1 and beyond), please comment on the issue. Issues left inactive for a further month will be closed. Michael d; lqjjLKA0p6
Hide
Michael de Raadt added a comment -

I'm closing this issue as it appears to have become inactive and is probably not relevant to a current supported version. If you are encountering this problem or one similar, please launch a new issue.

Show
Michael de Raadt added a comment - I'm closing this issue as it appears to have become inactive and is probably not relevant to a current supported version. If you are encountering this problem or one similar, please launch a new issue.

People

Dates

  • Created:
    Updated:
    Resolved: