You are here

function quiz_ddlines_config in Quiz 8.4

Same name and namespace in other branches
  1. 7.4 question_types/quiz_ddlines/quiz_ddlines.module \quiz_ddlines_config()

Implements hook_config().

File

question_types/quiz_ddlines/quiz_ddlines.module, line 57
The main file for Quiz drag and drop with lines.

Code

function quiz_ddlines_config() {
  $config = \Drupal::config('quiz_ddlines.settings');
  $form['quiz_ddlines_canvas_width'] = array(
    '#type' => 'textfield',
    '#title' => t('The default width of the canvas'),
    '#default_value' => $config
      ->get('quiz_ddlines_canvas_width') ?: Defaults::CANVAS_WIDTH,
  );
  $form['quiz_ddlines_canvas_height'] = array(
    '#type' => 'textfield',
    '#title' => t('The default height of the canvas'),
    '#default_value' => $config
      ->get('quiz_ddlines_canvas_height') ?: Defaults::CANVAS_HEIGHT,
  );
  $form['quiz_ddlines_hotspot_radius'] = array(
    '#type' => 'textfield',
    '#title' => t('The radius of the hotspot'),
    '#default_value' => $config
      ->get('quiz_ddlines_hotspot_radius') ?: Defaults::HOTSPOT_RADIUS,
  );
  $form['quiz_ddlines_pointer_radius'] = array(
    '#type' => 'textfield',
    '#title' => t('The radius of the pointer'),
    '#default_value' => $config
      ->get('quiz_ddlines_pointer_radius') ?: Defaults::POINTER_RADIUS,
  );
  $form['quiz_ddlines_feedback_correct'] = array(
    '#type' => 'textfield',
    '#title' => t('Default feedback for correct answers'),
    '#default_value' => $config
      ->get('quiz_ddlines_feedback_correct'),
  );
  $form['quiz_ddlines_feedback_wrong'] = array(
    '#type' => 'textfield',
    '#title' => t('Default feedback for wrong answers'),
    '#default_value' => $config
      ->get('quiz_ddlines_feedback_wrong'),
  );
  $form['#validate'][] = 'quiz_ddlines_config_validate';
  $form['#submit'][] = 'quiz_ddlines_config_submit';
  return $form;
}