0.7 First Day Assignment

Overview

AI and Human Judgment

In 0.5, the First Day application displayed weather information and you decided whether it showed evidence of rain. In this final First Day assignment, you will compare your independent judgment with an AI-supported interpretation of the same weather image.

The AI connection is supplied. You are not being asked to learn API authentication, HTTP, JSON, asynchronous programming, or response parsing. Your job is to understand what information is sent, inspect the Boolean result that comes back, observe how that result can affect the existing application, and decide whether the AI output should be accepted, revised, verified, or rejected.

User Story

As a student preparing for the first day of class, I want to compare my own interpretation of weather information with an AI-supported interpretation so that I can decide whether the AI output is sufficiently trustworthy to use.

Acceptance Criteria

Task List

  1. Get Started From Your 0.6 Solution
  2. Make Your Judgment Before AI
  3. Add the Supplied AI Support
  4. Add the AI and Human Judgment Controls
  5. Run the AI Analysis and Trace the Boolean
  6. Verify and Make the Final Human Decision
  7. Final Check and Submit
Do Not Put an API Key in Your Code

The supplied helper reads an instructor-provided environment setting named OPENAI_API_KEY. Never paste an API key into a source file, screenshot, Canvas submission, or ZIP file.

Use the Supplied Public Location

For this comparison, use Wausau WI rather than a home address or another personally identifying location. The goal is to evaluate AI-supported information, not to share personal data.

  1. 1. Back Up and Open Your Existing First Day Solution

    Your First Day solution was renamed to your last name in 0.2. Keep that working name for the rest of the sequence. Make a backup of the completed 0.6 checkpoint, then continue working in the original student-named solution.

    Step 1 — Make a checkpoint backup

    One Working Name

    The backup identifies the completed checkpoint. The working solution remains named for you.

    Step 2 — Verify the previous checkpoint

    1. Build or run the solution before making the new 0.7 changes
    2. Verify the clothing, shopping-list, weather, and structured-data sections are still present
    3. If the 0.6 checkpoint is not working, correct that starting state before adding the new work
    Go to top
  2. 2. Make Your Judgment Before AI

    AI output can influence people simply because it appears first. Make your own judgment before asking the AI system so you have an independent comparison.

    Step 1 — Load the public weather example

    1. Run the application
    2. In the existing Weather section, enter Wausau WI
    3. Click Load Weather
    4. Inspect the returned weather information and weather image
    Screenshot placeholder showing weather information for Wausau WI before any AI analysis has been requested
    Inspect the evidence first. Do not ask AI until you have made your own judgment.

    Step 2 — Decide what you think the image shows

    Choose one judgment for yourself: Rain, No rain, or Uncertain. Keep that judgment unchanged after the AI result appears so you can compare them.

    Step 3 — Read the AI/human workflow

    UML activity diagram: the student loads weather, inspects the image, and records an independent judgment. The application sends the public weather-image URL and focused prompt to an AI service. The AI returns rain or no rain plus a short explanation. The application sets aiSaysRain and the existing checkbox. The student compares the result, verifies when needed, and chooses Accept, Revise, Verify, or Reject.
    The AI output becomes application input, but the learner still evaluates whether that output deserves to be used.
    What AI Adds

    The AI system is another source of information. It can return a value that software can use, but a technically usable value is not automatically a correct or trustworthy value.

    Go to top
  3. 3. Add the Supplied AI Support

    The API implementation is supplied infrastructure. It can analyze either the live weather image or the course sample displayed by 0.5. If the live AI service is unavailable, the helper returns a clearly labeled course simulation so the remaining debugger and evaluation work can continue.

    Step 1 — Add WeatherAi.cs

    1. Download WeatherAi.cs
    2. Add it to the FirstDayScenario project as an existing item
    3. Do not edit the helper
    Screenshot placeholder showing WeatherAi.cs added to FirstDayScenario without exposing a credential
    The service and simulation details stay inside the supplied helper.

    Step 2 — Understand the information boundary

    The helper receives only the weather image already displayed by your application. When the live service is available, it sends that image with a focused rain/no-rain prompt. It does not need your name, student ID, email, home address, course records, or unrelated files.

    Live vs. Simulated Results

    If the live AI service cannot be used, the helper switches to a course simulation and the application labels the result Simulated AI result - live service unavailable. You do not need to troubleshoot the service or know how the simulation is implemented.

    WeatherAi.cs — supplied for transparency

    You are not expected to understand or reproduce the API, HTTP, JSON, response parsing, or simulation implementation.

    WeatherAi.cs — supplied infrastructure
    using System;
    using System.Net.Http;
    using System.Net.Http.Headers;
    using System.Text;
    using System.Text.RegularExpressions;
    using System.Threading.Tasks;
    
    namespace FirstDayScenario
    {
        /// <summary>
        /// Contains the result returned by the supplied weather AI helper.
        /// </summary>
        public sealed class WeatherAiResult
        {
            public WeatherAiResult(bool isRaining, string explanation, bool isSimulation)
            {
                this.IsRaining = isRaining;
                this.Explanation = explanation;
                this.IsSimulation = isSimulation;
            }
    
            public bool IsRaining { get; private set; }
    
            public string Explanation { get; private set; }
    
            public bool IsSimulation { get; private set; }
        }
    
        /// <summary>
        /// Provides the supplied AI integration used by the First Day walkthrough.
        /// </summary>
        public static class WeatherAi
        {
            private static readonly Random Random = new Random();
    
            public static async Task<WeatherAiResult> AnalyzeAsync(byte[] imageBytes, string imageMediaType)
            {
                if (imageBytes == null || imageBytes.Length == 0)
                {
                    throw new InvalidOperationException("Load a weather image before asking AI to analyze it.");
                }
    
                try
                {
                    string apiKey = Environment.GetEnvironmentVariable("OPENAI_API_KEY");
    
                    if (string.IsNullOrWhiteSpace(apiKey))
                    {
                        return CreateSimulationResult();
                    }
    
                    string prompt = "Look only at the supplied weather image. Does the visible information show evidence that it is currently raining? Respond with exactly two lines. First line: RAIN or NO_RAIN. Second line: one short reason based only on visible evidence. Do not infer information that is not visible.";
                    string imageDataUrl = "data:" + imageMediaType + ";base64," + Convert.ToBase64String(imageBytes);
                    string requestJson = "{\"model\":\"gpt-5.6-luna\",\"store\":false,\"input\":[{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"" + prompt + "\"},{\"type\":\"input_image\",\"image_url\":\"" + imageDataUrl + "\",\"detail\":\"low\"}]}]}";
    
                    using (HttpClient client = new HttpClient())
                    {
                        client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", apiKey);
    
                        using (StringContent content = new StringContent(requestJson, Encoding.UTF8, "application/json"))
                        {
                            HttpResponseMessage response = await client.PostAsync("https://api.openai.com/v1/responses", content);
                            string responseJson = await response.Content.ReadAsStringAsync();
    
                            response.EnsureSuccessStatusCode();
    
                            string outputText = ExtractOutputText(responseJson);
                            string normalized = outputText.Trim();
                            bool startsWithRain = normalized.StartsWith("RAIN", StringComparison.OrdinalIgnoreCase);
                            bool startsWithNoRain = normalized.StartsWith("NO_RAIN", StringComparison.OrdinalIgnoreCase);
    
                            if (!startsWithRain && !startsWithNoRain)
                            {
                                return CreateSimulationResult();
                            }
    
                            bool isRaining = startsWithRain;
                            int lineBreakIndex = normalized.IndexOf('
    ');
                            string explanation = lineBreakIndex >= 0
                                ? normalized.Substring(lineBreakIndex + 1).Trim()
                                : normalized;
    
                            return new WeatherAiResult(isRaining, explanation, false);
                        }
                    }
                }
                catch
                {
                    return CreateSimulationResult();
                }
            }
    
            private static WeatherAiResult CreateSimulationResult()
            {
                bool simulatedRain = Random.Next(2) == 1;
                string explanation = "Course simulation used because the live AI service was unavailable. Verify the result against the visible weather evidence.";
    
                return new WeatherAiResult(simulatedRain, explanation, true);
            }
    
            private static string ExtractOutputText(string responseJson)
            {
                Match match = Regex.Match(
                    responseJson,
                    "\"type\"\s*:\s*\"output_text\".*?\"text\"\s*:\s*\"(?<text>(?:\\.|[^\"])*)\"",
                    RegexOptions.Singleline);
    
                if (!match.Success)
                {
                    throw new InvalidOperationException("The AI service response did not contain output text.");
                }
    
                return Regex.Unescape(match.Groups["text"].Value);
            }
        }
    }
    Go to top
  4. 4. Add the AI and Human Judgment Controls

    The final section records your independent judgment, requests the analysis, displays the returned result, and records your final Accept/Revise/Verify/Reject decision.

    Step 1 — Extend the scrollable Grid

    MainWindow.xaml — update the inner Grid height
    <Grid Height="1680">

    Step 2 — Add the supplied controls

    Screenshot placeholder showing the AI and Human Judgment section below Sample Course Data
    Add the final learner-facing section below the existing structured-data area.
    MainWindow.xaml — add this section
    <StackPanel HorizontalAlignment="Center" Height="390" Margin="0,1140,0,0" VerticalAlignment="Top" Width="560">
        <TextBlock Text="AI and Human Judgment" FontWeight="Bold" Margin="5" />
        <TextBlock Text="Your judgment before AI" Margin="5" />
        <ComboBox x:Name="humanJudgmentComboBox" Width="360" Margin="5">
            <ComboBoxItem Content="Rain" />
            <ComboBoxItem Content="No rain" />
            <ComboBoxItem Content="Uncertain" />
        </ComboBox>
        <Button x:Name="analyzeWeatherWithAiButton" Content="Ask AI About Weather" Width="360" Margin="5" Click="AnalyzeWeatherWithAiButton_Click" />
        <TextBlock Text="AI result" Margin="5" />
        <TextBox x:Name="aiResultTextBox" Height="90" Width="520" Margin="5" IsReadOnly="True" TextWrapping="Wrap" VerticalScrollBarVisibility="Auto" />
        <TextBlock Text="Your decision about the AI output" Margin="5" />
        <ComboBox x:Name="aiDecisionComboBox" Width="360" Margin="5">
            <ComboBoxItem Content="Accept" />
            <ComboBoxItem Content="Revise" />
            <ComboBoxItem Content="Verify" />
            <ComboBoxItem Content="Reject" />
        </ComboBox>
    </StackPanel>

    Step 3 — Add the supplied button handler

    MainWindow.xaml.cs — supplied AI button handler
    private async void AnalyzeWeatherWithAiButton_Click(object sender, RoutedEventArgs e)
    {{
        if (this.currentWeatherImageBytes == null)
        {{
            this.aiResultTextBox.Text = "Load weather before asking AI.";
            return;
        }}
    
        WeatherAiResult aiResult = await WeatherAi.AnalyzeAsync(
            this.currentWeatherImageBytes,
            this.currentWeatherImageMediaType);
    
        bool aiSaysRain = aiResult.IsRaining;
    
        this.rainCheckBox.IsChecked = aiSaysRain;
    
        string resultLabel = aiResult.IsSimulation
            ? "Simulated AI result - live service unavailable"
            : "AI result";
    
        this.aiResultTextBox.Text =
            resultLabel + ": " + (aiSaysRain ? "Rain" : "No rain") + "
    " + aiResult.Explanation;
    }}
    Focus on the Information

    The key ideas are that the helper returns a result, the result contains a Boolean, and that Boolean can set the same checkbox used earlier in the sequence.

    Go to top
  5. 5. Run the Analysis and Trace the Boolean

    Observe the moment when either a live AI result or a clearly labeled course simulation becomes ordinary application data.

    Step 1 — Record your judgment first

    1. Load the weather image
    2. Inspect it yourself
    3. Choose Rain, No rain, or Uncertain in Your judgment before AI
    4. Do not change that initial judgment after the returned result appears

    Step 2 — Set the breakpoint

    Breakpoint line
    bool aiSaysRain = aiResult.IsRaining;

    Step 3 — Ask for the analysis

    1. Click Ask AI About Weather
    2. When Visual Studio pauses, inspect aiResult.IsRaining
    3. Inspect aiResult.IsSimulation so you know the result's provenance
    4. Press F10 so aiSaysRain receives the value
    5. Inspect aiSaysRain and aiResult.Explanation
    Screenshot placeholder showing the Boolean, explanation, and IsSimulation value without exposing credentials
    The debugger shows both the returned Boolean and whether its source was live AI or the course simulation.

    Step 4 — Apply the value to the existing checkbox

    Apply the returned Boolean
    this.rainCheckBox.IsChecked = aiSaysRain;
    1. Predict the checkbox state
    2. Press F10 over the assignment
    3. Continue the application
    4. Observe the checkbox and the live/simulated result label
    5. Click Choose Clothing and observe the existing 0.3 decision reuse the value
    Screenshot placeholder showing the labeled returned result and existing rain checkbox state
    The result becomes an ordinary Boolean, while its provenance still matters to the human evaluation.
    Technical Flow

    weather image → live AI or labeled simulation → Boolean → existing checkbox → existing if/else → clothing recommendation

    Go to top
  6. 6. Verify and Make the Final Human Decision

    The analysis step has finished, but the evaluation has not. Judge the generated answer against evidence appropriate to the decision you are making.

    Step 1 — Compare human and AI judgments

    Compare your independent judgment, the AI Rain/No rain result, the AI explanation, and the visible weather information. Agreement does not prove the AI is correct, and disagreement does not automatically prove the AI is wrong.

    Step 2 — Verify when the evidence is not enough

    1. Open the National Weather Service
    2. Find current conditions for Wausau, Wisconsin
    3. Compare that authoritative information with the weather image and AI explanation
    4. Consider timing: weather can change, so a difference may call for further verification rather than an immediate conclusion
    Screenshot placeholder showing authoritative current weather information used to verify the AI-supported rain interpretation
    Use an authoritative source when additional evidence is needed. The AI response itself is not verification.

    Step 3 — Choose Accept, Revise, Verify, or Reject

    UML activity diagram: AI produces output; a human reviews it and compares it with evidence. If supported, Accept. If more evidence is needed, Verify. If useful after correction, Revise. Otherwise Reject. The human determines final use.
    The AI response is an input to human judgment, not the final authority.
    • Accept — the output is sufficiently supported for this low-risk task
    • Revise — the response is useful but needs correction or qualification
    • Verify — better or more current evidence is needed before deciding
    • Reject — stronger evidence contradicts the output or it is unsuitable to use

    Choose the corresponding option in Your decision about the AI output. Be ready to identify the evidence that influenced your choice.

    Key Takeaway

    AI output can become application input, but technical integration and trustworthy judgment are different questions. The human user remains responsible for deciding whether the generated result should be used.

    Go to top
  7. 7. Final Check and Submit

    Verify the complete 0.7 checkpoint before packaging the solution.

    Step 1 — Complete the final technical and responsible-use check

    Step 2 — Zip the solution

    1. Close Visual Studio
    2. Locate the LastName parent folder containing the .sln and project folder
    3. Create a ZIP file of the entire solution folder
    4. Open the ZIP and confirm the solution, FirstDayScenario project, WeatherAi.cs, Courses.csv, and other project files are present
    5. Confirm again that the ZIP contains no API key or other credential

    Step 3 — Submit to the Feedback System

    1. Open the Feedback System
    2. Select the correct First Day 0.7 assignment
    3. Upload the zipped Visual Studio solution
    4. Review the Feedback System results and correct any in-scope issues if required
    5. Resubmit a corrected ZIP when needed

    Step 4 — Submit the Feedback System URL to Canvas

    1. After the required Feedback System submission is ready, copy its URL
    2. Open the correct 0.7 First Day Assignment in Canvas
    3. Submit the Feedback System URL as your Canvas submission
    First Day Progression Complete

    Your cumulative First Day application has now demonstrated objects, Boolean decisions, persistent storage, web requests, structured data, and AI-supported information. The final lesson is not that AI can check a box. It is that you can distinguish an AI-generated suggestion from the evidence needed to decide whether that suggestion should be trusted and used.

    © 2026 Northcentral Technical College

    Go to top