• I would like to allow my users the ability to share any one of the questions that I have in a quiz. I guess what I’m looking for is a unique url for a question in the quiz. I see where each question has an id but how do I correlate this into a unique url for a particular question?

    Any help would be greatly appreciate.

    Thanks and have a great day!
    – Brian

Viewing 3 replies - 1 through 3 (of 3 total)
  • Brian, because WP Pro Quiz uses custom database tables (not wordpress posts) for it’s questions, the only way to get the questions is to load them. There is no slug, or single view or anything that would come automatically if the developer was using WP posts. So the short answer is, unless you code it, there is no way to view a single question.

    Also the code for displaying a question is a mile long because there are so many different answer types, and normally questions are only displayed when loaded into a quiz first. To extend and rewrite the view classes to enable displaying a single question will be quite a bit of work.

    Thread Starter bmohr

    (@bmohr)

    ok. I would like to have individual urls for each question. Do you do this kind of work? How much would something like this cost?

    Yes, we work with WP Pro Quiz a lot and built an add-on called WP Pro Quiz Completed that displays all historical quiz stats to the quiz taker. We’re not allowed to share any links here or say anything promotional, so if you want to discuss further please contact via my profile which has our website link.

    The way I see building this feature as an addon (without touching the WP Pro Quiz files) is to make a shortcode like [wpproquiz_question]. If you include a question ID like [wpproquiz_question id=6] then it shows that question. Otherwise it tries to load the question from a get param so you could link to the page example.com/question/8 and that would load question with ID 8. And I suppose if you visit example.com/question/ it would just say a warning message “No Question ID Found”. It’s tough to support a slug in an addon without hacking the core files because WP Pro Quiz doesn’t have a hook like “question_saved” that we could tap into in order to generate a slug.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Url of individual question’ is closed to new replies.