How to bring up the latest Multichoice Content Type

I'm planning to create new Multichoice questions everyday and bring it up on the sidebar using Block and Shortcodes. How can I bring the latest Multichoice content type without changing the shortcode within block every time I create new content? I see that views integration is very minimal and cannot filter the latest Multichoice content type. Or is there any other way? Thanks in advance.

papi Jo's picture

Please specify which Platform you're using: Drupal, Wordpress, Moodle?

Sorry, I'm using Drupal 7.4X.

papi Jo's picture

You cannot filter by H5P activity type (MCQ, ...). But you can filter by date (and display only the latest quiz) and by Title (or start of title). So, for instance, you could give all your MCQ quizzes a title/name starting with MCQ- (MCQ-Geography quiz, MCQ-History of the 20th century, etc.) and apply the ad hoc filter when you create the Views block. I can provide more details if needed.

Thanks for that. That's a good way around. But when I substitute the shortcode within a view with 'Global:Custom Text' field like this: <code>[h5p=[nid]]</code> I simply get the output as <code>[h5p=3384XX]</code>. I've added the 'Content:Nid' field previous to this field. So I'm sure that I'm getting the Node ID. So the question now becomes how to use the Shortcodes within the Views?

papi Jo's picture

I don't understand what you mean by "shortcode" etc. This is what I do:

  1. If not already done you need to install the Views module on your Drupal site.
  2. Go to Home » Administration » Structure » Views
  3. Add New View, call it e.g. MCQ of the day
  4. Untick Create a page and tick Create a block / Click Continue and Edit button
  5. Attached is a view of the various settings of my "MCQ of the day" block.
  6. Save the view!

Then go to Home » Administration » Structure > Blocks and add your "MCQ of the day" block to somewhere on your drupal site. For instance I have added it to First Sidebar, see screenshot. The latest MCQ H5P activity created is a clickable link.

tomaj's picture

Good job with the screenies!

You are displaying the link to the page, right? I do not want the user to be taken to a separate page. Instead, show the quiz in the right sidebar itself, for example.

papi Jo's picture

Sorry, I had not understood from your original post that you actually wanted your mcq quiz to be displayed inside the sidebar. How do you do that " using Block and Shortcodes"?

Why do you want to do that? Won't the content of your MCQ quiz be squeezed in the sidebar? Why don't you want just a link in the sidebar leading to the MCQ quiz on the page?

Yeah, I guess that's the only way for now.