PageSourceSearch

https://azurecertprep.github.io/assets/js/195f80d1.1bec491b.js

js azurecertprep.github.io collected 2026-10-03 08:41:39 UTC 24,122 bytes, 1 lines download raw bytes

1"use strict";(globalThis.webpackChunkazurecertprep=globalThis.webpackChunkazurecertprep||[]).push([[917],{47829(e,n,r){r.r(n),r.d(n,{assets:()=>l,contentTitle:()=>c,default:()=>p,frontMatter:()=>s,metadata:()=>o,toc:()=>d});const o=JSON.parse('{"id":"sc-500/security-posture-monitoring/challenge-41","title":"Challenge 41: Defender for Cloud Workload Protection Plans","description":"Exam skills covered","source":"@site/docs/sc-500/04-security-posture-monitoring/challenge-41.md","sourceDirName":"sc-500/04-security-posture-monitoring","slug":"/sc-500/security-posture-monitoring/challenge-41","permalink":"/docs/sc-500/security-posture-monitoring/challenge-41","draft":false,"unlisted":false,"editUrl":"https://github.com/azurecertprep/azurecertprep.github.io/tree/main/docs/sc-500/04-security-posture-monitoring/challenge-41.md","tags":[],"version":"current","sidebarPosition":41,"frontMatter":{"sidebar_position":41,"title":"Challenge 41: Defender for Cloud Workload Protection Plans"},"sidebar":"sc500Sidebar","previous":{"title":"Challenge 40: Compliance Evaluation with Security Frameworks","permalink":"/docs/sc-500/security-posture-monitoring/challenge-40"},"next":{"title":"Challenge 42: Multicloud Connectors (AWS, GCP) in Defender for Cloud","permalink":"/docs/sc-500/security-posture-monitoring/challenge-42"}}');var t=r(74848),a=r(28453),i=r(67970);const s={sidebar_position:41,title:"Challenge 41: Defender for Cloud Workload Protection Plans"},c="Challenge 41: Defender for Cloud Workload Protection Plans",l={},d=[{value:"Exam skills covered",id:"exam-skills-covered",level:2},{value:"Scenario",id:"scenario",level:2},{value:"Prerequisites",id:"prerequisites",level:2},{value:"Task 1: Enable Defender for Servers Plan 2",id:"task-1-enable-defender-for-servers-plan-2",level:2},{value:"Task 2: Enable Defender for Storage and Databases",id:"task-2-enable-defender-for-storage-and-databases",level:2},{value:"Task 3: Deploy a VM and configure Just-In-Time access",id:"task-3-deploy-a-vm-and-configure-just-in-time-access",level:2},{value:"Task 4: Request JIT access",id:"task-4-request-jit-access",level:2},{value:"Task 5: Configure adaptive application controls",id:"task-5-configure-adaptive-application-controls",level:2},{value:"Task 6: Configure file integrity monitoring",id:"task-6-configure-file-integrity-monitoring",level:2},{value:"Break & Fix",id:"break--fix",level:2},{value:"Scenario 1: JIT request fails with "Policy not found"",id:"scenario-1-jit-request-fails-with-policy-not-found",level:3},{value:"Scenario 2: Defender for Storage alerts not triggering",id:"scenario-2-defender-for-storage-alerts-not-triggering",level:3},{value:"Scenario 3: VM not appearing in adaptive application control recommendations",id:"scenario-3-vm-not-appearing-in-adaptive-application-control-recommendations",level:3},{value:"Knowledge check",id:"knowledge-check",level:2},{value:"Cleanup",id:"cleanup",level:2}];function u(e){const n={code:"code",h1:"h1",h2:"h2",h3:"h3",header:"header",hr:"hr",li:"li",p:"p",pre:"pre",ul:"ul",...(0,a.R)(),...e.components},{Details:r}=n;return r||function(e,n){throw new Error("Expected "+(n?"component":"object")+" `"+e+"` to be defined: you likely forgot to import, pass, or provide it.")}("Details",!0),(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(n.header,{children:(0,t.jsx)(n.h1,{id:"challenge-41-defender-for-cloud-workload-protection-plans",children:"Challenge 41: Defender for Cloud Workload Protection Plans"})}),"\n",(0,t.jsx)(n.h2,{id:"exam-skills-covered",children:"Exam skills covered"}),"\n",(0,t.jsxs)(n.ul,{children:["\n",(0,t.jsx)(n.li,{children:"Configure Microsoft Defender for Cloud workload protection plans"}),"\n",(0,t.jsx)(n.li,{children:"Enable Defender for Servers, Storage, Databases, and Containers"}),"\n",(0,t.jsx)(n.li,{children:"Configure just-in-time VM access"}),"\n",(0,t.jsx)(n.li,{children:"Manage adaptive application controls and file integrity monitoring"}),"\n"]}),"\n",(0,t.jsx)(n.h2,{id:"scenario",children:"Scenario"}),"\n",(0,t.jsx)(n.p,{children:"Contoso Ltd is migrating production workloads to Azure and needs comprehensive threat protection. The security team requires you to enable Defender plans for servers, storage accounts, databases, and containers. You must also configure just-in-time (JIT) VM access to reduce the attack surface of management ports and set up adaptive application controls to detect anomalous process execution."}),"\n",(0,t.jsx)(n.hr,{}),"\n",(0,t.jsx)(n.h2,{id:"prerequisites",children:"Prerequisites"}),"\n",(0,t.jsxs)(n.ul,{children:["\n",(0,t.jsx)(n.li,{children:"Azure subscription with Owner or Security Admin role"}),"\n",(0,t.jsx)(n.li,{children:"Azure CLI installed and authenticated"}),"\n",(0,t.jsx)(n.li,{children:"At least one VM deployed (for JIT and adaptive controls)"}),"\n",(0,t.jsx)(n.li,{children:"A storage account and an Azure SQL database"}),"\n"]}),"\n",(0,t.jsx)(n.hr,{}),"\n",(0,t.jsx)(n.h2,{id:"task-1-enable-defender-for-servers-plan-2",children:"Task 1: Enable Defender for Servers Plan 2"}),"\n",(0,t.jsx)(n.p,{children:"Enable comprehensive server protection including vulnerability assessment and file integrity monitoring."}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-bash",children:'# Set variables\nSUBSCRIPTION_ID=$(az account show --query id -o tsv)\nRG_NAME="rg-contoso-workload-lab"\nLOCATION="eastus"\n\n# Create resource group\naz group create --name $RG_NAME --location $LOCATION\n\n# Enable Defender for Servers Plan 2\n# Note: --subplan parameter may not be supported in all CLI versions; REST API approach is more reliable\naz rest --method PUT \\\n  --url "https://management.azure.com/subscriptions/${SUBSCRIPTION_ID}/providers/Microsoft.Security/pricings/VirtualMachines?api-version=2024-01-01" \\\n  --body \'{"properties":{"pricingTier":"Standard","subPlan":"P2"}}\'\n\n# Verify plan status\naz security pricing show \\\n  --name VirtualMachines \\\n  --query "{Name:name, Tier:pricingTier, SubPlan:subPlan}" -o table\n\n# Enable Defender for Servers extensions\naz rest --method PUT \\\n  --uri "https://management.azure.com/subscriptions/${SUBSCRIPTION_ID}/providers/Microsoft.Security/pricings/VirtualMachines?api-version=2024-01-01" \\\n  --body \'{\n    "properties": {\n      "pricingTier": "Standard",\n      "subPlan": "P2",\n      "extensions": [\n        {"name": "AgentlessVmScanning", "isEnabled": "True"},\n        {"name": "MdeDesignatedSubscription", "isEnabled": "True"},\n        {"name": "FileIntegrityMonitoring", "isEnabled": "True"}\n      ]\n    }\n  }\'\n'})}),"\n",(0,t.jsx)(n.h2,{id:"task-2-enable-defender-for-storage-and-databases",children:"Task 2: Enable Defender for Storage and Databases"}),"\n",(0,t.jsx)(n.p,{children:"Configure protection for data-tier resources."}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-bash",children:'# Enable Defender for Storage (per-transaction pricing)\n# Note: --subplan parameter may not be supported in all CLI versions; REST API approach is more reliable\naz rest --method PUT \\\n  --url "https://management.azure.com/subscriptions/${SUBSCRIPTION_ID}/providers/Microsoft.Security/pricings/StorageAccounts?api-version=2024-01-01" \\\n  --body \'{"properties":{"pricingTier":"Standard","subPlan":"PerStorageAccount"}}\'\n\n# Enable Defender for Azure SQL Databases\naz security pricing create \\\n  --name SqlServers \\\n  --tier Standard\n\n# Enable Defender for Open Source Relational Databases\naz security pricing create \\\n  --name OpenSourceRelationalDatabases \\\n  --tier Standard\n\n# Enable Defender for Containers\naz security pricing create \\\n  --name Containers \\\n  --tier Standard\n\n# List all enabled Defender plans\naz security pricing list \\\n  --query "[?pricingTier==\'Standard\'].{Plan:name, Tier:pricingTier, SubPlan:subPlan}" -o table\n'})}),"\n",(0,t.jsx)(n.h2,{id:"task-3-deploy-a-vm-and-configure-just-in-time-access",children:"Task 3: Deploy a VM and configure Just-In-Time access"}),"\n",(0,t.jsx)(n.p,{children:"Create a VM and enable JIT access to restrict management port exposure."}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-bash",children:'# Create a test VM\naz vm create \\\n  --resource-group $RG_NAME \\\n  --name "vm-contoso-prod01" \\\n  --image Ubuntu2404 \\\n  --size Standard_B2s \\\n  --admin-username azureuser \\\n  --generate-ssh-keys \\\n  --nsg-rule SSH\n\nVM_ID=$(az vm show --resource-group $RG_NAME --name "vm-contoso-prod01" --query id -o tsv)\n\n# Enable JIT on the VM via REST API\naz rest --method PUT \\\n  --uri "https://management.azure.com/subscriptions/${SUBSCRIPTION_ID}/resourceGroups/${RG_NAME}
1/providers/Microsoft.Security/jitNetworkAccessPolicies/default?api-version=2020-01-01" \\\n  --body "{\n    \\"properties\\": {\n      \\"virtualMachines\\": [{\n        \\"id\\": \\"${VM_ID}\\",\n        \\"ports\\": [\n          {\\"number\\": 22, \\"protocol\\": \\"TCP\\", \\"allowedSourceAddressPrefix\\": \\"*\\", \\"maxRequestAccessDuration\\": \\"PT3H\\"},\n          {\\"number\\": 3389, \\"protocol\\": \\"TCP\\", \\"allowedSourceAddressPrefix\\": \\"*\\", \\"maxRequestAccessDuration\\": \\"PT3H\\"}\n        ]\n      }]\n    },\n    \\"kind\\": \\"Basic\\"\n  }"\n\necho "JIT policy configured - ports 22 and 3389 are now blocked until access is requested"\n'})}),"\n",(0,t.jsx)(n.h2,{id:"task-4-request-jit-access",children:"Task 4: Request JIT access"}),"\n",(0,t.jsx)(n.p,{children:"Simulate requesting just-in-time access to the VM."}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-bash",children:'# Request JIT access for SSH (port 22) for 1 hour\nMY_IP=$(curl -s https://ifconfig.me)\n\naz rest --method POST \\\n  --uri "https://management.azure.com/subscriptions/${SUBSCRIPTION_ID}/resourceGroups/${RG_NAME}
1/providers/Microsoft.Security/jitNetworkAccessPolicies/default/initiate?api-version=2020-01-01" \\\n  --body "{\n    \\"virtualMachines\\": [{\n      \\"id\\": \\"${VM_ID}\\",\n      \\"ports\\": [{\n        \\"number\\": 22,\n        \\"duration\\": \\"PT1H\\",\n        \\"allowedSourceAddressPrefix\\": \\"${MY_IP}\\"\n      }]\n    }]\n  }"\n\necho "JIT access granted for port 22 from ${MY_IP} for 1 hour"\n'})}),"\n",(0,t.jsx)(n.h2,{id:"task-5-configure-adaptive-application-controls",children:"Task 5: Configure adaptive application controls"}),"\n",(0,t.jsx)(n.p,{children:"Set up adaptive application controls to whitelist approved processes."}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-bash",children:'# List recommended application control groups\naz rest --method GET \\\n  --uri "https://management.azure.com/subscriptions/${SUBSCRIPTION_ID}/providers/Microsoft.Security/applicationWhitelistings?api-version=2020-01-01" \\\n  --query "value[].{Group:name, RecommendationStatus:properties.recommendationStatus, EnforcementMode:properties.enforcementMode}" -o table\n\n# Configure adaptive application controls for a VM group\n# Note: Adaptive controls require 2+ weeks of learning before recommendations appear\naz rest --method PUT \\\n  --uri "https://management.azure.com/subscriptions/${SUBSCRIPTION_ID}/providers/Microsoft.Security/locations/${LOCATION}/applicationWhitelistings/YOURGROUP?api-version=2020-01-01" \\\n  --body \'{\n    "properties": {\n      "enforcementMode": "Audit",\n      "protectionMode": {\n        "exe": "Audit",\n        "msi": "Audit",\n        "script": "None"\n      },\n      "vmRecommendations": [{\n        "configurationStatus": "Configured",\n        "enforcementSupport": "Supported"\n      }]\n    }\n  }\'\n'})}),"\n",(0,t.jsx)(n.h2,{id:"task-6-configure-file-integrity-monitoring",children:"Task 6: Configure file integrity monitoring"}),"\n",(0,t.jsx)(n.p,{children:"Enable FIM to detect changes to critical system files."}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-bash",children:'# Create a Data Collection Rule for File Integrity Monitoring\naz rest --method PUT \\\n  --uri "https://management.azure.com/subscriptions/${SUBSCRIPTION_ID}/resourceGroups/${RG_NAME}/providers/Microsoft.Insights/dataCollectionRules/dcr-fim-contoso?api-version=2022-06-01" \\\n  --body "{\n    \\"location\\": \\"${LOCATION}\\",\n    \\"properties\\": {\n      \\"description\\": \\"File Integrity Monitoring for Contoso production servers\\",\n      \\"dataSources\\": {\n        \\"extensions\\": [{\n          \\"name\\": \\"ChangeTrackingDataSource\\",\n          \\"extensionName\\": \\"ChangeTracking-Linux\\",\n          \\"streams\\": [\\"Microsoft-ConfigurationChange\\"],\n          \\"extensionSettings\\": {\n            \\"enableFiles\\": true,\n            \\"enableSoftware\\": true,\n            \\"enableRegistry\\": false,\n            \\"enableServices\\": true,\n            \\"fileSettings\\": {\n              \\"linuxFiles\\": [\n                {\\"name\\": \\"etc_passwd\\", \\"path\\": \\"/etc/passwd\\", \\"recurse\\": false, \\"enabled\\": true},\n                {\\"name\\": \\"etc_shadow\\", \\"path\\": \\"/etc/sh
1adow\\", \\"recurse\\": false, \\"enabled\\": true},\n                {\\"name\\": \\"etc_sudoers\\", \\"path\\": \\"/etc/sudoers*\\", \\"recurse\\": true, \\"enabled\\": true}\n              ]\n            }\n          }\n        }]\n      },\n      \\"destinations\\": {\n        \\"logAnalytics\\": [{\n          \\"name\\": \\"laDestination\\",\n          \\"workspaceResourceId\\": \\"/subscriptions/${SUBSCRIPTION_ID}/resourceGroups/${RG_NAME}/providers/Microsoft.OperationalInsights/workspaces/law-contoso-compliance\\"\n        }]\n      },\n      \\"dataFlows\\": [{\n        \\"streams\\": [\\"Microsoft-ConfigurationChange\\"],\n        \\"destinations\\": [\\"laDestination\\"]\n      }]\n    }\n  }"\n\necho "FIM configured - monitoring /etc/passwd, /etc/shadow, and /etc/sudoers"\n'})}),"\n",(0,t.jsx)(n.hr,{}),"\n",(0,t.jsx)(n.h2,{id:"break--fix",children:"Break & Fix"}),"\n",(0,t.jsx)(n.h3,{id:"scenario-1-jit-request-fails-with-policy-not-found",children:'Scenario 1: JIT request fails with "Policy not found"'}),"\n",(0,t.jsx)(n.p,{children:"A team member tries to request JIT access but gets an error saying the JIT policy does not exist for the VM."}),"\n",(0,t.jsxs)(r,{children:[(0,t.jsx)("summary",{children:"Show solution"}),(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-bash",children:'# Verify JIT policy exists for the resource group\naz rest --method GET \\\n  --uri "https://management.azure.com/subscriptions/${SUBSCRIPTION_ID}/resourceGroups/${RG_NAME}
1/providers/Microsoft.Security/jitNetworkAccessPolicies?api-version=2020-01-01" \\\n  --query "value[].{Name:name, VMs:properties.virtualMachines[].id}" -o json\n\n# Common causes:\n# 1. JIT policy was created in wrong resource group\n# 2. VM ID in the policy doesn\'t match the actual VM\n\n# Verify the VM exists and get its full resource ID\naz vm show --resource-group $RG_NAME --name "vm-contoso-prod01" --query id -o tsv\n\n# Re-create the JIT policy if needed with correct VM ID\n# Also ensure the NSG associated with the VM\'s NIC exists\naz network nsg show --resource-group $RG_NAME --name "vm-contoso-prod01NSG" --query id -o tsv\n\n# JIT requires an NSG associated with the VM\'s network interface\n'})})]}),"\n",(0,t.jsx)(n.h3,{id:"scenario-2-defender-for-storage-alerts-not-triggering",children:"Scenario 2: Defender for Storage alerts not triggering"}),"\n",(0,t.jsx)(n.p,{children:"Defender for Storage is enabled but no alerts are generated when suspicious access patterns occur."}),"\n",(0,t.jsxs)(r,{children:[(0,t.jsx)("summary",{children:"Show solution"}),(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-bash",children:'# Verify the correct sub-plan is enabled\naz security pricing show --name StorageAccounts \\\n  --query "{Tier:pricingTier, SubPlan:subPlan}" -o table\n\n# Should show SubPlan: DefenderForStorageV2\n# If it shows "PerTransaction" or "PerStorageAccount", update it:\naz security pricing create \\\n  --name StorageAccounts \\\n  --tier Standard \\\n  --subplan DefenderForStorageV2\n\n# Also check if per-resource override is disabling it\naz rest --method GET \\\n  --uri "https://management.azure.com/subscriptions/${SUBSCRIPTION_ID}/resourceGroups/${RG_NAME}/providers/Microsoft.Storage/storageAccounts/<account-name>/providers/Microsoft.Security/defenderForStorageSettings/current?api-version=2022-12-01-preview" \\\n  --query "properties.isEnabled"\n\n# Enable at resource level if overridden\naz rest --method PUT \\\n  --uri "https://management.azure.com/subscriptions/${SUBSCRIPTION_ID}/resourceGroups/${RG_NAME}/providers/Microsoft.Storage/storageAccounts/<account-name>/providers/Microsoft.Security/defenderForStorageSettings/current?api-version=2022-12-01-preview" \\\n  --body \'{"properties": {"isEnabled": true, "malwareScanning": {"onUpload": {"isEnabled": true, "capGBPerMonth": 5000}}, "sensitiveDataDiscovery": {"isEnabled": true}}}\'\n'})})]}),"\n",(0,t.jsx)(n.h3,{id:"scenario-3-vm-not-appearing-in-adaptive-application-control-recommendations",children:"Scenario 3: VM not appearing in adaptive application control recommendations"}),"\n",(0,t.jsx)(n.p,{children:"A production VM has been running for 3 weeks but doesn't appear in the adaptive application control recommendations."}),"\n",(0,t.jsxs)(r,{children:[(0,t.jsx)("summary",{children:"Show solution"}),(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-bash",children:'# Adaptive application controls require:\n# 1. Defender for Servers P2 enabled\n# 2. Log Analytics agent or Azure Monitor Agent collecting process data\n# 3. VM running consistently for 2+ weeks\n\n# Check if the VM has the monitoring agent\naz vm extension list --resource-group $RG_NAME --vm-name "vm-contoso-prod01" \\\n  --query "[].{Name:name, ProvisioningState:provisioningState}" -o table\n\n# If no agent, install Azure Monitor Agent\naz vm extension set \\\n  --resource-group $RG_NAME \\\n  --vm-name "vm-contoso-prod01" \\\n  --name AzureMonitorLinuxAgent \\\n  --publisher Microsoft.Azure.Monitor\n\n# Also verify the VM is in a supported region and OS\naz vm show --resource-group $RG_NAME --name "vm-contoso-prod01" \\\n  --query "{Location:location, OS:storageProfile.imageReference.offer}" -o table\n'})})]}),"\n",(0,t.jsx)(n.hr,{}),"\n",(0,t.jsx)(n.h2,{id:"knowledge-check",children:"Knowledge check"}),"\n",(0,t.jsx)(i.A,{questions:[{question:"What is the maximum duration that JIT VM access can be granted for a single request?",options:["1 hour","3 hours","24 hours","It depends on the maxRequestAccessDuration configured in the policy"],correctIndex:3,explanation:"The maximum duration is configured per-port in the JIT policy via the maxRequestAccessDuration field (in ISO 8601 duration format). Each request cannot exceed this configured maximum."},{question:"Which Defender for Servers plan includes agentless vulnerability scanning and file integrity monitoring?",options:["Defender for Servers Free tier","Defender for Servers Plan 1 (P1)","Defender for Servers Plan 2 (P2)","Both P1 and P2 include all features"],correctIndex:2,explanation:"Defender for Servers Plan 2 (P2) includes all P1 features plus agentless VM scanning, file integrity monitoring, adaptive application controls, and free data ingestion (500 MB/day) for specific security data types."},{question:"What does Defender for Storage's malware scanning capability do when malware is detected in an uploaded blob?",options:["Automatically deletes the blob","Generates a security alert and can trigger an Event Grid event for automation","Quarantines the blob and notifies the uploader","Blocks all access to the storage account"],correctIndex:1,explanation:"When malware is detected, Defender for Storage generates a security alert and publishes an Event Grid event. The blob is NOT automatically deleted or quarantined\u2014organizations must configure their own response via Logic Apps or Functions triggered by the Event Grid event."},{question:"How does adaptive application control differ from traditional application whitelisting?",options:["It uses machine learning to re
1commend which applications should be allowed based on observed behavior","It only works on Windows servers","It blocks all applications by default without any learning period","It requires manual configuration of every allowed process"],correctIndex:0,explanation:"Adaptive application controls use machine learning to analyze running processes over time and recommend application allowlists based on observed behavior. This reduces the manual effort of traditional whitelisting while adapting to the specific workload."}]}),"\n",(0,t.jsx)(n.h2,{id:"cleanup",children:"Cleanup"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-bash",children:'# Disable Defender plans\naz security pricing create --name VirtualMachines --tier Free\naz security pricing create --name StorageAccounts --tier Free\naz security pricing create --name SqlServers --tier Free\naz security pricing create --name OpenSourceRelationalDatabases --tier Free\naz security pricing create --name Containers --tier Free\n\n# Delete JIT policy\naz rest --method DELETE \\\n  --uri "https://management.azure.com/subscriptions/${SUBSCRIPTION_ID}/resourceGroups/${RG_NAME}
1/providers/Microsoft.Security/jitNetworkAccessPolicies/default?api-version=2020-01-01"\n\n# Delete resource group and all resources\naz group delete --name $RG_NAME --yes --no-wait\n\necho "Cleanup complete - all Defender plans set to Free tier"\n'})})]})}function p(e={}){const{wrapper:n}={...(0,a.R)(),...e.components};return n?(0,t.jsx)(n,{...e,children:(0,t.jsx)(u,{...e})}):u(e)}},67970(e,n,r){r.d(n,{A:()=>T});var o=r(96540);const t="container_Wc2S",a="question_w8BQ",i="questionText_khaT",s="questionNumber_tNAi",c="options_hoT3",l="option_h5Gz",d="correct_wiKw",u="incorrect_jk7n",p="dimmed_Rvup",h="optionLetter_SgXF",m="optionText_qkBQ",g="checkmark_PyUX",f="crossmark__CNH",v="explanationCorrect_PaNS",b="explanationIncorrect_Ul4c",S="scoreCard_qRIf",x="perfect_Nu3_",y="good_kzz1",I="review_WPHG";var j=r(74848);function T({questions:e}){const[n,r]=(0,o.useState)({}),a=Object.keys(n).length===e.length,i=Object.values(n).filter(Boolean).length,s=(e,n)=>{r(r=>({...r,[e]:n}))};return(0,j.jsxs)("div",{className:t,children:[e.map((e,n)=>(0,j.jsx)(M,{index:n,question:e.question,options:e.options,correctIndex:e.correctAnswer??e.correctIndex,explanation:e.explanation,onAnswer:s},n)),a&&(0,j.jsxs)("div",{className:S,children:[(0,j.jsxs)("strong",{children:["Score: ",i,"/",e.length]}),i===e.length?(0,j.jsx)("span",{className:x,children:" \u2014 Perfect!"}):i>=.75*e.length?(0,j.jsx)("span",{className:y,children:" \u2014 Good job!"}):(0,j.jsx)("span",{className:I,children:" \u2014 Review the explanations above."})]})]})}function M({index:e,question:n,options:r,correctIndex:t,explanation:S,onAnswer:x}){const[y,I]=(0,o.useState)(null),[T,M]=(0,o.useState)(!1);return(0,j.jsxs)("div",{className:a,children:[(0,j.jsxs)("p",{className:i,children:[(0,j.jsxs)("span",{className:s,children:[e+1,"."]})," ",n]}),(0,j.jsx)("div",{className:c,children:r.map((n,r)=>{let o=l;return T&&(o+=r===t?" "+d:r===y?" "+u:" "+p),(0,j.jsxs)("button",{className:o,onClick:()=>(n=>{T||(I(n),M(!0),x(e,n===t))})(r),disabled:T,children:[(0,j.jsx)("span",{className:h,children:String.fromCharCode(65+r)}),(0,j.jsx)("span",{className:m,children:n}),T&&r===t&&(0,j.jsx)("span",{className:g,children:"\u2713"}),T&&r===y&&r!==t&&(0,j.jsx)("span",{className:f,children:"\u2717"})]},r)})}),T&&(0,j.jsxs)("div",{className:y===t?v:b,children:[(0,j.jsx)("strong",{children:y===t?"Correct!":"Incorrect."})," ",S]})]})}},28453(e,n,r){r.d(n,{R:()=>i,x:()=>s});var o=r(96540);const t={},a=o.createContext(t);function i(e){const n=o.useContext(a);return o.useMemo(function(){return"function"==typeof e?e(n):{...n,...e}},[n,e])}function s(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(t):e.components||t:i(e.components),o.createElement(a.Provider,{value:n},e.children)}}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.