Links in Questions not updated

Links in Questions not updated

by James Foster -
Number of replies: 16

Dear All,

Moodle 4.0.1

I believe I've found a potential issue/problem when adding links into questions in quizzes.  I'll explain my process as best I can, hopefully, it will make sense.

What I want to do:  Add a hyperlink to a pdf file on the same server.

Process:

1. Open Quiz

2. Start a preview

3. Click on Edit Question (the add the link in there) and then click on "Save and return"

4. The link doesn't appear in the question

5. Scratch head!!!

6. Open quiz again and "Continue Last Preview".  No changes have been made.

7. Edit the question, add the link and then click on "preview"

8. Yey! Link is in the preview.  Close Preview and Click on "Save and Return"

9. See 4 & 5

What I've found out after much head-scratching is:

You need to finish the existing Preview before any changes are made.  This wasn't how it used to work on previous versions (you could just click save and it would update) and don't know if this is a deliberate feature (some kind of Cache thing) or if something is wrong.

Advice would be appreciated (as well ideas on a faster route to finish the preview, mine goes on for 3 pages each time...It can be done, but it's a pain)

Thanks all

Average of ratings: -
In reply to James Foster

Re: Links in Questions not updated

by Joseph Rézeau -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers Picture of Translators

Hi James,

"What I want to do:  Add a hyperlink [inside a question] to a pdf file on the same server."

I don't think that's a good idea. You must have very serious reasons for wanting/needing to do that. Can you explain? Thanks!

In reply to Joseph Rézeau

Re: Links in Questions not updated

by James Foster -
It's a question that refers to a piece of text that I have created as a pdf file.

For example:

Now read the passage. Do the statements reflect the claims of the writer?

Type:
-Yes if the statement reflects the claims of the writer.
-No if the statement contradicts the claims of the writer.
-Not Given if it is impossible to say what the writer thinks about this.

1. The people in the survey were all married couples.

I want to add the link to the file at "the passage" to make it easier for students to access.
In reply to James Foster

Re: Links in Questions not updated

by Dominique Bauer -
Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Plugin developers

Hello James,

A simple, convenient and elegant way to refer to a PDF document is to include it directly in the quiz using Adobe's PDF Embed API which is free, easy to use and gives excellent results. You will find the example below and basic explanations at https://moodleformulas.org/course/view.php?id=77&section=77 ↗.

Instructions and examples on how to use the API can be found at Adobe PDF Embed API ↗. Note that all you have to do is register and get your free 32 character long API key (client ID) to get started.

MoodleForum_20220707_2316.png

The XML file for the above question is attached below. For the question to work, you will need to put your 32 character long Adobe API key (client ID) where indicated in the HTML of the question text.

In reply to Dominique Bauer

Re: Links in Questions not updated

by James Foster -
Dominique,

Thanks for this.  I'll definitely check it out.  Although, I still have a concern that the students are going to need to scroll up and down to view the reading and the questions.  In my mind, it's easier to open a new window, and just have 2 half screen browsers open.  Tha's how I've done it in the past, but I'm always open to new ideas.

thanks Again.

James
In reply to Joseph Rézeau

Re: Links in Questions not updated

by James Foster -
Hi Joseph

Out of curiosity why do you think it's such a bad idea?
In reply to James Foster

Re: Links in Questions not updated

by Joseph Rézeau -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers Picture of Translators

It's a bad idea because, when the students are doing the Quiz, when they click on the link to your PDF file, they are taken away from the question and the quiz. How do you expect them to come back to the quiz/question after reading the PDF text?

The feature you are looking for is probably the Dual Pane/Screen for Moodle Quiz. Unfortunately that feature is not readily available in the Moodle Quiz activity. But you'll find some alternatives here: https://moodle.org/mod/forum/discuss.php?d=390371



In reply to Joseph Rézeau

Re: Links in Questions not updated

by James Foster -
Ah, I see what you mean and yes, a dual pane would be great. Normally, I check the "Open in a new window" so that they can easily switch between the two. The reason I did this was because students always had to scroll up and down the page between the text and the questions, so giving them a new tab was my solution. Thanks for the link, I'll check it out.

Anyway, this is a little off topic...is my problem of the questions not immediately updating a new feature, or an issue? Any ideas?
In reply to James Foster

Re: Links in Questions not updated

by Thomas Korner -
Picture of Plugin developers Picture of Testers
You might consider: with Moodle 4.0 we now have a proper versioning which makes sure that a used question will remain the same (even if you update or change the question). By referring to an external file, you break this feature. What does happen, if you remove (or worse change) the pdf? you can’t reproduce the original attempt. I strongly recommend to include everything you need to answer the question into the question as long as you haven’t a very, very good reason.
Average of ratings:Useful (1)
In reply to James Foster

Re: Links in Questions not updated

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 think that what you are talking about is not related to PDFs. It is just about question versions (new in 4.0) and how that relates to the preview pop-up.

Simpler steps to reproduce:

  1. Go to https://qa.moodledemo.net/question/edit.php?courseid=2 and log in as teacher.
  2. Preview any question. Answer the question, and leave the pop-up open.
  3. Back in the main window, edit the question, change the question text, and save.
  4. Return to the preview pop-up. Click 'Start again'.

Expected result: you see your new question text.

Actual result: you still see the oritinal question text.

Explanation: 'Preview options' in the pop-up. You will see a 'Question version' option which is set to 1. That is why your new preview used version 1.

Suggested solution: Perhaps that drop-down should have an 'Always latest' option (like on the quiz edit page) which should be the default (unless you have opened preview of a specific version from the question preview page).

Do people agree with this suggested solution? If so, we need to add it to the tracker, and implement it. (Should not be too hard.)

Average of ratings:Useful (3)
In reply to Tim Hunt

Re: Links in Questions not updated

by Joseph Rézeau -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers Picture of Translators

Tim "Suggested solution: Perhaps that drop-down should have an 'Always latest' option"

Agree.🙂

Average of ratings:Useful (1)
In reply to Tim Hunt

Re: Links in Questions not updated

by Matthias Giger -
Picture of Particularly helpful Moodlers
As in older versions of Moodle changes in questions reflected immediately and because that's what most users will probably expect, I second your suggestion.
Average of ratings:Useful (2)
In reply to Tim Hunt

Re: Links in Questions not updated

by Dominique Bauer -
Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Plugin developers

Of course, that seems pretty obvious.

You might take this opportunity to put back the "Download this question in Moodle XML format" link, which was  removed in 4.0.

Average of ratings:Useful (2)
In reply to Tim Hunt

Re: Links in Questions not updated

by Thomas Korner -
Picture of Plugin developers Picture of Testers
yes, I do agree, straight forward approach
In reply to Thomas Korner

Re: Links in Questions not updated

by Dominique Bauer -
Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Plugin developers
because that's what most users will probably expect
Agree. So why not just make the pop-up open by default to the latest version instead of the first. No one will complain about this.
Average of ratings:Useful (1)
In reply to Tim Hunt

Re: Links in Questions not updated

by Tim Hunt -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
OK, so I just created tracker issue MDL-75301 for this.
Average of ratings:Useful (1)
In reply to Tim Hunt

Re: Links in Questions not updated

by James Foster -
To everyone that helped me with my issue, a big THANK YOU. It also seems that the issue is now resolved.

I'll try and keep my eye on these forums more so that I can offer advice and help to others, if I can.

Thanks again

James
Average of ratings:Useful (2)