Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Quiz Review, Navigation Anchor Links Incorrect #104

Open
nyanginator opened this issue Jul 17, 2017 · 7 comments
Open

Quiz Review, Navigation Anchor Links Incorrect #104

nyanginator opened this issue Jul 17, 2017 · 7 comments
Labels

Comments

@nyanginator
Copy link

Possibly related to: #96. After taking a quiz, there is a review page. On the top-right is a Quiz Navigation section with anchor links to each question on the page. Those links are incorrect. They should be:

  1. http://localhost/cleanmoodle/mod/quiz/review.php?attempt=1#
  2. http://localhost/cleanmoodle/mod/quiz/review.php?attempt=1#q2
  3. http://localhost/cleanmoodle/mod/quiz/review.php?attempt=1#q3
  4. ...

Instead, I'm getting:

  1. http://localhost/cleanmoodle/cleanmoodle/#
  2. http://localhost/cleanmoodle/#q2
  3. http://localhost/cleanmoodle/#q3
  4. ...

My Moodle is installed in /htdocs/cleanmoodle, $CFG->wwwroot = http://localhost/cleanmoodle.

quiznav

@brendanheywood
Copy link
Owner

That is really weird, we are testing it right now with quiz and other pages and not seeing this issue. As a wild stab in the dark can you set up a host hack and change your wwwroot to something other than localhost. Try something which contains . and looks like a proper domain name. Perhaps the url parser is unhappy with localhost

@nyanginator
Copy link
Author

Same problem. I tried 2 more new installs of Moodle 3.3.1, with $CFG->wwwroot = http://192.168.1.10/cleanmoodle and $CFG->wwwroot = http://192.168.1.10. I created a course, created a quiz activity, and created some true/false questions. I'm noticing now that the navigation is actually broken during the quiz attempt as well, not just on the review page:

  1. When taking the quiz, the current question's link in the Navigation is wrong, in my case just going to http://192.168.1.10/#, which takes me to the Dashboard.
  2. The summary page Navigation links seem okay.
  3. The review page (after clicking Submit All and Finish) Navigation links are not, as specified in my original post.

As soon as I disable Clean URLs in the plugin settings, the links turn back to normal. I'm using XAMPP 7.1.1 btw.

@brendanheywood
Copy link
Owner

And what happens when you visit this page as an admin?:

/local/cleanurls/webservertest.php

@nyanginator
Copy link
Author

Everything looks okay there:

image

@nyanginator
Copy link
Author

In case anybody else is encountering this, here's a quick hacky fix. In /local/cleanurls/classes/local/cleaner/cleaner.php's execute(), basically ignore links on quiz pages that have an anchor # sign in it:

private function execute() {
    global $PAGE;
    if (strpos($PAGE->pagetype, 'mod-quiz-') !== false) {
        if (strpos($this->originalurl->raw_out(false), '#') !== false) {
            return;
        }
    }
    ...

I mentioned #96 above as well, and it appears the sample Custom Menu does also cause an anchor # to be in the dropdown URL.

@brendanheywood
Copy link
Owner

@nyanginator this one is probably fixed too. Do mind retesting a few of your issues and if they work in that dev branch can we close these off?

@nyanginator
Copy link
Author

nyanginator commented Aug 3, 2017

Still seeing the same issue with the latest dev branch. Other issues also remain: #96 and #110

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants