You are here

questions_import.module in Quiz 6.6

Questions Import

This module allows you to import questions to quiz node in CSV, QTI XML, Moodle Aiken format.

File

includes/questions_import/questions_import.module
View source
<?php

/**
 * @file
 * Questions Import
 *
 * This module allows you to import questions to quiz node in CSV, QTI XML, Moodle Aiken format.
 */

/**
 * @function
 * Implementation of hook_help().
 */
function questions_import_help($path, $arg) {
  if ($path == 'admin/help#questions_import') {
    return '<p>' . t('This module allows you to import questions to quiz node in CSV, QTI XML, Moodle Aiken format.') . '</p>';
  }
}

/**
 * @function
 * Implementation of hook_perm()
 * Valid permissions for this module
 * @return array An array of valid permissions.
 */
function questions_import_perm() {
  return array(
    'import questions',
  );
}

/*
 * @function
 * Implementation of hook_menu()
 */
function questions_import_menu() {
  $items = array();
  $items['admin/quiz/questions_import'] = array(
    'title' => t('Import Quiz Questions'),
    'description' => t('Import Questions is an addon for quiz module. It allows to create a bulk of quiz questions from files. Allowed file formats are CSV, Moodle Aiken and QTI format.'),
    'file' => 'questions_import.admin.inc',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'questions_import_form',
    ),
    'access arguments' => array(
      'import_questions',
    ),
    'type' => MENU_NORMAL_ITEM,
  );
  return $items;
}

/*
 * @function
 * Implementation of hook_init
 * Adds the CSS and JS to create hide/show effect in questions import form
 */
function questions_import_init() {

  //to show/hide the CVS field input
  drupal_add_js(drupal_get_path('module', 'questions_import') . '/questions_import.js');
  drupal_add_css(drupal_get_path('module', 'questions_import') . '/questions_import.css', 'theme');
}

Functions

Namesort descending Description
questions_import_help @function Implementation of hook_help().
questions_import_init
questions_import_menu
questions_import_perm @function Implementation of hook_perm() Valid permissions for this module