The "Start quiz" button that gets attached to the quiz node in hook_view should be implemented in hook_field_extra_fields so that Drupal core and other modules know about it.

I found this problem when I was using this module with Display Suite (http://drupal.org/project/ds) and the "Start quiz" button wouldn't show up in the Manage Display tab in the back-end and wouldn't be rendered in the front-end.

Here is my suggestion to fix the problem:

<?php
/**
* Implements hook_field_extra_fields().
*/
function quiz_field_extra_fields() {
 
$extra = array();
 
$extra['node']['quiz'] = array(
   
'display' => array(
     
'take' => array(
       
'label' => t('Take quiz button'),
       
'description' => t('The take button.'),
       
'weight' => 10,
      ),
    ),
  );
  return
$extra;
}
?>

Comments

I'm having a similar problem. Had everything working fine and I can't figure out what is causing the problem. I've disabled any new modules, changed themes, etc. but cant' get the button to appear for users.

Where do I add this code? I've tried a couple places so I'm either putting in the wrong place or and up against a different problem.

Thanks!

----

Ignore this...problem with my theme.

Status:Active» Fixed

Thanks for the fix. Added start quiz button and quiz summary to hook_field_extra_fields(). Commit c1842a0..e5e51e3.

Status:Fixed» Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

  • Commit e5e51e3 on 7.x-4.x, 7.x-5.x by sivaji: Fix #1863354 - Make start quiz button and quiz summary obey content type...