eulumdat-quiz 0.6.0

Photometric knowledge quiz engine for lighting professionals
Documentation
use crate::{Category, Difficulty, Question};

pub fn questions() -> Vec<Question> {
    vec![
        Question {
            id: 13001,
            category: Category::Units,
            difficulty: Difficulty::Beginner,
            text: "What does lux (lx) measure?".into(),
            options: vec!["Luminous flux".into(), "Luminous intensity".into(), "Illuminance (light falling on a surface)".into(), "Luminance (light leaving a surface)".into()],
            correct_index: 2,
            explanation: "Lux measures illuminance — the amount of luminous flux per unit area falling on a surface. 1 lux = 1 lumen per square meter.".into(),
            reference: Some("CIE S 017:2020".into()),
        },
        Question {
            id: 13002,
            category: Category::Units,
            difficulty: Difficulty::Beginner,
            text: "What is the imperial equivalent of lux?".into(),
            options: vec!["Candlepower".into(), "Foot-candle (fc)".into(), "Foot-lambert".into(), "Lumens per square foot".into()],
            correct_index: 1,
            explanation: "The foot-candle (fc) is the imperial unit of illuminance. 1 foot-candle = 10.764 lux.".into(),
            reference: Some("CIE S 017:2020".into()),
        },
        Question {
            id: 13003,
            category: Category::Units,
            difficulty: Difficulty::Intermediate,
            text: "How many lux equal one foot-candle?".into(),
            options: vec!["1.0".into(), "3.281".into(), "10.764".into(), "100".into()],
            correct_index: 2,
            explanation: "1 foot-candle = 10.764 lux (since 1 square meter = 10.764 square feet).".into(),
            reference: Some("CIE S 017:2020".into()),
        },
        Question {
            id: 13004,
            category: Category::Units,
            difficulty: Difficulty::Beginner,
            text: "What is a steradian (sr)?".into(),
            options: vec![
                "A unit of angle".into(),
                "A unit of solid angle (3D cone)".into(),
                "A unit of luminance".into(),
                "A unit of wavelength".into(),
            ],
            correct_index: 1,
            explanation: "A steradian is the SI unit of solid angle — the 3D equivalent of a radian. A full sphere subtends 4\u{03c0} steradians.".into(),
            reference: Some("CIE S 017:2020".into()),
        },
        Question {
            id: 13005,
            category: Category::Units,
            difficulty: Difficulty::Intermediate,
            text: "What does cd/m\u{00b2} measure?".into(),
            options: vec!["Illuminance".into(), "Luminous intensity".into(), "Luminance (brightness of a surface)".into(), "Luminous flux".into()],
            correct_index: 2,
            explanation: "cd/m\u{00b2} (candelas per square meter, also called 'nit') measures luminance — the intensity of light per unit area leaving a surface in a given direction.".into(),
            reference: Some("CIE S 017:2020".into()),
        },
        Question {
            id: 13006,
            category: Category::Units,
            difficulty: Difficulty::Intermediate,
            text: "What does cd/klm stand for?".into(),
            options: vec![
                "Candelas per kilolux".into(),
                "Candelas per kilolumen".into(),
                "Candelas per kilometer".into(),
                "Centidegrees per kilolumen".into(),
            ],
            correct_index: 1,
            explanation: "cd/klm means candelas per kilolumen — intensity normalized to a 1000 lumen lamp output. This is the unit used in EULUMDAT files.".into(),
            reference: Some("EULUMDAT specification".into()),
        },
        Question {
            id: 13007,
            category: Category::Units,
            difficulty: Difficulty::Expert,
            text: "How do you convert cd/klm to absolute candelas?".into(),
            options: vec![
                "cd = cd/klm × 1000".into(),
                "cd = cd/klm × (total_flux / 1000)".into(),
                "cd = cd/klm / total_flux".into(),
                "No conversion is possible".into(),
            ],
            correct_index: 1,
            explanation: "Absolute cd = (cd/klm) × (total_luminous_flux / 1000). Since cd/klm is normalized to 1000 lumens, multiply by the actual flux ratio.".into(),
            reference: Some("EULUMDAT specification".into()),
        },
        Question {
            id: 13008,
            category: Category::Units,
            difficulty: Difficulty::Beginner,
            text: "What does 'efficacy' of a light source refer to?".into(),
            options: vec![
                "How long the lamp lasts".into(),
                "How much light (lumens) is produced per watt of power".into(),
                "The beam angle of the luminaire".into(),
                "The color temperature accuracy".into(),
            ],
            correct_index: 1,
            explanation: "Luminous efficacy (lm/W) measures how efficiently a light source converts electrical power to visible light. Higher = more efficient.".into(),
            reference: Some("CIE S 017:2020".into()),
        },
        Question {
            id: 13009,
            category: Category::Units,
            difficulty: Difficulty::Expert,
            text: "What is the theoretical maximum luminous efficacy of white light?".into(),
            options: vec!["100 lm/W".into(), "250 lm/W".into(), "~350 lm/W".into(), "683 lm/W".into()],
            correct_index: 2,
            explanation: "The theoretical maximum for white light is approximately 350 lm/W. The absolute maximum (683 lm/W) is only achievable at 555nm monochromatic green.".into(),
            reference: Some("CIE S 017:2020".into()),
        },
        Question {
            id: 13010,
            category: Category::Units,
            difficulty: Difficulty::Intermediate,
            text: "What is the relationship between lux and lumens?".into(),
            options: vec![
                "1 lux = 1 lumen per square meter".into(),
                "1 lux = 1 lumen".into(),
                "1 lux = 1 lumen per steradian".into(),
                "They measure different things and are unrelated".into(),
            ],
            correct_index: 0,
            explanation: "1 lux = 1 lumen per square meter (lm/m\u{00b2}). Lux is the density of luminous flux on a surface.".into(),
            reference: Some("CIE S 017:2020".into()),
        },
    ]
}