Bird
Raised Fist0
SCADA systemsdevops~10 mins

Data quality flags in SCADA systems - Interactive Code Practice

Choose your learning style10 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to set the data quality flag to 'GOOD' when the sensor reading is valid.

SCADA systems
if sensor_reading_valid:
    data_quality_flag = '[1]'
Drag options to blanks, or click blank then click option'
AGOOD
BUNKNOWN
CERROR
DBAD
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'BAD' or 'ERROR' flags for valid data.
2fill in blank
medium

Complete the code to mark the data quality flag as 'BAD' if the sensor reading is out of range.

SCADA systems
if sensor_reading < min_value or sensor_reading > max_value:
    data_quality_flag = '[1]'
Drag options to blanks, or click blank then click option'
AGOOD
BVALID
CUNKNOWN
DBAD
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'GOOD' flag for out of range data.
3fill in blank
hard

Fix the error in the code to correctly assign the 'UNKNOWN' flag when sensor status is unclear.

SCADA systems
if sensor_status == 'uncertain':
    data_quality_flag = '[1]'
Drag options to blanks, or click blank then click option'
AUNKNOWN
BBAD
CGOOD
DERROR
Attempts:
3 left
💡 Hint
Common Mistakes
Assigning 'GOOD' or 'BAD' flags when status is uncertain.
4fill in blank
hard

Fill both blanks to set the flag to 'ERROR' if sensor reading is None and log the issue.

SCADA systems
if sensor_reading is [1]:
    data_quality_flag = '[2]'
    log_issue('Sensor reading missing')
Drag options to blanks, or click blank then click option'
ANone
BGOOD
CERROR
DBAD
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'BAD' or 'GOOD' flags for missing data.
5fill in blank
hard

Fill all three blanks to create a dictionary mapping sensor IDs to their data quality flags, including only sensors with 'GOOD' or 'UNKNOWN' flags.

SCADA systems
quality_map = {sensor_id: data_quality_flags[sensor_id] for sensor_id in sensor_ids if data_quality_flags[sensor_id] [1] ['GOOD', 'UNKNOWN'] and sensor_id [2] None and data_quality_flags[sensor_id] [3] 'BAD'}
Drag options to blanks, or click blank then click option'
Ain
Bis not
C!=
D==
Attempts:
3 left
💡 Hint
Common Mistakes
Using '==' instead of 'in' for list membership.
Using '==' instead of '!=' to exclude flags.

Practice

(1/5)
1. What does a GOOD data quality flag indicate in a SCADA system?
easy
A. The sensor is offline and not sending data.
B. The sensor data is missing or unavailable.
C. The sensor data is suspected to be incorrect.
D. The sensor data is reliable and accurate.

Solution

  1. Step 1: Understand the meaning of data quality flags

    Data quality flags classify sensor data status to help users trust or ignore readings.
  2. Step 2: Identify the meaning of the GOOD flag

    The GOOD flag means the data is reliable and accurate, suitable for use in decisions.
  3. Final Answer:

    The sensor data is reliable and accurate. -> Option D
  4. Quick Check:

    GOOD flag = reliable data [OK]
Hint: GOOD means data is trustworthy and accurate [OK]
Common Mistakes:
  • Confusing GOOD with MISSING or BAD flags
  • Assuming GOOD means sensor is offline
  • Mixing SUSPECT with GOOD data
2. Which of the following is the correct way to represent a BAD data quality flag in a SCADA system configuration file?
easy
A. flag = "BAD"
B. flag = BAD
C. flag = 'bad'
D. flag = bad

Solution

  1. Step 1: Review syntax for string assignment in configuration

    Flags are usually strings and must be enclosed in quotes to be valid.
  2. Step 2: Identify correct string syntax for BAD flag

    Using double quotes around "BAD" is correct; unquoted or lowercase without quotes is invalid.
  3. Final Answer:

    flag = "BAD" -> Option A
  4. Quick Check:

    String flags need quotes [OK]
Hint: Use quotes around string flags in configs [OK]
Common Mistakes:
  • Omitting quotes around string values
  • Using lowercase without quotes
  • Confusing variable names with string literals
3. Given the following SCADA data quality flag array: flags = ["GOOD", "SUSPECT", "BAD", "GOOD", "MISSING"], which flags indicate data that should be excluded from analysis?
medium
A. ["BAD", "MISSING"]
B. ["SUSPECT", "GOOD"]
C. ["GOOD", "SUSPECT"]
D. ["GOOD", "MISSING"]

Solution

  1. Step 1: Identify flags that mark unreliable data

    BAD and MISSING flags indicate data that is incorrect or unavailable and should be excluded.
  2. Step 2: Match these flags to the options

    ["BAD", "MISSING"] correctly lists BAD and MISSING as flags to exclude from analysis.
  3. Final Answer:

    ["BAD", "MISSING"] -> Option A
  4. Quick Check:

    Exclude BAD and MISSING data [OK]
Hint: Exclude BAD and MISSING flags from analysis [OK]
Common Mistakes:
  • Including GOOD or SUSPECT data for exclusion
  • Confusing SUSPECT as always bad
  • Ignoring MISSING data in filtering
4. You have a SCADA script that filters out BAD data using:
filtered = [d for d in data if d.flag != "BAD"]
but it still includes some BAD data. What is the likely cause?
medium
A. The data list is empty, so filtering does nothing.
B. The list comprehension syntax is incorrect and causes errors.
C. The flag comparison is case-sensitive and some flags are lowercase "bad".
D. The filter should use == instead of != to exclude BAD data.

Solution

  1. Step 1: Analyze the filtering condition

    The condition excludes items where flag equals "BAD" exactly, case-sensitive.
  2. Step 2: Identify case sensitivity issue

    If some flags are lowercase "bad", they won't match "BAD" and won't be excluded.
  3. Final Answer:

    The flag comparison is case-sensitive and some flags are lowercase "bad". -> Option C
  4. Quick Check:

    Case sensitivity causes filtering errors [OK]
Hint: Check case sensitivity in string comparisons [OK]
Common Mistakes:
  • Assuming != excludes all BAD flags regardless of case
  • Thinking list comprehension syntax is wrong
  • Using wrong comparison operator
5. You want to create a SCADA alert that triggers only when sensor data is either BAD or MISSING. Which logical condition correctly implements this?
hard
A. if flag == "BAD" and flag == "MISSING":
B. if flag == "BAD" or flag == "MISSING":
C. if flag != "BAD" or flag != "MISSING":
D. if flag == "GOOD" or flag == "SUSPECT":

Solution

  1. Step 1: Understand alert condition requirements

    The alert should trigger if the flag is BAD or MISSING, meaning either condition is true.
  2. Step 2: Choose correct logical operator

    Using 'or' checks if flag equals BAD or equals MISSING, which matches the requirement.
  3. Final Answer:

    if flag == "BAD" or flag == "MISSING": -> Option B
  4. Quick Check:

    Use 'or' to combine conditions for alert [OK]
Hint: Use 'or' to check multiple flag conditions [OK]
Common Mistakes:
  • Using 'and' which requires both flags simultaneously
  • Using negation incorrectly
  • Checking for GOOD or SUSPECT instead
Recommended

Ready to prove it?

Pass the test and this pattern moves unknown strong while earning +1 Grip toward your certificate.

10 questions~5 mineasy hard