Commit 407717c1 authored by Hemant Gupta's avatar Hemant Gupta Committed by Nigel Cunningham
Browse files

Issue #3098625 by guptahemant: Fix undefined index issues in the score plugins

parent 02b99b14
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -52,7 +52,7 @@ class Contains extends WebformScoreBase implements WebformScoreInterface {
      '#title' => $this->t('Match'),
      '#size' => 32,
      '#required' => TRUE,
      '#default_value' => $this->configuration['expected'],
      '#default_value' => $this->configuration['expected'] ?? '',
      '#description' => $this->t('The answer should contain this string to qualify as correct.'),
    ];

@@ -60,7 +60,7 @@ class Contains extends WebformScoreBase implements WebformScoreInterface {
      '#type' => 'checkbox',
      '#title' => $this->t('Case sensitive?'),
      '#description' => $this->t('Whether to compare the answer in case sensitive mode.'),
      '#default_value' => $this->configuration['case_sensitive'],
      '#default_value' => $this->configuration['case_sensitive'] ?? FALSE,
    ];

    return $form;
+2 −2
Original line number Diff line number Diff line
@@ -71,14 +71,14 @@ class Equals extends WebformScoreBase implements WebformScoreInterface {
      '#title' => $this->t('Expected answer'),
      '#size' => 32,
      '#required' => TRUE,
      '#default_value' => $this->configuration['expected'],
      '#default_value' => $this->configuration['expected'] ?? '',
    ];

    $form['case_sensitive'] = [
      '#type' => 'checkbox',
      '#title' => $this->t('Case sensitive?'),
      '#description' => $this->t('Whether to compare the answer in case sensitive mode.'),
      '#default_value' => $this->configuration['case_sensitive'],
      '#default_value' => $this->configuration['case_sensitive'] ?? FALSE,
    ];

    return $form;
+1 −1
Original line number Diff line number Diff line
@@ -57,7 +57,7 @@ abstract class WebformScoreBase extends PluginBase implements WebformScoreInterf
      '#required' => TRUE,
      '#step' => 1,
      '#min' => 0,
      '#default_value' => $this->configuration['max_score'],
      '#default_value' => $this->configuration['max_score'] ?? 1,
    ];

    return $form;