




<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Online Practical Archives &#187; GyanXp</title>
	<atom:link href="https://gyanxp.com/category/online-practical/feed/" rel="self" type="application/rss+xml" />
	<link>https://gyanxp.com/category/online-practical/</link>
	<description>अपनी Online Class</description>
	<lastBuildDate>Tue, 18 Aug 2026 03:37:09 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=7.1.3</generator>

<image>
	<url>https://gyanxp.com/wp-content/uploads/2025/02/image-1.webp</url>
	<title>Online Practical Archives &#187; GyanXp</title>
	<link>https://gyanxp.com/category/online-practical/</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>Online IoT Practical Solution (PR4)</title>
		<link>https://gyanxp.com/online-iot-practical-solution-pr4/</link>
					<comments>https://gyanxp.com/online-iot-practical-solution-pr4/#respond</comments>
		
		<dc:creator><![CDATA[Balmukund Maurya]]></dc:creator>
		<pubDate>Mon, 17 Aug 2026 14:11:08 +0000</pubDate>
				<category><![CDATA[Online Practical]]></category>
		<guid isPermaLink="false">https://gyanxp.com/?p=6236</guid>

					<description><![CDATA[<p>O Level IoT Practical Solutions (M4-R5) Practice NIELIT IoT practical exam problems with Arduino source code and verified Wokwi diagram configurations! 🔌 IoT Practical Completion Progress 0 / 0 Practiced (0%) 📑 Practical Index ◀ ▶</p>
<p>The post <a href="https://gyanxp.com/online-iot-practical-solution-pr4/">Online IoT Practical Solution (PR4)</a> appeared first on <a href="https://gyanxp.com">GyanXp</a>.</p>
]]></description>
										<content:encoded><![CDATA[		<div data-elementor-type="wp-post" data-elementor-id="6236" class="elementor elementor-6236">
						<section class="elementor-section elementor-top-section elementor-element elementor-element-4c83e89 elementor-section-boxed elementor-section-height-default elementor-section-height-default" data-id="4c83e89" data-element_type="section" data-e-type="section">
						<div class="elementor-container elementor-column-gap-default">
					<div class="elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-4749882" data-id="4749882" data-element_type="column" data-e-type="column">
			<div class="elementor-widget-wrap elementor-element-populated">
						<div class="elementor-element elementor-element-818ded4 elementor-widget elementor-widget-html" data-id="818ded4" data-element_type="widget" data-e-type="widget" data-widget_type="html.default">
				<div class="elementor-widget-container">
					<!-- Google Fonts & Prism.js Syntax Highlighting -->
<link href="https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700&display=swap" rel="stylesheet">
<link href="https://cdnjs.cloudflare.com/ajax/libs/prism/1.29.0/themes/prism-tomorrow.min.css" rel="stylesheet" />

<style>
  :root {
    --gyanxp-orange: #ff6600;
    --gyanxp-orange-hover: #e65c00;
    --gyanxp-dark: #1f2421;
    --gyanxp-accent-blue: #007bff;
    --gyanxp-bg: #f8f9fa;
    --gyanxp-card-bg: #ffffff;
    --gyanxp-danger: #dc3545;
    --gyanxp-success: #28a745;
  }

  .gyanxp-full-page,
  .gyanxp-full-page * {
    box-sizing: border-box !important;
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  }

  .gyanxp-full-page {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: clamp(10px, 2vw, 24px) !important;
    background-color: var(--gyanxp-bg);
  }

  .gyanxp-page-header {
    width: 100% !important;
    margin: 0 0 16px 0 !important;
    background: linear-gradient(135deg, var(--gyanxp-dark) 0%, #2c302e 100%) !important;
    color: #ffffff !important;
    padding: clamp(16px, 2.5vw, 24px) clamp(18px, 3vw, 30px) !important;
    border-radius: 12px !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05) !important;
    border: 1px solid #2c302e !important;
    border-left: 6px solid var(--gyanxp-orange) !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 6px !important;
  }

  .gyanxp-page-header h1 {
    margin: 0 !important;
    font-size: clamp(20px, 2.8vw, 28px) !important;
    font-weight: 700 !important;
    color: #ffffff !important;
  }

  .gyanxp-page-header p {
    margin: 0 !important;
    font-size: clamp(13px, 1.8vw, 15px) !important;
    color: #d1d5db !important;
  }

  .progress-widget {
    width: 100% !important;
    margin: 0 0 20px 0 !important;
    background: var(--gyanxp-card-bg) !important;
    padding: clamp(16px, 2vw, 20px) clamp(18px, 3vw, 30px) !important;
    border-radius: 12px !important;
    border: 1px solid #e9ecef !important;
    border-left: 6px solid var(--gyanxp-orange) !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04) !important;
  }

  .progress-info {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    flex-wrap: wrap !important;
    gap: 8px 12px !important;
    margin-bottom: 12px !important;
  }

  .progress-title {
    font-size: clamp(13.5px, 2vw, 15px) !important;
    font-weight: 600 !important;
    color: var(--gyanxp-dark) !important;
  }

  .progress-counter-badge {
    font-size: clamp(12px, 1.8vw, 13.5px) !important;
    font-weight: 600 !important;
    color: var(--gyanxp-orange) !important;
    background: #fff0e6 !important;
    padding: 4px 14px !important;
    border-radius: 20px !important;
    border: 1px solid rgba(255, 102, 0, 0.2) !important;
  }

  .progress-bar-bg {
    width: 100% !important;
    height: 10px !important;
    background: #e9ecef !important;
    border-radius: 10px !important;
    overflow: hidden !important;
  }

  .progress-bar-fill {
    height: 100% !important;
    width: 0% !important;
    background: linear-gradient(90deg, var(--gyanxp-orange), #ff9933) !important;
    transition: width 0.4s ease-in-out !important;
  }

  .practical-layout {
    width: 100% !important;
    display: grid !important;
    grid-template-columns: 320px 1fr !important;
    gap: 20px !important;
    align-items: start !important;
  }

  .program-sidebar {
    width: 100% !important;
    background: var(--gyanxp-card-bg);
    border-radius: 12px;
    padding: 18px 16px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
    position: sticky;
    top: 15px;
    border: 1px solid #e9ecef;
  }

  .sidebar-header-wrapper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--gyanxp-orange);
  }

  .sidebar-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--gyanxp-dark);
    margin: 0;
  }

  .sidebar-scroll-wrapper { 
    position: relative; 
    width: 100%; 
  }

  .frame-arrow {
    display: none;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    background: rgba(0, 0, 0, 0.35);
    backdrop-filter: blur(2px);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.3);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    transition: all 0.2s ease;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
  }

  .frame-arrow:hover {
    background: rgba(255, 102, 0, 0.85);
    color: #ffffff;
    box-shadow: 0 4px 10px rgba(255, 102, 0, 0.3);
  }

  .frame-arrow-left { left: 4px; }
  .frame-arrow-right { right: 4px; }

  .program-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: calc(100vh - 220px);
    overflow-y: auto;
    padding-right: 4px;
    scroll-behavior: smooth;
  }

  .nav-btn {
    width: 100%;
    text-align: left;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    padding: 12px 18px;
    border-radius: 50px;
    font-size: 13.5px;
    font-weight: 600;
    color: var(--gyanxp-dark);
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-height: 44px;
    gap: 10px;
  }

  .nav-btn:hover { background: #fff0e6; color: var(--gyanxp-orange); border-color: var(--gyanxp-orange); }
  .nav-btn.active { background: var(--gyanxp-orange); color: #ffffff; border-color: var(--gyanxp-orange); box-shadow: 0 3px 8px rgba(255, 102, 0, 0.25); }

  .program-workspace {
    width: 100% !important;
    background: var(--gyanxp-card-bg);
    border-radius: 12px;
    padding: clamp(18px, 2.5vw, 30px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
    border: 1px solid #e9ecef;
    min-width: 0;
  }

  .program-content { display: none; }
  .program-content.active { display: block; }

  .meta-tags { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
  .badge { font-size: 11px; font-weight: 700; padding: 4px 10px; border-radius: 20px; text-transform: uppercase; }
  .badge-tag { background: #fff0e6; color: var(--gyanxp-orange); }
  .badge-easy { background: #e6f4ea; color: #137333; }
  .badge-medium { background: #fef7e0; color: #b06000; }
  .badge-hard { background: #fce8e6; color: #c5221f; }
  .badge-marks { background: #e8f0fe; color: #1a73e8; }

  .question-title { font-size: clamp(18px, 2.2vw, 22px); font-weight: 700; color: var(--gyanxp-dark); margin: 0 0 12px 0; }
  .question-desc { font-size: clamp(13px, 1.8vw, 14px); color: #555; line-height: 1.6; margin-bottom: 18px; background: #fffcf9; padding: 14px 16px; border-radius: 8px; border-left: 4px solid var(--gyanxp-orange); }

  .timer-box { 
    display: flex; 
    align-items: center; 
    justify-content: space-between; 
    background: #f1f3f5; 
    padding: 10px 16px; 
    border-radius: 8px; 
    margin-bottom: 18px; 
    font-size: 13.5px; 
    font-weight: 600; 
    flex-wrap: wrap; 
    gap: 10px; 
  }
  .timer-controls { display: inline-flex; align-items: center; gap: 8px; }
  .timer-display { font-family: monospace; font-size: 15px; color: var(--gyanxp-orange); background: #ffffff; padding: 4px 10px; border-radius: 4px; border: 1px solid #ced4da; }
  .timer-btn { background: var(--gyanxp-dark); color: #fff; border: none; padding: 6px 14px; border-radius: 4px; cursor: pointer; font-size: 12.5px; }

  .code-header { margin-bottom: 6px; }
  .code-section-title { font-size: 14px; font-weight: 600; color: var(--gyanxp-dark); }

  .code-container {
    position: relative;
    margin: 0 0 18px 0;
  }

  .floating-copy-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 5;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(4px);
    color: #e0e0e0;
    border: 1px solid rgba(255, 255, 255, 0.25);
    padding: 5px 12px;
    font-size: 12px;
    font-weight: 600;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
  }

  .floating-copy-btn:hover {
    background: var(--gyanxp-orange);
    color: #ffffff;
    border-color: var(--gyanxp-orange);
    box-shadow: 0 2px 8px rgba(255, 102, 0, 0.4);
  }

  .program-workspace pre { 
    border-radius: 8px; 
    margin: 0 !important; 
    font-size: 13.5px; 
    max-height: 400px; 
    overflow: auto; 
    padding-top: 40px !important;
  }

  .btn-group { display: flex; gap: 10px; margin-bottom: 18px; flex-wrap: wrap; }
  .btn-action { 
    border: none; 
    height: 40px;
    padding: 0 18px; 
    font-size: 13px; 
    font-weight: 600; 
    border-radius: 6px; 
    cursor: pointer; 
    transition: all 0.2s ease; 
    display: inline-flex; 
    align-items: center; 
    justify-content: center;
    gap: 6px; 
  }
  .try-code-btn { background-color: var(--gyanxp-orange); color: #ffffff; }
  .try-code-btn:hover { background-color: var(--gyanxp-orange-hover); }
  
  .circuit-btn { background-color: var(--gyanxp-accent-blue); color: #ffffff; }
  .circuit-btn:hover { background-color: #0069d9; }

  .complete-btn { background-color: #e9ecef; color: var(--gyanxp-dark); }
  .complete-btn.done { background-color: var(--gyanxp-success); color: #ffffff; }

  .accordion-box { margin-bottom: 18px; border: 1px solid #e9ecef; border-radius: 8px; overflow: hidden; }
  .accordion-header { background: #f8f9fa; padding: 12px 16px; font-size: 13.5px; font-weight: 600; color: var(--gyanxp-dark); cursor: pointer; display: flex; justify-content: space-between; align-items: center; }
  .accordion-body { display: none; padding: 14px 16px; font-size: 13.5px; color: #444; line-height: 1.6; background: #ffffff; border-top: 1px solid #e9ecef; }

  .pagination-group { display: flex; justify-content: space-between; margin-top: 24px; padding-top: 18px; border-top: 1px dashed #e9ecef; gap: 10px; }
  .btn-page { 
    height: 40px;
    padding: 0 20px; 
    background-color: #f1f3f5; 
    color: var(--gyanxp-dark); 
    border: 1px solid #ced4da; 
    font-size: 13px; 
    font-weight: 600; 
    border-radius: 6px; 
    cursor: pointer; 
  }
  .btn-page:hover:not(:disabled) { background-color: var(--gyanxp-orange); color: #ffffff; border-color: var(--gyanxp-orange); }
  .btn-page:disabled { opacity: 0.4; cursor: not-allowed; }

  @media (max-width: 992px) {
    .practical-layout { grid-template-columns: 100% !important; }
    .program-list { 
      flex-direction: row; 
      overflow-x: auto; 
      max-height: none; 
      padding: 4px 42px; 
      scrollbar-width: none;
    }
    .program-list::-webkit-scrollbar { display: none; }
    .nav-btn { white-space: nowrap; width: auto; }
    .btn-group { display: grid; grid-template-columns: 1fr; }
    .frame-arrow { display: flex; }
  }
</style>

<div class="gyanxp-full-page">
  <div class="gyanxp-page-header">
    <h1>O Level IoT Practical Solutions (M4-R5)</h1>
    <p>Practice NIELIT IoT practical exam problems with Arduino source code and verified Wokwi diagram configurations!</p>
  </div>

  <div class="progress-widget">
    <div class="progress-info">
      <span class="progress-title">🔌 IoT Practical Completion Progress</span>
      <span class="progress-counter-badge" id="progress-text">0 / 0 Practiced (0%)</span>
    </div>
    <div class="progress-bar-bg">
      <div class="progress-bar-fill" id="progress-fill"></div>
    </div>
  </div>

  <div class="practical-layout">
    <div class="program-sidebar">
      <div class="sidebar-header-wrapper">
        <div class="sidebar-title" id="sidebar-main-title">📑 Practical Index</div>
      </div>
      <div class="sidebar-scroll-wrapper">
        <button class="frame-arrow frame-arrow-left" onclick="scrollIndexSidebar(-120)" title="Scroll Left">◀</button>
        <div class="program-list" id="sidebar-list"></div>
        <button class="frame-arrow frame-arrow-right" onclick="scrollIndexSidebar(120)" title="Scroll Right">▶</button>
      </div>
    </div>

    <div class="program-workspace" id="workspace-container"></div>
  </div>
</div>

<!-- Prism.js Scripts -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/prism/1.29.0/prism.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/prism/1.29.0/components/prism-c.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/prism/1.29.0/components/prism-cpp.min.js"></script>

<script>
  var programsData = [
    {
      id: 1,
      title: "Q1. Blink an LED with 1-Second Interval using Arduino",
      problem: "Write an Arduino C program to blink an onboard LED connected to pin 13 with a delay of 1000ms (1 second).",
      difficulty: "Easy",
      marks: 10,
      timerMins: 5,
      explanation: "Configure pin 13 as OUTPUT using pinMode(). Alternate pin voltage using digitalWrite() with delay(1000).",
      code: `void setup() {\n  pinMode(13, OUTPUT);\n}\n\nvoid loop() {\n  digitalWrite(13, HIGH);\n  delay(1000);\n  digitalWrite(13, LOW);\n  delay(1000);\n}`,
      diagramJson: `{\n  "version": 1,\n  "author": "GyanXp",\n  "editor": "wokwi",\n  "parts": [\n    { "type": "wokwi-arduino-uno", "id": "uno", "top": 0, "left": 0, "attrs": {} },\n    { "type": "wokwi-led", "id": "led1", "top": -96, "left": 147, "attrs": { "color": "red" } },\n    { "type": "wokwi-resistor", "id": "r1", "top": -38, "left": 144, "attrs": { "value": "220" } }\n  ],\n  "connections": [\n    [ "uno:13", "r1:1", "green", [ "v0" ] ],\n    [ "r1:2", "led1:A", "green", [ "v0" ] ],\n    [ "uno:GND.1", "led1:C", "black", [ "v0" ] ]\n  ]\n}`
    },
    {
      id: 2,
      title: "Q2. Read DHT11 Temperature & Humidity Data",
      problem: "Write an IoT program to interface a DHT11 sensor with Arduino and display temperature/humidity on Serial Monitor.",
      difficulty: "Medium",
      marks: 15,
      timerMins: 8,
      explanation: "Include DHT.h library, initialize sensor pin 2, and call readTemperature() and readHumidity() functions.",
      code: `#include "DHT.h"\n#define DHTPIN 2\n#define DHTTYPE DHT11\n\nDHT dht(DHTPIN, DHTTYPE);\n\nvoid setup() {\n  Serial.begin(9600);\n  dht.begin();\n}\n\nvoid loop() {\n  float h = dht.readHumidity();\n  float t = dht.readTemperature();\n  Serial.print("Humidity: ");\n  Serial.print(h);\n  Serial.print("%  Temp: ");\n  Serial.print(t);\n  Serial.println("°C");\n  delay(2000);\n}`,
      diagramJson: `{\n  "version": 1,\n  "author": "GyanXp",\n  "editor": "wokwi",\n  "parts": [\n    { "type": "wokwi-arduino-uno", "id": "uno", "top": 0, "left": 0, "attrs": {} },\n    { "type": "wokwi-dht11", "id": "dht1", "top": -100, "left": 120, "attrs": {} }\n  ],\n  "connections": [\n    [ "uno:5V", "dht1:VCC", "red", [ "v0" ] ],\n    [ "uno:GND.1", "dht1:GND", "black", [ "v0" ] ],\n    [ "uno:2", "dht1:SDA", "blue", [ "v0" ] ]\n  ]\n}`
    },
    {
      id: 3,
      title: "Q3. Control LED via Push Button Switch",
      problem: "Write a program to turn ON an LED when a push button is pressed and OFF when released.",
      difficulty: "Easy",
      marks: 10,
      timerMins: 6,
      explanation: "Use INPUT_PULLUP on pin 2 to handle push button input, driving pin 13 high when pin 2 reads LOW.",
      code: `const int buttonPin = 2;\nconst int ledPin = 13;\n\nvoid setup() {\n  pinMode(ledPin, OUTPUT);\n  pinMode(buttonPin, INPUT_PULLUP);\n}\n\nvoid loop() {\n  int buttonState = digitalRead(buttonPin);\n  if (buttonState == LOW) {\n    digitalWrite(ledPin, HIGH);\n  } else {\n    digitalWrite(ledPin, LOW);\n  }\n}`,
      diagramJson: `{\n  "version": 1,\n  "author": "GyanXp",\n  "editor": "wokwi",\n  "parts": [\n    { "type": "wokwi-arduino-uno", "id": "uno", "top": 0, "left": 0, "attrs": {} },\n    { "type": "wokwi-pushbutton", "id": "btn1", "top": -80, "left": 100, "attrs": { "color": "green" } },\n    { "type": "wokwi-led", "id": "led1", "top": -80, "left": 200, "attrs": { "color": "red" } }\n  ],\n  "connections": [\n    [ "uno:2", "btn1:1.M", "blue", [ "v0" ] ],\n    [ "uno:GND.1", "btn1:2.M", "black", [ "v0" ] ],\n    [ "uno:13", "led1:A", "green", [ "v0" ] ],\n    [ "uno:GND.2", "led1:C", "black", [ "v0" ] ]\n  ]\n}`
    },
    {
      id: 4,
      title: "Q4. Measure Distance using HC-SR04 Ultrasonic Sensor",
      problem: "Interface HC-SR04 ultrasonic distance sensor with Arduino and output calculated distance in centimeters.",
      difficulty: "Medium",
      marks: 15,
      timerMins: 10,
      explanation: "Send 10us trigger pulse on pin 9, then use pulseIn() on pin 10 to measure return echo pulse.",
      code: `const int trigPin = 9;\nconst int echoPin = 10;\n\nvoid setup() {\n  Serial.begin(9600);\n  pinMode(trigPin, OUTPUT);\n  pinMode(echoPin, INPUT);\n}\n\nvoid loop() {\n  digitalWrite(trigPin, LOW);\n  delayMicroseconds(2);\n  digitalWrite(trigPin, HIGH);\n  delayMicroseconds(10);\n  digitalWrite(trigPin, LOW);\n\n  long duration = pulseIn(echoPin, HIGH);\n  float distance = duration * 0.034 / 2;\n  Serial.print("Distance: ");\n  Serial.print(distance);\n  Serial.println(" cm");\n  delay(500);\n}`,
      diagramJson: `{\n  "version": 1,\n  "author": "GyanXp",\n  "editor": "wokwi",\n  "parts": [\n    { "type": "wokwi-arduino-uno", "id": "uno", "top": 0, "left": 0, "attrs": {} },\n    { "type": "wokwi-hc-sr04", "id": "hc1", "top": -120, "left": 120, "attrs": {} }\n  ],\n  "connections": [\n    [ "uno:5V", "hc1:VCC", "red", [ "v0" ] ],\n    [ "uno:GND.1", "hc1:GND", "black", [ "v0" ] ],\n    [ "uno:9", "hc1:TRIG", "orange", [ "v0" ] ],\n    [ "uno:10", "hc1:ECHO", "green", [ "v0" ] ]\n  ]\n}`
    },
    {
      id: 5,
      title: "Q5. Analog Sensor Reading & Serial Output",
      problem: "Read continuous voltage changes from a Potentiometer connected to analog pin A0.",
      difficulty: "Easy",
      marks: 10,
      timerMins: 5,
      explanation: "Read raw voltage levels between 0 and 1023 using analogRead(A0) and scale to voltage.",
      code: `const int sensorPin = A0;\n\nvoid setup() {\n  Serial.begin(9600);\n}\n\nvoid loop() {\n  int sensorValue = analogRead(sensorPin);\n  float voltage = sensorValue * (5.0 / 1023.0);\n  Serial.print("Raw Value: ");\n  Serial.print(sensorValue);\n  Serial.print(" | Voltage: ");\n  Serial.println(voltage);\n  delay(500);\n}`,
      diagramJson: `{\n  "version": 1,\n  "author": "GyanXp",\n  "editor": "wokwi",\n  "parts": [\n    { "type": "wokwi-arduino-uno", "id": "uno", "top": 0, "left": 0, "attrs": {} },\n    { "type": "wokwi-potentiometer", "id": "pot1", "top": -100, "left": 100, "attrs": {} }\n  ],\n  "connections": [\n    [ "uno:5V", "pot1:VCC", "red", [ "v0" ] ],\n    [ "uno:GND.1", "pot1:GND", "black", [ "v0" ] ],\n    [ "uno:A0", "pot1:SIG", "blue", [ "v0" ] ]\n  ]\n}`
    },
    {
      id: 6,
      title: "Q6. Traffic Light System Controller",
      problem: "Simulate a traffic light sequence with Red (5s), Yellow (2s), and Green (5s) LEDs.",
      difficulty: "Easy",
      marks: 10,
      timerMins: 8,
      explanation: "Sequential control of 3 LEDs on Digital Pins 11, 12, and 13 using predefined delays.",
      code: `const int red = 13, yellow = 12, green = 11;\n\nvoid setup() {\n  pinMode(red, OUTPUT);\n  pinMode(yellow, OUTPUT);\n  pinMode(green, OUTPUT);\n}\n\nvoid loop() {\n  digitalWrite(red, HIGH);\n  digitalWrite(yellow, LOW);\n  digitalWrite(green, LOW);\n  delay(5000);\n\n  digitalWrite(red, LOW);\n  digitalWrite(yellow, HIGH);\n  delay(2000);\n\n  digitalWrite(yellow, LOW);\n  digitalWrite(green, HIGH);\n  delay(5000);\n}`,
      diagramJson: `{\n  "version": 1,\n  "author": "GyanXp",\n  "editor": "wokwi",\n  "parts": [\n    { "type": "wokwi-arduino-uno", "id": "uno", "top": 0, "left": 0, "attrs": {} },\n    { "type": "wokwi-led", "id": "ledR", "top": -120, "left": 100, "attrs": { "color": "red" } },\n    { "type": "wokwi-led", "id": "ledY", "top": -120, "left": 160, "attrs": { "color": "yellow" } },\n    { "type": "wokwi-led", "id": "ledG", "top": -120, "left": 220, "attrs": { "color": "green" } }\n  ],\n  "connections": [\n    [ "uno:13", "ledR:A", "red", [ "v0" ] ],\n    [ "uno:12", "ledY:A", "gold", [ "v0" ] ],\n    [ "uno:11", "ledG:A", "green", [ "v0" ] ],\n    [ "uno:GND.1", "ledR:C", "black", [ "v0" ] ],\n    [ "uno:GND.1", "ledY:C", "black", [ "v0" ] ],\n    [ "uno:GND.1", "ledG:C", "black", [ "v0" ] ]\n  ]\n}`
    },
    {
      id: 7,
      title: "Q7. PIR Motion Detection Alarm with Buzzer",
      problem: "Interface PIR Motion Sensor to trigger a Piezo Buzzer whenever movement is detected.",
      difficulty: "Medium",
      marks: 15,
      timerMins: 8,
      explanation: "Read high signal from PIR output pin on Digital Pin 2 and activate tone on Pin 8.",
      code: `const int pirPin = 2;\nconst int buzzerPin = 8;\n\nvoid setup() {\n  pinMode(pirPin, INPUT);\n  pinMode(buzzerPin, OUTPUT);\n  Serial.begin(9600);\n}\n\nvoid loop() {\n  int motion = digitalRead(pirPin);\n  if (motion == HIGH) {\n    Serial.println("Motion Detected!");\n    tone(buzzerPin, 1000);\n    delay(500);\n  } else {\n    noTone(buzzerPin);\n  }\n}`,
      diagramJson: `{\n  "version": 1,\n  "author": "GyanXp",\n  "editor": "wokwi",\n  "parts": [\n    { "type": "wokwi-arduino-uno", "id": "uno", "top": 0, "left": 0, "attrs": {} },\n    { "type": "wokwi-pir-motion-sensor", "id": "pir1", "top": -140, "left": 80, "attrs": {} },\n    { "type": "wokwi-buzzer", "id": "bz1", "top": -100, "left": 240, "attrs": {} }\n  ],\n  "connections": [\n    [ "uno:5V", "pir1:VCC", "red", [ "v0" ] ],\n    [ "uno:GND.1", "pir1:GND", "black", [ "v0" ] ],\n    [ "uno:2", "pir1:OUT", "purple", [ "v0" ] ],\n    [ "uno:8", "bz1:1", "orange", [ "v0" ] ],\n    [ "uno:GND.2", "bz1:2", "black", [ "v0" ] ]\n  ]\n}`
    },
    {
      id: 8,
      title: "Q8. Servo Motor Angle Control with Potentiometer",
      problem: "Rotate a Servo motor continuously between 0 to 180 degrees using Potentiometer input.",
      difficulty: "Medium",
      marks: 15,
      timerMins: 10,
      explanation: "Map analog value 0-1023 to degree range 0-180 and output angle with Servo.h library.",
      code: `#include <Servo.h>\n\nServo myServo;\nint potPin = A0;\n\nvoid setup() {\n  myServo.attach(9);\n}\n\nvoid loop() {\n  int val = analogRead(potPin);\n  int angle = map(val, 0, 1023, 0, 180);\n  myServo.write(angle);\n  delay(15);\n}`,
      diagramJson: `{\n  "version": 1,\n  "author": "GyanXp",\n  "editor": "wokwi",\n  "parts": [\n    { "type": "wokwi-arduino-uno", "id": "uno", "top": 0, "left": 0, "attrs": {} },\n    { "type": "wokwi-servo", "id": "servo1", "top": -120, "left": 180, "attrs": {} },\n    { "type": "wokwi-potentiometer", "id": "pot1", "top": -80, "left": 60, "attrs": {} }\n  ],\n  "connections": [\n    [ "uno:5V", "servo1:V+", "red", [ "v0" ] ],\n    [ "uno:GND.1", "servo1:GND", "black", [ "v0" ] ],\n    [ "uno:9", "servo1:PWM", "orange", [ "v0" ] ],\n    [ "uno:5V", "pot1:VCC", "red", [ "v0" ] ],\n    [ "uno:GND.2", "pot1:GND", "black", [ "v0" ] ],\n    [ "uno:A0", "pot1:SIG", "blue", [ "v0" ] ]\n  ]\n}`
    },
    {
      id: 9,
      title: "Q9. Display Custom Text on 16x2 LCD Display",
      problem: "Display 'GyanXp IoT' on line 1 and 'NIELIT O Level' on line 2 using I2C LCD Display.",
      difficulty: "Medium",
      marks: 15,
      timerMins: 10,
      explanation: "Initialize LiquidCrystal_I2C at 0x27 address, print text using setCursor() methods.",
      code: `#include <LiquidCrystal_I2C.h>\n\nLiquidCrystal_I2C lcd(0x27, 16, 2);\n\nvoid setup() {\n  lcd.init();\n  lcd.backlight();\n  lcd.setCursor(0, 0);\n  lcd.print("GyanXp IoT");\n  lcd.setCursor(0, 1);\n  lcd.print("NIELIT O Level");\n}\n\nvoid loop() {}`,
      diagramJson: `{\n  "version": 1,\n  "author": "GyanXp",\n  "editor": "wokwi",\n  "parts": [\n    { "type": "wokwi-arduino-uno", "id": "uno", "top": 0, "left": 0, "attrs": {} },\n    { "type": "wokwi-lcd1602", "id": "lcd1", "top": -160, "left": 100, "attrs": { "pins": "i2c" } }\n  ],\n  "connections": [\n    [ "uno:5V", "lcd1:VCC", "red", [ "v0" ] ],\n    [ "uno:GND.1", "lcd1:GND", "black", [ "v0" ] ],\n    [ "uno:A4", "lcd1:SDA", "blue", [ "v0" ] ],\n    [ "uno:A5", "lcd1:SCL", "yellow", [ "v0" ] ]\n  ]\n}`
    },
    {
      id: 10,
      title: "Q10. LED Brightness Control using PWM Signal",
      problem: "Fade an LED in and out smoothly using PWM signal generation on pin 9.",
      difficulty: "Easy",
      marks: 10,
      timerMins: 5,
      explanation: "Use analogWrite() from value 0 to 255 to alter duty cycle of PWM signal.",
      code: `const int ledPin = 9;\n\nvoid setup() {\n  pinMode(ledPin, OUTPUT);\n}\n\nvoid loop() {\n  for (int b = 0; b <= 255; b += 5) {\n    analogWrite(ledPin, b);\n    delay(30);\n  }\n  for (int b = 255; b >= 0; b -= 5) {\n    analogWrite(ledPin, b);\n    delay(30);\n  }\n}`,
      diagramJson: `{\n  "version": 1,\n  "author": "GyanXp",\n  "editor": "wokwi",\n  "parts": [\n    { "type": "wokwi-arduino-uno", "id": "uno", "top": 0, "left": 0, "attrs": {} },\n    { "type": "wokwi-led", "id": "led1", "top": -80, "left": 150, "attrs": { "color": "blue" } }\n  ],\n  "connections": [\n    [ "uno:9", "led1:A", "blue", [ "v0" ] ],\n    [ "uno:GND.1", "led1:C", "black", [ "v0" ] ]\n  ]\n}`
    },
    {
      id: 11,
      title: "Q11. LDR Light Sensor Night Lamp Automation",
      problem: "Automatically switch ON an LED when ambient light drops below threshold using LDR sensor.",
      difficulty: "Medium",
      marks: 15,
      timerMins: 8,
      explanation: "Read analog values from LDR voltage divider on pin A0 and toggle LED when light drops.",
      code: `const int ldrPin = A0;\nconst int ledPin = 13;\n\nvoid setup() {\n  pinMode(ledPin, OUTPUT);\n  Serial.begin(9600);\n}\n\nvoid loop() {\n  int ldrVal = analogRead(ldrPin);\n  Serial.println(ldrVal);\n  if (ldrVal < 500) {\n    digitalWrite(ledPin, HIGH);\n  } else {\n    digitalWrite(ledPin, LOW);\n  }\n  delay(300);\n}`,
      diagramJson: `{\n  "version": 1,\n  "author": "GyanXp",\n  "editor": "wokwi",\n  "parts": [\n    { "type": "wokwi-arduino-uno", "id": "uno", "top": 0, "left": 0, "attrs": {} },\n    { "type": "wokwi-photoresistor-sensor", "id": "ldr1", "top": -120, "left": 80, "attrs": {} },\n    { "type": "wokwi-led", "id": "led1", "top": -80, "left": 220, "attrs": { "color": "yellow" } }\n  ],\n  "connections": [\n    [ "uno:5V", "ldr1:VCC", "red", [ "v0" ] ],\n    [ "uno:GND.1", "ldr1:GND", "black", [ "v0" ] ],\n    [ "uno:A0", "ldr1:AO", "blue", [ "v0" ] ],\n    [ "uno:13", "led1:A", "gold", [ "v0" ] ],\n    [ "uno:GND.2", "led1:C", "black", [ "v0" ] ]\n  ]\n}`
    },
    {
      id: 12,
      title: "Q12. Keypad Lock Password Verification System",
      problem: "Accept 4-digit PIN via Matrix Keypad and output access granted or denied status.",
      difficulty: "Hard",
      marks: 20,
      timerMins: 15,
      explanation: "Read key matrix using Keypad.h library and match string sequence against stored password.",
      code: `#include <Keypad.h>\n\nconst byte ROWS = 4, COLS = 4;\nchar keys[ROWS][COLS] = {\n  {'1','2','3','A'},\n  {'4','5','6','B'},\n  {'7','8','9','C'},\n  {'*','0','#','D'}\n};\nbyte rowPins[ROWS] = {9, 8, 7, 6};\nbyte colPins[COLS] = {5, 4, 3, 2};\nKeypad keypad = Keypad(makeKeymap(keys), rowPins, colPins, ROWS, COLS);\n\nvoid setup() {\n  Serial.begin(9600);\n}\n\nvoid loop() {\n  char key = keypad.getKey();\n  if (key) {\n    Serial.print("Pressed Key: ");\n    Serial.println(key);\n  }\n}`,
      diagramJson: `{\n  "version": 1,\n  "author": "GyanXp",\n  "editor": "wokwi",\n  "parts": [\n    { "type": "wokwi-arduino-uno", "id": "uno", "top": 0, "left": 0, "attrs": {} },\n    { "type": "wokwi-membrane-keypad", "id": "kp1", "top": -200, "left": 120, "attrs": {} }\n  ],\n  "connections": [\n    [ "uno:9", "kp1:R1", "green", [ "v0" ] ],\n    [ "uno:8", "kp1:R2", "green", [ "v0" ] ],\n    [ "uno:7", "kp1:R3", "green", [ "v0" ] ],\n    [ "uno:6", "kp1:R4", "green", [ "v0" ] ],\n    [ "uno:5", "kp1:C1", "blue", [ "v0" ] ],\n    [ "uno:4", "kp1:C2", "blue", [ "v0" ] ],\n    [ "uno:3", "kp1:C3", "blue", [ "v0" ] ],\n    [ "uno:2", "kp1:C4", "blue", [ "v0" ] ]\n  ]\n}`
    },
    {
      id: 13,
      title: "Q13. Smart Home Relay Control with Switch",
      problem: "Control a high-voltage Appliance simulator via Relay Module with Digital Trigger Switch.",
      difficulty: "Medium",
      marks: 15,
      timerMins: 10,
      explanation: "Toggle relay coil control pin HIGH/LOW to switch isolated contact terminals.",
      code: `const int switchPin = 2;\nconst int relayPin = 7;\n\nvoid setup() {\n  pinMode(switchPin, INPUT_PULLUP);\n  pinMode(relayPin, OUTPUT);\n}\n\nvoid loop() {\n  int state = digitalRead(switchPin);\n  if (state == LOW) {\n    digitalWrite(relayPin, HIGH);\n  } else {\n    digitalWrite(relayPin, LOW);\n  }\n}`,
      diagramJson: `{\n  "version": 1,\n  "author": "GyanXp",\n  "editor": "wokwi",\n  "parts": [\n    { "type": "wokwi-arduino-uno", "id": "uno", "top": 0, "left": 0, "attrs": {} },\n    { "type": "wokwi-relay-module", "id": "rel1", "top": -100, "left": 160, "attrs": {} },\n    { "type": "wokwi-pushbutton", "id": "btn1", "top": -60, "left": 60, "attrs": {} }\n  ],\n  "connections": [\n    [ "uno:5V", "rel1:VCC", "red", [ "v0" ] ],\n    [ "uno:GND.1", "rel1:GND", "black", [ "v0" ] ],\n    [ "uno:7", "rel1:IN", "purple", [ "v0" ] ],\n    [ "uno:2", "btn1:1.M", "blue", [ "v0" ] ],\n    [ "uno:GND.2", "btn1:2.M", "black", [ "v0" ] ]\n  ]\n}`
    },
    {
      id: 14,
      title: "Q14. Stepper Motor Rotation Sequence Driver",
      problem: "Drive a 28BYJ-48 Stepper Motor using ULN2003 Driver Module for automated rotation.",
      difficulty: "Hard",
      marks: 20,
      timerMins: 12,
      explanation: "Step coil sequences on digital pins 8, 9, 10, 11 through Stepper.h library.",
      code: `#include <Stepper.h>\n\nconst int stepsPerRev = 200;\nStepper myStepper(stepsPerRev, 8, 9, 10, 11);\n\nvoid setup() {\n  myStepper.setSpeed(60);\n}\n\nvoid loop() {\n  myStepper.step(stepsPerRev);\n  delay(1000);\n  myStepper.step(-stepsPerRev);\n  delay(1000);\n}`,
      diagramJson: `{\n  "version": 1,\n  "author": "GyanXp",\n  "editor": "wokwi",\n  "parts": [\n    { "type": "wokwi-arduino-uno", "id": "uno", "top": 0, "left": 0, "attrs": {} },\n    { "type": "wokwi-stepper-motor", "id": "step1", "top": -140, "left": 150, "attrs": {} }\n  ],\n  "connections": [\n    [ "uno:8", "step1:A1", "orange", [ "v0" ] ],\n    [ "uno:9", "step1:A2", "yellow", [ "v0" ] ],\n    [ "uno:10", "step1:B1", "pink", [ "v0" ] ],\n    [ "uno:11", "step1:B2", "blue", [ "v0" ] ]\n  ]\n}`
    },
    {
      id: 15,
      title: "Q15. IoT Water Level Detector with Buzzer & LEDs",
      problem: "Indicate Low, Medium, and High water level status using 3 LEDs and a Warning Alarm.",
      difficulty: "Hard",
      marks: 20,
      timerMins: 15,
      explanation: "Map multi-threshold sensor analog inputs to 3 distinct warning levels and buzzer trigger.",
      code: `const int levelPin = A0;\nconst int greenLed = 10, yellowLed = 11, redLed = 12;\nconst int buzzer = 8;\n\nvoid setup() {\n  pinMode(greenLed, OUTPUT);\n  pinMode(yellowLed, OUTPUT);\n  pinMode(redLed, OUTPUT);\n  pinMode(buzzer, OUTPUT);\n}\n\nvoid loop() {\n  int val = analogRead(levelPin);\n  digitalWrite(greenLed, val > 200 ? HIGH : LOW);\n  digitalWrite(yellowLed, val > 500 ? HIGH : LOW);\n  if (val > 800) {\n    digitalWrite(redLed, HIGH);\n    tone(buzzer, 1200);\n  } else {\n    digitalWrite(redLed, LOW);\n    noTone(buzzer);\n  }\n  delay(200);\n}`,
      diagramJson: `{\n  "version": 1,\n  "author": "GyanXp",\n  "editor": "wokwi",\n  "parts": [\n    { "type": "wokwi-arduino-uno", "id": "uno", "top": 0, "left": 0, "attrs": {} },\n    { "type": "wokwi-potentiometer", "id": "pot1", "top": -80, "left": 40, "attrs": {} },\n    { "type": "wokwi-led", "id": "ledG", "top": -120, "left": 150, "attrs": { "color": "green" } },\n    { "type": "wokwi-led", "id": "ledY", "top": -120, "left": 200, "attrs": { "color": "yellow" } },\n    { "type": "wokwi-led", "id": "ledR", "top": -120, "left": 250, "attrs": { "color": "red" } },\n    { "type": "wokwi-buzzer", "id": "bz1", "top": -50, "left": 200, "attrs": {} }\n  ],\n  "connections": [\n    [ "uno:5V", "pot1:VCC", "red", [ "v0" ] ],\n    [ "uno:GND.1", "pot1:GND", "black", [ "v0" ] ],\n    [ "uno:A0", "pot1:SIG", "blue", [ "v0" ] ],\n    [ "uno:10", "ledG:A", "green", [ "v0" ] ],\n    [ "uno:11", "ledY:A", "gold", [ "v0" ] ],\n    [ "uno:12", "ledR:A", "red", [ "v0" ] ],\n    [ "uno:8", "bz1:1", "purple", [ "v0" ] ],\n    [ "uno:GND.2", "bz1:2", "black", [ "v0" ] ]\n  ]\n}`
    }
  ];

  var TOTAL_PROGRAMS = programsData.length;
  var completedPrograms = JSON.parse(localStorage.getItem('gyanxp_iot_completed')) || [];
  var activeTimers = {};

  function escapeHtml(text) {
    return text.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;");
  }

  function scrollIndexSidebar(offset) {
    var sidebarList = document.getElementById('sidebar-list');
    if (sidebarList) {
      sidebarList.scrollBy({ left: offset, behavior: 'smooth' });
    }
  }

  function copySnippetCode(progId) {
    var program = programsData.find(function(p) { return p.id === progId; });
    var floatBtn = document.getElementById('float-copy-' + progId);

    if (program && floatBtn) {
      navigator.clipboard.writeText(program.code).then(function() {
        var originalText = floatBtn.innerText;
        floatBtn.innerText = '📋 Copied!';
        setTimeout(function() { floatBtn.innerText = originalText; }, 2000);
      });
    }
  }

  function renderAllPrograms() {
    var sidebarHtml = '';
    var workspaceHtml = '';

    var mainTitleEl = document.getElementById('sidebar-main-title');
    if (mainTitleEl) mainTitleEl.innerText = '📑 Practical Index (' + TOTAL_PROGRAMS + ')';

    programsData.forEach(function (item, index) {
      var isFirst = index === 0;
      var progNum = index + 1;
      var diffClass = 'badge-' + item.difficulty.toLowerCase();

      sidebarHtml += `
        <button class="nav-btn ${isFirst ? 'active' : ''}" id="side-btn-${item.id}" onclick="switchProgram(${item.id})">
          <span>Practical ${progNum}</span>
          <span class="status-dot" id="dot-${item.id}">⚪</span>
        </button>
      `;

      workspaceHtml += `
        <div id="prog-${item.id}" class="program-content ${isFirst ? 'active' : ''}">
          <div class="meta-tags">
            <span class="badge badge-tag">Practical #${progNum}</span>
            <span class="badge ${diffClass}">${item.difficulty}</span>
            <span class="badge badge-marks">Weightage: ${item.marks} Marks</span>
          </div>

          <h2 class="question-title">${item.title}</h2>
          <div class="question-desc"><strong>Problem Statement:</strong> ${item.problem}</div>

          <div class="timer-box">
            <span>⏱ Recommended Time: ${item.timerMins} mins</span>
            <div class="timer-controls">
              <span class="timer-display" id="timer-${item.id}">00:00</span>
              <button class="timer-btn" onclick="toggleTimer(${item.id})">Start Timer</button>
            </div>
          </div>

          <div class="code-header"><span class="code-section-title">Solution C++ Code (sketch.ino):</span></div>
          
          <div class="code-container">
            <button class="floating-copy-btn" id="float-copy-${item.id}" onclick="copySnippetCode(${item.id})">📋 Copy Code</button>
            <pre><code class="language-cpp" id="code-snippet-${item.id}">${escapeHtml(item.code)}</code></pre>
          </div>

          <div class="btn-group">
            <button class="btn-action try-code-btn" id="btn-editor-${item.id}" onclick="openCompilerTab(${item.id})">▶ Copy Code & Open Wokwi</button>
            <button class="btn-action circuit-btn" id="btn-circuit-${item.id}" onclick="copyCircuitCode(${item.id})">🔌 Copy Circuit Code</button>
            <button class="btn-action complete-btn" id="mark-btn-${item.id}" onclick="toggleCompletion(${item.id})">✔ Mark Done</button>
          </div>

          <div class="accordion-box">
            <div class="accordion-header" onclick="toggleAccordion(${item.id})">
              <span>💡 Hardware & Logic Explanation</span><span id="acc-icon-${item.id}">➕</span>
            </div>
            <div class="accordion-body" id="acc-body-${item.id}">${item.explanation}</div>
          </div>

          <div class="pagination-group">
            <button class="btn-page" ${index === 0 ? 'disabled' : `onclick="switchProgram(${programsData[index - 1].id})"`}>◀ Previous</button>
            <button class="btn-page" ${index === programsData.length - 1 ? 'disabled' : `onclick="switchProgram(${programsData[index + 1].id})"`}>Next ▶</button>
          </div>
        </div>
      `;
    });

    document.getElementById('sidebar-list').innerHTML = sidebarHtml;
    document.getElementById('workspace-container').innerHTML = workspaceHtml;

    if (window.Prism) Prism.highlightAll();
  }

  function switchProgram(progId) {
    document.querySelectorAll('.program-content').forEach(function(el) { el.classList.remove('active'); });
    document.querySelectorAll('.nav-btn').forEach(function(btn) { btn.classList.remove('active'); });

    var targetProg = document.getElementById('prog-' + progId);
    var targetBtn = document.getElementById('side-btn-' + progId);

    if (targetProg) targetProg.classList.add('active');
    if (targetBtn) {
      targetBtn.classList.add('active');
      targetBtn.scrollIntoView({ behavior: 'smooth', block: 'nearest', inline: 'center' });
    }
  }

  function openCompilerTab(progId) {
    var program = programsData.find(function(p) { return p.id === progId; });
    var editorBtn = document.getElementById('btn-editor-' + progId);

    if (program) {
      navigator.clipboard.writeText(program.code).then(function() {
        var originalText = editorBtn.innerText;
        editorBtn.innerText = '📋 Code Copied!';
        setTimeout(function() { editorBtn.innerText = originalText; }, 2000);
        window.open('online-iot-compiler', '_blank');
      }).catch(function() {
        window.open('online-iot-compiler', '_blank');
      });
    }
  }

  function copyCircuitCode(progId) {
    var program = programsData.find(function(p) { return p.id === progId; });
    var circuitBtn = document.getElementById('btn-circuit-' + progId);

    if (program) {
      navigator.clipboard.writeText(program.diagramJson).then(function() {
        var originalText = circuitBtn.innerText;
        circuitBtn.innerText = '✅ Circuit JSON Copied!';
        setTimeout(function() { circuitBtn.innerText = originalText; }, 2000);
      });
    }
  }

  function toggleAccordion(progId) {
    var body = document.getElementById('acc-body-' + progId);
    var icon = document.getElementById('acc-icon-' + progId);
    var isOpen = body.style.display === 'block';
    body.style.display = isOpen ? 'none' : 'block';
    icon.innerText = isOpen ? '➕' : '➖';
  }

  function toggleTimer(progId) {
    var timerDisplay = document.getElementById('timer-' + progId);
    var timerBtn = timerDisplay.nextElementSibling;

    if (activeTimers[progId]) {
      clearInterval(activeTimers[progId].interval);
      delete activeTimers[progId];
      timerBtn.innerText = 'Start Timer';
    } else {
      var seconds = 0;
      timerBtn.innerText = 'Stop Timer';
      activeTimers[progId] = {
        interval: setInterval(function () {
          seconds++;
          var mins = Math.floor(seconds / 60);
          var secs = seconds % 60;
          timerDisplay.innerText = (mins < 10 ? '0' : '') + mins + ':' + (secs < 10 ? '0' : '') + secs;
        }, 1000)
      };
    }
  }

  function toggleCompletion(progId) {
    var index = completedPrograms.indexOf(progId);
    if (index > -1) {
      completedPrograms.splice(index, 1);
    } else {
      completedPrograms.push(progId);
    }
    localStorage.setItem('gyanxp_iot_completed', JSON.stringify(completedPrograms));
    updateProgressUI();
  }

  function updateProgressUI() {
    programsData.forEach(function (item) {
      var markBtn = document.getElementById('mark-btn-' + item.id);
      var dot = document.getElementById('dot-' + item.id);

      if (completedPrograms.includes(item.id)) {
        if (markBtn) { markBtn.innerText = '✔ Practiced'; markBtn.classList.add('done'); }
        if (dot) dot.innerText = '🟢';
      } else {
        if (markBtn) { markBtn.innerText = '✔ Mark Done'; markBtn.classList.remove('done'); }
        if (dot) dot.innerText = '⚪';
      }
    });

    var validCompleted = completedPrograms.filter(function(id) {
      return programsData.some(p => p.id === id);
    }).length;

    var percentage = TOTAL_PROGRAMS > 0 ? Math.round((validCompleted / TOTAL_PROGRAMS) * 100) : 0;
    document.getElementById('progress-fill').style.width = percentage + '%';
    document.getElementById('progress-text').innerText = validCompleted + ' / ' + TOTAL_PROGRAMS + ' Practiced (' + percentage + '%)';
  }

  document.addEventListener("DOMContentLoaded", function () {
    renderAllPrograms();
    updateProgressUI();
  });
</script>				</div>
				</div>
					</div>
		</div>
					</div>
		</section>
				</div>
		<p>The post <a href="https://gyanxp.com/online-iot-practical-solution-pr4/">Online IoT Practical Solution (PR4)</a> appeared first on <a href="https://gyanxp.com">GyanXp</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://gyanxp.com/online-iot-practical-solution-pr4/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Online IoT Compiler</title>
		<link>https://gyanxp.com/online-iot-compiler/</link>
					<comments>https://gyanxp.com/online-iot-compiler/#respond</comments>
		
		<dc:creator><![CDATA[Balmukund Maurya]]></dc:creator>
		<pubDate>Mon, 17 Aug 2026 13:29:57 +0000</pubDate>
				<category><![CDATA[Online Practical]]></category>
		<guid isPermaLink="false">https://gyanxp.com/?p=6228</guid>

					<description><![CDATA[<p>IoT Lab IoT Practical Simulator — Arduino Uno Design circuits, write embedded C/C++ code, and simulate IoT hardware in real-time. Fullscreen Exit Fullscreen</p>
<p>The post <a href="https://gyanxp.com/online-iot-compiler/">Online IoT Compiler</a> appeared first on <a href="https://gyanxp.com">GyanXp</a>.</p>
]]></description>
										<content:encoded><![CDATA[		<div data-elementor-type="wp-post" data-elementor-id="6228" class="elementor elementor-6228">
						<section class="elementor-section elementor-top-section elementor-element elementor-element-0352912 elementor-section-boxed elementor-section-height-default elementor-section-height-default" data-id="0352912" data-element_type="section" data-e-type="section">
						<div class="elementor-container elementor-column-gap-default">
					<div class="elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-c4869d4" data-id="c4869d4" data-element_type="column" data-e-type="column">
			<div class="elementor-widget-wrap elementor-element-populated">
						<div class="elementor-element elementor-element-e67576e elementor-widget elementor-widget-html" data-id="e67576e" data-element_type="widget" data-e-type="widget" data-widget_type="html.default">
				<div class="elementor-widget-container">
					<style>
  /* Outer Container */
  .compiler-container {
    width: 100%;
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  }

  /* IoT Practical Title Header */
  .iot-header {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    border: 1px solid #334155;
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    transition: opacity 0.2s ease, visibility 0.2s ease;
  }

  .iot-header-info {
    display: flex;
    align-items: center;
    gap: 12px;
  }

  .iot-badge {
    background-color: #00979d;
    color: #ffffff;
    font-size: 11px;
    font-weight: 700;
    padding: 4px 8px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
  }

  .iot-title {
    margin: 0;
    color: #f8fafc;
    font-size: 16px;
    font-weight: 600;
    letter-spacing: 0.3px;
  }

  .iot-subtitle {
    margin: 2px 0 0 0;
    color: #94a3b8;
    font-size: 12px;
  }

  /* Top Actions Bar */
  .compiler-toolbar {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
    transition: opacity 0.2s ease, visibility 0.2s ease;
  }

  /* Fullscreen Toggle Button */
  .fullscreen-toggle-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 32px;
    padding: 0 14px;
    background-color: #00979d;
    color: #ffffff;
    font-size: 13px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    box-shadow: 0 2px 2px 0 rgba(0, 0, 0, 0.14);
    transition: background-color 0.2s ease, box-shadow 0.2s ease;
    user-select: none;
    outline: none;
  }

  .fullscreen-toggle-btn:hover {
    background-color: #008186;
    box-shadow: 0 4px 5px 0 rgba(0, 0, 0, 0.14);
  }

  /* Floating Exit Fullscreen Button (Appears only in Fullscreen Mode) */
  .exit-fullscreen-floating-btn {
    display: none;
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 1000001;
    height: 32px;
    padding: 0 14px;
    background-color: rgba(30, 41, 59, 0.85);
    color: #ffffff;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    cursor: pointer;
    backdrop-filter: blur(4px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
    transition: background-color 0.2s ease;
  }

  .exit-fullscreen-floating-btn:hover {
    background-color: rgba(15, 23, 42, 0.95);
  }

  /* Simulator Wrapper acting as a crop mask */
  .compiler-wrapper {
    position: relative;
    width: 100%;
    height: 520px;
    margin: 0;
    padding: 0;
    background-color: #1e1e1e;
    border-radius: 8px;
    overflow: hidden;
  }

  /* Iframe offset to hide Wokwi's top header bar */
  .compiler-wrapper iframe {
    width: 100%;
    height: calc(100% + 50px); 
    margin-top: -50px; 
    border: none;
    display: block;
  }

  /* =======================================================
     Mobile & Desktop Fullscreen Mode (Shows ONLY Compiler)
     ======================================================= */
  .compiler-container.is-fullscreen {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    height: 100dvh !important;
    z-index: 999999 !important;
    background-color: #1e1e1e !important;
    padding: 0 !important;
    margin: 0 !important;
    box-sizing: border-box !important;
    display: block !important;
    overflow: hidden !important;
  }

  /* Hide Header and Standard Toolbar in Fullscreen Mode */
  .compiler-container.is-fullscreen .iot-header,
  .compiler-container.is-fullscreen .compiler-toolbar {
    display: none !important;
  }

  /* Show Floating Exit Button in Fullscreen Mode */
  .compiler-container.is-fullscreen .exit-fullscreen-floating-btn {
    display: inline-flex !important;
    align-items: center;
    gap: 6px;
  }

  /* Expand Wrapper to 100% Edge-to-Edge */
  .compiler-container.is-fullscreen .compiler-wrapper {
    width: 100vw !important;
    height: 100vh !important;
    height: 100dvh !important;
    border-radius: 0 !important;
  }

  @media (max-width: 768px) {
    .iot-header {
      flex-direction: column;
      align-items: flex-start;
      gap: 8px;
    }

    .fullscreen-toggle-btn {
      height: 30px;
      padding: 0 12px;
      font-size: 12px;
    }

    .compiler-wrapper {
      height: 420px;
    }
  }
</style>

<div id="compiler-container" class="compiler-container">
  <!-- Title Header for IoT Practical -->
  <div class="iot-header">
    <div class="iot-header-info">
      <span class="iot-badge">IoT Lab</span>
      <div>
        <h3 class="iot-title">IoT Practical Simulator — Arduino Uno</h3>
        <p class="iot-subtitle">Design circuits, write embedded C/C++ code, and simulate IoT hardware in real-time.</p>
      </div>
    </div>
  </div>

  <!-- Outside Top Toolbar -->
  <div class="compiler-toolbar">
    <button id="fullscreen-btn" class="fullscreen-toggle-btn" title="Toggle Fullscreen">
      <svg id="fullscreen-icon" width="14" height="14" viewBox="0 0 24 24" fill="currentColor">
        <path d="M7 14H5v5h5v-2H7v-3zm-2-4h2V7h3V5H5v5zm12 7h-3v2h5v-5h-2v3zM14 5v2h3v3h2V5h-5z"/>
      </svg>
      <span id="fullscreen-text">Fullscreen</span>
    </button>
  </div>

  <!-- Wokwi Simulator Container -->
  <div class="compiler-wrapper">
    <!-- Floating Exit Fullscreen Button -->
    <button id="exit-fullscreen-floating-btn" class="exit-fullscreen-floating-btn" title="Exit Fullscreen">
      <svg width="14" height="14" viewBox="0 0 24 24" fill="currentColor">
        <path d="M5 16h3v3h2v-5H5v2zm3-8H5v2h5V5H8v3zm6 11h2v-3h3v-2h-5v5zm2-11V5h-2v5h5V8h-3z"/>
      </svg>
      Exit Fullscreen
    </button>

    <iframe 
      id="wokwi-editor"
      src="https://wokwi.com/projects/new/arduino-uno?embed=1&theme=dark" 
      width="100%" 
      height="100%"
      allow="cross-origin-isolated">
    </iframe>
  </div>
</div>

<script>
  document.addEventListener("DOMContentLoaded", function () {
    var fullscreenBtn = document.getElementById('fullscreen-btn');
    var exitFloatingBtn = document.getElementById('exit-fullscreen-floating-btn');
    var container = document.getElementById('compiler-container');

    function toggleFullscreen() {
      container.classList.toggle('is-fullscreen');
      var isFull = container.classList.contains('is-fullscreen');

      if (isFull) {
        document.body.style.overflow = 'hidden';
      } else {
        document.body.style.overflow = '';
      }
    }

    fullscreenBtn.addEventListener('click', toggleFullscreen);
    exitFloatingBtn.addEventListener('click', toggleFullscreen);
  });
</script>				</div>
				</div>
					</div>
		</div>
					</div>
		</section>
				</div>
		<p>The post <a href="https://gyanxp.com/online-iot-compiler/">Online IoT Compiler</a> appeared first on <a href="https://gyanxp.com">GyanXp</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://gyanxp.com/online-iot-compiler/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Online Web Practical Solution (PR2)</title>
		<link>https://gyanxp.com/online-web-practical-solution-pr2/</link>
					<comments>https://gyanxp.com/online-web-practical-solution-pr2/#respond</comments>
		
		<dc:creator><![CDATA[Balmukund Maurya]]></dc:creator>
		<pubDate>Mon, 17 Aug 2026 12:58:21 +0000</pubDate>
				<category><![CDATA[Online Practical]]></category>
		<guid isPermaLink="false">https://gyanxp.com/?p=6215</guid>

					<description><![CDATA[<p>O Level Web Designing &#038; Publishing Practical Solutions (M2-R5) Complete set of 30 Practical Exam Solutions with Live Output, Practice Timers, and Progress Tracking! 📚 Practical Completion Progress 0 / 30 Practiced (0%) 📑 Practical Index (Q1 &#8211; Q30) ◀ ▶ HTML FormEasyWeightage: 10 Marks Q1. Contact Form with Auto Focus on Name Problem Statement: [&#8230;]</p>
<p>The post <a href="https://gyanxp.com/online-web-practical-solution-pr2/">Online Web Practical Solution (PR2)</a> appeared first on <a href="https://gyanxp.com">GyanXp</a>.</p>
]]></description>
										<content:encoded><![CDATA[		<div data-elementor-type="wp-post" data-elementor-id="6215" class="elementor elementor-6215">
						<section class="elementor-section elementor-top-section elementor-element elementor-element-20de10c elementor-section-boxed elementor-section-height-default elementor-section-height-default" data-id="20de10c" data-element_type="section" data-e-type="section">
						<div class="elementor-container elementor-column-gap-default">
					<div class="elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-1c02dca" data-id="1c02dca" data-element_type="column" data-e-type="column">
			<div class="elementor-widget-wrap elementor-element-populated">
						<div class="elementor-element elementor-element-f238471 elementor-widget elementor-widget-html" data-id="f238471" data-element_type="widget" data-e-type="widget" data-widget_type="html.default">
				<div class="elementor-widget-container">
					<!-- Google Fonts & Prism.js Syntax Highlighting for HTML/CSS/JS -->
<link href="https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700&display=swap" rel="stylesheet">
<link href="https://cdnjs.cloudflare.com/ajax/libs/prism/1.29.0/themes/prism-tomorrow.min.css" rel="stylesheet" />

<style>
  :root {
    --gyanxp-orange: #ff6600;
    --gyanxp-orange-hover: #e65c00;
    --gyanxp-dark: #1f2421;
    --gyanxp-accent-blue: #007bff;
    --gyanxp-bg: #f8f9fa;
    --gyanxp-card-bg: #ffffff;
    --gyanxp-danger: #dc3545;
    --gyanxp-success: #28a745;
    --gyanxp-purple: #6f42c1;
  }

  /* Universal Box-Sizing & Typography */
  .gyanxp-container,
  .gyanxp-container * {
    box-sizing: border-box !important;
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  }

  /* Full Width Container */
  .gyanxp-container {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: clamp(10px, 2vw, 24px) !important;
    background-color: var(--gyanxp-bg);
  }

  /* Header Banner */
  .gyanxp-page-header {
    width: 100% !important;
    margin: 0 0 16px 0 !important;
    background: linear-gradient(135deg, var(--gyanxp-dark) 0%, #2c302e 100%) !important;
    color: #ffffff !important;
    padding: clamp(16px, 2.5vw, 24px) clamp(18px, 3vw, 30px) !important;
    border-radius: 12px !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05) !important;
    border: 1px solid #2c302e !important;
    border-left: 6px solid var(--gyanxp-orange) !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 6px !important;
  }

  .gyanxp-page-header h1 {
    margin: 0 !important;
    padding: 0 !important;
    font-size: clamp(20px, 2.8vw, 28px) !important;
    font-weight: 700 !important;
    line-height: 1.35 !important;
    color: #ffffff !important;
  }

  .gyanxp-page-header p {
    margin: 0 !important;
    padding: 0 !important;
    font-size: clamp(13px, 1.8vw, 15px) !important;
    color: #d1d5db !important;
    line-height: 1.5 !important;
  }

  /* Progress Bar Widget */
  .progress-widget {
    width: 100% !important;
    margin: 0 0 20px 0 !important;
    background: var(--gyanxp-card-bg) !important;
    padding: clamp(16px, 2vw, 20px) clamp(18px, 3vw, 30px) !important;
    border-radius: 12px !important;
    border: 1px solid #e9ecef !important;
    border-left: 6px solid var(--gyanxp-orange) !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04) !important;
  }

  .progress-info {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    flex-wrap: wrap !important;
    gap: 8px 12px !important;
    margin-bottom: 12px !important;
    font-size: clamp(13px, 1.8vw, 15px) !important;
    font-weight: 600 !important;
    color: var(--gyanxp-dark) !important;
  }

  .progress-bar-bg {
    width: 100% !important;
    height: 10px !important;
    background: #e9ecef !important;
    border-radius: 10px !important;
    overflow: hidden !important;
  }

  .progress-bar-fill {
    height: 100% !important;
    width: 0% !important;
    background: linear-gradient(90deg, var(--gyanxp-orange), #ff9933) !important;
    transition: width 0.4s ease-in-out !important;
  }

  /* Main Practical Layout (Grid) */
  .practical-layout {
    width: 100% !important;
    display: grid !important;
    grid-template-columns: 320px 1fr !important;
    gap: 20px !important;
    align-items: start !important;
    margin: 0 !important;
  }

  /* Sidebar */
  .program-sidebar {
    width: 100% !important;
    background: var(--gyanxp-card-bg);
    border-radius: 12px;
    padding: 18px 16px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
    position: sticky;
    top: 15px;
    border: 1px solid #e9ecef;
  }

  .sidebar-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--gyanxp-dark);
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--gyanxp-orange);
  }

  .sidebar-scroll-wrapper {
    position: relative;
    width: 100%;
  }

  .program-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: calc(100vh - 220px);
    overflow-y: auto;
    padding-right: 4px;
    scroll-behavior: smooth;
  }

  /* Navigation Arrows */
  .sidebar-nav-arrow {
    display: none;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(4px);
    color: var(--gyanxp-dark);
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    cursor: pointer;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    transition: all 0.2s ease;
  }

  .sidebar-nav-arrow:hover { background: #ffffff; color: var(--gyanxp-orange); }
  .sidebar-nav-prev { left: -8px; }
  .sidebar-nav-next { right: -8px; }

  .nav-btn {
    width: 100%;
    text-align: left;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    padding: 10px 12px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    color: var(--gyanxp-dark);
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-height: 40px;
  }

  .nav-btn:hover { background: #fff0e6; color: var(--gyanxp-orange); border-color: var(--gyanxp-orange); }
  .nav-btn.active { background: var(--gyanxp-orange); color: #ffffff; border-color: var(--gyanxp-orange); box-shadow: 0 3px 8px rgba(255, 102, 0, 0.25); }

  /* Workspace */
  .program-workspace {
    width: 100% !important;
    background: var(--gyanxp-card-bg);
    border-radius: 12px;
    padding: clamp(18px, 2.5vw, 30px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
    border: 1px solid #e9ecef;
    min-width: 0;
  }

  .program-content { display: none; }
  .program-content.active { display: block; }

  .meta-tags { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }

  .badge { font-size: 11px; font-weight: 700; padding: 4px 10px; border-radius: 20px; text-transform: uppercase; }
  .badge-tag { background: #fff0e6; color: var(--gyanxp-orange); }
  .badge-easy { background: #e6f4ea; color: #137333; }
  .badge-medium { background: #fef7e0; color: #b06000; }
  .badge-marks { background: #e8f0fe; color: #1a73e8; }

  .question-title { font-size: clamp(18px, 2.2vw, 22px); font-weight: 700; color: var(--gyanxp-dark); margin: 0 0 12px 0; line-height: 1.4; }
  .question-desc { font-size: clamp(13px, 1.8vw, 14px); color: #555; line-height: 1.6; margin-bottom: 18px; background: #fffcf9; padding: 14px 16px; border-radius: 8px; border-left: 4px solid var(--gyanxp-orange); }

  /* Timer Widget */
  .timer-box { 
    display: flex; 
    align-items: center; 
    justify-content: space-between; 
    background: #f1f3f5; 
    padding: 10px 16px; 
    border-radius: 8px; 
    margin-bottom: 18px; 
    font-size: 13.5px; 
    font-weight: 600; 
    flex-wrap: wrap; 
    gap: 10px; 
  }
  .timer-controls { display: inline-flex; align-items: center; gap: 8px; }
  .timer-display { font-family: monospace; font-size: 15px; color: var(--gyanxp-orange); background: #ffffff; padding: 4px 10px; border-radius: 4px; border: 1px solid #ced4da; line-height: 1; }
  .timer-btn { background: var(--gyanxp-dark); color: #fff; border: none; padding: 6px 14px; border-radius: 4px; cursor: pointer; font-size: 12.5px; font-weight: 500; }
  .timer-btn:hover { background: #000; }

  /* Code Header */
  .code-header { margin-bottom: 6px; }
  .code-section-title { font-size: 14px; font-weight: 600; color: var(--gyanxp-dark); }

  .program-workspace pre { border-radius: 8px; margin: 0 0 18px 0; font-size: 13.5px; max-height: 500px; overflow: auto; box-shadow: 0 2px 8px rgba(0,0,0,0.06); }

  /* Action Buttons */
  .btn-group { display: flex; gap: 10px; margin-bottom: 18px; flex-wrap: wrap; }
  .btn-action { 
    border: none; 
    height: 40px;
    padding: 0 18px; 
    font-size: 13px; 
    font-weight: 600; 
    border-radius: 6px; 
    cursor: pointer; 
    transition: all 0.2s ease; 
    display: inline-flex; 
    align-items: center; 
    justify-content: center;
    gap: 6px; 
    user-select: none;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
  }
  .try-code-btn { background-color: var(--gyanxp-orange); color: #ffffff; }
  .try-code-btn:hover { background-color: var(--gyanxp-orange-hover); }
  .show-result-btn { background-color: var(--gyanxp-accent-blue); color: #ffffff; }
  .show-result-btn:hover { background-color: #0069d9; }
  .show-result-btn.active-btn { background-color: var(--gyanxp-danger); }
  .show-result-btn.active-btn:hover { background-color: #bd2130; }
  .complete-btn { background-color: #e9ecef; color: var(--gyanxp-dark); }
  .complete-btn:hover { background-color: #dde2e6; }
  .complete-btn.done { background-color: var(--gyanxp-success); color: #ffffff; }
  .complete-btn.done:hover { background-color: #218838; }

  /* Accordions */
  .accordion-box { margin-bottom: 18px; border: 1px solid #e9ecef; border-radius: 8px; overflow: hidden; }
  .accordion-header { background: #f8f9fa; padding: 12px 16px; font-size: 13.5px; font-weight: 600; color: var(--gyanxp-dark); cursor: pointer; display: flex; justify-content: space-between; align-items: center; user-select: none; }
  .accordion-body { display: none; padding: 14px 16px; font-size: 13.5px; color: #444; line-height: 1.6; background: #ffffff; border-top: 1px solid #e9ecef; }

  /* Output Frame */
  .result-container { display: none; margin-top: 14px; margin-bottom: 18px; background: #ffffff; border-radius: 8px; overflow: hidden; border: 1px solid #ced4da; box-shadow: 0 4px 10px rgba(0,0,0,0.05); }
  .result-header { background: #1f2421; color: #ffffff; font-size: 11px; padding: 8px 14px; text-transform: uppercase; font-weight: 700; border-bottom: 1px solid #333333; }
  .result-container iframe { width: 100%; height: 350px; border: none; display: block; background: #ffffff; }

  /* Pagination */
  .pagination-group { display: flex; justify-content: space-between; margin-top: 24px; padding-top: 18px; border-top: 1px dashed #e9ecef; gap: 10px; }
  .btn-page { 
    height: 40px;
    padding: 0 20px; 
    background-color: #f1f3f5; 
    color: var(--gyanxp-dark); 
    border: 1px solid #ced4da; 
    font-size: 13px; 
    font-weight: 600; 
    border-radius: 6px; 
    cursor: pointer; 
    display: inline-flex; 
    align-items: center; 
    justify-content: center;
    transition: all 0.2s ease;
  }
  .btn-page:hover:not(:disabled) { background-color: var(--gyanxp-orange); color: #ffffff; border-color: var(--gyanxp-orange); }
  .btn-page:disabled { opacity: 0.4; cursor: not-allowed; }

  /* Responsive Design */
  @media (max-width: 992px) {
    .practical-layout { grid-template-columns: 100% !important; gap: 15px !important; }
    .program-sidebar { position: static; width: 100% !important; padding: 12px 14px; border-radius: 12px; }
    .sidebar-title { font-size: 14px; margin-bottom: 8px; }
    .sidebar-nav-arrow { display: inline-flex; }
    .program-list {
      flex-direction: row;
      overflow-x: auto;
      max-height: none;
      padding: 4px 20px 8px 20px;
      gap: 8px;
      scroll-snap-type: x mandatory;
      -webkit-overflow-scrolling: touch;
      scrollbar-width: none;
    }
    .program-list::-webkit-scrollbar { display: none; }
    .nav-btn { white-space: nowrap; width: auto; flex-shrink: 0; padding: 6px 16px; font-size: 12.5px; min-height: 38px; border-radius: 20px; gap: 8px; scroll-snap-align: center; }
    .program-workspace { padding: 18px 14px; border-radius: 12px; }
    .btn-group { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
    .btn-action { width: 100%; height: 40px; font-size: 12.5px; padding: 0 10px; }
    .btn-action.complete-btn { grid-column: span 2; }
    .pagination-group .btn-page { flex: 1; height: 40px; }
    .result-container iframe { height: 280px; }
  }

  @media (max-width: 480px) {
    .btn-group { grid-template-columns: 1fr; }
    .btn-action.complete-btn { grid-column: auto; }
    .timer-box { flex-direction: column; align-items: flex-start; }
    .timer-controls { width: 100%; justify-content: space-between; }
  }
</style>

<div class="gyanxp-container">
  
  <!-- Header Banner -->
  <div class="gyanxp-page-header">
    <h1>O Level Web Designing & Publishing Practical Solutions (M2-R5)</h1>
    <p>Complete set of 30 Practical Exam Solutions with Live Output, Practice Timers, and Progress Tracking!</p>
  </div>

  <!-- Progress Bar Widget -->
  <div class="progress-widget">
    <div class="progress-info">
      <span>📚 Practical Completion Progress</span>
      <span id="progress-text">0 / 30 Practiced (0%)</span>
    </div>
    <div class="progress-bar-bg">
      <div class="progress-bar-fill" id="progress-fill"></div>
    </div>
  </div>

  <!-- Practical Workspaces Layout -->
  <div class="practical-layout">
    
    <!-- Sidebar / Index Bar -->
    <div class="program-sidebar">
      <div class="sidebar-title">📑 Practical Index (Q1 - Q30)</div>
      <div class="sidebar-scroll-wrapper">
        <button class="sidebar-nav-arrow sidebar-nav-prev" onclick="scrollIndexSidebar(-140)" title="Previous Programs">◀</button>
        <div class="program-list" id="sidebar-list">
          <!-- Sidebar Buttons Q1 to Q30 -->
          <script>
            for(let i=1; i<=30; i++) {
              document.write(`
                <button class="nav-btn ${i===1?'active':''}" id="side-btn-${i}" onclick="switchProgram(${i})">
                  <span>Practical ${i}</span> <span class="status-dot" id="dot-${i}">⚪</span>
                </button>
              `);
            }
          </script>
        </div>
        <button class="sidebar-nav-arrow sidebar-nav-next" onclick="scrollIndexSidebar(140)" title="Next Programs">▶</button>
      </div>
    </div>

    <!-- Main Workspace -->
    <div class="program-workspace">

      <!-- PRACTICAL 1 -->
      <div id="prog-1" class="program-content active">
        <div class="meta-tags"><span class="badge badge-tag">HTML Form</span><span class="badge badge-easy">Easy</span><span class="badge badge-marks">Weightage: 10 Marks</span></div>
        <h2 class="question-title">Q1. Contact Form with Auto Focus on Name</h2>
        <div class="question-desc"><strong>Problem Statement:</strong> Make a Contact form with Name, Mobile No, Email ID, Comments, and Submit button with focus on the Name field at cursor load.</div>
        <div class="timer-box">
          <span>⏱ Practice Timer (Recommended: 8 mins)</span>
          <div class="timer-controls"><span class="timer-display" id="timer-1">00:00</span> <button class="timer-btn" onclick="toggleTimer(1)">Start Timer</button></div>
        </div>
        <div class="code-header"><span class="code-section-title">Solution Code:</span></div>
        <pre><code class="language-html" id="code-snippet-1">&lt;!DOCTYPE html&gt;
&lt;html&gt;
&lt;head&gt;
  &lt;style&gt;
    body { font-family: Arial, sans-serif; padding: 15px; }
    .form-group { margin-bottom: 12px; }
    label { display: block; font-weight: bold; margin-bottom: 4px; }
    input, textarea { width: 100%; padding: 8px; box-sizing: border-box; }
    button { background: #ff6600; color: #fff; border: none; padding: 8px 16px; cursor: pointer; border-radius: 4px; }
  &lt;/style&gt;
&lt;/head&gt;
&lt;body&gt;
  &lt;h3&gt;Contact Form&lt;/h3&gt;
  &lt;form&gt;
    &lt;div class="form-group"&gt;
      &lt;label&gt;Name:&lt;/label&gt;
      &lt;input type="text" id="name" autofocus placeholder="Enter Name"&gt;
    &lt;/div&gt;
    &lt;div class="form-group"&gt;
      &lt;label&gt;Mobile No:&lt;/label&gt;
      &lt;input type="tel" placeholder="Enter Mobile No"&gt;
    &lt;/div&gt;
    &lt;div class="form-group"&gt;
      &lt;label&gt;Email ID:&lt;/label&gt;
      &lt;input type="email" placeholder="Enter Email"&gt;
    &lt;/div&gt;
    &lt;div class="form-group"&gt;
      &lt;label&gt;Comments:&lt;/label&gt;
      &lt;textarea rows="3" placeholder="Enter Comments"&gt;&lt;/textarea&gt;
    &lt;/div&gt;
    &lt;button type="submit"&gt;Submit&lt;/button&gt;
  &lt;/form&gt;
&lt;/body&gt;
&lt;/html&gt;</code></pre>
        <div class="btn-group">
          <button class="btn-action try-code-btn" onclick="openCompilerTab(1, 'html')">▶ Try Code</button>
          <button class="btn-action show-result-btn" id="toggle-btn-1" onclick="toggleResult(1, 'html')">⚡ Show Result</button>
          <button class="btn-action complete-btn" id="mark-btn-1" onclick="toggleCompletion(1)">✔ Mark Done</button>
        </div>
        <div class="accordion-box">
          <div class="accordion-header" onclick="toggleAccordion(1)"><span>💡 How this code works</span><span id="acc-icon-1">➕</span></div>
          <div class="accordion-body" id="acc-body-1">The <code>autofocus</code> attribute automatically focuses the cursor on the Name input field when the page loads.</div>
        </div>
        <div id="result-box-1" class="result-container"><div class="result-header">Live Output Window</div><div id="iframe-holder-1"></div></div>
        <div class="pagination-group"><button class="btn-page" disabled>◀ Previous</button><button class="btn-page" onclick="switchProgram(2)">Next ▶</button></div>
      </div>

      <!-- PRACTICAL 2 -->
      <div id="prog-2" class="program-content">
        <div class="meta-tags"><span class="badge badge-tag">HTML Form</span><span class="badge badge-easy">Easy</span><span class="badge badge-marks">Weightage: 10 Marks</span></div>
        <h2 class="question-title">Q2. Contact Form with Input Validation</h2>
        <div class="question-desc"><strong>Problem Statement:</strong> Create a Contact form with Name, Mobile No, Email ID, Comments, and Submit button, using required validation.</div>
        <div class="timer-box">
          <span>⏱ Practice Timer (Recommended: 8 mins)</span>
          <div class="timer-controls"><span class="timer-display" id="timer-2">00:00</span> <button class="timer-btn" onclick="toggleTimer(2)">Start Timer</button></div>
        </div>
        <div class="code-header"><span class="code-section-title">Solution Code:</span></div>
        <pre><code class="language-html" id="code-snippet-2">&lt;!DOCTYPE html&gt;
&lt;html&gt;
&lt;head&gt;
  &lt;style&gt;
    body { font-family: Arial, sans-serif; padding: 15px; }
    .form-group { margin-bottom: 12px; }
    label { display: block; font-weight: bold; margin-bottom: 4px; }
    input, textarea { width: 100%; padding: 8px; box-sizing: border-box; }
    button { background: #ff6600; color: #fff; border: none; padding: 8px 16px; cursor: pointer; border-radius: 4px; }
  &lt;/style&gt;
&lt;/head&gt;
&lt;body&gt;
  &lt;h3&gt;Contact Form with Validation&lt;/h3&gt;
  &lt;form&gt;
    &lt;div class="form-group"&gt;
      &lt;label&gt;Name:&lt;/label&gt;
      &lt;input type="text" autofocus required placeholder="Enter Name"&gt;
    &lt;/div&gt;
    &lt;div class="form-group"&gt;
      &lt;label&gt;Mobile No:&lt;/label&gt;
      &lt;input type="tel" required pattern="[0-9]{10}" placeholder="10 digit mobile number"&gt;
    &lt;/div&gt;
    &lt;div class="form-group"&gt;
      &lt;label&gt;Email ID:&lt;/label&gt;
      &lt;input type="email" required placeholder="Enter Email"&gt;
    &lt;/div&gt;
    &lt;div class="form-group"&gt;
      &lt;label&gt;Comments:&lt;/label&gt;
      &lt;textarea rows="3" placeholder="Enter Comments"&gt;&lt;/textarea&gt;
    &lt;/div&gt;
    &lt;button type="submit"&gt;Submit&lt;/button&gt;
  &lt;/form&gt;
&lt;/body&gt;
&lt;/html&gt;</code></pre>
        <div class="btn-group">
          <button class="btn-action try-code-btn" onclick="openCompilerTab(2, 'html')">▶ Try Code</button>
          <button class="btn-action show-result-btn" id="toggle-btn-2" onclick="toggleResult(2, 'html')">⚡ Show Result</button>
          <button class="btn-action complete-btn" id="mark-btn-2" onclick="toggleCompletion(2)">✔ Mark Done</button>
        </div>
        <div class="accordion-box">
          <div class="accordion-header" onclick="toggleAccordion(2)"><span>💡 How this code works</span><span id="acc-icon-2">➕</span></div>
          <div class="accordion-body" id="acc-body-2">Uses HTML5 built-in validation like <code>required</code> and regex pattern <code>pattern="[0-9]{10}"</code>.</div>
        </div>
        <div id="result-box-2" class="result-container"><div class="result-header">Live Output Window</div><div id="iframe-holder-2"></div></div>
        <div class="pagination-group"><button class="btn-page" onclick="switchProgram(1)">◀ Previous</button><button class="btn-page" onclick="switchProgram(3)">Next ▶</button></div>
      </div>

      <!-- PRACTICAL 3 -->
      <div id="prog-3" class="program-content">
        <div class="meta-tags"><span class="badge badge-tag">CSS Hover Effect</span><span class="badge badge-easy">Easy</span><span class="badge badge-marks">Weightage: 10 Marks</span></div>
        <h2 class="question-title">Q3. CSS Circle with Hover Color Change</h2>
        <div class="question-desc"><strong>Problem Statement:</strong> Design a circle with Specifications: Width 200px, Height 200px, Background Red, Border 2px Double Line and Black. Change background to Yellow on hover.</div>
        <div class="timer-box">
          <span>⏱ Practice Timer (Recommended: 8 mins)</span>
          <div class="timer-controls"><span class="timer-display" id="timer-3">00:00</span> <button class="timer-btn" onclick="toggleTimer(3)">Start Timer</button></div>
        </div>
        <div class="code-header"><span class="code-section-title">Solution Code:</span></div>
        <pre><code class="language-html" id="code-snippet-3">&lt;!DOCTYPE html&gt;
&lt;html&gt;
&lt;head&gt;
  &lt;style&gt;
    .circle {
      width: 200px;
      height: 200px;
      background-color: red;
      border: 2px double black;
      border-radius: 50%;
      transition: background-color 0.3s ease;
    }
    .circle:hover {
      background-color: yellow;
    }
  &lt;/style&gt;
&lt;/head&gt;
&lt;body&gt;
  &lt;h3&gt;Hover Circle Demo&lt;/h3&gt;
  &lt;div class="circle"&gt;&lt;/div&gt;
&lt;/body&gt;
&lt;/html&gt;</code></pre>
        <div class="btn-group">
          <button class="btn-action try-code-btn" onclick="openCompilerTab(3, 'html')">▶ Try Code</button>
          <button class="btn-action show-result-btn" id="toggle-btn-3" onclick="toggleResult(3, 'html')">⚡ Show Result</button>
          <button class="btn-action complete-btn" id="mark-btn-3" onclick="toggleCompletion(3)">✔ Mark Done</button>
        </div>
        <div class="accordion-box">
          <div class="accordion-header" onclick="toggleAccordion(3)"><span>💡 How this code works</span><span id="acc-icon-3">➕</span></div>
          <div class="accordion-body" id="acc-body-3">Setting <code>border-radius: 50%</code> converts a square div into a circle, while <code>:hover</code> toggles color on mouse hover.</div>
        </div>
        <div id="result-box-3" class="result-container"><div class="result-header">Live Output Window</div><div id="iframe-holder-3"></div></div>
        <div class="pagination-group"><button class="btn-page" onclick="switchProgram(2)">◀ Previous</button><button class="btn-page" onclick="switchProgram(4)">Next ▶</button></div>
      </div>

      <!-- PRACTICAL 4 -->
      <div id="prog-4" class="program-content">
        <div class="meta-tags"><span class="badge badge-tag">HTML Hyperlink</span><span class="badge badge-easy">Easy</span><span class="badge badge-marks">Weightage: 5 Marks</span></div>
        <h2 class="question-title">Q4. HTML Hyperlink to External Website</h2>
        <div class="question-desc"><strong>Problem Statement:</strong> Add a hyperlink in which clicking it redirects to www.google.com.</div>
        <div class="timer-box">
          <span>⏱ Practice Timer (Recommended: 3 mins)</span>
          <div class="timer-controls"><span class="timer-display" id="timer-4">00:00</span> <button class="timer-btn" onclick="toggleTimer(4)">Start Timer</button></div>
        </div>
        <div class="code-header"><span class="code-section-title">Solution Code:</span></div>
        <pre><code class="language-html" id="code-snippet-4">&lt;!DOCTYPE html&gt;
&lt;html&gt;
&lt;body&gt;
  &lt;h3&gt;Hyperlink Example&lt;/h3&gt;
  &lt;p&gt;Click the link below to go to Google:&lt;/p&gt;
  &lt;a href="https://www.google.com" target="_blank"&gt;Visit Google&lt;/a&gt;
&lt;/body&gt;
&lt;/html&gt;</code></pre>
        <div class="btn-group">
          <button class="btn-action try-code-btn" onclick="openCompilerTab(4, 'html')">▶ Try Code</button>
          <button class="btn-action show-result-btn" id="toggle-btn-4" onclick="toggleResult(4, 'html')">⚡ Show Result</button>
          <button class="btn-action complete-btn" id="mark-btn-4" onclick="toggleCompletion(4)">✔ Mark Done</button>
        </div>
        <div class="accordion-box">
          <div class="accordion-header" onclick="toggleAccordion(4)"><span>💡 How this code works</span><span id="acc-icon-4">➕</span></div>
          <div class="accordion-body" id="acc-body-4">The <code>href</code> attribute defines the target URL, and <code>target="_blank"</code> opens the link in a new tab.</div>
        </div>
        <div id="result-box-4" class="result-container"><div class="result-header">Live Output Window</div><div id="iframe-holder-4"></div></div>
        <div class="pagination-group"><button class="btn-page" onclick="switchProgram(3)">◀ Previous</button><button class="btn-page" onclick="switchProgram(5)">Next ▶</button></div>
      </div>

      <!-- PRACTICAL 5 -->
      <div id="prog-5" class="program-content">
        <div class="meta-tags"><span class="badge badge-tag">JavaScript Math</span><span class="badge badge-medium">Medium</span><span class="badge badge-marks">Weightage: 15 Marks</span></div>
        <h2 class="question-title">Q5. JavaScript Arithmetic Calculation Program</h2>
        <div class="question-desc"><strong>Problem Statement:</strong> Write a JavaScript program for basic arithmetic calculations (addition, subtraction, multiplication, division).</div>
        <div class="timer-box">
          <span>⏱ Practice Timer (Recommended: 10 mins)</span>
          <div class="timer-controls"><span class="timer-display" id="timer-5">00:00</span> <button class="timer-btn" onclick="toggleTimer(5)">Start Timer</button></div>
        </div>
        <div class="code-header"><span class="code-section-title">Solution Code:</span></div>
        <pre><code class="language-html" id="code-snippet-5">&lt;!DOCTYPE html&gt;
&lt;html&gt;
&lt;head&gt;
  &lt;style&gt;
    body { font-family: Arial, sans-serif; padding: 15px; }
    input { width: 100px; padding: 5px; margin-right: 10px; }
    button { padding: 6px 12px; margin-right: 5px; cursor: pointer; }
    #result { margin-top: 15px; font-weight: bold; font-size: 16px; color: #ff6600; }
  &lt;/style&gt;
&lt;/head&gt;
&lt;body&gt;
  &lt;h3&gt;Arithmetic Calculator&lt;/h3&gt;
  &lt;input type="number" id="num1" placeholder="Num 1"&gt;
  &lt;input type="number" id="num2" placeholder="Num 2"&gt;&lt;br&gt;&lt;br&gt;
  
  &lt;button onclick="calc('+')"&gt;Add&lt;/button&gt;
  &lt;button onclick="calc('-')"&gt;Subtract&lt;/button&gt;
  &lt;button onclick="calc('*')"&gt;Multiply&lt;/button&gt;
  &lt;button onclick="calc('/')"&gt;Divide&lt;/button&gt;

  &lt;div id="result"&gt;&lt;/div&gt;

  &lt;script&gt;
    function calc(op) {
      let n1 = parseFloat(document.getElementById('num1').value);
      let n2 = parseFloat(document.getElementById('num2').value);
      let res = 0;
      if (isNaN(n1) || isNaN(n2)) {
        document.getElementById('result').innerText = "Please enter valid numbers!";
        return;
      }
      if (op === '+') res = n1 + n2;
      else if (op === '-') res = n1 - n2;
      else if (op === '*') res = n1 * n2;
      else if (op === '/') res = n2 !== 0 ? (n1 / n2) : "Cannot divide by 0";
      
      document.getElementById('result').innerText = "Result: " + res;
    }
  &lt;/script&gt;
&lt;/body&gt;
&lt;/html&gt;</code></pre>
        <div class="btn-group">
          <button class="btn-action try-code-btn" onclick="openCompilerTab(5, 'html')">▶ Try Code</button>
          <button class="btn-action show-result-btn" id="toggle-btn-5" onclick="toggleResult(5, 'html')">⚡ Show Result</button>
          <button class="btn-action complete-btn" id="mark-btn-5" onclick="toggleCompletion(5)">✔ Mark Done</button>
        </div>
        <div class="accordion-box">
          <div class="accordion-header" onclick="toggleAccordion(5)"><span>💡 How this code works</span><span id="acc-icon-5">➕</span></div>
          <div class="accordion-body" id="acc-body-5">Reads values from inputs, parses them to floats, performs the operator math, and updates the output DOM text.</div>
        </div>
        <div id="result-box-5" class="result-container"><div class="result-header">Live Output Window</div><div id="iframe-holder-5"></div></div>
        <div class="pagination-group"><button class="btn-page" onclick="switchProgram(4)">◀ Previous</button><button class="btn-page" onclick="switchProgram(6)">Next ▶</button></div>
      </div>

      <!-- PRACTICAL 6 -->
      <div id="prog-6" class="program-content">
        <div class="meta-tags"><span class="badge badge-tag">HTML Image Link</span><span class="badge badge-easy">Easy</span><span class="badge badge-marks">Weightage: 5 Marks</span></div>
        <h2 class="question-title">Q6. HTML Clickable Image Demonstration</h2>
        <div class="question-desc"><strong>Problem Statement:</strong> Create an HTML page to demonstrate a Clickable image.</div>
        <div class="timer-box">
          <span>⏱ Practice Timer (Recommended: 5 mins)</span>
          <div class="timer-controls"><span class="timer-display" id="timer-6">00:00</span> <button class="timer-btn" onclick="toggleTimer(6)">Start Timer</button></div>
        </div>
        <div class="code-header"><span class="code-section-title">Solution Code:</span></div>
        <pre><code class="language-html" id="code-snippet-6">&lt;!DOCTYPE html&gt;
&lt;html&gt;
&lt;body&gt;
  &lt;h3&gt;Clickable Image Example&lt;/h3&gt;
  &lt;p&gt;Click the image below to visit GyanXP:&lt;/p&gt;
  &lt;a href="https://www.gyanxp.com" target="_blank"&gt;
    &lt;img src="https://via.placeholder.com/200x100?text=Click+Me" alt="Clickable Banner" style="border:2px solid #ff6600; border-radius:8px;"&gt;
  &lt;/a&gt;
&lt;/body&gt;
&lt;/html&gt;</code></pre>
        <div class="btn-group">
          <button class="btn-action try-code-btn" onclick="openCompilerTab(6, 'html')">▶ Try Code</button>
          <button class="btn-action show-result-btn" id="toggle-btn-6" onclick="toggleResult(6, 'html')">⚡ Show Result</button>
          <button class="btn-action complete-btn" id="mark-btn-6" onclick="toggleCompletion(6)">✔ Mark Done</button>
        </div>
        <div class="accordion-box">
          <div class="accordion-header" onclick="toggleAccordion(6)"><span>💡 How this code works</span><span id="acc-icon-6">➕</span></div>
          <div class="accordion-body" id="acc-body-6">Nesting an <code>&lt;img&gt;</code> tag inside an <code>&lt;a&gt;</code> anchor tag turns the image into a clickable link.</div>
        </div>
        <div id="result-box-6" class="result-container"><div class="result-header">Live Output Window</div><div id="iframe-holder-6"></div></div>
        <div class="pagination-group"><button class="btn-page" onclick="switchProgram(5)">◀ Previous</button><button class="btn-page" onclick="switchProgram(7)">Next ▶</button></div>
      </div>

      <!-- PRACTICAL 7 -->
      <div id="prog-7" class="program-content">
        <div class="meta-tags"><span class="badge badge-tag">HTML Table</span><span class="badge badge-easy">Easy</span><span class="badge badge-marks">Weightage: 10 Marks</span></div>
        <h2 class="question-title">Q7. HTML Table (5 Rows x 4 Columns)</h2>
        <div class="question-desc"><strong>Problem Statement:</strong> Write an HTML program to display a table with 5 rows and 4 columns. Provide appropriate headings.</div>
        <div class="timer-box">
          <span>⏱ Practice Timer (Recommended: 8 mins)</span>
          <div class="timer-controls"><span class="timer-display" id="timer-7">00:00</span> <button class="timer-btn" onclick="toggleTimer(7)">Start Timer</button></div>
        </div>
        <div class="code-header"><span class="code-section-title">Solution Code:</span></div>
        <pre><code class="language-html" id="code-snippet-7">&lt;!DOCTYPE html&gt;
&lt;html&gt;
&lt;head&gt;
  &lt;style&gt;
    table { width: 100%; border-collapse: collapse; text-align: left; }
    th, td { border: 1px solid #ddd; padding: 8px; }
    th { background-color: #ff6600; color: white; }
    tr:nth-child(even) { background-color: #f2f2f2; }
  &lt;/style&gt;
&lt;/head&gt;
&lt;body&gt;
  &lt;h3&gt;Student Academic Report Table&lt;/h3&gt;
  &lt;table&gt;
    &lt;tr&gt;
      &lt;th&gt;Roll No&lt;/th&gt;
      &lt;th&gt;Student Name&lt;/th&gt;
      &lt;th&gt;Course&lt;/th&gt;
      &lt;th&gt;Marks&lt;/th&gt;
    &lt;/tr&gt;
    &lt;tr&gt;&lt;td&gt;101&lt;/td&gt;&lt;td&gt;Rahul Sharma&lt;/td&gt;&lt;td&gt;O Level&lt;/td&gt;&lt;td&gt;85%&lt;/td&gt;&lt;/tr&gt;
    &lt;tr&gt;&lt;td&gt;102&lt;/td&gt;&lt;td&gt;Priya Verma&lt;/td&gt;&lt;td&gt;A Level&lt;/td&gt;&lt;td&gt;90%&lt;/td&gt;&lt;/tr&gt;
    &lt;tr&gt;&lt;td&gt;103&lt;/td&gt;&lt;td&gt;Amit Patel&lt;/td&gt;&lt;td&gt;O Level&lt;/td&gt;&lt;td&gt;78%&lt;/td&gt;&lt;/tr&gt;
    &lt;tr&gt;&lt;td&gt;104&lt;/td&gt;&lt;td&gt;Neha Singh&lt;/td&gt;&lt;td&gt;CCC&lt;/td&gt;&lt;td&gt;92%&lt;/td&gt;&lt;/tr&gt;
  &lt;/table&gt;
&lt;/body&gt;
&lt;/html&gt;</code></pre>
        <div class="btn-group">
          <button class="btn-action try-code-btn" onclick="openCompilerTab(7, 'html')">▶ Try Code</button>
          <button class="btn-action show-result-btn" id="toggle-btn-7" onclick="toggleResult(7, 'html')">⚡ Show Result</button>
          <button class="btn-action complete-btn" id="mark-btn-7" onclick="toggleCompletion(7)">✔ Mark Done</button>
        </div>
        <div class="accordion-box">
          <div class="accordion-header" onclick="toggleAccordion(7)"><span>💡 How this code works</span><span id="acc-icon-7">➕</span></div>
          <div class="accordion-body" id="acc-body-7">Uses <code>&lt;table&gt;</code>, <code>&lt;tr&gt;</code>, <code>&lt;th&gt;</code>, and <code>&lt;td&gt;</code> tags to construct 1 header row + 4 data rows (5 rows total across 4 columns).</div>
        </div>
        <div id="result-box-7" class="result-container"><div class="result-header">Live Output Window</div><div id="iframe-holder-7"></div></div>
        <div class="pagination-group"><button class="btn-page" onclick="switchProgram(6)">◀ Previous</button><button class="btn-page" onclick="switchProgram(8)">Next ▶</button></div>
      </div>

      <!-- PRACTICAL 8 -->
      <div id="prog-8" class="program-content">
        <div class="meta-tags"><span class="badge badge-tag">JavaScript Loops</span><span class="badge badge-medium">Medium</span><span class="badge badge-marks">Weightage: 15 Marks</span></div>
        <h2 class="question-title">Q8. JavaScript Squares and Cubes Table (0-10)</h2>
        <div class="question-desc"><strong>Problem Statement:</strong> Calculate the squares and cubes of numbers from 0 to 10 and display output in an HTML table.</div>
        <div class="timer-box">
          <span>⏱ Practice Timer (Recommended: 10 mins)</span>
          <div class="timer-controls"><span class="timer-display" id="timer-8">00:00</span> <button class="timer-btn" onclick="toggleTimer(8)">Start Timer</button></div>
        </div>
        <div class="code-header"><span class="code-section-title">Solution Code:</span></div>
        <pre><code class="language-html" id="code-snippet-8">&lt;!DOCTYPE html&gt;
&lt;html&gt;
&lt;head&gt;
  &lt;style&gt;
    table { width: 300px; border-collapse: collapse; text-align: center; }
    th, td { border: 1px solid #333; padding: 6px; }
    th { background-color: #ff6600; color: #fff; }
  &lt;/style&gt;
&lt;/head&gt;
&lt;body&gt;
  &lt;h3&gt;Squares and Cubes (0 to 10)&lt;/h3&gt;
  &lt;div id="table-container"&gt;&lt;/div&gt;

  &lt;script&gt;
    let html = "&lt;table&gt;&lt;tr&gt;&lt;th&gt;Number&lt;/th&gt;&lt;th&gt;Square&lt;/th&gt;&lt;th&gt;Cube&lt;/th&gt;&lt;/tr&gt;";
    for (let i = 0; i &lt;= 10; i++) {
      html += `&lt;tr&gt;&lt;td&gt;${i}&lt;/td&gt;&lt;td&gt;${i * i}&lt;/td&gt;&lt;td&gt;${i * i * i}&lt;/td&gt;&lt;/tr&gt;`;
    }
    html += "&lt;/table&gt;";
    document.getElementById('table-container').innerHTML = html;
  &lt;/script&gt;
&lt;/body&gt;
&lt;/html&gt;</code></pre>
        <div class="btn-group">
          <button class="btn-action try-code-btn" onclick="openCompilerTab(8, 'html')">▶ Try Code</button>
          <button class="btn-action show-result-btn" id="toggle-btn-8" onclick="toggleResult(8, 'html')">⚡ Show Result</button>
          <button class="btn-action complete-btn" id="mark-btn-8" onclick="toggleCompletion(8)">✔ Mark Done</button>
        </div>
        <div class="accordion-box">
          <div class="accordion-header" onclick="toggleAccordion(8)"><span>💡 How this code works</span><span id="acc-icon-8">➕</span></div>
          <div class="accordion-body" id="acc-body-8">A JS <code>for</code> loop iterates from 0 to 10, computing <code>i*i</code> and <code>i*i*i</code> and dynamically constructing the table markup.</div>
        </div>
        <div id="result-box-8" class="result-container"><div class="result-header">Live Output Window</div><div id="iframe-holder-8"></div></div>
        <div class="pagination-group"><button class="btn-page" onclick="switchProgram(7)">◀ Previous</button><button class="btn-page" onclick="switchProgram(9)">Next ▶</button></div>
      </div>

      <!-- PRACTICAL 9 -->
      <div id="prog-9" class="program-content">
        <div class="meta-tags"><span class="badge badge-tag">HTML Table Formatting</span><span class="badge badge-easy">Easy</span><span class="badge badge-marks">Weightage: 10 Marks</span></div>
        <h2 class="question-title">Q9. Styled Table with Double Border & Cellpadding</h2>
        <div class="question-desc"><strong>Problem Statement:</strong> Create a table with double border, cellpadding 5, cellspacing 5, dynamic background color, and appropriate size.</div>
        <div class="timer-box">
          <span>⏱ Practice Timer (Recommended: 8 mins)</span>
          <div class="timer-controls"><span class="timer-display" id="timer-9">00:00</span> <button class="timer-btn" onclick="toggleTimer(9)">Start Timer</button></div>
        </div>
        <div class="code-header"><span class="code-section-title">Solution Code:</span></div>
        <pre><code class="language-html" id="code-snippet-9">&lt;!DOCTYPE html&gt;
&lt;html&gt;
&lt;head&gt;
  &lt;style&gt;
    table {
      width: 80%;
      height: 150px;
      border: 4px double #ff6600;
      border-spacing: 5px; /* Cell spacing equivalent */
      background-color: #fff8f0;
      margin: auto;
    }
    td, th {
      border: 1px solid #333;
      padding: 5px; /* Cell padding equivalent */
      text-align: center;
    }
    th { background-color: #ffe0cc; }
  &lt;/style&gt;
&lt;/head&gt;
&lt;body&gt;
  &lt;h3 style="text-align:center;"&gt;Custom Styled Table&lt;/h3&gt;
  &lt;table&gt;
    &lt;tr&gt;
      &lt;th&gt;Item Code&lt;/th&gt;
      &lt;th&gt;Item Name&lt;/th&gt;
      &lt;th&gt;Price&lt;/th&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;P001&lt;/td&gt;
      &lt;td&gt;Web Designing Book&lt;/td&gt;
      &lt;td&gt;₹350&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;P002&lt;/td&gt;
      &lt;td&gt;Python Module Kit&lt;/td&gt;
      &lt;td&gt;₹450&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/table&gt;
&lt;/body&gt;
&lt;/html&gt;</code></pre>
        <div class="btn-group">
          <button class="btn-action try-code-btn" onclick="openCompilerTab(9, 'html')">▶ Try Code</button>
          <button class="btn-action show-result-btn" id="toggle-btn-9" onclick="toggleResult(9, 'html')">⚡ Show Result</button>
          <button class="btn-action complete-btn" id="mark-btn-9" onclick="toggleCompletion(9)">✔ Mark Done</button>
        </div>
        <div class="accordion-box">
          <div class="accordion-header" onclick="toggleAccordion(9)"><span>💡 How this code works</span><span id="acc-icon-9">➕</span></div>
          <div class="accordion-body" id="acc-body-9">Uses CSS properties <code>border: 4px double #ff6600</code>, <code>border-spacing: 5px</code>, and <code>padding: 5px</code> to achieve exact legacy formatting cleanly.</div>
        </div>
        <div id="result-box-9" class="result-container"><div class="result-header">Live Output Window</div><div id="iframe-holder-9"></div></div>
        <div class="pagination-group"><button class="btn-page" onclick="switchProgram(8)">◀ Previous</button><button class="btn-page" onclick="switchProgram(10)">Next ▶</button></div>
      </div>

      <!-- PRACTICAL 10 -->
      <div id="prog-10" class="program-content">
        <div class="meta-tags"><span class="badge badge-tag">HTML Lists</span><span class="badge badge-medium">Medium</span><span class="badge badge-marks">Weightage: 15 Marks</span></div>
        <h2 class="question-title">Q10. HTML Ordered, Unordered & Definition Lists for Indian States</h2>
        <div class="question-desc"><strong>Problem Statement:</strong> List 4 states using Ordered, Unordered, and Definition lists with custom text colors and attributes.</div>
        <div class="timer-box">
          <span>⏱ Practice Timer (Recommended: 10 mins)</span>
          <div class="timer-controls"><span class="timer-display" id="timer-10">00:00</span> <button class="timer-btn" onclick="toggleTimer(10)">Start Timer</button></div>
        </div>
        <div class="code-header"><span class="code-section-title">Solution Code:</span></div>
        <pre><code class="language-html" id="code-snippet-10">&lt;!DOCTYPE html&gt;
&lt;html&gt;
&lt;head&gt;
  &lt;style&gt;
    body { background-color: #f0f4f8; font-family: Arial; padding: 15px; }
    ol { color: red; }
    ul { color: blue; }
    dl { color: green; }
  &lt;/style&gt;
&lt;/head&gt;
&lt;body&gt;
  &lt;h3&gt;Indian States List Demonstration&lt;/h3&gt;

  &lt;h4&gt;1. Ordered List (Numbered A, B, C...)&lt;/h4&gt;
  &lt;ol type="A" start="1"&gt;
    &lt;li&gt;Uttar Pradesh&lt;/li&gt;
    &lt;li&gt;Maharashtra&lt;/li&gt;
    &lt;li&gt;Rajasthan&lt;/li&gt;
    &lt;li&gt;Madhya Pradesh&lt;/li&gt;
  &lt;/ol&gt;

  &lt;h4&gt;2. Unordered List (Square Bullets)&lt;/h4&gt;
  &lt;ul type="square"&gt;
    &lt;li&gt;Uttar Pradesh&lt;/li&gt;
    &lt;li&gt;Maharashtra&lt;/li&gt;
    &lt;li&gt;Rajasthan&lt;/li&gt;
    &lt;li&gt;Madhya Pradesh&lt;/li&gt;
  &lt;/ul&gt;

  &lt;h4&gt;3. Definition List&lt;/h4&gt;
  &lt;dl&gt;
    &lt;dt&gt;&lt;b&gt;Uttar Pradesh&lt;/b&gt;&lt;/dt&gt;
    &lt;dd&gt;Capital: Lucknow&lt;/dd&gt;
    &lt;dt&gt;&lt;b&gt;Maharashtra&lt;/b&gt;&lt;/dt&gt;
    &lt;dd&gt;Capital: Mumbai&lt;/dd&gt;
  &lt;/dl&gt;
&lt;/body&gt;
&lt;/html&gt;</code></pre>
        <div class="btn-group">
          <button class="btn-action try-code-btn" onclick="openCompilerTab(10, 'html')">▶ Try Code</button>
          <button class="btn-action show-result-btn" id="toggle-btn-10" onclick="toggleResult(10, 'html')">⚡ Show Result</button>
          <button class="btn-action complete-btn" id="mark-btn-10" onclick="toggleCompletion(10)">✔ Mark Done</button>
        </div>
        <div class="accordion-box">
          <div class="accordion-header" onclick="toggleAccordion(10)"><span>💡 How this code works</span><span id="acc-icon-10">➕</span></div>
          <div class="accordion-body" id="acc-body-10">Demonstrates <code>&lt;ol&gt;</code> with <code>type="A"</code>, <code>&lt;ul&gt;</code> with <code>type="square"</code>, and <code>&lt;dl&gt;</code> definition pairs, each styled in distinct colors.</div>
        </div>
        <div id="result-box-10" class="result-container"><div class="result-header">Live Output Window</div><div id="iframe-holder-10"></div></div>
        <div class="pagination-group"><button class="btn-page" onclick="switchProgram(9)">◀ Previous</button><button class="btn-page" onclick="switchProgram(11)">Next ▶</button></div>
      </div>

      <!-- PRACTICAL 11 -->
      <div id="prog-11" class="program-content">
        <div class="meta-tags"><span class="badge badge-tag">HTML Form Validation</span><span class="badge badge-medium">Medium</span><span class="badge badge-marks">Weightage: 15 Marks</span></div>
        <h2 class="question-title">Q11. Swimming Membership Form with Age Validation</h2>
        <div class="question-desc"><strong>Problem Statement:</strong> Design "Swimming Membership Form" with Name, Address (Textarea), Contact Number, Age (Validation 10-18), and Duration radio buttons.</div>
        <div class="timer-box">
          <span>⏱ Practice Timer (Recommended: 12 mins)</span>
          <div class="timer-controls"><span class="timer-display" id="timer-11">00:00</span> <button class="timer-btn" onclick="toggleTimer(11)">Start Timer</button></div>
        </div>
        <div class="code-header"><span class="code-section-title">Solution Code:</span></div>
        <pre><code class="language-html" id="code-snippet-11">&lt;!DOCTYPE html&gt;
&lt;html&gt;
&lt;head&gt;
  &lt;style&gt;
    body { font-family: Arial; padding: 15px; }
    .form-container { width: 350px; margin: auto; border: 1px solid #ccc; padding: 15px; border-radius: 8px; }
    h2 { text-align: center; color: #ff6600; }
    .row { margin-bottom: 10px; }
    label { font-weight: bold; display: block; }
    input[type="text"], input[type="number"], textarea { width: 100%; padding: 6px; box-sizing: border-box; }
    .radio-group { display: flex; gap: 10px; margin-top: 5px; }
    button { width: 100%; background: #ff6600; color: white; border: none; padding: 8px; cursor: pointer; }
  &lt;/style&gt;
&lt;/head&gt;
&lt;body&gt;
  &lt;div class="form-container"&gt;
    &lt;h2&gt;Swimming Membership Form&lt;/h2&gt;
    &lt;form&gt;
      &lt;div class="row"&gt;&lt;label&gt;Name:&lt;/label&gt;&lt;input type="text" required&gt;&lt;/div&gt;
      &lt;div class="row"&gt;&lt;label&gt;Address:&lt;/label&gt;&lt;textarea rows="2" required&gt;&lt;/textarea&gt;&lt;/div&gt;
      &lt;div class="row"&gt;&lt;label&gt;Contact Number:&lt;/label&gt;&lt;input type="text" required&gt;&lt;/div&gt;
      &lt;div class="row"&gt;&lt;label&gt;Age (10-18):&lt;/label&gt;&lt;input type="number" min="10" max="18" required&gt;&lt;/div&gt;
      &lt;div class="row"&gt;
        &lt;label&gt;Membership Duration:&lt;/label&gt;
        &lt;div class="radio-group"&gt;
          &lt;label&gt;&lt;input type="radio" name="dur" value="1" required&gt; 1 Month&lt;/label&gt;
          &lt;label&gt;&lt;input type="radio" name="dur" value="2"&gt; 2 Months&lt;/label&gt;
          &lt;label&gt;&lt;input type="radio" name="dur" value="3"&gt; 3 Months&lt;/label&gt;
        &lt;/div&gt;
      &lt;/div&gt;
      &lt;button type="submit"&gt;Join Membership&lt;/button&gt;
    &lt;/form&gt;
  &lt;/div&gt;
&lt;/body&gt;
&lt;/html&gt;</code></pre>
        <div class="btn-group">
          <button class="btn-action try-code-btn" onclick="openCompilerTab(11, 'html')">▶ Try Code</button>
          <button class="btn-action show-result-btn" id="toggle-btn-11" onclick="toggleResult(11, 'html')">⚡ Show Result</button>
          <button class="btn-action complete-btn" id="mark-btn-11" onclick="toggleCompletion(11)">✔ Mark Done</button>
        </div>
        <div class="accordion-box">
          <div class="accordion-header" onclick="toggleAccordion(11)"><span>💡 How this code works</span><span id="acc-icon-11">➕</span></div>
          <div class="accordion-body" id="acc-body-11">Uses <code>min="10" max="18"</code> on numeric inputs for constraint validation and radio buttons grouped by <code>name="dur"</code>.</div>
        </div>
        <div id="result-box-11" class="result-container"><div class="result-header">Live Output Window</div><div id="iframe-holder-11"></div></div>
        <div class="pagination-group"><button class="btn-page" onclick="switchProgram(10)">◀ Previous</button><button class="btn-page" onclick="switchProgram(12)">Next ▶</button></div>
      </div>

      <!-- PRACTICAL 12 -->
      <div id="prog-12" class="program-content">
        <div class="meta-tags"><span class="badge badge-tag">HTML Formatting</span><span class="badge badge-easy">Easy</span><span class="badge badge-marks">Weightage: 5 Marks</span></div>
        <h2 class="question-title">Q12. Centered Heading and 3-Line Paragraph with Background</h2>
        <div class="question-desc"><strong>Problem Statement:</strong> Use H1 tag for centered title introduction, create a paragraph spanning 3 lines, and set a custom background color.</div>
        <div class="timer-box">
          <span>⏱ Practice Timer (Recommended: 5 mins)</span>
          <div class="timer-controls"><span class="timer-display" id="timer-12">00:00</span> <button class="timer-btn" onclick="toggleTimer(12)">Start Timer</button></div>
        </div>
        <div class="code-header"><span class="code-section-title">Solution Code:</span></div>
        <pre><code class="language-html" id="code-snippet-12">&lt;!DOCTYPE html&gt;
&lt;html&gt;
&lt;head&gt;
  &lt;style&gt;
    body { background-color: #e3f2fd; font-family: Arial, sans-serif; padding: 20px; }
    h1 { text-align: center; color: #0d47a1; }
    p { font-size: 16px; line-height: 1.8; color: #333; text-align: justify; }
  &lt;/style&gt;
&lt;/head&gt;
&lt;body&gt;
  &lt;h1&gt;Introduction to Web Designing&lt;/h1&gt;
  &lt;p&gt;
    Web Designing is an exciting field that combines creativity and technical skills to build websites.&lt;br&gt;
    It involves learning HTML for structure, CSS for styling, and JavaScript for interactive features.&lt;br&gt;
    Mastering these core technologies empowers students to create modern responsive web applications.
  &lt;/p&gt;
&lt;/body&gt;
&lt;/html&gt;</code></pre>
        <div class="btn-group">
          <button class="btn-action try-code-btn" onclick="openCompilerTab(12, 'html')">▶ Try Code</button>
          <button class="btn-action show-result-btn" id="toggle-btn-12" onclick="toggleResult(12, 'html')">⚡ Show Result</button>
          <button class="btn-action complete-btn" id="mark-btn-12" onclick="toggleCompletion(12)">✔ Mark Done</button>
        </div>
        <div class="accordion-box">
          <div class="accordion-header" onclick="toggleAccordion(12)"><span>💡 How this code works</span><span id="acc-icon-12">➕</span></div>
          <div class="accordion-body" id="acc-body-12">Uses <code>text-align: center</code> on H1 and line break tags <code>&lt;br&gt;</code> to separate the paragraph into 3 distinct lines.</div>
        </div>
        <div id="result-box-12" class="result-container"><div class="result-header">Live Output Window</div><div id="iframe-holder-12"></div></div>
        <div class="pagination-group"><button class="btn-page" onclick="switchProgram(11)">◀ Previous</button><button class="btn-page" onclick="switchProgram(13)">Next ▶</button></div>
      </div>

      <!-- PRACTICAL 13 -->
      <div id="prog-13" class="program-content">
        <div class="meta-tags"><span class="badge badge-tag">HTML Table</span><span class="badge badge-easy">Easy</span><span class="badge badge-marks">Weightage: 10 Marks</span></div>
        <h2 class="question-title">Q13. Student Data Table with 3 Entries</h2>
        <div class="question-desc"><strong>Problem Statement:</strong> Create an HTML table with columns: Sr No, Name, Class, Year of Passing, Percentage. Populate with 3 entries.</div>
        <div class="timer-box">
          <span>⏱ Practice Timer (Recommended: 8 mins)</span>
          <div class="timer-controls"><span class="timer-display" id="timer-13">00:00</span> <button class="timer-btn" onclick="toggleTimer(13)">Start Timer</button></div>
        </div>
        <div class="code-header"><span class="code-section-title">Solution Code:</span></div>
        <pre><code class="language-html" id="code-snippet-13">&lt;!DOCTYPE html&gt;
&lt;html&gt;
&lt;head&gt;
  &lt;style&gt;
    table { width: 100%; border-collapse: collapse; }
    th, td { border: 1px solid #000; padding: 8px; text-align: center; }
    th { background-color: #ff6600; color: #fff; }
  &lt;/style&gt;
&lt;/head&gt;
&lt;body&gt;
  &lt;h3&gt;Student Academic Records&lt;/h3&gt;
  &lt;table&gt;
    &lt;tr&gt;
      &lt;th&gt;Sr No&lt;/th&gt;
      &lt;th&gt;Name&lt;/th&gt;
      &lt;th&gt;Class&lt;/th&gt;
      &lt;th&gt;Year of Passing&lt;/th&gt;
      &lt;th&gt;Percentage&lt;/th&gt;
    &lt;/tr&gt;
    &lt;tr&gt;&lt;td&gt;1&lt;/td&gt;&lt;td&gt;Aman Gupta&lt;/td&gt;&lt;td&gt;O Level&lt;/td&gt;&lt;td&gt;2024&lt;/td&gt;&lt;td&gt;82%&lt;/td&gt;&lt;/tr&gt;
    &lt;tr&gt;&lt;td&gt;2&lt;/td&gt;&lt;td&gt;Suman Singh&lt;/td&gt;&lt;td&gt;A Level&lt;/td&gt;&lt;td&gt;2025&lt;/td&gt;&lt;td&gt;88%&lt;/td&gt;&lt;/tr&gt;
    &lt;tr&gt;&lt;td&gt;3&lt;/td&gt;&lt;td&gt;Rohan Mehta&lt;/td&gt;&lt;td&gt;CCC&lt;/td&gt;&lt;td&gt;2024&lt;/td&gt;&lt;td&gt;76%&lt;/td&gt;&lt;/tr&gt;
  &lt;/table&gt;
&lt;/body&gt;
&lt;/html&gt;</code></pre>
        <div class="btn-group">
          <button class="btn-action try-code-btn" onclick="openCompilerTab(13, 'html')">▶ Try Code</button>
          <button class="btn-action show-result-btn" id="toggle-btn-13" onclick="toggleResult(13, 'html')">⚡ Show Result</button>
          <button class="btn-action complete-btn" id="mark-btn-13" onclick="toggleCompletion(13)">✔ Mark Done</button>
        </div>
        <div class="accordion-box">
          <div class="accordion-header" onclick="toggleAccordion(13)"><span>💡 How this code works</span><span id="acc-icon-13">➕</span></div>
          <div class="accordion-body" id="acc-body-13">Structured HTML table layout using 5 column headers and 3 standard data rows.</div>
        </div>
        <div id="result-box-13" class="result-container"><div class="result-header">Live Output Window</div><div id="iframe-holder-13"></div></div>
        <div class="pagination-group"><button class="btn-page" onclick="switchProgram(12)">◀ Previous</button><button class="btn-page" onclick="switchProgram(14)">Next ▶</button></div>
      </div>

      <!-- PRACTICAL 14 -->
      <div id="prog-14" class="program-content">
        <div class="meta-tags"><span class="badge badge-tag">HTML Form Dropdown</span><span class="badge badge-easy">Easy</span><span class="badge badge-marks">Weightage: 10 Marks</span></div>
        <h2 class="question-title">Q14. Library Management Form with Dropdown</h2>
        <div class="question-desc"><strong>Problem Statement:</strong> Create a Library Management form with Name, Father's Name, Email ID, Year dropdown (1st, 2nd, 3rd Year), and Submit button.</div>
        <div class="timer-box">
          <span>⏱ Practice Timer (Recommended: 8 mins)</span>
          <div class="timer-controls"><span class="timer-display" id="timer-14">00:00</span> <button class="timer-btn" onclick="toggleTimer(14)">Start Timer</button></div>
        </div>
        <div class="code-header"><span class="code-section-title">Solution Code:</span></div>
        <pre><code class="language-html" id="code-snippet-14">&lt;!DOCTYPE html&gt;
&lt;html&gt;
&lt;head&gt;
  &lt;style&gt;
    body { font-family: Arial; padding: 15px; }
    .form-card { width: 320px; border: 1px solid #ddd; padding: 15px; border-radius: 6px; }
    .field { margin-bottom: 10px; }
    label { display: block; font-weight: bold; }
    input, select { width: 100%; padding: 6px; margin-top: 4px; box-sizing: border-box; }
    button { background: #ff6600; color: #fff; border: none; padding: 8px 15px; cursor: pointer; width: 100%; margin-top: 10px; }
  &lt;/style&gt;
&lt;/head&gt;
&lt;body&gt;
  &lt;div class="form-card"&gt;
    &lt;h3 style="text-align:center; margin-top:0;"&gt;Library Management&lt;/h3&gt;
    &lt;form&gt;
      &lt;div class="field"&gt;&lt;label&gt;Name:&lt;/label&gt;&lt;input type="text" required&gt;&lt;/div&gt;
      &lt;div class="field"&gt;&lt;label&gt;Father's Name:&lt;/label&gt;&lt;input type="text" required&gt;&lt;/div&gt;
      &lt;div class="field"&gt;&lt;label&gt;Email ID:&lt;/label&gt;&lt;input type="email" required&gt;&lt;/div&gt;
      &lt;div class="field"&gt;
        &lt;label&gt;Academic Year:&lt;/label&gt;
        &lt;select&gt;
          &lt;option&gt;1st Year&lt;/option&gt;
          &lt;option&gt;2nd Year&lt;/option&gt;
          &lt;option&gt;3rd Year&lt;/option&gt;
        &lt;/select&gt;
      &lt;/div&gt;
      &lt;button type="submit"&gt;Submit Request&lt;/button&gt;
    &lt;/form&gt;
  &lt;/div&gt;
&lt;/body&gt;
&lt;/html&gt;</code></pre>
        <div class="btn-group">
          <button class="btn-action try-code-btn" onclick="openCompilerTab(14, 'html')">▶ Try Code</button>
          <button class="btn-action show-result-btn" id="toggle-btn-14" onclick="toggleResult(14, 'html')">⚡ Show Result</button>
          <button class="btn-action complete-btn" id="mark-btn-14" onclick="toggleCompletion(14)">✔ Mark Done</button>
        </div>
        <div class="accordion-box">
          <div class="accordion-header" onclick="toggleAccordion(14)"><span>💡 How this code works</span><span id="acc-icon-14">➕</span></div>
          <div class="accordion-body" id="acc-body-14">Utilizes <code>&lt;select&gt;</code> and <code>&lt;option&gt;</code> elements to create a clean drop-down menu selection for academic years.</div>
        </div>
        <div id="result-box-14" class="result-container"><div class="result-header">Live Output Window</div><div id="iframe-holder-14"></div></div>
        <div class="pagination-group"><button class="btn-page" onclick="switchProgram(13)">◀ Previous</button><button class="btn-page" onclick="switchProgram(15)">Next ▶</button></div>
      </div>

      <!-- PRACTICAL 15 -->
      <div id="prog-15" class="program-content">
        <div class="meta-tags"><span class="badge badge-tag">HTML Frames / Iframe Layout</span><span class="badge badge-medium">Medium</span><span class="badge badge-marks">Weightage: 15 Marks</span></div>
        <h2 class="question-title">Q15. Interactive Two-Pane Layout for National Leaders</h2>
        <div class="question-desc"><strong>Problem Statement:</strong> Create a two-frame/pane webpage where clicking a leader's link in the left pane displays details in the right target frame.</div>
        <div class="timer-box">
          <span>⏱ Practice Timer (Recommended: 12 mins)</span>
          <div class="timer-controls"><span class="timer-display" id="timer-15">00:00</span> <button class="timer-btn" onclick="toggleTimer(15)">Start Timer</button></div>
        </div>
        <div class="code-header"><span class="code-section-title">Solution Code:</span></div>
        <pre><code class="language-html" id="code-snippet-15">&lt;!DOCTYPE html&gt;
&lt;html&gt;
&lt;head&gt;
  &lt;style&gt;
    body { display: flex; height: 280px; margin: 0; font-family: Arial; }
    .left-pane { width: 40%; background: #f4f4f4; padding: 10px; border-right: 2px solid #ccc; }
    .right-pane { width: 60%; padding: 10px; }
    a { display: block; margin-bottom: 8px; color: #ff6600; text-decoration: none; font-weight: bold; }
  &lt;/style&gt;
&lt;/head&gt;
&lt;body&gt;
  &lt;div class="left-pane"&gt;
    &lt;h4&gt;National Leaders&lt;/h4&gt;
    &lt;a href="javascript:void(0)" onclick="showLeader('Mahatma Gandhi', 'Father of the Nation, leader of Indian Independence Movement through non-violence.')"&gt;Mahatma Gandhi&lt;/a&gt;
    &lt;a href="javascript:void(0)" onclick="showLeader('Netaji Subhash Chandra Bose', 'Founder of Azad Hind Fauj (INA), key figure in armed struggle for independence.')"&gt;Subhash Chandra Bose&lt;/a&gt;
  &lt;/div&gt;

  &lt;div class="right-pane" id="details-pane"&gt;
    &lt;h4&gt;Leader Details&lt;/h4&gt;
    &lt;p&gt;Click a leader name on the left to view details.&lt;/p&gt;
  &lt;/div&gt;

  &lt;script&gt;
    function showLeader(name, desc) {
      document.getElementById('details-pane').innerHTML = `&lt;h3 style="color:#ff6600;"&gt;${name}&lt;/h3&gt;&lt;p&gt;${desc}&lt;/p&gt;`;
    }
  &lt;/script&gt;
&lt;/body&gt;
&lt;/html&gt;</code></pre>
        <div class="btn-group">
          <button class="btn-action try-code-btn" onclick="openCompilerTab(15, 'html')">▶ Try Code</button>
          <button class="btn-action show-result-btn" id="toggle-btn-15" onclick="toggleResult(15, 'html')">⚡ Show Result</button>
          <button class="btn-action complete-btn" id="mark-btn-15" onclick="toggleCompletion(15)">✔ Mark Done</button>
        </div>
        <div class="accordion-box">
          <div class="accordion-header" onclick="toggleAccordion(15)"><span>💡 How this code works</span><span id="acc-icon-15">➕</span></div>
          <div class="accordion-body" id="acc-body-15">Simulates dual frame behavior using modern Flexbox split view and JS event target updates.</div>
        </div>
        <div id="result-box-15" class="result-container"><div class="result-header">Live Output Window</div><div id="iframe-holder-15"></div></div>
        <div class="pagination-group"><button class="btn-page" onclick="switchProgram(14)">◀ Previous</button><button class="btn-page" onclick="switchProgram(16)">Next ▶</button></div>
      </div>

      <!-- PRACTICAL 16 -->
      <div id="prog-16" class="program-content">
        <div class="meta-tags"><span class="badge badge-tag">HTML Formatting</span><span class="badge badge-easy">Easy</span><span class="badge badge-marks">Weightage: 5 Marks</span></div>
        <h2 class="question-title">Q16. Simple Bio-Data Webpage Display</h2>
        <div class="question-desc"><strong>Problem Statement:</strong> Write HTML code to display Bio-data showing Name, Father's Name, Date of Birth, and Age.</div>
        <div class="timer-box">
          <span>⏱ Practice Timer (Recommended: 5 mins)</span>
          <div class="timer-controls"><span class="timer-display" id="timer-16">00:00</span> <button class="timer-btn" onclick="toggleTimer(16)">Start Timer</button></div>
        </div>
        <div class="code-header"><span class="code-section-title">Solution Code:</span></div>
        <pre><code class="language-html" id="code-snippet-16">&lt;!DOCTYPE html&gt;
&lt;html&gt;
&lt;head&gt;
  &lt;style&gt;
    .biodata-box { width: 300px; border: 2px solid #ff6600; padding: 15px; border-radius: 8px; font-family: Arial; }
    h2 { text-align: center; color: #ff6600; border-bottom: 1px solid #ddd; padding-bottom: 5px; }
    p { font-size: 14px; margin: 8px 0; }
  &lt;/style&gt;
&lt;/head&gt;
&lt;body&gt;
  &lt;div class="biodata-box"&gt;
    &lt;h2&gt;BIO-DATA&lt;/h2&gt;
    &lt;p&gt;&lt;b&gt;Name:&lt;/b&gt; Rajesh Kumar&lt;/p&gt;
    &lt;p&gt;&lt;b&gt;Father's Name:&lt;/b&gt; Shri Suresh Kumar&lt;/p&gt;
    &lt;p&gt;&lt;b&gt;Date of Birth:&lt;/b&gt; 15/08/2002&lt;/p&gt;
    &lt;p&gt;&lt;b&gt;Age:&lt;/b&gt; 22 Years&lt;/p&gt;
  &lt;/div&gt;
&lt;/body&gt;
&lt;/html&gt;</code></pre>
        <div class="btn-group">
          <button class="btn-action try-code-btn" onclick="openCompilerTab(16, 'html')">▶ Try Code</button>
          <button class="btn-action show-result-btn" id="toggle-btn-16" onclick="toggleResult(16, 'html')">⚡ Show Result</button>
          <button class="btn-action complete-btn" id="mark-btn-16" onclick="toggleCompletion(16)">✔ Mark Done</button>
        </div>
        <div class="accordion-box">
          <div class="accordion-header" onclick="toggleAccordion(16)"><span>💡 How this code works</span><span id="acc-icon-16">➕</span></div>
          <div class="accordion-body" id="acc-body-16">Uses simple semantic HTML tags like <code>&lt;h2&gt;</code>, <code>&lt;p&gt;</code>, and <code>&lt;b&gt;</code> for organized data presentation.</div>
        </div>
        <div id="result-box-16" class="result-container"><div class="result-header">Live Output Window</div><div id="iframe-holder-16"></div></div>
        <div class="pagination-group"><button class="btn-page" onclick="switchProgram(15)">◀ Previous</button><button class="btn-page" onclick="switchProgram(17)">Next ▶</button></div>
      </div>

      <!-- PRACTICAL 17 -->
      <div id="prog-17" class="program-content">
        <div class="meta-tags"><span class="badge badge-tag">HTML Lists</span><span class="badge badge-easy">Easy</span><span class="badge badge-marks">Weightage: 10 Marks</span></div>
        <h2 class="question-title">Q17. Combination of OL, UL, and DL Lists</h2>
        <div class="question-desc"><strong>Problem Statement:</strong> Create an HTML document with (a) Top 3 Books (OL), (b) Hobbies (UL), and (c) Common HTML Tags (DL).</div>
        <div class="timer-box">
          <span>⏱ Practice Timer (Recommended: 8 mins)</span>
          <div class="timer-controls"><span class="timer-display" id="timer-17">00:00</span> <button class="timer-btn" onclick="toggleTimer(17)">Start Timer</button></div>
        </div>
        <div class="code-header"><span class="code-section-title">Solution Code:</span></div>
        <pre><code class="language-html" id="code-snippet-17">&lt;!DOCTYPE html&gt;
&lt;html&gt;
&lt;body style="font-family: Arial; padding: 15px;"&gt;
  &lt;h3&gt;(a) Favourite Books (Ordered List)&lt;/h3&gt;
  &lt;ol&gt;
    &lt;li&gt;Wings of Fire&lt;/li&gt;
    &lt;li&gt;The Alchemist&lt;/li&gt;
    &lt;li&gt;Atomic Habits&lt;/li&gt;
  &lt;/ol&gt;

  &lt;h3&gt;(b) Hobbies (Unordered List)&lt;/h3&gt;
  &lt;ul&gt;
    &lt;li&gt;Web Coding&lt;/li&gt;
    &lt;li&gt;Reading Tech Blogs&lt;/li&gt;
    &lt;li&gt;Playing Chess&lt;/li&gt;
  &lt;/ul&gt;

  &lt;h3&gt;(c) HTML Tags Glossary (Definition List)&lt;/h3&gt;
  &lt;dl&gt;
    &lt;dt&gt;&lt;b&gt;&amp;lt;h1&amp;gt;&lt;/b&gt;&lt;/dt&gt;
    &lt;dd&gt;Defines the most important top-level heading.&lt;/dd&gt;
    &lt;dt&gt;&lt;b&gt;&amp;lt;p&amp;gt;&lt;/b&gt;&lt;/dt&gt;
    &lt;dd&gt;Defines a paragraph block of text.&lt;/dd&gt;
  &lt;/dl&gt;
&lt;/body&gt;
&lt;/html&gt;</code></pre>
        <div class="btn-group">
          <button class="btn-action try-code-btn" onclick="openCompilerTab(17, 'html')">▶ Try Code</button>
          <button class="btn-action show-result-btn" id="toggle-btn-17" onclick="toggleResult(17, 'html')">⚡ Show Result</button>
          <button class="btn-action complete-btn" id="mark-btn-17" onclick="toggleCompletion(17)">✔ Mark Done</button>
        </div>
        <div class="accordion-box">
          <div class="accordion-header" onclick="toggleAccordion(17)"><span>💡 How this code works</span><span id="acc-icon-17">➕</span></div>
          <div class="accordion-body" id="acc-body-17">Demonstrates all three list structures in HTML: <code>&lt;ol&gt;</code>, <code>&lt;ul&gt;</code>, and <code>&lt;dl&gt;</code>.</div>
        </div>
        <div id="result-box-17" class="result-container"><div class="result-header">Live Output Window</div><div id="iframe-holder-17"></div></div>
        <div class="pagination-group"><button class="btn-page" onclick="switchProgram(16)">◀ Previous</button><button class="btn-page" onclick="switchProgram(18)">Next ▶</button></div>
      </div>

      <!-- PRACTICAL 18 -->
      <div id="prog-18" class="program-content">
        <div class="meta-tags"><span class="badge badge-tag">HTML Table Merge</span><span class="badge badge-medium">Medium</span><span class="badge badge-marks">Weightage: 15 Marks</span></div>
        <h2 class="question-title">Q18. Employee Table with ROWSPAN & COLSPAN</h2>
        <div class="question-desc"><strong>Problem Statement:</strong> Create an employee table using ROWSPAN to merge repeated departments and COLSPAN for aligned table headers.</div>
        <div class="timer-box">
          <span>⏱ Practice Timer (Recommended: 10 mins)</span>
          <div class="timer-controls"><span class="timer-display" id="timer-18">00:00</span> <button class="timer-btn" onclick="toggleTimer(18)">Start Timer</button></div>
        </div>
        <div class="code-header"><span class="code-section-title">Solution Code:</span></div>
        <pre><code class="language-html" id="code-snippet-18">&lt;!DOCTYPE html&gt;
&lt;html&gt;
&lt;head&gt;
  &lt;style&gt;
    table { width: 100%; border-collapse: collapse; text-align: center; }
    th, td { border: 1px solid #333; padding: 8px; }
    th { background-color: #ff6600; color: white; }
  &lt;/style&gt;
&lt;/head&gt;
&lt;body&gt;
  &lt;h3&gt;Employee Department Matrix&lt;/h3&gt;
  &lt;table&gt;
    &lt;tr&gt;
      &lt;th colspan="3"&gt;GyanXP Employee Directory&lt;/th&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;th&gt;Department&lt;/th&gt;
      &lt;th&gt;Emp ID&lt;/th&gt;
      &lt;th&gt;Emp Name&lt;/th&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td rowspan="2"&gt;&lt;b&gt;IT Dept&lt;/b&gt;&lt;/td&gt;
      &lt;td&gt;E101&lt;/td&gt;
      &lt;td&gt;Aarav Sharma&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;E102&lt;/td&gt;
      &lt;td&gt;Kavya Verma&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;b&gt;HR Dept&lt;/b&gt;&lt;/td&gt;
      &lt;td&gt;E103&lt;/td&gt;
      &lt;td&gt;Rohan Das&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/table&gt;
&lt;/body&gt;
&lt;/html&gt;</code></pre>
        <div class="btn-group">
          <button class="btn-action try-code-btn" onclick="openCompilerTab(18, 'html')">▶ Try Code</button>
          <button class="btn-action show-result-btn" id="toggle-btn-18" onclick="toggleResult(18, 'html')">⚡ Show Result</button>
          <button class="btn-action complete-btn" id="mark-btn-18" onclick="toggleCompletion(18)">✔ Mark Done</button>
        </div>
        <div class="accordion-box">
          <div class="accordion-header" onclick="toggleAccordion(18)"><span>💡 How this code works</span><span id="acc-icon-18">➕</span></div>
          <div class="accordion-body" id="acc-body-18">Uses <code>colspan="3"</code> to span the main title across columns and <code>rowspan="2"</code> to merge IT department cells.</div>
        </div>
        <div id="result-box-18" class="result-container"><div class="result-header">Live Output Window</div><div id="iframe-holder-18"></div></div>
        <div class="pagination-group"><button class="btn-page" onclick="switchProgram(17)">◀ Previous</button><button class="btn-page" onclick="switchProgram(19)">Next ▶</button></div>
      </div>

      <!-- PRACTICAL 19 -->
      <div id="prog-19" class="program-content">
        <div class="meta-tags"><span class="badge badge-tag">HTML Formatting</span><span class="badge badge-easy">Easy</span><span class="badge badge-marks">Weightage: 5 Marks</span></div>
        <h2 class="question-title">Q19. Welcome Page with Text Formatting (Bold, Italic, Underline)</h2>
        <div class="question-desc"><strong>Problem Statement:</strong> Create welcome.html with a large title "Welcome to My Webpage", two self-description paragraphs, and bold, italic, and underline tags.</div>
        <div class="timer-box">
          <span>⏱ Practice Timer (Recommended: 5 mins)</span>
          <div class="timer-controls"><span class="timer-display" id="timer-19">00:00</span> <button class="timer-btn" onclick="toggleTimer(19)">Start Timer</button></div>
        </div>
        <div class="code-header"><span class="code-section-title">Solution Code:</span></div>
        <pre><code class="language-html" id="code-snippet-19">&lt;!DOCTYPE html&gt;
&lt;html&gt;
&lt;body style="font-family: Arial; padding: 15px;"&gt;
  &lt;h1 style="color:#ff6600;"&gt;Welcome to My Webpage&lt;/h1&gt;
  
  &lt;p&gt;
    Hello! I am a student preparing for the &lt;b&gt;NIELIT O Level Course&lt;/b&gt;. 
    I enjoy &lt;i&gt;developing clean interactive web user interfaces&lt;/i&gt;.
  &lt;/p&gt;
  
  &lt;p&gt;
    My goal is to achieve &lt;u&gt;top marks in Web Designing &amp; Publishing (M2-R5)&lt;/u&gt; by practicing daily live coding practicals.
  &lt;/p&gt;
&lt;/body&gt;
&lt;/html&gt;</code></pre>
        <div class="btn-group">
          <button class="btn-action try-code-btn" onclick="openCompilerTab(19, 'html')">▶ Try Code</button>
          <button class="btn-action show-result-btn" id="toggle-btn-19" onclick="toggleResult(19, 'html')">⚡ Show Result</button>
          <button class="btn-action complete-btn" id="mark-btn-19" onclick="toggleCompletion(19)">✔ Mark Done</button>
        </div>
        <div class="accordion-box">
          <div class="accordion-header" onclick="toggleAccordion(19)"><span>💡 How this code works</span><span id="acc-icon-19">➕</span></div>
          <div class="accordion-body" id="acc-body-19">Demonstrates inline semantic text formatting tags: <code>&lt;b&gt;</code> for bold, <code>&lt;i&gt;</code> for italic, and <code>&lt;u&gt;</code> for underline.</div>
        </div>
        <div id="result-box-19" class="result-container"><div class="result-header">Live Output Window</div><div id="iframe-holder-19"></div></div>
        <div class="pagination-group"><button class="btn-page" onclick="switchProgram(18)">◀ Previous</button><button class="btn-page" onclick="switchProgram(20)">Next ▶</button></div>
      </div>

      <!-- PRACTICAL 20 -->
      <div id="prog-20" class="program-content">
        <div class="meta-tags"><span class="badge badge-tag">CSS Animations</span><span class="badge badge-easy">Easy</span><span class="badge badge-marks">Weightage: 10 Marks</span></div>
        <h2 class="question-title">Q20. Styled Word "Welcome" with Color Change on Hover</h2>
        <div class="question-desc"><strong>Problem Statement:</strong> Display "Welcome" with center alignment, large font size, bold, underline, and color change on mouse hover.</div>
        <div class="timer-box">
          <span>⏱ Practice Timer (Recommended: 5 mins)</span>
          <div class="timer-controls"><span class="timer-display" id="timer-20">00:00</span> <button class="timer-btn" onclick="toggleTimer(20)">Start Timer</button></div>
        </div>
        <div class="code-header"><span class="code-section-title">Solution Code:</span></div>
        <pre><code class="language-html" id="code-snippet-20">&lt;!DOCTYPE html&gt;
&lt;html&gt;
&lt;head&gt;
  &lt;style&gt;
    .welcome-text {
      text-align: center;
      font-size: 48px;
      font-weight: bold;
      text-decoration: underline;
      color: #1f2421;
      transition: color 0.3s ease;
      cursor: pointer;
      margin-top: 50px;
    }
    .welcome-text:hover {
      color: #ff6600;
    }
  &lt;/style&gt;
&lt;/head&gt;
&lt;body&gt;
  &lt;div class="welcome-text"&gt;Welcome&lt;/div&gt;
&lt;/body&gt;
&lt;/html&gt;</code></pre>
        <div class="btn-group">
          <button class="btn-action try-code-btn" onclick="openCompilerTab(20, 'html')">▶ Try Code</button>
          <button class="btn-action show-result-btn" id="toggle-btn-20" onclick="toggleResult(20, 'html')">⚡ Show Result</button>
          <button class="btn-action complete-btn" id="mark-btn-20" onclick="toggleCompletion(20)">✔ Mark Done</button>
        </div>
        <div class="accordion-box">
          <div class="accordion-header" onclick="toggleAccordion(20)"><span>💡 How this code works</span><span id="acc-icon-20">➕</span></div>
          <div class="accordion-body" id="acc-body-20">Combines CSS text property rules with the <code>:hover</code> pseudo-class to smooth-transition text color.</div>
        </div>
        <div id="result-box-20" class="result-container"><div class="result-header">Live Output Window</div><div id="iframe-holder-20"></div></div>
        <div class="pagination-group"><button class="btn-page" onclick="switchProgram(19)">◀ Previous</button><button class="btn-page" onclick="switchProgram(21)">Next ▶</button></div>
      </div>

      <!-- PRACTICAL 21 -->
      <div id="prog-21" class="program-content">
        <div class="meta-tags"><span class="badge badge-tag">HTML Table Layout</span><span class="badge badge-medium">Medium</span><span class="badge badge-marks">Weightage: 15 Marks</span></div>
        <h2 class="question-title">Q21. Webpage Layout using Table for College Infrastructure</h2>
        <div class="question-desc"><strong>Problem Statement:</strong> Use HTML tables to provide layout structure describing your college infrastructure.</div>
        <div class="timer-box">
          <span>⏱ Practice Timer (Recommended: 10 mins)</span>
          <div class="timer-controls"><span class="timer-display" id="timer-21">00:00</span> <button class="timer-btn" onclick="toggleTimer(21)">Start Timer</button></div>
        </div>
        <div class="code-header"><span class="code-section-title">Solution Code:</span></div>
        <pre><code class="language-html" id="code-snippet-21">&lt;!DOCTYPE html&gt;
&lt;html&gt;
&lt;head&gt;
  &lt;style&gt;
    .layout-table { width: 100%; border-collapse: collapse; font-family: Arial; }
    .header-cell { background: #ff6600; color: white; padding: 15px; text-align: center; }
    .nav-cell { width: 25%; background: #f8f9fa; padding: 10px; vertical-align: top; border-right: 1px solid #ccc; }
    .content-cell { padding: 15px; vertical-align: top; }
    .footer-cell { background: #1f2421; color: white; text-align: center; padding: 8px; font-size: 12px; }
  &lt;/style&gt;
&lt;/head&gt;
&lt;body&gt;
  &lt;table class="layout-table" border="1"&gt;
    &lt;tr&gt;&lt;td colspan="2" class="header-cell"&gt;&lt;h2 style="margin:0;"&gt;Government Polytechnic Infrastructure&lt;/h2&gt;&lt;/td&gt;&lt;/tr&gt;
    &lt;tr&gt;
      &lt;td class="nav-cell"&gt;
        &lt;b&gt;Facilities&lt;/b&gt;&lt;br&gt;&lt;br&gt;
        • Computer Labs&lt;br&gt;
        • Central Library&lt;br&gt;
        • Sports Complex&lt;br&gt;
        • Auditorium
      &lt;/td&gt;
      &lt;td class="content-cell"&gt;
        &lt;h3&gt;State-of-the-Art Computer Labs&lt;/h3&gt;
        &lt;p&gt;Our campus features high-speed internet-enabled modern labs with over 200 high-performance workstations for IT students.&lt;/p&gt;
      &lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;&lt;td colspan="2" class="footer-cell"&gt;© 2026 College Campus Portal&lt;/td&gt;&lt;/tr&gt;
  &lt;/table&gt;
&lt;/body&gt;
&lt;/html&gt;</code></pre>
        <div class="btn-group">
          <button class="btn-action try-code-btn" onclick="openCompilerTab(21, 'html')">▶ Try Code</button>
          <button class="btn-action show-result-btn" id="toggle-btn-21" onclick="toggleResult(21, 'html')">⚡ Show Result</button>
          <button class="btn-action complete-btn" id="mark-btn-21" onclick="toggleCompletion(21)">✔ Mark Done</button>
        </div>
        <div class="accordion-box">
          <div class="accordion-header" onclick="toggleAccordion(21)"><span>💡 How this code works</span><span id="acc-icon-21">➕</span></div>
          <div class="accordion-body" id="acc-body-21">Demonstrates classic table-based structural web layout using headers, sidebar columns, main content, and footers.</div>
        </div>
        <div id="result-box-21" class="result-container"><div class="result-header">Live Output Window</div><div id="iframe-holder-21"></div></div>
        <div class="pagination-group"><button class="btn-page" onclick="switchProgram(20)">◀ Previous</button><button class="btn-page" onclick="switchProgram(22)">Next ▶</button></div>
      </div>

      <!-- PRACTICAL 22 -->
      <div id="prog-22" class="program-content">
        <div class="meta-tags"><span class="badge badge-tag">HTML Grid Layout</span><span class="badge badge-medium">Medium</span><span class="badge badge-marks">Weightage: 15 Marks</span></div>
        <h2 class="question-title">Q22. Student Profile Grid Layout (2 Rows x 3 Columns)</h2>
        <div class="question-desc"><strong>Problem Statement:</strong> Webpage layout: Top Row spanning 3 cols (Header: Student Profile in Bold with Orange BG). Second Row (3 Cols): Personal Details, Academic Table, Hobbies.</div>
        <div class="timer-box">
          <span>⏱ Practice Timer (Recommended: 12 mins)</span>
          <div class="timer-controls"><span class="timer-display" id="timer-22">00:00</span> <button class="timer-btn" onclick="toggleTimer(22)">Start Timer</button></div>
        </div>
        <div class="code-header"><span class="code-section-title">Solution Code:</span></div>
        <pre><code class="language-html" id="code-snippet-22">&lt;!DOCTYPE html&gt;
&lt;html&gt;
&lt;head&gt;
  &lt;style&gt;
    table { width: 100%; border-collapse: collapse; font-family: Arial; }
    td, th { border: 1px solid #333; padding: 10px; vertical-align: top; }
    .header { background-color: orange; color: white; text-align: center; font-weight: bold; font-size: 20px; }
    .sub-table { width: 100%; border-collapse: collapse; }
    .sub-table td { border: 1px solid #ccc; padding: 4px; }
  &lt;/style&gt;
&lt;/head&gt;
&lt;body&gt;
  &lt;table&gt;
    &lt;tr&gt;
      &lt;td colspan="3" class="header"&gt;Header: Student Profile&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td width="33%"&gt;
        &lt;h4 style="margin-top:0;"&gt;Personal Details&lt;/h4&gt;
        &lt;p&gt;&lt;b&gt;Name:&lt;/b&gt; Vikram Malhotra&lt;/p&gt;
        &lt;p&gt;&lt;b&gt;Age:&lt;/b&gt; 20&lt;/p&gt;
        &lt;p&gt;&lt;b&gt;Address:&lt;/b&gt; Lucknow, UP&lt;/p&gt;
      &lt;/td&gt;
      &lt;td width="33%"&gt;
        &lt;h4 style="margin-top:0;"&gt;Academic Information&lt;/h4&gt;
        &lt;table class="sub-table"&gt;
          &lt;tr&gt;&lt;th&gt;Subject&lt;/th&gt;&lt;th&gt;Grade&lt;/th&gt;&lt;/tr&gt;
          &lt;tr&gt;&lt;td&gt;M2-R5&lt;/td&gt;&lt;td&gt;S Grade&lt;/td&gt;&lt;/tr&gt;
          &lt;tr&gt;&lt;td&gt;M1-R5&lt;/td&gt;&lt;td&gt;A Grade&lt;/td&gt;&lt;/tr&gt;
        &lt;/table&gt;
      &lt;/td&gt;
      &lt;td width="33%"&gt;
        &lt;h4 style="margin-top:0;"&gt;Hobbies&lt;/h4&gt;
        &lt;ul style="padding-left:18px;"&gt;
          &lt;li&gt;Web Coding&lt;/li&gt;
          &lt;li&gt;Playing Chess&lt;/li&gt;
          &lt;li&gt;Blogging&lt;/li&gt;
        &lt;/ul&gt;
      &lt;/td&gt;
    &lt;/tr&gt;
  &lt;/table&gt;
&lt;/body&gt;
&lt;/html&gt;</code></pre>
        <div class="btn-group">
          <button class="btn-action try-code-btn" onclick="openCompilerTab(22, 'html')">▶ Try Code</button>
          <button class="btn-action show-result-btn" id="toggle-btn-22" onclick="toggleResult(22, 'html')">⚡ Show Result</button>
          <button class="btn-action complete-btn" id="mark-btn-22" onclick="toggleCompletion(22)">✔ Mark Done</button>
        </div>
        <div class="accordion-box">
          <div class="accordion-header" onclick="toggleAccordion(22)"><span>💡 How this code works</span><span id="acc-icon-22">➕</span></div>
          <div class="accordion-body" id="acc-body-22">Full fills 2-row multi-column grid specs with <code>colspan="3"</code> top header span and nested table formatting.</div>
        </div>
        <div id="result-box-22" class="result-container"><div class="result-header">Live Output Window</div><div id="iframe-holder-22"></div></div>
        <div class="pagination-group"><button class="btn-page" onclick="switchProgram(21)">◀ Previous</button><button class="btn-page" onclick="switchProgram(23)">Next ▶</button></div>
      </div>

      <!-- PRACTICAL 23 -->
      <div id="prog-23" class="program-content">
        <div class="meta-tags"><span class="badge badge-tag">HTML Form Validation</span><span class="badge badge-medium">Medium</span><span class="badge badge-marks">Weightage: 15 Marks</span></div>
        <h2 class="question-title">Q23. Swimming Membership Form with Title Alignment</h2>
        <div class="question-desc"><strong>Problem Statement:</strong> Design swimming membership form with name, address textarea, contact, age (10-18), properly aligned with title "Swimming Membership Form".</div>
        <div class="timer-box">
          <span>⏱ Practice Timer (Recommended: 10 mins)</span>
          <div class="timer-controls"><span class="timer-display" id="timer-23">00:00</span> <button class="timer-btn" onclick="toggleTimer(23)">Start Timer</button></div>
        </div>
        <div class="code-header"><span class="code-section-title">Solution Code:</span></div>
        <pre><code class="language-html" id="code-snippet-23">&lt;!DOCTYPE html&gt;
&lt;html&gt;
&lt;head&gt;
  &lt;style&gt;
    .form-wrapper { width: 340px; margin: 10px auto; border: 2px solid #ff6600; padding: 15px; border-radius: 8px; font-family: Arial; }
    .form-title { text-align: center; color: #ff6600; text-transform: uppercase; font-size: 18px; margin-bottom: 15px; }
    .input-group { margin-bottom: 10px; }
    label { font-size: 13px; font-weight: bold; display: block; margin-bottom: 3px; }
    input[type="text"], input[type="number"], textarea { width: 100%; padding: 6px; box-sizing: border-box; }
    button { background: #ff6600; color: #fff; border: none; padding: 8px; width: 100%; cursor: pointer; }
  &lt;/style&gt;
&lt;/head&gt;
&lt;body&gt;
  &lt;div class="form-wrapper"&gt;
    &lt;div class="form-title"&gt;Swimming Membership Form&lt;/div&gt;
    &lt;form&gt;
      &lt;div class="input-group"&gt;&lt;label&gt;Member Name:&lt;/label&gt;&lt;input type="text" required&gt;&lt;/div&gt;
      &lt;div class="input-group"&gt;&lt;label&gt;Address:&lt;/label&gt;&lt;textarea rows="2" required&gt;&lt;/textarea&gt;&lt;/div&gt;
      &lt;div class="input-group"&gt;&lt;label&gt;Contact Number:&lt;/label&gt;&lt;input type="text" required&gt;&lt;/div&gt;
      &lt;div class="input-group"&gt;&lt;label&gt;Age (10 - 18):&lt;/label&gt;&lt;input type="number" min="10" max="18" required&gt;&lt;/div&gt;
      &lt;button type="submit"&gt;Submit Application&lt;/button&gt;
    &lt;/form&gt;
  &lt;/div&gt;
&lt;/body&gt;
&lt;/html&gt;</code></pre>
        <div class="btn-group">
          <button class="btn-action try-code-btn" onclick="openCompilerTab(23, 'html')">▶ Try Code</button>
          <button class="btn-action show-result-btn" id="toggle-btn-23" onclick="toggleResult(23, 'html')">⚡ Show Result</button>
          <button class="btn-action complete-btn" id="mark-btn-23" onclick="toggleCompletion(23)">✔ Mark Done</button>
        </div>
        <div class="accordion-box">
          <div class="accordion-header" onclick="toggleAccordion(23)"><span>💡 How this code works</span><span id="acc-icon-23">➕</span></div>
          <div class="accordion-body" id="acc-body-23">Validates range 10 to 18 automatically on submission using HTML5 constraints.</div>
        </div>
        <div id="result-box-23" class="result-container"><div class="result-header">Live Output Window</div><div id="iframe-holder-23"></div></div>
        <div class="pagination-group"><button class="btn-page" onclick="switchProgram(22)">◀ Previous</button><button class="btn-page" onclick="switchProgram(24)">Next ▶</button></div>
      </div>

      <!-- PRACTICAL 24 -->
      <div id="prog-24" class="program-content">
        <div class="meta-tags"><span class="badge badge-tag">JavaScript Conditional Logic</span><span class="badge badge-medium">Medium</span><span class="badge badge-marks">Weightage: 15 Marks</span></div>
        <h2 class="question-title">Q24. JavaScript Simple Interest Calculator (>1 Lakh Conditional Rate)</h2>
        <div class="question-desc"><strong>Problem Statement:</strong> Calculate simple interest: If Principal > ₹1,000,000, interest rate is 15%; otherwise, rate is 10%.</div>
        <div class="timer-box">
          <span>⏱ Practice Timer (Recommended: 10 mins)</span>
          <div class="timer-controls"><span class="timer-display" id="timer-24">00:00</span> <button class="timer-btn" onclick="toggleTimer(24)">Start Timer</button></div>
        </div>
        <div class="code-header"><span class="code-section-title">Solution Code:</span></div>
        <pre><code class="language-html" id="code-snippet-24">&lt;!DOCTYPE html&gt;
&lt;html&gt;
&lt;head&gt;
  &lt;style&gt;
    body { font-family: Arial; padding: 15px; }
    .input-box { margin-bottom: 8px; }
    button { background: #ff6600; color: #fff; border: none; padding: 6px 12px; cursor: pointer; }
    #out { margin-top: 10px; font-weight: bold; color: #ff6600; }
  &lt;/style&gt;
&lt;/head&gt;
&lt;body&gt;
  &lt;h3&gt;Simple Interest Calculator&lt;/h3&gt;
  &lt;div class="input-box"&gt;Principal (₹): &lt;input type="number" id="p"&gt;&lt;/div&gt;
  &lt;div class="input-box"&gt;Time (Years): &lt;input type="number" id="t"&gt;&lt;/div&gt;
  &lt;button onclick="calcInterest()"&gt;Calculate Interest&lt;/button&gt;

  &lt;div id="out"&gt;&lt;/div&gt;

  &lt;script&gt;
    function calcInterest() {
      let p = parseFloat(document.getElementById('p').value);
      let t = parseFloat(document.getElementById('t').value);
      if(isNaN(p) || isNaN(t)) return;

      let r = (p &gt; 100000) ? 15 : 10;
      let si = (p * r * t) / 100;

      document.getElementById('out').innerHTML = `Rate Applied: ${r}% &lt;br&gt;Simple Interest: ₹${si.toFixed(2)}`;
    }
  &lt;/script&gt;
&lt;/body&gt;
&lt;/html&gt;</code></pre>
        <div class="btn-group">
          <button class="btn-action try-code-btn" onclick="openCompilerTab(24, 'html')">▶ Try Code</button>
          <button class="btn-action show-result-btn" id="toggle-btn-24" onclick="toggleResult(24, 'html')">⚡ Show Result</button>
          <button class="btn-action complete-btn" id="mark-btn-24" onclick="toggleCompletion(24)">✔ Mark Done</button>
        </div>
        <div class="accordion-box">
          <div class="accordion-header" onclick="toggleAccordion(24)"><span>💡 How this code works</span><span id="acc-icon-24">➕</span></div>
          <div class="accordion-body" id="acc-body-24">Uses conditional ternary operator <code>(p > 100000) ? 15 : 10</code> to dynamically assign interest rate.</div>
        </div>
        <div id="result-box-24" class="result-container"><div class="result-header">Live Output Window</div><div id="iframe-holder-24"></div></div>
        <div class="pagination-group"><button class="btn-page" onclick="switchProgram(23)">◀ Previous</button><button class="btn-page" onclick="switchProgram(25)">Next ▶</button></div>
      </div>

      <!-- PRACTICAL 25 -->
      <div id="prog-25" class="program-content">
        <div class="meta-tags"><span class="badge badge-tag">JavaScript Application</span><span class="badge badge-medium">Medium</span><span class="badge badge-marks">Weightage: 15 Marks</span></div>
        <h2 class="question-title">Q25. Student Marks Calculation, Result & Grade Calculator</h2>
        <div class="question-desc"><strong>Problem Statement:</strong> Create student form to calculate total marks, average, pass/fail result, and grade using JavaScript.</div>
        <div class="timer-box">
          <span>⏱ Practice Timer (Recommended: 12 mins)</span>
          <div class="timer-controls"><span class="timer-display" id="timer-25">00:00</span> <button class="timer-btn" onclick="toggleTimer(25)">Start Timer</button></div>
        </div>
        <div class="code-header"><span class="code-section-title">Solution Code:</span></div>
        <pre><code class="language-html" id="code-snippet-25">&lt;!DOCTYPE html&gt;
&lt;html&gt;
&lt;head&gt;
  &lt;style&gt;
    body { font-family: Arial; padding: 15px; }
    .input-row { margin-bottom: 6px; }
    button { background: #ff6600; color: #fff; border: none; padding: 6px 12px; cursor: pointer; }
    #report { margin-top: 12px; line-height: 1.6; }
  &lt;/style&gt;
&lt;/head&gt;
&lt;body&gt;
  &lt;h3&gt;Student Grade Report Calculator&lt;/h3&gt;
  &lt;div class="input-row"&gt;Subject 1: &lt;input type="number" id="m1"&gt;&lt;/div&gt;
  &lt;div class="input-row"&gt;Subject 2: &lt;input type="number" id="m2"&gt;&lt;/div&gt;
  &lt;div class="input-row"&gt;Subject 3: &lt;input type="number" id="m3"&gt;&lt;/div&gt;
  &lt;button onclick="calcResult()"&gt;Calculate Grade&lt;/button&gt;

  &lt;div id="report"&gt;&lt;/div&gt;

  &lt;script&gt;
    function calcResult() {
      let m1 = parseFloat(document.getElementById('m1').value) || 0;
      let m2 = parseFloat(document.getElementById('m2').value) || 0;
      let m3 = parseFloat(document.getElementById('m3').value) || 0;

      let total = m1 + m2 + m3;
      let avg = total / 3;
      let result = (m1 >= 33 && m2 >= 33 && m3 >= 33) ? "PASS" : "FAIL";
      let grade = "F";

      if (result === "PASS") {
        if (avg >= 85) grade = "S";
        else if (avg >= 75) grade = "A";
        else if (avg >= 65) grade = "B";
        else if (avg >= 55) grade = "C";
        else grade = "D";
      }

      document.getElementById('report').innerHTML = `
        &lt;b&gt;Total Marks:&lt;/b&gt; ${total}/300 &lt;br&gt;
        &lt;b&gt;Average:&lt;/b&gt; ${avg.toFixed(2)}% &lt;br&gt;
        &lt;b&gt;Result:&lt;/b&gt; &lt;span style="color:${result==='PASS'?'green':'red'};"&gt;${result}&lt;/span&gt; &lt;br&gt;
        &lt;b&gt;Grade:&lt;/b&gt; ${grade}
      `;
    }
  &lt;/script&gt;
&lt;/body&gt;
&lt;/html&gt;</code></pre>
        <div class="btn-group">
          <button class="btn-action try-code-btn" onclick="openCompilerTab(25, 'html')">▶ Try Code</button>
          <button class="btn-action show-result-btn" id="toggle-btn-25" onclick="toggleResult(25, 'html')">⚡ Show Result</button>
          <button class="btn-action complete-btn" id="mark-btn-25" onclick="toggleCompletion(25)">✔ Mark Done</button>
        </div>
        <div class="accordion-box">
          <div class="accordion-header" onclick="toggleAccordion(25)"><span>💡 How this code works</span><span id="acc-icon-25">➕</span></div>
          <div class="accordion-body" id="acc-body-25">Sums three subject marks, calculates average percentage, and evaluates standard grading logic.</div>
        </div>
        <div id="result-box-25" class="result-container"><div class="result-header">Live Output Window</div><div id="iframe-holder-25"></div></div>
        <div class="pagination-group"><button class="btn-page" onclick="switchProgram(24)">◀ Previous</button><button class="btn-page" onclick="switchProgram(26)">Next ▶</button></div>
      </div>

      <!-- PRACTICAL 26 -->
      <div id="prog-26" class="program-content">
        <div class="meta-tags"><span class="badge badge-tag">CSS Styling</span><span class="badge badge-medium">Medium</span><span class="badge badge-marks">Weightage: 15 Marks</span></div>
        <h2 class="question-title">Q26. "About My College" Page with Scrolling Text</h2>
        <div class="question-desc"><strong>Problem Statement:</strong> Title "about my college", large college name header followed by small address, background image styling, stylized courses list, and scrolling marquee.</div>
        <div class="timer-box">
          <span>⏱ Practice Timer (Recommended: 10 mins)</span>
          <div class="timer-controls"><span class="timer-display" id="timer-26">00:00</span> <button class="timer-btn" onclick="toggleTimer(26)">Start Timer</button></div>
        </div>
        <div class="code-header"><span class="code-section-title">Solution Code:</span></div>
        <pre><code class="language-html" id="code-snippet-26">&lt;!DOCTYPE html&gt;
&lt;html&gt;
&lt;head&gt;
  &lt;title&gt;about my college&lt;/title&gt;
  &lt;style&gt;
    body {
      background-color: #f0f4f8;
      font-family: Arial, sans-serif;
      padding: 15px;
    }
    .college-header { text-align: center; }
    .college-name { font-size: 28px; font-weight: bold; color: #ff6600; margin: 0; }
    .address { font-size: 12px; color: #666; margin-top: 4px; }
    .c1 { color: #d9534f; font-family: 'Georgia', serif; }
    .c2 { color: #0275d8; font-family: 'Courier New', monospace; }
    .c3 { color: #5cb85c; font-family: 'Verdana', sans-serif; }
  &lt;/style&gt;
&lt;/head&gt;
&lt;body&gt;
  &lt;div class="college-header"&gt;
    &lt;div class="college-name"&gt;NATIONAL INSTITUTE OF TECHNOLOGY&lt;/div&gt;
    &lt;div class="address"&gt;123 Knowledge Park, City Campus, Pin - 226001&lt;/div&gt;
  &lt;/div&gt;

  &lt;hr&gt;
  &lt;marquee bgcolor="#ff6600" style="color:#fff; padding:5px; font-weight:bold;"&gt;Admissions Open for 2026 Academic Session! Apply Online Today.&lt;/marquee&gt;

  &lt;h3&gt;Offered Courses:&lt;/h3&gt;
  &lt;ul&gt;
    &lt;li class="c1"&gt;NIELIT O Level (Web Designing &amp; Publishing)&lt;/li&gt;
    &lt;li class="c2"&gt;Diploma in Computer Science&lt;/li&gt;
    &lt;li class="c3"&gt;Bachelor of Computer Applications (BCA)&lt;/li&gt;
  &lt;/ul&gt;
&lt;/body&gt;
&lt;/html&gt;</code></pre>
        <div class="btn-group">
          <button class="btn-action try-code-btn" onclick="openCompilerTab(26, 'html')">▶ Try Code</button>
          <button class="btn-action show-result-btn" id="toggle-btn-26" onclick="toggleResult(26, 'html')">⚡ Show Result</button>
          <button class="btn-action complete-btn" id="mark-btn-26" onclick="toggleCompletion(26)">✔ Mark Done</button>
        </div>
        <div class="accordion-box">
          <div class="accordion-header" onclick="toggleAccordion(26)"><span>💡 How this code works</span><span id="acc-icon-26">➕</span></div>
          <div class="accordion-body" id="acc-body-26">Implements <code>&lt;marquee&gt;</code> for scrolling text along with distinct font typography rules for each listed course.</div>
        </div>
        <div id="result-box-26" class="result-container"><div class="result-header">Live Output Window</div><div id="iframe-holder-26"></div></div>
        <div class="pagination-group"><button class="btn-page" onclick="switchProgram(25)">◀ Previous</button><button class="btn-page" onclick="switchProgram(27)">Next ▶</button></div>
      </div>

      <!-- PRACTICAL 27 -->
      <div id="prog-27" class="program-content">
        <div class="meta-tags"><span class="badge badge-tag">JavaScript Algorithms</span><span class="badge badge-medium">Medium</span><span class="badge badge-marks">Weightage: 15 Marks</span></div>
        <h2 class="question-title">Q27. JavaScript Even, Odd and Prime Numbers (0 to 100)</h2>
        <div class="question-desc"><strong>Problem Statement:</strong> Write a JavaScript program to evaluate and categorize Even, Odd, and Prime numbers from 0 to 100.</div>
        <div class="timer-box">
          <span>⏱ Practice Timer (Recommended: 12 mins)</span>
          <div class="timer-controls"><span class="timer-display" id="timer-27">00:00</span> <button class="timer-btn" onclick="toggleTimer(27)">Start Timer</button></div>
        </div>
        <div class="code-header"><span class="code-section-title">Solution Code:</span></div>
        <pre><code class="language-html" id="code-snippet-27">&lt;!DOCTYPE html&gt;
&lt;html&gt;
&lt;head&gt;
  &lt;style&gt;
    body { font-family: Arial; padding: 15px; }
    .box { background: #f8f9fa; border: 1px solid #ddd; padding: 10px; margin-bottom: 10px; border-radius: 6px; word-break: break-word; }
    h4 { margin: 0 0 5px 0; color: #ff6600; }
  &lt;/style&gt;
&lt;/head&gt;
&lt;body&gt;
  &lt;h3&gt;Numbers Classifier (0 - 100)&lt;/h3&gt;
  
  &lt;div class="box"&gt;&lt;h4&gt;Even Numbers:&lt;/h4&gt;&lt;div id="evens"&gt;&lt;/div&gt;&lt;/div&gt;
  &lt;div class="box"&gt;&lt;h4&gt;Odd Numbers:&lt;/h4&gt;&lt;div id="odds"&gt;&lt;/div&gt;&lt;/div&gt;
  &lt;div class="box"&gt;&lt;h4&gt;Prime Numbers:&lt;/h4&gt;&lt;div id="primes"&gt;&lt;/div&gt;&lt;/div&gt;

  &lt;script&gt;
    let evens = [], odds = [], primes = [];

    function isPrime(num) {
      if (num &lt; 2) return false;
      for (let i = 2; i &lt;= Math.sqrt(num); i++) {
        if (num % i === 0) return false;
      }
      return true;
    }

    for (let i = 0; i &lt;= 100; i++) {
      if (i % 2 === 0) evens.push(i);
      else odds.push(i);
      
      if (isPrime(i)) primes.push(i);
    }

    document.getElementById('evens').innerText = evens.join(', ');
    document.getElementById('odds').innerText = odds.join(', ');
    document.getElementById('primes').innerText = primes.join(', ');
  &lt;/script&gt;
&lt;/body&gt;
&lt;/html&gt;</code></pre>
        <div class="btn-group">
          <button class="btn-action try-code-btn" onclick="openCompilerTab(27, 'html')">▶ Try Code</button>
          <button class="btn-action show-result-btn" id="toggle-btn-27" onclick="toggleResult(27, 'html')">⚡ Show Result</button>
          <button class="btn-action complete-btn" id="mark-btn-27" onclick="toggleCompletion(27)">✔ Mark Done</button>
        </div>
        <div class="accordion-box">
          <div class="accordion-header" onclick="toggleAccordion(27)"><span>💡 How this code works</span><span id="acc-icon-27">➕</span></div>
          <div class="accordion-body" id="acc-body-27">Loops through numbers 0-100, checking modulus <code>i % 2</code> for parity and trial division up to <code>Math.sqrt(num)</code> for prime check.</div>
        </div>
        <div id="result-box-27" class="result-container"><div class="result-header">Live Output Window</div><div id="iframe-holder-27"></div></div>
        <div class="pagination-group"><button class="btn-page" onclick="switchProgram(26)">◀ Previous</button><button class="btn-page" onclick="switchProgram(28)">Next ▶</button></div>
      </div>

      <!-- PRACTICAL 28 -->
      <div id="prog-28" class="program-content">
        <div class="meta-tags"><span class="badge badge-tag">HTML Frames</span><span class="badge badge-medium">Medium</span><span class="badge badge-marks">Weightage: 10 Marks</span></div>
        <h2 class="question-title">Q28. Target Attribute in HTML Frame/Iframe Navigation</h2>
        <div class="question-desc"><strong>Problem Statement:</strong> Demonstrate the target attribute in frames/iframes to update content dynamically.</div>
        <div class="timer-box">
          <span>⏱ Practice Timer (Recommended: 8 mins)</span>
          <div class="timer-controls"><span class="timer-display" id="timer-28">00:00</span> <button class="timer-btn" onclick="toggleTimer(28)">Start Timer</button></div>
        </div>
        <div class="code-header"><span class="code-section-title">Solution Code:</span></div>
        <pre><code class="language-html" id="code-snippet-28">&lt;!DOCTYPE html&gt;
&lt;html&gt;
&lt;head&gt;
  &lt;style&gt;
    .frame-wrapper { display: flex; gap: 15px; font-family: Arial; }
    .nav-box { width: 30%; background: #f0f0f0; padding: 10px; border-radius: 6px; }
    .display-box { width: 70%; border: 2px solid #ff6600; padding: 10px; border-radius: 6px; }
    a { display: block; margin-bottom: 8px; color: #ff6600; font-weight: bold; }
  &lt;/style&gt;
&lt;/head&gt;
&lt;body&gt;
  &lt;h3&gt;Target Attribute Demonstration&lt;/h3&gt;
  &lt;div class="frame-wrapper"&gt;
    &lt;div class="nav-box"&gt;
      &lt;a href="https://www.wikipedia.org" target="myTargetFrame"&gt;Load Wikipedia&lt;/a&gt;
      &lt;a href="https://www.bing.com" target="myTargetFrame"&gt;Load Bing Search&lt;/a&gt;
    &lt;/div&gt;
    &lt;div class="display-box"&gt;
      &lt;iframe name="myTargetFrame" style="width:100%; height:200px; border:none;" srcdoc="&lt;h4 style='color:#666;'&gt;Click a link on the left to target this frame.&lt;/h4&gt;"&gt;&lt;/iframe&gt;
    &lt;/div&gt;
  &lt;/div&gt;
&lt;/body&gt;
&lt;/html&gt;</code></pre>
        <div class="btn-group">
          <button class="btn-action try-code-btn" onclick="openCompilerTab(28, 'html')">▶ Try Code</button>
          <button class="btn-action show-result-btn" id="toggle-btn-28" onclick="toggleResult(28, 'html')">⚡ Show Result</button>
          <button class="btn-action complete-btn" id="mark-btn-28" onclick="toggleCompletion(28)">✔ Mark Done</button>
        </div>
        <div class="accordion-box">
          <div class="accordion-header" onclick="toggleAccordion(28)"><span>💡 How this code works</span><span id="acc-icon-28">➕</span></div>
          <div class="accordion-body" id="acc-body-28">Setting <code>target="myTargetFrame"</code> on links directs navigation output straight inside the named iframe.</div>
        </div>
        <div id="result-box-28" class="result-container"><div class="result-header">Live Output Window</div><div id="iframe-holder-28"></div></div>
        <div class="pagination-group"><button class="btn-page" onclick="switchProgram(27)">◀ Previous</button><button class="btn-page" onclick="switchProgram(29)">Next ▶</button></div>
      </div>

      <!-- PRACTICAL 29 -->
      <div id="prog-29" class="program-content">
        <div class="meta-tags"><span class="badge badge-tag">HTML Image Alignment</span><span class="badge badge-easy">Easy</span><span class="badge badge-marks">Weightage: 10 Marks</span></div>
        <h2 class="question-title">Q29. Image Alignment Layout (Left, Center, Right)</h2>
        <div class="question-desc"><strong>Problem Statement:</strong> Create an HTML file displaying three images positioned at LEFT, RIGHT, and CENTER across the browser line.</div>
        <div class="timer-box">
          <span>⏱ Practice Timer (Recommended: 8 mins)</span>
          <div class="timer-controls"><span class="timer-display" id="timer-29">00:00</span> <button class="timer-btn" onclick="toggleTimer(29)">Start Timer</button></div>
        </div>
        <div class="code-header"><span class="code-section-title">Solution Code:</span></div>
        <pre><code class="language-html" id="code-snippet-29">&lt;!DOCTYPE html&gt;
&lt;html&gt;
&lt;head&gt;
  &lt;style&gt;
    .image-container { display: flex; justify-content: space-between; align-items: center; padding: 10px; }
    .img-box { text-align: center; font-family: Arial; font-size: 12px; font-weight: bold; }
    img { border: 2px solid #333; border-radius: 6px; }
  &lt;/style&gt;
&lt;/head&gt;
&lt;body&gt;
  &lt;h3 style="text-align:center;"&gt;Image Alignment (Left, Center, Right)&lt;/h3&gt;
  &lt;div class="image-container"&gt;
    &lt;div class="img-box"&gt;
      &lt;img src="https://via.placeholder.com/100/ff6600/ffffff?text=Left" alt="Left"&gt;
      &lt;div&gt;LEFT&lt;/div&gt;
    &lt;/div&gt;
    &lt;div class="img-box"&gt;
      &lt;img src="https://via.placeholder.com/100/007bff/ffffff?text=Center" alt="Center"&gt;
      &lt;div&gt;CENTER&lt;/div&gt;
    &lt;/div&gt;
    &lt;div class="img-box"&gt;
      &lt;img src="https://via.placeholder.com/100/28a745/ffffff?text=Right" alt="Right"&gt;
      &lt;div&gt;RIGHT&lt;/div&gt;
    &lt;/div&gt;
  &lt;/div&gt;
&lt;/body&gt;
&lt;/html&gt;</code></pre>
        <div class="btn-group">
          <button class="btn-action try-code-btn" onclick="openCompilerTab(29, 'html')">▶ Try Code</button>
          <button class="btn-action show-result-btn" id="toggle-btn-29" onclick="toggleResult(29, 'html')">⚡ Show Result</button>
          <button class="btn-action complete-btn" id="mark-btn-29" onclick="toggleCompletion(29)">✔ Mark Done</button>
        </div>
        <div class="accordion-box">
          <div class="accordion-header" onclick="toggleAccordion(29)"><span>💡 How this code works</span><span id="acc-icon-29">➕</span></div>
          <div class="accordion-body" id="acc-body-29">Uses <code>justify-content: space-between</code> in Flexbox to position three images cleanly at Left, Center, and Right.</div>
        </div>
        <div id="result-box-29" class="result-container"><div class="result-header">Live Output Window</div><div id="iframe-holder-29"></div></div>
        <div class="pagination-group"><button class="btn-page" onclick="switchProgram(28)">◀ Previous</button><button class="btn-page" onclick="switchProgram(30)">Next ▶</button></div>
      </div>

      <!-- PRACTICAL 30 -->
      <div id="prog-30" class="program-content">
        <div class="meta-tags"><span class="badge badge-tag">HTML Form Validation</span><span class="badge badge-medium">Medium</span><span class="badge badge-marks">Weightage: 15 Marks</span></div>
        <h2 class="question-title">Q30. Complete Student Registration Form with JS Validation</h2>
        <div class="question-desc"><strong>Problem Statement:</strong> Create an HTML Student Registration Form with JavaScript validation checking empty fields before submission.</div>
        <div class="timer-box">
          <span>⏱ Practice Timer (Recommended: 12 mins)</span>
          <div class="timer-controls"><span class="timer-display" id="timer-30">00:00</span> <button class="timer-btn" onclick="toggleTimer(30)">Start Timer</button></div>
        </div>
        <div class="code-header"><span class="code-section-title">Solution Code:</span></div>
        <pre><code class="language-html" id="code-snippet-30">&lt;!DOCTYPE html&gt;
&lt;html&gt;
&lt;head&gt;
  &lt;style&gt;
    body { font-family: Arial, sans-serif; padding: 15px; }
    .reg-form { width: 320px; border: 1px solid #ccc; padding: 15px; border-radius: 8px; margin: auto; }
    .form-group { margin-bottom: 12px; }
    label { display: block; font-weight: bold; margin-bottom: 4px; }
    input[type="text"], input[type="email"] { width: 100%; padding: 8px; box-sizing: border-box; }
    button { background: #ff6600; color: #fff; border: none; padding: 8px 16px; width: 100%; cursor: pointer; border-radius: 4px; }
  &lt;/style&gt;
&lt;/head&gt;
&lt;body&gt;
  &lt;div class="reg-form"&gt;
    &lt;h3 style="text-align:center; color:#ff6600;"&gt;Student Registration&lt;/h3&gt;
    &lt;form onsubmit="return validateForm()"&gt;
      &lt;div class="form-group"&gt;
        &lt;label&gt;Full Name:&lt;/label&gt;
        &lt;input type="text" id="fullname" placeholder="Enter full name"&gt;
      &lt;/div&gt;
      &lt;div class="form-group"&gt;
        &lt;label&gt;Email Address:&lt;/label&gt;
        &lt;input type="email" id="email" placeholder="Enter email address"&gt;
      &lt;/div&gt;
      &lt;button type="submit"&gt;Register Now&lt;/button&gt;
    &lt;/form&gt;
  &lt;/div&gt;

  &lt;script&gt;
    function validateForm() {
      let name = document.getElementById('fullname').value;
      let email = document.getElementById('email').value;
      if (name.trim() === "" || email.trim() === "") {
        alert("Validation Error: Please fill in all required fields!");
        return false;
      }
      alert("Registration Successful!");
      return true;
    }
  &lt;/script&gt;
&lt;/body&gt;
&lt;/html&gt;</code></pre>
        <div class="btn-group">
          <button class="btn-action try-code-btn" onclick="openCompilerTab(30, 'html')">▶ Try Code</button>
          <button class="btn-action show-result-btn" id="toggle-btn-30" onclick="toggleResult(30, 'html')">⚡ Show Result</button>
          <button class="btn-action complete-btn" id="mark-btn-30" onclick="toggleCompletion(30)">✔ Mark Done</button>
        </div>
        <div class="accordion-box">
          <div class="accordion-header" onclick="toggleAccordion(30)"><span>💡 How this code works</span><span id="acc-icon-30">➕</span></div>
          <div class="accordion-body" id="acc-body-30">Intercepts standard form submission via <code>onsubmit="return validateForm()"</code>, ensuring fields are verified before submission.</div>
        </div>
        <div id="result-box-30" class="result-container"><div class="result-header">Live Output Window</div><div id="iframe-holder-30"></div></div>
        <div class="pagination-group"><button class="btn-page" onclick="switchProgram(29)">◀ Previous</button><button class="btn-page" disabled>Next ▶</button></div>
      </div>

    </div>
  </div>

</div>

<!-- Prism.js Scripts -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/prism/1.29.0/prism.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/prism/1.29.0/components/prism-markup.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/prism/1.29.0/components/prism-css.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/prism/1.29.0/components/prism-javascript.min.js"></script>

<script>
  var TOTAL_PROGRAMS = 30;
  var completedPrograms = JSON.parse(localStorage.getItem('gyanxp_m2_completed')) || [];
  var activeTimers = {};

  function scrollIndexSidebar(offset) {
    var sidebarList = document.getElementById('sidebar-list');
    if (sidebarList) {
      sidebarList.scrollBy({ left: offset, behavior: 'smooth' });
    }
  }

  document.addEventListener("DOMContentLoaded", function() { updateProgressUI(); });

  function switchProgram(progId) {
    document.querySelectorAll('.program-content').forEach(function(el) { el.classList.remove('active'); });
    document.querySelectorAll('.nav-btn').forEach(function(btn) { btn.classList.remove('active'); });

    var targetProg = document.getElementById('prog-' + progId);
    var targetBtn = document.getElementById('side-btn-' + progId);

    if (targetProg) targetProg.classList.add('active');
    if (targetBtn) {
      targetBtn.classList.add('active');
      targetBtn.scrollIntoView({ behavior: 'smooth', block: 'nearest', inline: 'center' });
    }
  }

  function openCompilerTab(progId, language) {
    var codeText = document.getElementById('code-snippet-' + progId).innerText;
    localStorage.setItem('pendingCode', codeText);
    localStorage.setItem('pendingLang', language);
    window.open('/online-web-compiler/', '_blank');
  }

  function toggleResult(progId, language) {
    var resultBox = document.getElementById('result-box-' + progId);
    var iframeHolder = document.getElementById('iframe-holder-' + progId);
    var toggleBtn = document.getElementById('toggle-btn-' + progId);
    var codeText = document.getElementById('code-snippet-' + progId).innerText;

    if (resultBox.style.display === 'block') {
      resultBox.style.display = 'none';
      iframeHolder.innerHTML = '';
      toggleBtn.innerText = '⚡ Show Result';
      toggleBtn.classList.remove('active-btn');
    } else {
      resultBox.style.display = 'block';
      toggleBtn.innerText = '✕ Hide Result';
      toggleBtn.classList.add('active-btn');
      
      var iframe = document.createElement('iframe');
      iframe.style.width = '100%';
      iframe.style.border = 'none';
      iframeHolder.innerHTML = '';
      iframeHolder.appendChild(iframe);

      var doc = iframe.contentWindow.document;
      doc.open();
      doc.write(codeText);
      doc.close();
    }
  }

  function toggleAccordion(progId) {
    var body = document.getElementById('acc-body-' + progId);
    var icon = document.getElementById('acc-icon-' + progId);
    body.style.display = (body.style.display === 'block') ? 'none' : 'block';
    if (icon) icon.innerText = (body.style.display === 'block') ? '➖' : '➕';
  }

  function toggleTimer(progId) {
    var timerDisplay = document.getElementById('timer-' + progId);
    var timerBtn = timerDisplay.nextElementSibling;
    if (activeTimers[progId]) {
      clearInterval(activeTimers[progId].interval);
      delete activeTimers[progId];
      timerBtn.innerText = 'Start Timer';
    } else {
      var seconds = 0;
      timerBtn.innerText = 'Stop Timer';
      activeTimers[progId] = {
        interval: setInterval(function() {
          seconds++;
          var mins = Math.floor(seconds / 60);
          var secs = seconds % 60;
          timerDisplay.innerText = (mins < 10 ? '0' : '') + mins + ':' + (secs < 10 ? '0' : '') + secs;
        }, 1000)
      };
    }
  }

  function toggleCompletion(progId) {
    var index = completedPrograms.indexOf(progId);
    if (index > -1) completedPrograms.splice(index, 1);
    else completedPrograms.push(progId);
    localStorage.setItem('gyanxp_m2_completed', JSON.stringify(completedPrograms));
    updateProgressUI();
  }

  function updateProgressUI() {
    for (var i = 1; i <= TOTAL_PROGRAMS; i++) {
      var markBtn = document.getElementById('mark-btn-' + i);
      var dot = document.getElementById('dot-' + i);
      if (completedPrograms.includes(i)) {
        if (markBtn) { markBtn.innerText = '✔ Practiced'; markBtn.classList.add('done'); }
        if (dot) dot.innerText = '🟢';
      } else {
        if (markBtn) { markBtn.innerText = '✔ Mark Done'; markBtn.classList.remove('done'); }
        if (dot) dot.innerText = '⚪';
      }
    }
    var percentage = Math.round((completedPrograms.length / TOTAL_PROGRAMS) * 100);
    document.getElementById('progress-fill').style.width = percentage + '%';
    document.getElementById('progress-text').innerText = completedPrograms.length + ' / ' + TOTAL_PROGRAMS + ' Practiced (' + percentage + '%)';
  }
</script>				</div>
				</div>
					</div>
		</div>
					</div>
		</section>
				</div>
		<p>The post <a href="https://gyanxp.com/online-web-practical-solution-pr2/">Online Web Practical Solution (PR2)</a> appeared first on <a href="https://gyanxp.com">GyanXp</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://gyanxp.com/online-web-practical-solution-pr2/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Online Web Compiler</title>
		<link>https://gyanxp.com/online-web-compiler/</link>
					<comments>https://gyanxp.com/online-web-compiler/#respond</comments>
		
		<dc:creator><![CDATA[Balmukund Maurya]]></dc:creator>
		<pubDate>Mon, 17 Aug 2026 12:41:42 +0000</pubDate>
				<category><![CDATA[Online Practical]]></category>
		<guid isPermaLink="false">https://gyanxp.com/?p=6202</guid>

					<description><![CDATA[<p>Run Fullscreen</p>
<p>The post <a href="https://gyanxp.com/online-web-compiler/">Online Web Compiler</a> appeared first on <a href="https://gyanxp.com">GyanXp</a>.</p>
]]></description>
										<content:encoded><![CDATA[		<div data-elementor-type="wp-post" data-elementor-id="6202" class="elementor elementor-6202">
						<section class="elementor-section elementor-top-section elementor-element elementor-element-20076a9 elementor-section-boxed elementor-section-height-default elementor-section-height-default" data-id="20076a9" data-element_type="section" data-e-type="section">
						<div class="elementor-container elementor-column-gap-default">
					<div class="elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-7b72d43" data-id="7b72d43" data-element_type="column" data-e-type="column">
			<div class="elementor-widget-wrap elementor-element-populated">
						<div class="elementor-element elementor-element-e5324a0 elementor-widget elementor-widget-html" data-id="e5324a0" data-element_type="widget" data-e-type="widget" data-widget_type="html.default">
				<div class="elementor-widget-container">
					<style>
  /* Base Container */
  .compiler-container {
    width: 100%;
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    box-sizing: border-box;
  }

  /* Top Toolbar */
  .compiler-toolbar {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
  }

  /* Action Buttons */
  .custom-run-btn,
  .fullscreen-toggle-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 34px;
    padding: 0 16px;
    color: #ffffff;
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    transition: background-color 0.2s ease;
    user-select: none;
  }

  .custom-run-btn {
    background-color: #e91e63;
  }

  .custom-run-btn:hover {
    background-color: #d81b60;
  }

  .fullscreen-toggle-btn {
    background-color: #333333;
  }

  .fullscreen-toggle-btn:hover {
    background-color: #444444;
  }

  /* Editor Frame Wrapper */
  .compiler-wrapper {
    width: 100%;
    height: 480px;
    margin: 0;
    padding: 0;
    background-color: #1e1e1e;
    border-radius: 8px;
    overflow: hidden;
  }

  .compiler-wrapper iframe {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
  }

  /* Fullscreen Overlay */
  .compiler-container.is-fullscreen {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    height: 100dvh !important;
    z-index: 9999999 !important;
    background-color: #1e1e1e !important;
    padding: 10px !important;
    box-sizing: border-box !important;
    display: flex !important;
    flex-direction: column !important;
  }

  .compiler-container.is-fullscreen .compiler-toolbar {
    flex-shrink: 0;
  }

  .compiler-container.is-fullscreen .compiler-wrapper {
    flex: 1 !important;
    width: 100% !important;
    height: 100% !important;
    border-radius: 4px !important;
  }
</style>

<div id="compiler-container" class="compiler-container">
  <div class="compiler-toolbar">
    <button id="custom-run-btn" class="custom-run-btn" type="button" title="Run Code">
      <svg width="14" height="14" viewBox="0 0 24 24" fill="currentColor">
        <path d="M8 5v14l11-7z"/>
      </svg>
      Run
    </button>

    <button id="fullscreen-btn" class="fullscreen-toggle-btn" type="button" title="Toggle Fullscreen">
      <svg id="fullscreen-icon" width="14" height="14" viewBox="0 0 24 24" fill="currentColor">
        <path d="M7 14H5v5h5v-2H7v-3zm-2-4h2V7h3V5H5v5zm12 7h-3v2h5v-5h-2v3zM14 5v2h3v3h2V5h-5z"/>
      </svg>
      <span id="fullscreen-text">Fullscreen</span>
    </button>
  </div>

  <div class="compiler-wrapper">
    <iframe 
      id="oc-editor"
      src="https://onecompiler.com/embed/html?listenToEvents=true&theme=dark" 
      width="100%" 
      height="100%"
      allow="fullscreen"
      allowfullscreen="true">
    </iframe>
  </div>
</div>

<script>
  (function () {
    var iframe = document.getElementById('oc-editor');
    var runBtn = document.getElementById('custom-run-btn');
    var fullscreenBtn = document.getElementById('fullscreen-btn');
    var container = document.getElementById('compiler-container');
    var fullscreenText = document.getElementById('fullscreen-text');
    var fullscreenIcon = document.getElementById('fullscreen-icon');

    // 1. Trigger Run Programmatically via OneCompiler API
    function triggerRunCode() {
      if (iframe && iframe.contentWindow) {
        iframe.contentWindow.postMessage({
          eventType: 'triggerRun'
        }, 'https://onecompiler.com');
      }
    }

    runBtn.addEventListener('click', function (e) {
      e.preventDefault();
      triggerRunCode();
    });

    // 2. Fullscreen Toggle (Native API with CSS Overlay Fallback)
    function toggleFullscreen() {
      var isFullscreenCSS = container.classList.contains('is-fullscreen');

      if (!document.fullscreenElement && !isFullscreenCSS) {
        if (container.requestFullscreen) {
          container.requestFullscreen().catch(function () {
            container.classList.add('is-fullscreen');
            updateUI(true);
          });
        } else {
          container.classList.add('is-fullscreen');
          updateUI(true);
        }
      } else {
        if (document.exitFullscreen && document.fullscreenElement) {
          document.exitFullscreen();
        } else {
          container.classList.remove('is-fullscreen');
          updateUI(false);
        }
      }
    }

    function updateUI(isFull) {
      if (isFull) {
        fullscreenText.textContent = "Exit Fullscreen";
        fullscreenIcon.innerHTML = '<path d="M5 16h3v3h2v-5H5v2zm3-8H5v2h5V5H8v3zm6 11h2v-3h3v-2h-5v5zm2-11V5h-2v5h5V8h-3z"/>';
        document.body.style.overflow = 'hidden';
      } else {
        fullscreenText.textContent = "Fullscreen";
        fullscreenIcon.innerHTML = '<path d="M7 14H5v5h5v-2H7v-3zm-2-4h2V7h3V5H5v5zm12 7h-3v2h5v-5h-2v3zM14 5v2h3v3h2V5h-5z"/>';
        document.body.style.overflow = '';
      }
    }

    document.addEventListener('fullscreenchange', function () {
      updateUI(!!document.fullscreenElement);
    });

    fullscreenBtn.addEventListener('click', function (e) {
      e.preventDefault();
      toggleFullscreen();
    });

    // 3. Simple Default Code Population with GyanXp Message
    iframe.addEventListener('load', function () {
      var codeText = localStorage.getItem('pendingCode');
      var lang = localStorage.getItem('pendingLang') || 'html';

      // Very simple default code featuring GyanXp
      var defaultCode = '<!DOCTYPE html>\n<html>\n<head>\n  <style>\n    body {\n      font-family: Arial, sans-serif;\n      text-align: center;\n      margin-top: 50px;\n      background-color: #f4f4f4;\n    }\n    h1 {\n      color: #ff6600;\n    }\n    p {\n      color: #333;\n      font-size: 18px;\n    }\n  </style>\n</head>\n<body>\n\n  <h1>Welcome to GyanXp!</h1>\n  <p>Learn Web Designing with Ease.</p>\n\n</body>\n</html>';

      var finalCode = codeText ? codeText : defaultCode;

      // Delayed handshake to ensure OneCompiler listener is ready
      setTimeout(function () {
        iframe.contentWindow.postMessage({
          eventType: 'populateCode',
          language: lang,
          files: [{ name: 'index.html', content: finalCode }]
        }, 'https://onecompiler.com');

        setTimeout(function () {
          triggerRunCode();
          if (codeText) {
            localStorage.removeItem('pendingCode');
            localStorage.removeItem('pendingLang');
          }
        }, 500);
      }, 1000);
    });
  })();
</script>				</div>
				</div>
					</div>
		</div>
					</div>
		</section>
				</div>
		<p>The post <a href="https://gyanxp.com/online-web-compiler/">Online Web Compiler</a> appeared first on <a href="https://gyanxp.com">GyanXp</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://gyanxp.com/online-web-compiler/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Online Python Practical Solution (PR3)</title>
		<link>https://gyanxp.com/online-python-practical-solution/</link>
					<comments>https://gyanxp.com/online-python-practical-solution/#respond</comments>
		
		<dc:creator><![CDATA[Balmukund Maurya]]></dc:creator>
		<pubDate>Wed, 12 Aug 2026 07:46:41 +0000</pubDate>
				<category><![CDATA[Online Practical]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<guid isPermaLink="false">https://gyanxp.com/?p=5917</guid>

					<description><![CDATA[<p>O Level Python Practical Solutions (M3-R5) Practice 50+ NIELIT practical exam questions with dynamic code runners, timer tracking, and instant solutions! 📚 Practical Completion Progress 0 / 51 Practiced (0%) 📑 Practical Index ◀ ▶</p>
<p>The post <a href="https://gyanxp.com/online-python-practical-solution/">Online Python Practical Solution (PR3)</a> appeared first on <a href="https://gyanxp.com">GyanXp</a>.</p>
]]></description>
										<content:encoded><![CDATA[		<div data-elementor-type="wp-post" data-elementor-id="5917" class="elementor elementor-5917">
						<section class="elementor-section elementor-top-section elementor-element elementor-element-22ce531 elementor-section-boxed elementor-section-height-default elementor-section-height-default" data-id="22ce531" data-element_type="section" data-e-type="section">
						<div class="elementor-container elementor-column-gap-default">
					<div class="elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-eb0ad13" data-id="eb0ad13" data-element_type="column" data-e-type="column">
			<div class="elementor-widget-wrap elementor-element-populated">
						<div class="elementor-element elementor-element-135feea elementor-widget__width-initial elementor-widget elementor-widget-html" data-id="135feea" data-element_type="widget" data-e-type="widget" data-widget_type="html.default">
				<div class="elementor-widget-container">
					<!-- Google Fonts & Prism.js Syntax Highlighting -->
<link href="https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700&display=swap" rel="stylesheet">
<link href="https://cdnjs.cloudflare.com/ajax/libs/prism/1.29.0/themes/prism-tomorrow.min.css" rel="stylesheet" />

<style>
  :root {
    --gyanxp-orange: #ff6600;
    --gyanxp-orange-hover: #e65c00;
    --gyanxp-dark: #1f2421;
    --gyanxp-accent-blue: #007bff;
    --gyanxp-bg: #f8f9fa;
    --gyanxp-card-bg: #ffffff;
    --gyanxp-danger: #dc3545;
    --gyanxp-success: #28a745;
  }

  /* Universal Box-Sizing & Reset */
  .gyanxp-full-page,
  .gyanxp-full-page * {
    box-sizing: border-box !important;
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  }

  /* Full Width Outer Container */
  .gyanxp-full-page {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: clamp(10px, 2vw, 24px) !important;
    background-color: var(--gyanxp-bg);
  }

  /* =========================================================
     TOP BOX 1: FULL WIDTH HEADER BANNER
     ========================================================= */
  .gyanxp-page-header {
    width: 100% !important;
    margin: 0 0 16px 0 !important;
    background: linear-gradient(135deg, var(--gyanxp-dark) 0%, #2c302e 100%) !important;
    color: #ffffff !important;
    padding: clamp(16px, 2.5vw, 24px) clamp(18px, 3vw, 30px) !important;
    border-radius: 12px !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05) !important;
    border: 1px solid #2c302e !important;
    border-left: 6px solid var(--gyanxp-orange) !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 6px !important;
  }

  .gyanxp-page-header h1 {
    margin: 0 !important;
    padding: 0 !important;
    font-size: clamp(20px, 2.8vw, 28px) !important;
    font-weight: 700 !important;
    line-height: 1.35 !important;
    color: #ffffff !important;
  }

  .gyanxp-page-header p {
    margin: 0 !important;
    padding: 0 !important;
    font-size: clamp(13px, 1.8vw, 15px) !important;
    color: #d1d5db !important;
    line-height: 1.5 !important;
  }

  /* =========================================================
     TOP BOX 2: FULL WIDTH PROGRESS WIDGET
     ========================================================= */
  .progress-widget {
    width: 100% !important;
    margin: 0 0 20px 0 !important;
    background: var(--gyanxp-card-bg) !important;
    padding: clamp(16px, 2vw, 20px) clamp(18px, 3vw, 30px) !important;
    border-radius: 12px !important;
    border: 1px solid #e9ecef !important;
    border-left: 6px solid var(--gyanxp-orange) !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04) !important;
  }

  .progress-info {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    flex-wrap: wrap !important;
    gap: 8px 12px !important;
    margin-bottom: 12px !important;
  }

  .progress-title {
    font-size: clamp(13.5px, 2vw, 15px) !important;
    font-weight: 600 !important;
    color: var(--gyanxp-dark) !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px !important;
  }

  .progress-counter-badge {
    font-size: clamp(12px, 1.8vw, 13.5px) !important;
    font-weight: 600 !important;
    color: var(--gyanxp-orange) !important;
    background: #fff0e6 !important;
    padding: 4px 14px !important;
    border-radius: 20px !important;
    border: 1px solid rgba(255, 102, 0, 0.2) !important;
    white-space: nowrap !important;
  }

  .progress-bar-bg {
    width: 100% !important;
    height: 10px !important;
    background: #e9ecef !important;
    border-radius: 10px !important;
    overflow: hidden !important;
  }

  .progress-bar-fill {
    height: 100% !important;
    width: 0% !important;
    background: linear-gradient(90deg, var(--gyanxp-orange), #ff9933) !important;
    transition: width 0.4s ease-in-out !important;
  }

  /* =========================================================
     FULL WIDTH PRACTICAL GRID LAYOUT
     ========================================================= */
  .practical-layout {
    width: 100% !important;
    display: grid !important;
    grid-template-columns: 320px 1fr !important;
    gap: 20px !important;
    align-items: start !important;
    margin: 0 !important;
  }

  /* Sidebar (Practical Index) */
  .program-sidebar {
    width: 100% !important;
    background: var(--gyanxp-card-bg);
    border-radius: 12px;
    padding: 18px 16px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
    position: sticky;
    top: 15px;
    border: 1px solid #e9ecef;
  }

  .sidebar-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--gyanxp-dark);
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--gyanxp-orange);
  }

  .sidebar-scroll-wrapper {
    position: relative;
    width: 100%;
  }

  .program-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: calc(100vh - 220px);
    overflow-y: auto;
    padding-right: 4px;
    scroll-behavior: smooth;
  }

  /* Floating Scroll Arrows for Small Screens */
  .sidebar-nav-arrow {
    display: none;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(4px);
    color: var(--gyanxp-dark);
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    cursor: pointer;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    transition: all 0.2s ease;
  }

  .sidebar-nav-arrow:hover {
    background: #ffffff;
    color: var(--gyanxp-orange);
  }

  .sidebar-nav-prev { left: -8px; }
  .sidebar-nav-next { right: -8px; }

  .nav-btn {
    width: 100%;
    text-align: left;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    padding: 12px 14px;
    border-radius: 8px;
    font-size: 13.5px;
    font-weight: 600;
    color: var(--gyanxp-dark);
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-height: 44px;
  }

  .nav-btn:hover { background: #fff0e6; color: var(--gyanxp-orange); border-color: var(--gyanxp-orange); }
  .nav-btn.active { background: var(--gyanxp-orange); color: #ffffff; border-color: var(--gyanxp-orange); box-shadow: 0 3px 8px rgba(255, 102, 0, 0.25); }

  /* Workspace Card */
  .program-workspace {
    width: 100% !important;
    background: var(--gyanxp-card-bg);
    border-radius: 12px;
    padding: clamp(18px, 2.5vw, 30px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
    border: 1px solid #e9ecef;
    min-width: 0;
  }

  .program-content { display: none; }
  .program-content.active { display: block; }

  .meta-tags { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
  .badge { font-size: 11px; font-weight: 700; padding: 4px 10px; border-radius: 20px; text-transform: uppercase; }
  .badge-tag { background: #fff0e6; color: var(--gyanxp-orange); }
  .badge-easy { background: #e6f4ea; color: #137333; }
  .badge-medium { background: #fef7e0; color: #b06000; }
  .badge-hard { background: #fce8e6; color: #c5221f; }
  .badge-marks { background: #e8f0fe; color: #1a73e8; }

  .question-title { font-size: clamp(18px, 2.2vw, 22px); font-weight: 700; color: var(--gyanxp-dark); margin: 0 0 12px 0; line-height: 1.4; }
  .question-desc { font-size: clamp(13px, 1.8vw, 14px); color: #555; line-height: 1.6; margin-bottom: 18px; background: #fffcf9; padding: 14px 16px; border-radius: 8px; border-left: 4px solid var(--gyanxp-orange); }

  /* Timer Box */
  .timer-box { 
    display: flex; 
    align-items: center; 
    justify-content: space-between; 
    background: #f1f3f5; 
    padding: 10px 16px; 
    border-radius: 8px; 
    margin-bottom: 18px; 
    font-size: 13.5px; 
    font-weight: 600; 
    flex-wrap: wrap; 
    gap: 10px; 
  }
  .timer-controls { display: inline-flex; align-items: center; gap: 8px; }
  .timer-display { font-family: monospace; font-size: 15px; color: var(--gyanxp-orange); background: #ffffff; padding: 4px 10px; border-radius: 4px; border: 1px solid #ced4da; line-height: 1; }
  .timer-btn { background: var(--gyanxp-dark); color: #fff; border: none; padding: 6px 14px; border-radius: 4px; cursor: pointer; font-size: 12.5px; font-weight: 500; }
  .timer-btn:hover { background: #000; }

  /* Code Section */
  .code-header { margin-bottom: 6px; }
  .code-section-title { font-size: 14px; font-weight: 600; color: var(--gyanxp-dark); }
  .program-workspace pre { border-radius: 8px; margin: 0 0 18px 0; font-size: 13.5px; max-height: 500px; overflow: auto; }

  /* Action Buttons */
  .btn-group { display: flex; gap: 10px; margin-bottom: 18px; flex-wrap: wrap; }
  .btn-action { 
    border: none; 
    height: 40px;
    padding: 0 18px; 
    font-size: 13px; 
    font-weight: 600; 
    border-radius: 6px; 
    cursor: pointer; 
    transition: all 0.2s ease; 
    display: inline-flex; 
    align-items: center; 
    justify-content: center;
    gap: 6px; 
    user-select: none;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
  }
  .try-code-btn { background-color: var(--gyanxp-orange); color: #ffffff; }
  .try-code-btn:hover { background-color: var(--gyanxp-orange-hover); }
  
  .show-result-btn { background-color: var(--gyanxp-accent-blue); color: #ffffff; }
  .show-result-btn:hover { background-color: #0069d9; }
  .show-result-btn.active-btn { background-color: var(--gyanxp-danger); }
  .show-result-btn.active-btn:hover { background-color: #bd2130; }

  .complete-btn { background-color: #e9ecef; color: var(--gyanxp-dark); }
  .complete-btn:hover { background-color: #dde2e6; }
  .complete-btn.done { background-color: var(--gyanxp-success); color: #ffffff; }
  .complete-btn.done:hover { background-color: #218838; }

  /* Accordions */
  .accordion-box { margin-bottom: 18px; border: 1px solid #e9ecef; border-radius: 8px; overflow: hidden; }
  .accordion-header { background: #f8f9fa; padding: 12px 16px; font-size: 13.5px; font-weight: 600; color: var(--gyanxp-dark); cursor: pointer; display: flex; justify-content: space-between; align-items: center; user-select: none; }
  .accordion-body { display: none; padding: 14px 16px; font-size: 13.5px; color: #444; line-height: 1.6; background: #ffffff; border-top: 1px solid #e9ecef; }

  /* Output Frame */
  .result-container { display: none; margin-top: 14px; margin-bottom: 18px; background: #000000; border-radius: 8px; overflow: hidden; border: 1px solid #333333; }
  .result-header { background: #1e1e1e; color: #a0aec0; font-size: 11px; padding: 8px 14px; text-transform: uppercase; font-weight: 700; border-bottom: 1px solid #333333; }
  .result-container iframe { width: 100%; height: 400px; border: none; display: block; }

  /* Pagination */
  .pagination-group { display: flex; justify-content: space-between; margin-top: 24px; padding-top: 18px; border-top: 1px dashed #e9ecef; gap: 10px; }
  .btn-page { 
    height: 40px;
    padding: 0 20px; 
    background-color: #f1f3f5; 
    color: var(--gyanxp-dark); 
    border: 1px solid #ced4da; 
    font-size: 13px; 
    font-weight: 600; 
    border-radius: 6px; 
    cursor: pointer; 
    display: inline-flex; 
    align-items: center; 
    justify-content: center;
    transition: all 0.2s ease;
  }
  .btn-page:hover:not(:disabled) { background-color: var(--gyanxp-orange); color: #ffffff; border-color: var(--gyanxp-orange); }
  .btn-page:disabled { opacity: 0.4; cursor: not-allowed; }

  /* =========================================================
     RESPONSIVE (MOBILE & TABLET): FLUID INDEX BAR
     ========================================================= */
  @media (max-width: 992px) {
    .practical-layout { 
      grid-template-columns: 100% !important; 
      gap: 15px !important; 
    }
    
    .program-sidebar { 
      position: static; 
      width: 100% !important;
      padding: 12px 14px; 
      border-radius: 12px;
    }
    
    .sidebar-title { 
      font-size: 14px; 
      margin-bottom: 8px; 
    }

    .sidebar-nav-arrow {
      display: inline-flex;
    }

    .program-list {
      flex-direction: row;
      overflow-x: auto;
      max-height: none;
      padding: 4px 20px 8px 20px;
      gap: 8px;
      scroll-snap-type: x mandatory;
      -webkit-overflow-scrolling: touch;
      scrollbar-width: none;
    }
    .program-list::-webkit-scrollbar {
      display: none;
    }

    .nav-btn {
      white-space: nowrap;
      width: auto;
      flex-shrink: 0;
      padding: 6px 16px;
      font-size: 12.5px;
      min-height: 38px;
      border-radius: 20px;
      gap: 8px;
      scroll-snap-align: center;
    }

    .program-workspace { 
      padding: 18px 14px; 
      border-radius: 12px;
    }

    .btn-group { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
    .btn-action { width: 100%; height: 40px; font-size: 12.5px; padding: 0 10px; }
    .btn-action.complete-btn { grid-column: span 2; }
    .pagination-group .btn-page { flex: 1; height: 40px; }
    .result-container iframe { height: 280px; }
  }

  @media (max-width: 480px) {
    .btn-group { grid-template-columns: 1fr; }
    .btn-action.complete-btn { grid-column: auto; }
    .timer-box { flex-direction: column; align-items: flex-start; }
    .timer-controls { width: 100%; justify-content: space-between; }
  }
</style>

<div class="gyanxp-full-page">
  
  <!-- Uniform Full Width Header Banner -->
  <div class="gyanxp-page-header">
    <h1>O Level Python Practical Solutions (M3-R5)</h1>
    <p>Practice 50+ NIELIT practical exam questions with dynamic code runners, timer tracking, and instant solutions!</p>
  </div>

  <!-- Uniform Full Width Progress Widget -->
  <div class="progress-widget">
    <div class="progress-info">
      <span class="progress-title">📚 Practical Completion Progress</span>
      <span class="progress-counter-badge" id="progress-text">0 / 51 Practiced (0%)</span>
    </div>
    <div class="progress-bar-bg">
      <div class="progress-bar-fill" id="progress-fill"></div>
    </div>
  </div>

  <!-- Full Width Practical Grid Layout -->
  <div class="practical-layout">
    
    <!-- Practical Index Sidebar with Live Dynamic Count -->
    <div class="program-sidebar">
      <div class="sidebar-title" id="sidebar-main-title">📑 Practical Index</div>
      <div class="sidebar-scroll-wrapper">
        <button class="sidebar-nav-arrow sidebar-nav-prev" onclick="scrollIndexSidebar(-140)" title="Previous Programs">◀</button>
        <div class="program-list" id="sidebar-list"></div>
        <button class="sidebar-nav-arrow sidebar-nav-next" onclick="scrollIndexSidebar(140)" title="Next Programs">▶</button>
      </div>
    </div>

    <!-- Main Workspace -->
    <div class="program-workspace" id="workspace-container"></div>
  </div>

</div>

<!-- Prism.js Scripts -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/prism/1.29.0/prism.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/prism/1.29.0/components/prism-python.min.js"></script>

<script>
  /* =========================================================================
     50+ NIELIT O-LEVEL PYTHON (M3-R5) PRACTICAL QUESTIONS
     ========================================================================= */
  var programsData = [
    {
      id: 1,
      title: "Q1. Calculator Program using Python Functions",
      problem: "By using Python functions design a small calculator program having four operations: addition, subtraction, multiplication, and division.",
      difficulty: "Easy",
      marks: 10,
      timerMins: 8,
      explanation: "Define separate functions for <code>add()</code>, <code>subtract()</code>, <code>multiply()</code>, and <code>divide()</code> with zero-division handling.",
      code: `def add(a, b): return a + b
def subtract(a, b): return a - b
def multiply(a, b): return a * b
def divide(a, b): return a / b if b != 0 else "Error: Div by 0"

num1, num2 = 20, 5
print(f"{num1} + {num2} = {add(num1, num2)}")
print(f"{num1} - {num2} = {subtract(num1, num2)}")
print(f"{num1} * {num2} = {multiply(num1, num2)}")
print(f"{num1} / {num2} = {divide(num1, num2)}")`
    },
    {
      id: 2,
      title: "Q2. Sum of Digits of an Integer using While Loop",
      problem: "Write a python program to find the sum of digits of an integer number using while loop.",
      difficulty: "Easy",
      marks: 10,
      timerMins: 6,
      explanation: "Extract the last digit using modulus <code>% 10</code> and trim the number using integer floor division <code>// 10</code> until it becomes 0.",
      code: `num = 12345
total = 0
temp = num
while temp > 0:
    total += temp % 10
    temp //= 10

print(f"Sum of digits of {num} is: {total}")`
    },
    {
      id: 3,
      title: "Q3. Find Odd Numbers in an Array / List",
      problem: "Write a python program to find the odd numbers in an array.",
      difficulty: "Easy",
      marks: 10,
      timerMins: 5,
      explanation: "Iterate through elements and check if element modulo 2 is not equal to 0 (<code>x % 2 != 0</code>).",
      code: `arr = [12, 17, 24, 39, 40, 55, 60, 71]
odds = [x for x in arr if x % 2 != 0]
print("Original Array:", arr)
print("Odd Numbers:", odds)`
    },
    {
      id: 4,
      title: "Q4. Swap First Two Characters of Two Strings",
      problem: "Write a Python program for: Input = 'abc', 'xyz' -> Output = 'xyc abz'",
      difficulty: "Medium",
      marks: 15,
      timerMins: 8,
      explanation: "Use string slicing to swap the first 2 characters: <code>s2[:2] + s1[2:]</code> and <code>s1[:2] + s2[2:]</code>.",
      code: `str1 = "abc"
str2 = "xyz"

new_str1 = str2[:2] + str1[2:]
new_str2 = str1[:2] + str2[2:]

print(f"Input:  '{str1}', '{str2}'")
print(f"Output: '{new_str1} {new_str2}'")`
    },
    {
      id: 5,
      title: "Q5. Print Full Pyramid using *",
      problem: "Program to print full pyramid using * pattern.",
      difficulty: "Easy",
      marks: 10,
      timerMins: 6,
      explanation: "On row <code>i</code>, print <code>(n - i)</code> leading spaces and repeat <code>'* '</code> <code>i</code> times.",
      code: `rows = 5
for i in range(1, rows + 1):
    print(" " * (rows - i) + "* " * i)`
    },
    {
      id: 6,
      title: "Q6. Number of Days Between Two Given Dates",
      problem: "Python Program to Find Number of Days Between Two Given Dates.",
      difficulty: "Easy",
      marks: 10,
      timerMins: 6,
      explanation: "Import <code>datetime.date</code> and compute difference directly using timedelta subtraction.",
      code: `from datetime import date

d1 = date(2026, 1, 1)
d2 = date(2026, 8, 15)
delta = d2 - d1
print(f"Days between {d1} and {d2}: {delta.days} days")`
    },
    {
      id: 7,
      title: "Q7. Sum of Numbers Between 100 and 500 Divisible by 2",
      problem: "Write a python function to find the sum of all numbers between 100 and 500 which are divisible by 2.",
      difficulty: "Easy",
      marks: 10,
      timerMins: 6,
      explanation: "Use <code>range(100, 501, 2)</code> to step only through even integers in that interval.",
      code: `def sum_even_range():
    return sum(x for x in range(100, 501) if x % 2 == 0)

print("Sum of even numbers (100 to 500):", sum_even_range())`
    },
    {
      id: 8,
      title: "Q8. Reverse a String",
      problem: "Write a python program to reverse a string.",
      difficulty: "Easy",
      marks: 5,
      timerMins: 4,
      explanation: "Use extended slice step <code>[::-1]</code> to reverse string sequence in linear time.",
      code: `text = "GyanXp Python"
reversed_text = text[::-1]
print(f"Original: '{text}'")
print(f"Reversed: '{reversed_text}'")`
    },
    {
      id: 9,
      title: "Q9. Count Repeated Characters in a String",
      problem: "Write a Python program to show character repetition count in 'thequickbrownfoxjumpsovorthelazydog'.",
      difficulty: "Medium",
      marks: 15,
      timerMins: 8,
      explanation: "Use a dictionary to track letter occurrences and filter characters with frequency > 1.",
      code: `s = 'thequickbrownfoxjumpsovorthelazydog'
counts = {}
for ch in s:
    counts[ch] = counts.get(ch, 0) + 1

print("Repeated Characters:")
for ch, count in counts.items():
    if count > 1:
        print(f"'{ch}': {count}")`
    },
    {
      id: 10,
      title: "Q10. Sum of Series 1^3 + 2^3 + ... + n^3",
      problem: "Write a Python program to print the sum of series 1^3 + 2^3 + ... + n^3 till n-th term.",
      difficulty: "Easy",
      marks: 10,
      timerMins: 6,
      explanation: "Iterate from 1 to n computing <code>i**3</code> or apply formula <code>((n*(n+1))//2)**2</code>.",
      code: `n = 5
series_sum = sum(i**3 for i in range(1, n + 1))
print(f"Sum of cubes up to {n} terms: {series_sum}")`
    },
    {
      id: 11,
      title: "Q11. Count Even and Odd Numbers in a List",
      problem: "Write a program to count even and odd numbers in list: [4, 7, 5, 64, 13, 18, 22, 29, 37].",
      difficulty: "Easy",
      marks: 10,
      timerMins: 6,
      explanation: "Iterate through elements: increment even counter if <code>x % 2 == 0</code>, otherwise increment odd counter.",
      code: `list1 = [4, 7, 5, 64, 13, 18, 22, 29, 37]
evens = sum(1 for x in list1 if x % 2 == 0)
odds = len(list1) - evens
print(f"Input: {list1}")
print(f"Count of even numbers: {evens}")
print(f"Count of odd numbers: {odds}")`
    },
    {
      id: 12,
      title: "Q12. Multiply Two Numbers by Repeated Addition",
      problem: "Write a Python program to multiply two numbers by repeated addition. Example: 6*3 = 6+6+6.",
      difficulty: "Easy",
      marks: 10,
      timerMins: 5,
      explanation: "Initialize product accumulator to 0 and add first number inside a loop running second number times.",
      code: `a, b = 6, 3
prod = 0
for _ in range(abs(b)):
    prod += a

if b < 0: prod = -prod
print(f"{a} * {b} (by repeated addition) = {prod}")`
    },
    {
      id: 13,
      title: "Q13. Count Words, Capital, Small Letters, and Symbols",
      problem: "Take a sentence as input and display number of words, capital letters, small letters, and special symbols.",
      difficulty: "Medium",
      marks: 15,
      timerMins: 10,
      explanation: "Use <code>.split()</code> for words; iterate through characters with <code>isupper()</code>, <code>islower()</code>, and symbols.",
      code: `text = "GyanXp O-Level 2026 Batch: #1 Exam Platform!"
words = len(text.split())
caps = sum(1 for c in text if c.isupper())
smalls = sum(1 for c in text if c.islower())
specials = sum(1 for c in text if not c.isalnum() and not c.isspace())

print(f"Sentence: '{text}'")
print(f"Words: {words}, Capital: {caps}, Small: {smalls}, Special Symbols: {specials}")`
    },
    {
      id: 14,
      title: "Q14. Sum of All Odd Numbers till 100",
      problem: "Write a Python program to find the sum of all odd numbers till 100.",
      difficulty: "Easy",
      marks: 5,
      timerMins: 4,
      explanation: "Sum sequence generated by <code>range(1, 101, 2)</code>.",
      code: `total = sum(range(1, 101, 2))
print("Sum of all odd numbers till 100 is:", total)`
    },
    {
      id: 15,
      title: "Q15. Check Leap Year",
      problem: "Write a program to Check Leap Year.",
      difficulty: "Easy",
      marks: 10,
      timerMins: 5,
      explanation: "A year is leap if <code>(year % 4 == 0 and year % 100 != 0) or (year % 400 == 0)</code>.",
      code: `year = 2024
is_leap = (year % 4 == 0 and year % 100 != 0) or (year % 400 == 0)
print(f"{year} is Leap Year: {is_leap}")`
    },
    {
      id: 16,
      title: "Q16. Print Elements of Upper Triangular Matrix",
      problem: "Write a program to print elements of upper triangular matrix.",
      difficulty: "Medium",
      marks: 15,
      timerMins: 8,
      explanation: "In an upper triangular matrix, row index <code>i <= column index j</code>.",
      code: `mat = [
    [1, 2, 3],
    [4, 5, 6],
    [7, 8, 9]
]
print("Upper Triangular Elements:")
for i in range(len(mat)):
    for j in range(len(mat[0])):
        if i <= j:
            print(mat[i][j], end=" ")
        else:
            print(" ", end=" ")
    print()`
    },
    {
      id: 17,
      title: "Q17. Count Number of Digits in an Integer",
      problem: "Count digits in an integer (e.g. 12345 -> 5, 153 -> 3, '00003452' -> 4).",
      difficulty: "Easy",
      marks: 10,
      timerMins: 5,
      explanation: "Convert number to string, strip leading zeroes (or parse as int) and find length.",
      code: `val = "00003452"
clean_digits = str(int(val))
print(f"Input: {val} -> Digit Count: {len(clean_digits)}")`
    },
    {
      id: 18,
      title: "Q18. Check Prime Number (Quick Check)",
      problem: "Write a Python program to verify whether a given integer is prime.",
      difficulty: "Easy",
      marks: 10,
      timerMins: 5,
      explanation: "Test divisibility up to square root of n.",
      code: `def is_prime(n):
    return n > 1 and all(n % i != 0 for i in range(2, int(n**0.5) + 1))

n = 37
print(f"{n} is Prime: {is_prime(n)}")`
    },
    {
      id: 19,
      title: "Q19. Fibonacci Series of N Numbers",
      problem: "Write a Python program to find the Fibonacci series of n numbers. (Input: 7 -> 0 1 1 2 3 5 8).",
      difficulty: "Easy",
      marks: 10,
      timerMins: 6,
      explanation: "Maintain two pointers initialized to 0 and 1; generate next value via <code>a, b = b, a + b</code>.",
      code: `n = 7
a, b = 0, 1
fib = []
for _ in range(n):
    fib.append(a)
    a, b = b, a + b

print(f"Fibonacci series of {n} numbers:", *fib)`
    },
    {
      id: 20,
      title: "Q20. Slicing, Splitting, and Joining Strings",
      problem: "Input string: (a) Slice first 5 & last 5 chars, (b) split into words, (c) join back into single string.",
      difficulty: "Medium",
      marks: 15,
      timerMins: 8,
      explanation: "Use slices <code>[:5]</code> and <code>[-5:]</code>, <code>str.split()</code>, and <code>' '.join()</code>.",
      code: `text = "Python is an amazing programming language"

# (a) Slicing
first_5 = text[:5]
last_5 = text[-5:]
print(f"First 5: '{first_5}', Last 5: '{last_5}'")

# (b) Splitting
words = text.split()
print("Words List:", words)

# (c) Joining
joined = " ".join(words)
print("Joined back:", joined)`
    },
    {
      id: 21,
      title: "Q21. Biggest Number Among 3 Numbers",
      problem: "Write a program for finding biggest number among 3 numbers.",
      difficulty: "Easy",
      marks: 10,
      timerMins: 5,
      explanation: "Use conditional <code>if-elif-else</code> or max() function.",
      code: `a, b, c = 45, 89, 23
if a >= b and a >= c: biggest = a
elif b >= a and b >= c: biggest = b
else: biggest = c

print(f"Numbers: {a}, {b}, {c}")
print("Biggest number is:", biggest)`
    },
    {
      id: 22,
      title: "Q22. Iterate Through Tuple Using For Loop",
      problem: "Write a Python program to iterate through a tuple: ('apple', 'banana', 'orange').",
      difficulty: "Easy",
      marks: 5,
      timerMins: 4,
      explanation: "Use a standard <code>for item in my_tuple</code> loop to print each element.",
      code: `fruits = ('apple', 'banana', 'orange')
print("Iterating through tuple:")
for fruit in fruits:
    print("-", fruit)`
    },
    {
      id: 23,
      title: "Q23. Volume of Cylinder Given Radius & Height",
      problem: "Calculate the volume (V) of a cylinder given radius (r) and height (h). Formula: V = π × r² × h.",
      difficulty: "Easy",
      marks: 10,
      timerMins: 5,
      explanation: "Import <code>math.pi</code> and calculate <code>math.pi * (r**2) * h</code>.",
      code: `import math

r = 5.0
h = 12.0
volume = math.pi * (r ** 2) * h
print(f"Radius: {r}, Height: {h}")
print(f"Volume of Cylinder: {volume:.2f}")`
    },
    {
      id: 24,
      title: "Q24. Simple Calculator using If-Elif-Else",
      problem: "Design a Simple Calculator using 'if-elif-else' statements.",
      difficulty: "Easy",
      marks: 10,
      timerMins: 6,
      explanation: "Check operator symbol with conditional blocks.",
      code: `a, b = 15, 3
operator = '*'

if operator == '+': res = a + b
elif operator == '-': res = a - b
elif operator == '*': res = a * b
elif operator == '/': res = a / b if b != 0 else "Cannot divide by 0"
else: res = "Invalid operator"

print(f"{a} {operator} {b} = {res}")`
    },
    {
      id: 25,
      title: "Q25. Sentence Slicing and Concatenation",
      problem: "(a) Accept sentence, (b) display first 5 chars using slicing, (c) concatenate with predefined string.",
      difficulty: "Easy",
      marks: 10,
      timerMins: 5,
      explanation: "Extract <code>sentence[:5]</code> and concatenate with <code>+</code> operator.",
      code: `sentence = "GyanXp Academy provides best education."
first_5 = sentence[:5]
extra = " [Verified O-Level Portal]"
combined = sentence + extra

print("First 5 chars:", first_5)
print("Concatenated: ", combined)`
    },
    {
      id: 26,
      title: "Q26. Length of a Dictionary",
      problem: "Write a Python program to find the length of a dictionary (dic = {'10': 'ten', '20': 'twenty'}).",
      difficulty: "Easy",
      marks: 5,
      timerMins: 4,
      explanation: "<code>len(dictionary)</code> returns total number of key-value pairs.",
      code: `dic = {"10": "ten", "20": "twenty"}
print("Dictionary:", dic)
print("Length of Dictionary:", len(dic))`
    },
    {
      id: 27,
      title: "Q27. Reverse Elements of a List",
      problem: "Write a Python program to reverse the elements of a list.",
      difficulty: "Easy",
      marks: 5,
      timerMins: 4,
      explanation: "Use <code>list.reverse()</code> in-place or slicing <code>list[::-1]</code>.",
      code: `nums = [10, 20, 30, 40, 50]
reversed_list = nums[::-1]
print("Original List:", nums)
print("Reversed List:", reversed_list)`
    },
    {
      id: 28,
      title: "Q28. Factorial of a Number",
      problem: "Given an integer number n, write a Python program to print the factorial of this number.",
      difficulty: "Easy",
      marks: 10,
      timerMins: 5,
      explanation: "Iterate from 1 to n multiplying into result accumulator.",
      code: `n = 5
fact = 1
for i in range(1, n + 1):
    fact *= i

print(f"Factorial of {n} is: {fact}")`
    },
    {
      id: 29,
      title: "Q29. Generate Prime Number Series up to N",
      problem: "Implement Python script to generate prime number series up to n.",
      difficulty: "Medium",
      marks: 15,
      timerMins: 8,
      explanation: "Check each number up to n for prime divisibility and collect in a list.",
      code: `n = 50
primes = [x for x in range(2, n + 1) if all(x % i != 0 for i in range(2, int(x**0.5) + 1))]
print(f"Primes up to {n}:", primes)`
    },
    {
      id: 30,
      title: "Q30. Sum of Even Numbers Between M & N using Pass Statement",
      problem: "Compute sum of all even numbers between m & n (inclusive) using pass statement for odd numbers.",
      difficulty: "Easy",
      marks: 10,
      timerMins: 6,
      explanation: "Use <code>if x % 2 == 0: total += x else: pass</code> to explicitly demonstrate the pass statement.",
      code: `m, n = 10, 25
total = 0
for num in range(m, n + 1):
    if num % 2 == 0:
        total += num
    else:
        pass  # pass statement for non-even numbers

print(f"Sum of even numbers between {m} and {n}: {total}")`
    },
    {
      id: 31,
      title: "Q31. Remove Duplicate Even Positive Integers from List",
      problem: "Remove duplicate even positive integers (including zero) keeping first occurrence intact.",
      difficulty: "Medium",
      marks: 15,
      timerMins: 8,
      explanation: "Track seen even numbers in a set while maintaining original order.",
      code: `def filter_even_duplicates(text_input):
    seen_evens = set()
    result = []
    for ch in str(text_input):
        digit = int(ch)
        if digit % 2 == 0:
            if digit not in seen_evens:
                seen_evens.add(digit)
                result.append(ch)
        else:
            result.append(ch)
    return "".join(result)

print("4321 ->", filter_even_duplicates("4321"))
print("0001 ->", filter_even_duplicates("0001"))
print("1133 ->", filter_even_duplicates("1133"))`
    },
    {
      id: 32,
      title: "Q32. Calculate Area of Triangle (0.5 * b * h)",
      problem: "Write a python program to calculate area of triangle. Area = 0.5 * b * h.",
      difficulty: "Easy",
      marks: 5,
      timerMins: 4,
      explanation: "Multiply base by height and scale by 0.5.",
      code: `base = 10
height = 5
area = 0.5 * base * height
print(f"Base: {base}, Height: {height} -> Triangle Area: {area}")`
    },
    {
      id: 33,
      title: "Q33. Check Given Number is Armstrong or Not",
      problem: "Implement python script program to check if given number is Armstrong or not.",
      difficulty: "Easy",
      marks: 10,
      timerMins: 6,
      explanation: "Sum each digit raised to total digit count power.",
      code: `num = 371
order = len(str(num))
total = sum(int(d)**order for d in str(num))
print(f"{num} is Armstrong: {total == num}")`
    },
    {
      id: 34,
      title: "Q34. Sum of Series: X + X^4/4! + X^6/6! + X^8/8! + ...",
      problem: "Write a Function to Compute the Sum of n Terms of: X + X^4/4! + X^6/6! + X^8/8! + ...",
      difficulty: "Medium",
      marks: 15,
      timerMins: 10,
      explanation: "First term is X, subsequent terms k from 2 to n have power and factorial of <code>2 * k</code>.",
      code: `import math

def compute_series(x, n):
    if n <= 0: return 0
    total = x
    for k in range(2, n + 1):
        power = 2 * k
        total += (x ** power) / math.factorial(power)
    return total

x_val, terms = 2, 4
print(f"Sum of series for X={x_val}, N={terms}: {compute_series(x_val, terms):.4f}")`
    },
    {
      id: 35,
      title: "Q35. Count Characters, Vowels, and Spaces in Text",
      problem: "Accept a line of text and find total characters, number of vowels, and number of blank spaces.",
      difficulty: "Easy",
      marks: 10,
      timerMins: 6,
      explanation: "Iterate across the string checking <code>char in 'aeiouAEIOU'</code> and <code>char == ' '</code>.",
      code: `text = "GyanXp provides live interactive online batches"
total_chars = len(text)
vowels = sum(1 for c in text if c.lower() in "aeiou")
spaces = sum(1 for c in text if c == " ")

print(f"Characters: {total_chars}")
print(f"Vowels: {vowels}")
print(f"Spaces: {spaces}")`
    },
    {
      id: 36,
      title: "Q36. Linear Search on List of 10 Positive Numbers",
      problem: "Take a list of 10 numbers and a key value; apply Linear Search to check if key is present.",
      difficulty: "Easy",
      marks: 10,
      timerMins: 6,
      explanation: "Iterate sequentially through list indices.",
      code: `numbers = [12, 45, 23, 67, 89, 90, 34, 56, 78, 11]
key = 90
found_idx = -1

for i in range(len(numbers)):
    if numbers[i] == key:
        found_idx = i
        break

if found_idx != -1:
    print(f"Key {key} found at index {found_idx}")
else:
    print(f"Key {key} not found")`
    },
    {
      id: 37,
      title: "Q37. Check Number is Palindrome or Not",
      problem: "Write a Python program to check whether a given number is a palindrome or not.",
      difficulty: "Easy",
      marks: 10,
      timerMins: 5,
      explanation: "Convert number to string and compare with reversed string.",
      code: `num = 12321
s = str(num)
is_pal = (s == s[::-1])
print(f"Number {num} is Palindrome: {is_pal}")`
    },
    {
      id: 38,
      title: "Q38. Sum of Squares of N Natural Numbers",
      problem: "Find sum of squares of N natural numbers (e.g. 5 -> 55, 10 -> 385, 50 -> 42925, 100 -> 338350).",
      difficulty: "Easy",
      marks: 10,
      timerMins: 5,
      explanation: "Apply direct mathematical formula <code>(n * (n + 1) * (2*n + 1)) // 6</code> or sum iteration.",
      code: `def sum_of_squares(n):
    return (n * (n + 1) * (2 * n + 1)) // 6

for val in [5, 10, 50, 100]:
    print(f"N={val} -> Sum of Squares: {sum_of_squares(val)}")`
    },
    {
      id: 39,
      title: "Q39. NumPy 3x3 Array Slicing (Row, Col, Sub-array)",
      problem: "Create 3x3 array (1 to 9). Extract 2nd row, 2nd column, and 2x2 bottom-right sub-array.",
      difficulty: "Medium",
      marks: 15,
      timerMins: 8,
      explanation: "Index 2D arrays with <code>arr[1, :]</code> for row 2, <code>arr[:, 1]</code> for col 2, and <code>arr[1:, 1:]</code> for corner.",
      code: `import numpy as np

arr = np.arange(1, 10).reshape(3, 3)
print("3x3 Matrix:\\n", arr)
print("Second Row:", arr[1, :])
print("Second Column:", arr[:, 1])
print("2x2 Bottom-Right Sub-array:\\n", arr[1:, 1:])`
    },
    {
      id: 40,
      title: "Q40. Store Lengths of Sub-Tuples into New Tuple",
      problem: "Given T1 = ((1,2,3), (3,4), (2,3,4,5), (5,6,7)), output T2 = (3, 2, 4, 3).",
      difficulty: "Easy",
      marks: 10,
      timerMins: 5,
      explanation: "Use a tuple comprehension or generator <code>tuple(len(sub) for sub in T1)</code>.",
      code: `T1 = ((1, 2, 3), (3, 4), (2, 3, 4, 5), (5, 6, 7))
T2 = tuple(len(sub) for sub in T1)
print("T1 =", T1)
print("T2 =", T2)`
    },
    {
      id: 41,
      title: "Q41. Array Copy and Modify Second Element",
      problem: "Create original array [5,10,15,20]. Copy and modify copy[1] = 50. Verify original remains unchanged.",
      difficulty: "Easy",
      marks: 10,
      timerMins: 5,
      explanation: "Use <code>.copy()</code> to create an independent copy without shared reference pointer.",
      code: `import numpy as np

original = np.array([5, 10, 15, 20])
modified_copy = original.copy()
modified_copy[1] = 50

print("Original Array:     ", original)
print("Modified Copy Array:", modified_copy)`
    },
    {
      id: 42,
      title: "Q42. Perform Bitwise Operations (AND, OR, XOR, Shifts)",
      problem: "Perform bitwise operations: (A) AND, (B) OR, (C) XOR, (D) Left Shift (by 2), (E) Right Shift (by 2).",
      difficulty: "Easy",
      marks: 10,
      timerMins: 6,
      explanation: "Python operators: <code>&</code> (AND), <code>|</code> (OR), <code>^</code> (XOR), <code><<</code> (Left shift), <code>>></code> (Right shift).",
      code: `a, b = 12, 5  # 12 = 1100, 5 = 0101 in binary

print(f"a = {a}, b = {b}")
print("(A) a & b (AND):       ", a & b)
print("(B) a | b (OR):        ", a | b)
print("(C) a ^ b (XOR):       ", a ^ b)
print("(D) a << 2 (Left Shift):", a << 2)
print("(E) a >> 2 (Right Shift):", a >> 2)`
    },
    {
      id: 43,
      title: "Q43. Modular Student Grade Calculator",
      problem: "Calculate student final grade modularly with separate functions for average and grade assignment.",
      difficulty: "Medium",
      marks: 15,
      timerMins: 10,
      explanation: "Separate business logic into <code>calc_avg()</code> and <code>assign_grade()</code> functions.",
      code: `def calc_avg(scores):
    return sum(scores) / len(scores)

def assign_grade(avg):
    if avg >= 85: return 'S (Outstanding)'
    elif avg >= 75: return 'A (Excellent)'
    elif avg >= 65: return 'B (Good)'
    elif avg >= 50: return 'C (Satisfactory)'
    else: return 'F (Failed)'

student_marks = [78, 85, 90]
avg = calc_avg(student_marks)
grade = assign_grade(avg)
print(f"Marks: {student_marks} -> Average: {avg:.2f} -> Grade: {grade}")`
    },
    {
      id: 44,
      title: "Q44. Reverse of a String",
      problem: "Write a program to print reverse of a string.",
      difficulty: "Easy",
      marks: 5,
      timerMins: 4,
      explanation: "Reverse sequence using Python string slice step -1.",
      code: `msg = "NIELIT O Level M3-R5"
print("Original:", msg)
print("Reversed:", msg[::-1])`
    },
    {
      id: 45,
      title: "Q45. NumPy 5x5 Random Array & Replace Min with 0",
      problem: "Create a 5x5 array with random values and replace the minimum value with 0.",
      difficulty: "Medium",
      marks: 15,
      timerMins: 8,
      explanation: "Use <code>np.random.rand(5,5)</code> and assign <code>arr[arr == arr.min()] = 0</code>.",
      code: `import numpy as np

arr = np.random.randint(10, 100, (5, 5))
print("Original 5x5 Matrix:\\n", arr)
min_val = arr.min()
arr[arr == min_val] = 0
print(f"\\nAfter Replacing Min Value ({min_val}) with 0:\\n", arr)`
    },
    {
      id: 46,
      title: "Q46. Generate Fibonacci Series",
      problem: "Write a python program to generate Fibonacci series.",
      difficulty: "Easy",
      marks: 10,
      timerMins: 6,
      explanation: "Produce terms iteratively.",
      code: `terms = 8
a, b = 0, 1
print("Fibonacci:", end=" ")
for _ in range(terms):
    print(a, end=" ")
    a, b = b, a + b
print()`
    },
    {
      id: 47,
      title: "Q47. Divisible by Both 3 and 5 in Range [a, b]",
      problem: "Print numbers between a and b divisible by both 3 and 5. If none, display 'No numbers found'.",
      difficulty: "Easy",
      marks: 10,
      timerMins: 6,
      explanation: "Divisible by both 3 and 5 means divisible by 15 (<code>x % 15 == 0</code>).",
      code: `a, b = 10, 50
matches = [x for x in range(a, b + 1) if x % 3 == 0 and x % 5 == 0]

if matches:
    print(f"Numbers between {a} and {b} divisible by 3 & 5:", matches)
else:
    print("No numbers found")`
    },
    {
      id: 48,
      title: "Q48. Find Palindromes in Range 200 to 400",
      problem: "Write a python program to find all palindrome numbers in given range 200 to 400.",
      difficulty: "Easy",
      marks: 10,
      timerMins: 6,
      explanation: "Iterate across range and select numbers whose string form equals reversed string.",
      code: `palindromes = [x for x in range(200, 401) if str(x) == str(x)[::-1]]
print("Palindromes between 200 and 400:")
print(palindromes)`
    },
    {
      id: 49,
      title: "Q49. Display Numbers 0 to 6 Except 3 and 6",
      problem: "Write a program to display numbers from 0 to 6 except 3 and 6 using continue statement.",
      difficulty: "Easy",
      marks: 5,
      timerMins: 4,
      explanation: "Use <code>continue</code> inside loop when iteration reaches 3 or 6.",
      code: `print("Numbers (0 to 6 except 3 and 6):")
for x in range(7):
    if x == 3 or x == 6:
        continue
    print(x, end=" ")
print()`
    },
    {
      id: 50,
      title: "Q50. Check Positive Number using Assert Statement",
      problem: "Check if a number is positive using the Python assert statement.",
      difficulty: "Easy",
      marks: 10,
      timerMins: 5,
      explanation: "<code>assert condition, 'error message'</code> raises AssertionError if condition is false.",
      code: `def verify_positive(num):
    assert num > 0, f"Assertion Failed: {num} is not positive!"
    return f"{num} is valid positive number."

print(verify_positive(15))
try:
    print(verify_positive(-5))
except AssertionError as err:
    print(err)`
    },
    {
      id: 51,
      title: "Q51. Formatted Current Date & Time (YYYY-MM-DD HH:MM)",
      problem: "Print the current date and time in formatted form (Year-Month-Day Hour:Minute).",
      difficulty: "Easy",
      marks: 5,
      timerMins: 4,
      explanation: "Use <code>datetime.datetime.now().strftime('%Y-%m-%d %H:%M')</code>.",
      code: `from datetime import datetime

now = datetime.now()
formatted = now.strftime("%Y-%m-%d %H:%M")
print("Current Formatted Date & Time:", formatted)`
    }
  ];

  /* =========================================================================
     CORE SCRIPT & DYNAMIC LOGIC
     ========================================================================= */
  var TOTAL_PROGRAMS = programsData.length;
  var completedPrograms = JSON.parse(localStorage.getItem('gyanxp_completed')) || [];
  var activeTimers = {};

  function escapeHtml(text) {
    return text.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;");
  }

  function scrollIndexSidebar(offset) {
    var sidebarList = document.getElementById('sidebar-list');
    if (sidebarList) {
      sidebarList.scrollBy({ left: offset, behavior: 'smooth' });
    }
  }

  function renderAllPrograms() {
    var sidebarHtml = '';
    var workspaceHtml = '';

    // Set Dynamic Sidebar Header Title
    var mainTitleEl = document.getElementById('sidebar-main-title');
    if (mainTitleEl) {
      mainTitleEl.innerText = '📑 Practical Index (' + TOTAL_PROGRAMS + ' Problems)';
    }

    programsData.forEach(function (item, index) {
      var isFirst = index === 0;
      var progNum = index + 1;
      var diffClass = 'badge-' + item.difficulty.toLowerCase();

      // Updated Button Label to "Practical X"
      sidebarHtml += `
        <button class="nav-btn ${isFirst ? 'active' : ''}" id="side-btn-${item.id}" onclick="switchProgram(${item.id})">
          <span>Practical ${progNum}</span>
          <span class="status-dot" id="dot-${item.id}">⚪</span>
        </button>
      `;

      workspaceHtml += `
        <div id="prog-${item.id}" class="program-content ${isFirst ? 'active' : ''}">
          <div class="meta-tags">
            <span class="badge badge-tag">Practical #${progNum}</span>
            <span class="badge ${diffClass}">${item.difficulty}</span>
            <span class="badge badge-marks">Weightage: ${item.marks} Marks</span>
          </div>

          <h2 class="question-title">${item.title}</h2>
          <div class="question-desc"><strong>Problem Statement:</strong> ${item.problem}</div>

          <div class="timer-box">
            <span>⏱ Recommended Time: ${item.timerMins} mins</span>
            <div class="timer-controls">
              <span class="timer-display" id="timer-${item.id}">00:00</span>
              <button class="timer-btn" onclick="toggleTimer(${item.id})">Start Timer</button>
            </div>
          </div>

          <div class="code-header"><span class="code-section-title">Solution Code:</span></div>
          <pre><code class="language-python" id="code-snippet-${item.id}">${escapeHtml(item.code)}</code></pre>

          <div class="btn-group">
            <button class="btn-action try-code-btn" onclick="openCompilerTab(${item.id}, 'python')">▶ Try Full Editor</button>
            <button class="btn-action show-result-btn" id="toggle-btn-${item.id}" onclick="toggleResult(${item.id}, 'python')">⚡ Show Result</button>
            <button class="btn-action complete-btn" id="mark-btn-${item.id}" onclick="toggleCompletion(${item.id})">✔ Mark Done</button>
          </div>

          <div class="accordion-box">
            <div class="accordion-header" onclick="toggleAccordion(${item.id})">
              <span>💡 Logic Explanation</span><span id="acc-icon-${item.id}">➕</span>
            </div>
            <div class="accordion-body" id="acc-body-${item.id}">${item.explanation}</div>
          </div>

          <div id="result-box-${item.id}" class="result-container">
            <div class="result-header">Live Output Console</div>
            <div id="iframe-holder-${item.id}"></div>
          </div>

          <div class="pagination-group">
            <button class="btn-page" ${index === 0 ? 'disabled' : `onclick="switchProgram(${programsData[index - 1].id})"`}>◀ Previous</button>
            <button class="btn-page" ${index === programsData.length - 1 ? 'disabled' : `onclick="switchProgram(${programsData[index + 1].id})"`}>Next ▶</button>
          </div>
        </div>
      `;
    });

    document.getElementById('sidebar-list').innerHTML = sidebarHtml;
    document.getElementById('workspace-container').innerHTML = workspaceHtml;

    if (window.Prism) {
      Prism.highlightAll();
    }
  }

  function switchProgram(progId) {
    document.querySelectorAll('.program-content').forEach(function(el) { el.classList.remove('active'); });
    document.querySelectorAll('.nav-btn').forEach(function(btn) { btn.classList.remove('active'); });

    var targetProg = document.getElementById('prog-' + progId);
    var targetBtn = document.getElementById('side-btn-' + progId);

    if (targetProg) targetProg.classList.add('active');
    if (targetBtn) {
      targetBtn.classList.add('active');
      targetBtn.scrollIntoView({ behavior: 'smooth', block: 'nearest', inline: 'center' });
    }
  }

  function openCompilerTab(progId, language) {
    var codeText = document.getElementById('code-snippet-' + progId).innerText;
    localStorage.setItem('pendingCode', codeText);
    localStorage.setItem('pendingLang', language);
    window.open('/test-online-python-compiler/', '_blank');
  }

  function toggleResult(progId, language) {
    var resultBox = document.getElementById('result-box-' + progId);
    var iframeHolder = document.getElementById('iframe-holder-' + progId);
    var toggleBtn = document.getElementById('toggle-btn-' + progId);
    var codeText = document.getElementById('code-snippet-' + progId).innerText;

    if (resultBox.style.display === 'block') {
      resultBox.style.display = 'none';
      iframeHolder.innerHTML = '';
      toggleBtn.innerText = '⚡ Show Result';
      toggleBtn.classList.remove('active-btn');
    } else {
      resultBox.style.display = 'block';
      toggleBtn.innerText = '✕ Hide Result';
      toggleBtn.classList.add('active-btn');

      var embedUrl = 'https://onecompiler.com/embed/' + language + '?listenToEvents=true&hideLanguageSelection=true&hideTitle=true&hideNew=true&theme=dark';
      iframeHolder.innerHTML = '<iframe id="runner-iframe-' + progId + '" src="' + embedUrl + '"></iframe>';

      var iframe = document.getElementById('runner-iframe-' + progId);
      iframe.onload = function () {
        setTimeout(function () {
          iframe.contentWindow.postMessage({
            eventType: 'populateCode',
            language: language,
            files: [{ name: 'main.py', content: codeText }]
          }, "*");

          setTimeout(function () {
            iframe.contentWindow.postMessage({ eventType: 'triggerRun' }, "*");
          }, 300);
        }, 500);
      };
    }
  }

  function toggleAccordion(progId) {
    var body = document.getElementById('acc-body-' + progId);
    var icon = document.getElementById('acc-icon-' + progId);
    var isOpen = body.style.display === 'block';
    body.style.display = isOpen ? 'none' : 'block';
    icon.innerText = isOpen ? '➕' : '➖';
  }

  function toggleTimer(progId) {
    var timerDisplay = document.getElementById('timer-' + progId);
    var timerBtn = timerDisplay.nextElementSibling;

    if (activeTimers[progId]) {
      clearInterval(activeTimers[progId].interval);
      delete activeTimers[progId];
      timerBtn.innerText = 'Start Timer';
    } else {
      var seconds = 0;
      timerBtn.innerText = 'Stop Timer';
      activeTimers[progId] = {
        interval: setInterval(function () {
          seconds++;
          var mins = Math.floor(seconds / 60);
          var secs = seconds % 60;
          timerDisplay.innerText = (mins < 10 ? '0' : '') + mins + ':' + (secs < 10 ? '0' : '') + secs;
        }, 1000)
      };
    }
  }

  function toggleCompletion(progId) {
    var index = completedPrograms.indexOf(progId);
    if (index > -1) {
      completedPrograms.splice(index, 1);
    } else {
      completedPrograms.push(progId);
    }
    localStorage.setItem('gyanxp_completed', JSON.stringify(completedPrograms));
    updateProgressUI();
  }

  function updateProgressUI() {
    programsData.forEach(function (item) {
      var markBtn = document.getElementById('mark-btn-' + item.id);
      var dot = document.getElementById('dot-' + item.id);

      if (completedPrograms.includes(item.id)) {
        if (markBtn) { markBtn.innerText = '✔ Practiced'; markBtn.classList.add('done'); }
        if (dot) dot.innerText = '🟢';
      } else {
        if (markBtn) { markBtn.innerText = '✔ Mark Done'; markBtn.classList.remove('done'); }
        if (dot) dot.innerText = '⚪';
      }
    });

    var validCompleted = completedPrograms.filter(function(id) {
      return programsData.some(p => p.id === id);
    }).length;

    var percentage = TOTAL_PROGRAMS > 0 ? Math.round((validCompleted / TOTAL_PROGRAMS) * 100) : 0;
    document.getElementById('progress-fill').style.width = percentage + '%';
    document.getElementById('progress-text').innerText = validCompleted + ' / ' + TOTAL_PROGRAMS + ' Practiced (' + percentage + '%)';
  }

  document.addEventListener("DOMContentLoaded", function () {
    renderAllPrograms();
    updateProgressUI();
  });
</script>				</div>
				</div>
					</div>
		</div>
					</div>
		</section>
				</div>
		<p>The post <a href="https://gyanxp.com/online-python-practical-solution/">Online Python Practical Solution (PR3)</a> appeared first on <a href="https://gyanxp.com">GyanXp</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://gyanxp.com/online-python-practical-solution/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Online Python Compiler</title>
		<link>https://gyanxp.com/test-online-python-compiler/</link>
					<comments>https://gyanxp.com/test-online-python-compiler/#respond</comments>
		
		<dc:creator><![CDATA[Balmukund Maurya]]></dc:creator>
		<pubDate>Wed, 12 Aug 2026 07:44:43 +0000</pubDate>
				<category><![CDATA[Online Practical]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<guid isPermaLink="false">https://gyanxp.com/?p=5912</guid>

					<description><![CDATA[<p>Run Fullscreen</p>
<p>The post <a href="https://gyanxp.com/test-online-python-compiler/">Online Python Compiler</a> appeared first on <a href="https://gyanxp.com">GyanXp</a>.</p>
]]></description>
										<content:encoded><![CDATA[		<div data-elementor-type="wp-post" data-elementor-id="5912" class="elementor elementor-5912">
						<section class="elementor-section elementor-top-section elementor-element elementor-element-63aa4f6 elementor-section-boxed elementor-section-height-default elementor-section-height-default" data-id="63aa4f6" data-element_type="section" data-e-type="section">
						<div class="elementor-container elementor-column-gap-default">
					<div class="elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-66390a6" data-id="66390a6" data-element_type="column" data-e-type="column">
			<div class="elementor-widget-wrap elementor-element-populated">
						<div class="elementor-element elementor-element-eb0d555 elementor-widget__width-initial elementor-widget elementor-widget-html" data-id="eb0d555" data-element_type="widget" data-e-type="widget" data-widget_type="html.default">
				<div class="elementor-widget-container">
					<style>
  /* Outer Container */
  .compiler-container {
    width: 100%;
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  }

  /* Top Actions Bar (Above the Editor) */
  .compiler-toolbar {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
  }

  /* Run Button - Exact OneCompiler Default Material Design */
  .custom-run-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 32px;
    padding: 0 16px;
    background-color: #e91e63;
    color: #ffffff;
    font-size: 13px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    box-shadow: 0 2px 2px 0 rgba(0, 0, 0, 0.14), 0 3px 1px -2px rgba(0, 0, 0, 0.12), 0 1px 5px 0 rgba(0, 0, 0, 0.2);
    transition: background-color 0.2s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    user-select: none;
    outline: none;
  }

  .custom-run-btn:hover {
    background-color: #d81b60;
    box-shadow: 0 4px 5px 0 rgba(0, 0, 0, 0.14), 0 1px 10px 0 rgba(0, 0, 0, 0.12), 0 2px 4px -1px rgba(0, 0, 0, 0.3);
  }

  .custom-run-btn:active {
    background-color: #c2185b;
  }

  /* Fullscreen Toggle Button */
  .fullscreen-toggle-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 32px;
    padding: 0 14px;
    background-color: #333333;
    color: #ffffff;
    font-size: 13px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    box-shadow: 0 2px 2px 0 rgba(0, 0, 0, 0.14);
    transition: background-color 0.2s ease;
  }

  .fullscreen-toggle-btn:hover {
    background-color: #444444;
  }

  /* Compiler Window Wrapper */
  .compiler-wrapper {
    width: 100%;
    height: 450px;
    margin: 0;
    padding: 0;
    background-color: #1e1e1e;
    border-radius: 8px;
    overflow: hidden;
  }

  .compiler-wrapper iframe {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
  }

  /* =======================================================
     Mobile Fullscreen Mode (Portrait & Landscape)
     ======================================================= */
  .compiler-container.is-fullscreen {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    height: 100dvh !important;
    z-index: 999999 !important;
    background-color: #1e1e1e !important;
    padding: 8px 10px 10px 10px !important;
    box-sizing: border-box !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
  }

  .compiler-container.is-fullscreen .compiler-toolbar {
    flex-shrink: 0;
    margin-bottom: 6px;
    z-index: 1000000;
  }

  .compiler-container.is-fullscreen .compiler-wrapper {
    flex: 1 !important;
    width: 100% !important;
    height: auto !important;
    border-radius: 4px !important;
  }

  /* Responsive Adjustments for Mobile Viewports */
  @media (max-width: 768px) {
    .custom-run-btn, 
    .fullscreen-toggle-btn {
      height: 30px;
      padding: 0 12px;
      font-size: 12px;
    }
  }

  /* Landscape Optimizations on Mobile */
  @media (max-width: 900px) and (orientation: landscape) {
    .compiler-container.is-fullscreen {
      padding: 4px 8px 6px 8px !important;
    }

    .compiler-container.is-fullscreen .compiler-toolbar {
      margin-bottom: 4px;
    }

    .custom-run-btn, 
    .fullscreen-toggle-btn {
      height: 26px;
      padding: 0 10px;
      font-size: 11px;
    }
  }
</style>

<div id="compiler-container" class="compiler-container">
  <!-- Outside Top-Left Toolbar -->
  <div class="compiler-toolbar">
    <!-- Run Button -->
    <button id="custom-run-btn" class="custom-run-btn" title="Run Code">
      <svg width="14" height="14" viewBox="0 0 24 24" fill="currentColor">
        <path d="M8 5v14l11-7z"/>
      </svg>
      Run
    </button>

    <!-- Fullscreen Toggle Button -->
    <button id="fullscreen-btn" class="fullscreen-toggle-btn" title="Toggle Fullscreen">
      <svg id="fullscreen-icon" width="14" height="14" viewBox="0 0 24 24" fill="currentColor">
        <path d="M7 14H5v5h5v-2H7v-3zm-2-4h2V7h3V5H5v5zm12 7h-3v2h5v-5h-2v3zM14 5v2h3v3h2V5h-5z"/>
      </svg>
      <span id="fullscreen-text">Fullscreen</span>
    </button>
  </div>

  <!-- OneCompiler Embedded Frame -->
  <div class="compiler-wrapper">
    <iframe 
      id="oc-editor"
      src="https://onecompiler.com/embed/python?listenToEvents=true&theme=dark" 
      width="100%" 
      height="100%">
    </iframe>
  </div>
</div>

<script>
  document.addEventListener("DOMContentLoaded", function () {
    var iframe = document.getElementById('oc-editor');
    var runButton = document.getElementById('custom-run-btn');
    var fullscreenBtn = document.getElementById('fullscreen-btn');
    var container = document.getElementById('compiler-container');
    var fullscreenText = document.getElementById('fullscreen-text');
    var fullscreenIcon = document.getElementById('fullscreen-icon');

    // Trigger code execution inside OneCompiler
    function runCode() {
      if (iframe && iframe.contentWindow) {
        iframe.contentWindow.postMessage({
          eventType: 'triggerRun'
        }, "*");
      }
    }

    // Toggle Fullscreen View
    fullscreenBtn.addEventListener('click', function () {
      container.classList.toggle('is-fullscreen');
      var isFull = container.classList.contains('is-fullscreen');

      if (isFull) {
        fullscreenText.textContent = "Exit Fullscreen";
        // Exit Fullscreen Icon
        fullscreenIcon.innerHTML = '<path d="M5 16h3v3h2v-5H5v2zm3-8H5v2h5V5H8v3zm6 11h2v-3h3v-2h-5v5zm2-11V5h-2v5h5V8h-3z"/>';
        document.body.style.overflow = 'hidden'; // Lock background scrolling
      } else {
        fullscreenText.textContent = "Fullscreen";
        // Enter Fullscreen Icon
        fullscreenIcon.innerHTML = '<path d="M7 14H5v5h5v-2H7v-3zm-2-4h2V7h3V5H5v5zm12 7h-3v2h5v-5h-2v3zM14 5v2h3v3h2V5h-5z"/>';
        document.body.style.overflow = '';
      }
    });

    // Attach click event to Run button
    runButton.addEventListener('click', runCode);

    // Initial load handling for pending code from localStorage
    iframe.onload = function () {
      var codeText = localStorage.getItem('pendingCode');
      var lang = localStorage.getItem('pendingLang') || 'python';

      if (codeText) {
        setTimeout(function () {
          // 1. Populate code into editor
          iframe.contentWindow.postMessage({
            eventType: 'populateCode',
            language: lang,
            files: [
              {
                name: 'main.py',
                content: codeText
              }
            ]
          }, "*");

          // 2. Trigger automatic code execution on first load
          setTimeout(function () {
            runCode();

            // Clean up temporary storage
            localStorage.removeItem('pendingCode');
            localStorage.removeItem('pendingLang');
          }, 300);

        }, 500);
      }
    };
  });
</script>				</div>
				</div>
					</div>
		</div>
					</div>
		</section>
				</div>
		<p>The post <a href="https://gyanxp.com/test-online-python-compiler/">Online Python Compiler</a> appeared first on <a href="https://gyanxp.com">GyanXp</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://gyanxp.com/test-online-python-compiler/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
