Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Da_Cloud created an issue. See original summary.

Da_Cloud’s picture

quiz.install => quiz_schema()

$schema['quiz_node_results_answers'] = array(
  'description' => 'Table storing information about each question response in an attempt.',
  'fields' => array(
    'result_answer_id' => array(
      'description' => 'The result answer ID',
      'type' => 'serial',
      'unsigned' => TRUE,
      'not null' => TRUE,
      'description' => 'The primary identifier for this result answer.',
    ),

As per default the last key will be used and this description is also in line with the rest of quiz_schema().

Da_Cloud’s picture

quiz.module => quiz_entity_info()

'quiz_result_type' => array(
  'label' => t('Quiz result type'),
  'entity class' => 'Entity',
  'plural label' => t('Quiz result types'),
  'description' => t('Quiz result types.'),
  'controller class' => 'EntityAPIControllerExportable',
  'base table' => 'quiz_result_type',
  'fieldable' => FALSE,
  'entity class' => 'Entity',
  'bundle of' => 'quiz_result',
  'exportable' => TRUE,
  'entity keys' => array(
    'id' => 'id',
    'name' => 'type',
    'label' => 'label',
  ),
  'access callback' => 'quiz_result_type_access',
  'module' => 'quiz',
  // Enable the entity API's admin UI.
  'admin ui' => array(
    'path' => 'admin/quiz/result',
    'controller class' => 'EntityDefaultUIController',
  ),
),

Here we have a double 'entity class' => 'Entity', declaration.

Da_Cloud’s picture

tests/QuizAccessTestCase.test => testQuizTakerAnswerScore() {

$question_node = $this->drupalCreateNode(array(
  'type' => 'short_answer',
  'title' => 'SA 1 title',
  'correct_answer_evaluation' => ShortAnswerQuestion::ANSWER_MANUAL,
  'correct_answer' => 'blue',
  'correct_answer' => 1,
  'body' => array(LANGUAGE_NONE => array(array('value' => 'SA 1 body text'))),
));
$quiz_node = $this->linkQuestionToQuiz($question_node);

Here we have a double correct_answer declaration with 2 different answers. As per PHP default the last declaration will be used so the patch will remove the first.

Da_Cloud’s picture

Status: Active » Needs review
djdevin’s picture

Title: Remove dublicated array indexes » Remove duplicated array indexes

  • djdevin committed 942dfb2 on 7.x-5.x authored by Da_Cloud
    Issue #2844872 by Da_Cloud: Remove duplicated array indexes
    
djdevin’s picture

Status: Needs review » Fixed

Thanks! Committed #2 #3 #4

Status: Fixed » Closed (fixed)

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