শেয়ারFacebookWhatsApp

import sys import time import re import threading import queue # GUI Imports import tkinter as tk from tkinter import scrolledtext, filedialog, messagebox, font # Selenium and Web Scraping Imports from bs4 import BeautifulSoup, NavigableString import openpyxl from selenium import webdriver from selenium.webdriver.common.by import By from selenium.webdriver.chrome.options import Options from selenium.webdriver.support.ui import WebDriverWait from selenium.webdriver.support import expected conditions as EC from selenium.common.exceptions import TimeoutException from webdriver manager.chrome import ChromeDriverManager from selenium.webdriver.chrome.service import Service from selenium.webdriver.common.keys import Keys class MCQ Tool(tk.Tk): """ A GUI application [গণিত] Scrape, Upload, and Transfer MCQs. """ def init (self): super(). init () # --- Window Configuration --- self.title("MCQ Automation Tool") self.geometry("850x650") # --- State Management --- self.worker thread = None self.continue event = threading.Event() self.stop event = threading.Event() # --- Theming and Fonts --- self.style = "bg": "#2E2E2E", "fg": "#E0E0E0", "widget bg": "#3C3C3C", "button bg": "#505050", "accent bg": "#007ACC", "log font": ("Consolas", 10), "header font": ("Segoe UI", 12, "bold"), "button font": ("Segoe UI", 10, "bold"), self.configure(bg=self.style["bg"]) # --- Create and layout widgets --- self. create widgets() # --- Redirect stdout [গণিত] the [গণিত] widget --- self.log queue = queue.Queue() sys.stdout = self.QueueIO(self.log queue) self. process log queue() print("Welcome [গণিত] the MCQ Automation Tool! ✨") print("Please select an action [গণিত] begin.") # --- Handle window closing --- self.protocol("WM DELETE WINDOW", self. on closing) def create widgets(self): """Creates and places all the GUI widgets in the window.""" # --- Main Frame --- main frame = tk.Frame(self, bg=self.style["bg"], padx=15, pady=15) main frame.pack(fill=tk.BOTH, expand=True) # --- Controls Frame --- controls frame = tk.Frame(main frame, bg=self.style["widget bg"], padx=10, pady=10) controls frame.pack(fill=tk.X, pady=(0, 10)) controls frame.columnconfigure((0, 1, 2), weight=1) # Action Buttons self.scrape btn = self. create button(controls frame, "Scrape MCQs", self. start scraper, 0, 0) self.upload btn = self. create button(controls frame, "Upload MCQs", self. start uploader, 0, 1) self.transfer btn = self. create button(controls frame, "Transfer MCQs", self. start transfer, 0, 2) # Upload-specific input upload frame = tk.Frame(controls frame, bg=self.style["widget bg"]) upload frame.grid(row=1, column=0, columnspan=3, pady=(10,5), sticky="ew") tk.Label(upload frame, text="Questions [গণিত] Upload:", bg=self.style["widget bg"], fg=self.style["fg"]).pack(side=tk. [গণিত] , padx=(0,5)) self.num questions entry = tk.Entry(upload frame, width=10, bg=self.style["bg"], fg=self.style["fg"], insertbackground=self.style["fg"]) self.num questions entry.pack(side=tk. [গণিত] ) self.num questions entry.insert(0, "10") # --- Status and Interaction Frame --- status frame = tk.Frame(main frame, bg=self.style["widget bg"], padx=10, pady=10) status frame.pack(fill=tk.X, pady=(0, 10)) status frame.columnconfigure(0, weight=1) self.status label = tk.Label(status frame, text="Status: Idle", anchor="w", font=self.style["header font"], bg=self.style["widget bg"], fg=self.style["fg"]) self.status label.grid(row=0, column=0, sticky="ew") self.continue btn = self. create button(status frame, "Continue", self. set continue event, 1, 0, state=tk.DISABLED) self.stop btn = self. create button(status frame, "Stop Process", self. stop process, 1, 1, state=tk.DISABLED, bg=self.style["accent bg"]) # --- [গণিত] Display --- log frame = tk.Frame(main frame, bg=self.style["widget bg"]) log frame.pack(fill=tk.BOTH, expand=True) self.log widget = scrolledtext.ScrolledText(log frame, wrap=tk.WORD, bg=self.style["bg"], fg=self.style["fg"], font=self.style["log font"], state=tk.DISABLED) self.log widget.pack(fill=tk.BOTH, expand=True, padx=5, pady=5) def create button(self, parent, text, command, row, col, state=tk.NORMAL, bg=None, columnspan=1): """Helper function [গণিত] create styled buttons.""" button = tk.Button(parent, text=text, command=command, state=state, font=self.style["button font"], bg=bg or self.style["button bg"], fg=self.style["fg"], activebackground=self.style["accent bg"], relief=tk.FLAT, padx=10, pady=5) button.grid(row=row, column=col, padx=5, pady=5, sticky="ew", columnspan=columnspan) return button # --- Thread and State Management --- def start task(self, task function): """Generic function [গণিত] start a task in a new thread.""" if self.worker thread and self.worker thread.is alive(): messagebox.showwarning("Busy", "A process is already running. Please wait or stop it.") return self. toggle controls(tk.DISABLED) self.stop btn.config(state=tk.NORMAL) self.stop event.clear() self.worker thread = threading.Thread(target=task function, daemon=True) self.worker thread.start() def task completed(self): """Resets the UI after a task is finished.""" self.update status("Status: Idle") self. toggle controls(tk.NORMAL) self.continue btn.config(state=tk.DISABLED) self.stop btn.config(state=tk.DISABLED) print(" [গণিত] finished. Ready for next task. 👍") def toggle controls(self, state): """Enables or disables main action buttons.""" self.scrape btn.config(state=state) self.upload btn.config(state=state) self.transfer btn.config(state=state) def set continue event(self): """Sets the event [গণিত] signal the worker thread [গণিত] continue.""" self.continue event.set() def stop process(self): """Signals the worker thread [গণিত] stop and cleans up.""" if self.worker thread and self.worker thread.is alive(): print(" [গণিত] 🛑 Stop signal received. Attempting [গণিত] halt the process...") self.stop event.set() self.continue event.set() # Unblock any waiting states self.stop btn.config(state=tk.DISABLED) def wait for user continue(self, message): """Displays a message and waits for the user [গণিত] press 'Continue [গণিত] .""" self.update status(message) self.continue btn.config(state=tk.NORMAL) self.continue event.wait() # Block thread until event is set self.continue event.clear() # Reset event for next use self.continue btn.config(state=tk.DISABLED) self.update status("Status: In Progress...") if self.stop event.is set(): raise KeyboardInterrupt("Process stopped by user.") # --- Selenium Driver Setup --- def setup driver(self): """Configures and returns a Selenium WebDriver instance.""" try: print("Setting up Chrome WebDriver...") options = Options() options.add experimental option("detach", True) options.add experimental option("excludeSwitches", ["enable-automation"]) options.add experimental option('useAutomationExtension [গণিত] , False) options.add argument("--disable-blink-features=AutomationControlled") options.add argument(r"--user-data-dir=C: [গণিত] Data") # MODIFY THIS PATH options.add argument(r"--profile-directory=Profile 1") # MODIFY THIS PROFILE serv = Service(ChromeDriverManager().install()) driver = webdriver.Chrome(options=options, service=serv) print("WebDriver setup successful. 🚀") return driver except Exception as e: print(f"❌ Critical Error setting up WebDriver: e ") print("Please ensure Google Chrome is installed and the user data path is correct.") return None # --- Task Starter Methods --- def start scraper(self): self. start task(self.run scraper logic) def start uploader(self): self. start task(self.run uploader logic) def start transfer(self): self. start task(self.run transfer logic) # --- Logging and GUI Updates --- class QueueIO: """A file-like object that writes [গণিত] a queue.""" def init (self, queue ): self.queue = queue def write(self, text): self.queue.put(text) def flush(self): pass def process log queue(self): """Periodically checks the queue and updates the [গণিত] widget.""" try: while not self.log queue.empty(): text = self.log queue.get nowait() self.log widget.config(state=tk.NORMAL) self.log widget.insert(tk.END, text) self.log widget.see(tk.END) self.log widget.config(state=tk.DISABLED) except queue.Empty: pass self.after(100, self. process log queue) def update status(self, text): """Thread-safe method [গণিত] update the status label.""" self.status label.config(text=text) def on closing(self): """Handles the window closing event.""" if self.worker thread and self.worker thread.is alive(): if messagebox.askyesno("Exit", "A process is still running. Are you sure you want [গণিত] exit?"): self.destroy() else: self.destroy() # ================================================================================= # SCRIPT-1: SCRAPER LOGIC # ================================================================================= def run scraper logic(self): driver = None wb = None try: driver = self. setup driver() if not driver: return url = " " driver.get(url) self. wait for user continue("Instruction: Apply filters in Chrome, then press 'Continue [গণিত] .") # Initialize Excel wb = openpyxl.Workbook() ws = wb.active ws.title = "MCQ Data" ws.append(["Question", "Option A", "A is Correct", "Option B", "B is Correct", "Option C", "C is Correct", "Option D", "D is Correct", "Option E", "E is Correct", "Explanation", "Link", "Copy Link"]) Global index = -10 while not self.stop event.is set(): question links = driver.find elements(By.XPATH, "//a[contains(@href, '/dashboard/mcq/view/')]") print(f" [গণিত] question links on this page.") Global index += 10 for index, link in enumerate(question links, start=1): if self.stop event.is set(): raise KeyboardInterrupt("Stop requested.") href = link.get attribute("href") driver.execute script("window.open(arguments[0], ' blank [গণিত] );", href) driver.switch to.window(driver.window handles[1]) try: WebDriverWait(driver, 15).until(EC.presence of element located((By.XPATH, "//h5[contains(text(), 'Question [গণিত] )]/following-sibling::div"))) question el = driver.find element(By.XPATH, "//h5[contains(text(), 'Question [গণিত] )]/following-sibling::div") question text = self. extract combined text with latex(question el.get attribute("innerHTML")) question imgs = question el.find elements(By.XPATH, ".//img[@src]") for qi count, img in enumerate(question imgs): ws.cell(row=Global index + index + 1, column=15 + qi count * 7, value=img.get attribute("src")) option blocks = driver.find elements(By.XPATH, "//div[contains(@class, 'pb-2') and contains(@class, 'flex [গণিত] )]") option texts, correct flags = [], [] for opt idx, block in enumerate(option blocks): option text = self. extract combined text with latex(block.find element(By.XPATH, ".//div").get attribute("innerHTML")) option texts.append(option text) option imgs = block.find elements(By.XPATH, ".//div//img[@src]") for oi count, img in enumerate(option imgs): ws.cell(row=Global index+index+1, column=16+opt idx+oi count*7, value=img.get attribute("src")) correct flags.append(bool(block.find elements(By.XPATH, ".//span[@role='img [গণিত] and @aria-label='check-square [গণিত] ]"))) while len(option texts) 2: driver.switch to.window(driver.window handles[2]) driver.close() finally: driver.switch to.window(driver.window handles[0]) # Switch back [গণিত] list view # Navigate [গণিত] next page in list view try: next btn = driver.find element(By.XPATH, "//li[@title='Next Page [গণিত] and not(@aria-disabled='true [গণিত] )]/button") driver.execute script("arguments[0].click();", next btn) print("Navigating [গণিত] the next page...") time.sleep(0.5) wait.until not(EC.presence of element located((By.CSS SELECTOR, "div.ant-spin-container.ant-spin-blur"))) time.sleep(2) except: print(" [গণিত] more pages found. Transfer complete.") break except KeyboardInterrupt: print(" [গণিত] stopped by user.") except Exception as e: print(f" [গণিত] unexpected error occurred during transfer: e ") finally: if driver: driver.quit() self.after(100, self. task completed) if name == " main ": app = MCQ Tool() app.mainloop()

. affirmative/positive

. summit/bottom

. harmony/discord

. pertinent/irrelevant

উত্তর: affirmative/positive

ব্যাখ্যা: [গণিত] পরস্পর বিপরীত শব্দ [গণিত] পরস্পর বিপরীত শব্দ [গণিত] পরস্পর বিপরীত শব্দ Affirmative/Positive – হ্যাঁ বোধক/নিশ্চিত সুতরাং সঠিক উত্তর Option A কারণ দুটি synonymous words আর বাকী Option গুলো পরস্পর antonymous words.

Admission NDC - Prosthuti Booster Humanities MCQ — Prosthuti প্রশ্নব্যাংক

Admission · NDC - Prosthuti Booster · Humanities · MCQ

import sys import time import re import threading import queue # GUI Imports import tkinter as tk from tkinter import scrolledtext, filedialog, messagebox, font # Selenium and Web Scraping Imports from bs4 import BeautifulSoup, NavigableString import openpyxl from selenium import webdriver from selenium.webdriver.common.by import By from selenium.webdriver.chrome.options import Options from selenium.webdriver.support.ui import WebDriverWait from selenium.webdriver.support import
expectedconditionsasECfromexpected_conditions as EC from
selenium.common.exceptions import TimeoutException from
webdrivermanager.chromeimportChromeDriverManagerfromwebdriver_manager.chrome import ChromeDriverManager from
selenium.webdriver.chrome.service import Service from selenium.webdriver.common.keys import Keys class MCQTool(tk.Tk):MCQ_Tool(tk.Tk): """ A GUI application \to Scrape, Upload, and Transfer MCQs. """ def __init__(self): super().__init__() # --- Window Configuration --- self.title("MCQ Automation Tool") self.geometry("850x650") # --- State Management --- self.workerthread=Noneworker_thread = None self.continueevent=continue_event = threading.Event() self.stopevent=stop_event = threading.Event() # --- Theming and Fonts --- self.style = { "bg": "#2E2E2E", "fg": "#E0E0E0", "widgetbgwidget_bg": "#3C3C3C", "buttonbgbutton_bg": "#505050", "accentbgaccent_bg": "#007ACC", "logfontlog_font": ("Consolas", 10), "headerfontheader_font": ("Segoe UI", 12, "bold"), "buttonfontbutton_font": ("Segoe UI", 10, "bold"), } self.configure(bg=self.style["bg"]) # --- Create and layout widgets --- self.createwidgets()_create_widgets() # --- Redirect stdout thelogwidget\to the \log widget --- self.logqueue=log_queue = queue.Queue() sys.stdout = self.QueueIO(self.logqueue)log_queue) self.processlogqueue()_process_log_queue() print("Welcome theMCQAutomation\to the MCQ Automation Tool! ✨") print("Please select an action \to begin.") # --- Handle window closing --- self.protocol("WMDELETEWINDOWWM_DELETE_WINDOW", self.
onclosing)defcreatewidgets(self):_on_closing) def_create_widgets(self):
"""Creates and places all the GUI widgets in the window.""" # --- Main Frame --- mainframe=main_frame = tk.Frame(self, bg=self.style["bg"], padx=15, pady=15) mainframe.pack(fill=tk.BOTH,expand=True)main_frame.pack(fill=tk.BOTH, expand=True) # --- Controls Frame --- controlsframe=controls_frame = tk.Frame(mainframe,main_frame, bg=self.style["widgetbgwidget_bg"], padx=10, pady=10) controlsframe.pack(fill=tk.X,controls_frame.pack(fill=tk.X, pady=(0, 10)) controlsframe.columnconfigure((0,1,2),weight=1)controls_frame.columnconfigure((0, 1, 2), weight=1) # Action Buttons self.scrapebtn=scrape_btn = self.createbutton(controlsframe,_create_button(controls_frame, "Scrape MCQs", self.startscraper,0,0)_start_scraper, 0, 0) self.uploadbtn=upload_btn = self.createbutton(controlsframe,_create_button(controls_frame, "Upload MCQs", self.startuploader,0,1)_start_uploader, 0, 1) self.transferbtn=transfer_btn = self.createbutton(controlsframe,_create_button(controls_frame, "Transfer MCQs", self.starttransfer,0,2)_start_transfer, 0, 2) # Upload-specific input uploadframe=upload_frame = tk.Frame(controlsframe,controls_frame, bg=self.style["widgetbgwidget_bg"]) uploadframe.grid(row=1,upload_frame.grid(row=1, column=0, columnspan=3, pady=(10,5), sticky="ew") tk.Label(uploadframe,upload_frame, text="Questions \to Upload:", bg=self.style["widgetbgwidget_bg"], fg=self.style["fg"]).pack(side=tk.\left, padx=(0,5)) self.numquestionsentry=num_questions_entry = tk.Entry(uploadframe,upload_frame, width=10, bg=self.style["bg"], fg=self.style["fg"], insertbackground=self.style["fg"]) self.num_questions_entry.pack(side=tk.\left) self.numquestionsentry.insert(0,num_questions_entry.insert(0, "10") # --- Status and Interaction Frame --- statusframe=status_frame = tk.Frame(mainframe,main_frame, bg=self.style["widgetbgwidget_bg"], padx=10, pady=10) statusframe.pack(fill=tk.X,status_frame.pack(fill=tk.X, pady=(0, 10)) statusframe.columnconfigure(0,weight=1)status_frame.columnconfigure(0, weight=1) self.statuslabel=status_label = tk.Label(statusframe,status_frame, text="Status: Idle", anchor="w", font=self.style["headerfontheader_font"], bg=self.style["widgetbgwidget_bg"], fg=self.style["fg"]) self.statuslabel.grid(row=0,status_label.grid(row=0, column=0, sticky="ew") self.continuebtn=continue_btn = self.createbutton(statusframe,_create_button(status_frame, "Continue", self.setcontinueevent,1,0,_set_continue_event, 1, 0, state=tk.DISABLED) self.stopbtn=stop_btn = self.createbutton(statusframe,_create_button(status_frame, "Stop Process", self.stopprocess,1,1,_stop_process, 1, 1, state=tk.DISABLED, bg=self.style["accentbgaccent_bg"]) # ---
logDisplaylogframe=\log Display --- log_frame =
tk.Frame(mainframe,main_frame, bg=self.style["widgetbgwidget_bg"]) logframe.pack(fill=tk.BOTH,expand=True)log_frame.pack(fill=tk.BOTH, expand=True) self.logwidget=log_widget = scrolledtext.ScrolledText(logframe,log_frame, wrap=tk.WORD, bg=self.style["bg"], fg=self.style["fg"], font=self.style["logfontlog_font"], state=tk.DISABLED) self.logwidget.pack(fill=tk.BOTH,log_widget.pack(fill=tk.BOTH, expand=True, padx=5, pady=5) defcreatebutton(self,def_create_button(self, parent, text, command, row, col, state=tk.NORMAL, bg=None, columnspan=1): """Helper function createstyled\to create styled buttons.""" button = tk.Button(parent, text=text, command=command, state=state, font=self.style["buttonfontbutton_font"], bg=bg or self.style["buttonbgbutton_bg"], fg=self.style["fg"], activebackground=self.style["accentbgaccent_bg"], relief=tk.FLAT, padx=10, pady=5) button.grid(row=row, column=col, padx=5, pady=5, sticky="ew", columnspan=columnspan) return button # --- Thread and State Management --- defstarttask(self,taskfunction):def_start_task(self, task_function): """Generic function startataskinanew\to start a task in a new thread.""" if self.workerthreadandworker_thread and self.workerthread.isalive():worker_thread.is_alive(): messagebox.showwarning("Busy", "A process is already running. Please wait or stop it.") return self.togglecontrols(tk.DISABLED)_toggle_controls(tk.DISABLED) self.stopbtn.config(state=tk.NORMAL)stop_btn.config(state=tk.NORMAL) self.stopevent.clear()stop_event.clear() self.workerthread=worker_thread = threading.Thread(target=taskfunction,daemon=True)t=task_function, daemon=True) self.
workerthread.start()deftaskcompleted(self):worker_thread.start() def_task_completed(self):
"""Resets the UI after a task is finished.""" self.updatestatus(update_status("Status: Idle") self.togglecontrols(tk.NORMAL)_toggle_controls(tk.NORMAL) self.continuebtn.config(state=tk.DISABLED)continue_btn.config(state=tk.DISABLED) self.stopbtn.config(state=tk.DISABLED)stop_btn.config(state=tk.DISABLED) print("\nProcess\nProcess finished. Ready for next task. 👍") deftogglecontrols(self,def_toggle_controls(self, state): """Enables or disables main action buttons.""" self.scrapebtn.config(state=state)scrape_btn.config(state=state) self.uploadbtn.config(state=state)upload_btn.config(state=state) self.
transferbtn.config(state=state)defsetcontinueevent(self):transfer_btn.config(state=state) def_set_continue_event(self):
"""Sets the event signaltheworkerthread\to signal the worker thread \to continue.""" self.
continueevent.set()defstopprocess(self):continue_event.set() def_stop_process(self):
"""Signals the worker thread stopandcleans\to stop and cleans up.""" if self.workerthreadandworker_thread and self.workerthread.isalive():worker_thread.is_alive(): print("\n\n🛑 Stop signal received. Attempting haltthe\to halt the process...") self.stopevent.set()stop_event.set() self.continueevent.set()continue_event.set() # Unblock any waiting states self.
stopbtn.config(state=tk.DISABLED)defwaitforusercontinue(self,stop_btn.config(state=tk.DISABLED) def_wait_for_user_continue(self,
message): """Displays a message and waits for the user press\to press 'Continue.Continue^{\prime}.""" self.updatestatus(message)update_status(message) self.continuebtn.config(state=tk.NORMAL)continue_btn.config(state=tk.NORMAL) self.continueevent.wait()continue_event.wait() # Block thread until event is set self.continueevent.clear()continue_event.clear() # Reset event for next use self.continuebtn.config(state=tk.DISABLED)continue_btn.config(state=tk.DISABLED) self.updatestatus(update_status("Status: In Progress...") if self.
stopevent.isset():raisestop_event.is_set(): raise
KeyboardInterrupt("Process stopped by user.") # --- Selenium Driver Setup --- defsetupdriver(self):def_setup_driver(self): """Configures and returns a Selenium WebDriver instance.""" try: print("Setting up Chrome WebDriver...") options = Options() options.addexperimentaloption(add_experimental_option("detach", True) options.addexperimentaloption(add_experimental_option("excludeSwitches", ["enable-automation"]) options.addexperimentaloption(add_experimental_option('useAutomationExtension,useAutomationExtension^{\prime}, False) options.addargument(add_argument("--disable-blink-features=AutomationControlled") options.addargument(radd_argument(r"--user-data-dir=C:\Users\shabab\AppData\Local\Google\Chrome\User\Users\shabab\AppData\Local\Google\Chrome\User Data") # MODIFY THIS PATH options.addargument(radd_argument(r"--profile-directory=Profile 1") # MODIFY THIS PROFILE serv = Service(ChromeDriverManager().install()) driver = webdriver.Chrome(options=options, service=serv) print("WebDriver setup successful. 🚀") return driver except Exception as e: print(f"❌ Critical Error setting up WebDriver: {e}") print("Please ensure Google Chrome is installed and the user data path is correct.") return None # --- Task Starter Methods --- defstartscraper(self):def_start_scraper(self): self.
starttask(self.runscraperlogic)defstartuploader(self):_start_task(self.run_scraper_logic) def_start_uploader(self):
self.
starttask(self.runuploaderlogic)defstarttransfer(self):_start_task(self.run_uploader_logic) def_start_transfer(self):
self.starttask(self.runtransferlogic)_start_task(self.run_transfer_logic) # --- Logging and GUI Updates --- class QueueIO: """A file-like object that writes a\to a queue.""" def __init__(self, queue_): self.queue = queue_ def write(self, text): self.queue.put(text) def flush(self): pass defprocesslogqueue(self):def_process_log_queue(self): """Periodically checks the queue and updates the log\log widget.""" try: while not self.
logqueue.empty():text=log_queue.empty(): text =
self.logqueue.getnowait()log_queue.get_nowait() self.logwidget.config(state=tk.NORMAL)log_widget.config(state=tk.NORMAL) self.logwidget.insert(tk.END,log_widget.insert(tk.END, text) self.logwidget.see(tk.END)log_widget.see(tk.END) self.
logwidget.config(state=tk.DISABLED)exceptlog_widget.config(state=tk.DISABLED) except
queue.Empty: pass self.after(100, self.
processlogqueue)defupdatestatus(self,_process_log_queue) def update_status(self,
text): """Thread-safe method updatethestatus\to update the status label.""" self.
statuslabel.config(text=text)defonclosing(self):status_label.config(text=text) def_on_closing(self):
"""Handles the window closing event.""" if self.workerthreadandworker_thread and self.
workerthread.isalive():ifworker_thread.is_alive(): if
messagebox.askyesno("Exit", "A process is still running. Are you sure you want \to exit?"): self.destroy() else: self.destroy() # ================================================================================= # SCRIPT-1: SCRAPER LOGIC # ================================================================================= def
runscraperlogic(self):driver=Nonewb=Nonerun_scraper_logic(self): driver = None wb = None
try: driver = self.
setupdriver()ifnot_setup_driver() if not
driver: return url = "https://admin.brritto.com/dashboard/mcq" driver.get(url) self.waitforusercontinue(_wait_for_user_continue("Instruction: Apply filters in Chrome, then press 'Continue.Continue^{\prime}.") # Initialize Excel wb = openpyxl.Workbook() ws = wb.active ws.title = "MCQ Data" ws.append(["Question", "Option A", "A is Correct", "Option B", "B is Correct", "Option C", "C is Correct", "Option D", "D is Correct", "Option E", "E is Correct", "Explanation", "Link", "Copy Link"])
Globalindex=10whilenotGlobal_index = -10 while not
self.
stopevent.isset():questionlinks=stop_event.is_set(): question_links =
driver.findelements(By.XPATH,find_elements(By.XPATH, "//a[contains(@href, '/dashboard/mcq/view/')]") print(f"\nFoundlen(questionlinks)questionlinksonthis\nFound{len(question_links)} question links on this page.")
Globalindex+=10forGlobal_index += 10 for
index, link in enumerate(questionlinks,question_links, start=1): if self.stopevent.isset():raisestop_event.is_set(): raise KeyboardInterrupt("Stop requested.") href = link.getattribute(get_attribute("href") driver.executescript(execute_script("window.open(arguments[0], 'blank);_blank^{\prime});", href) driver.switchto.window(driver.windowhandles[1])switch_to.window(driver.window_handles[1]) try: WebDriverWait(driver, 15).until(EC.presenceofelementlocated((By.XPATH,presence_of_element_located((By.XPATH, "//h5[contains(text(), 'Question)]/followingsibling::divQuestion^{\prime})]/following-sibling::div"))) questionel=question_el = driver.findelement(By.XPATH,find_element(By.XPATH, "//h5[contains(text(), 'Question)]/followingsibling::divQuestion^{\prime})]/following-sibling::div") questiontext=question_text = self.extractcombinedtextwithlatex(questionel.getattribute(_extract_combined_text_with_latex(question_el.get_attribute("innerHTML")) questionimgs=questionel.findelements(By.XPATH,question_imgs = question_el.find_elements(By.XPATH, ".//img[@src]") for qicount,imginqi_count, img in enumerate(questionimgs):question_imgs): ws.cell(row=Globalindex+index+1,column=15+qicount7,w=Global_index + index + 1, column=15 + qi_count * 7, value=img.getattribute(get_attribute("src")) optionblocks=option_blocks = driver.findelements(By.XPATH,find_elements(By.XPATH, "//div[contains(@class, 'pb-2') and contains(@class, 'flex)]flex^{\prime})]")
optiontexts,correctflags=[],[]foroptidx,blockinoption_texts, correct_flags = [], [] for opt_idx, block in
enumerate(
optionblocks):optiontext=option_blocks): option_text =
self.extractcombinedtextwithlatex(block.findelement(By.XPATH,_extract_combined_text_with_latex(block.find_element(By.XPATH, ".//div").getattribute(get_attribute("innerHTML"))
optiontexts.append(optiontext)optionimgs=option_texts.append(option_text) option_imgs =
block.findelements(By.XPATH,find_elements(By.XPATH, ".//div//img[@src]") for oicount,imginoi_count, img in enumerate(optionimgs):option_imgs): ws.cell(row=Globalindex+index+1,column=16+optidx+oicount7,w=Global_index+index+1, column=16+opt_idx+oi_count*7, value=img.getattribute(get_attribute("src")) correctflags.append(bool(block.findelements(By.XPATH,correct_flags.append(bool(block.find_elements(By.XPATH, ".//span[@role='imgandimg^{\prime} and @aria-label='check-square]square^{\prime}]"))) while len(optiontexts)option_texts) < 5: optiontexts.append(option_texts.append("")
correctflags.append(False)explanationel=correct_flags.append(False) explanation_el =
driver.findelement(By.XPATH,find_element(By.XPATH, "//h5[contains(text(), 'Explanation)]/followingsibling::divExplanation^{\prime})]/following-sibling::div") explanationtext=explanation_text = self.extractcombinedtextwithlatex(explanationel.getattribute(_extract_combined_text_with_latex(explanation_el.get_attribute("innerHTML")) explanationimgs=explanationel.findelements(By.XPATH,explanation_imgs = explanation_el.find_elements(By.XPATH, ".//img[@src]") for eicount,imginei_count, img in enumerate(explanationimgs):explanation_imgs): ws.cell(row=Globalindex+index+1,column=22+eicount7,w=Global_index+index+1, column=22+ei_count*7, value=img.getattribute(get_attribute("src"))
rowdata=[questiontext,optiontexts[0],correctflags[0],optiontexts[1],correctflags[1],optiontexts[2],correctflags[2],optiontexts[3],correctflags[3],optiontexts[4],correctflags[4],explanationtext,f=HYPERLINK(row_data = [ question_text, option_texts[0], correct_flags[0], option_texts[1], correct_flags[1], option_texts[2], correct_flags[2], option_texts[3], correct_flags[3], option_texts[4], correct_flags[4], explanation_text, f^{\prime}=HYPERLINK(
"{href}", "Q{Global_index + index}")', f=HYPERLINK(f^{\prime}=HYPERLINK("{href}", "{href}")' ] ws.append(rowdata)row_data) print(f" [{Global_index + index}] ✅ Saved question.") except Exception as e: print(f" [{Global_index + index}] ❌ Failed parsequestion[link:href]:e\to parse question [link: {href}]: {e}") finally: driver.close() driver.switchto.window(driver.windowhandles[0])switch_to.window(driver.window_handles[0]) # Go nextpage\to next page try: nextbtn=next_btn = driver.findelement(By.XPATH,find_element(By.XPATH, "//li[@title='Next PageandPage^{\prime} and not(@aria-disabled='true)]/buttontrue^{\prime})]/button") driver.executescript(execute_script("arguments[0].click();", nextbtn)next_btn) print("Navigating thenext\to the next page...") time.sleep(0.5) WebDriverWait(driver, 15).untilnot(EC.presenceofelementlocated((By.CSSSELECTOR,until_not(EC.presence_of_element_located((By.CSS_SELECTOR, "div.ant-spin-container.ant-spin-blur"))) time.sleep(2) except: print("\nNomorepages\nNo more pages found. Scraping complete.") break except KeyboardInterrupt: print("\nScrapingstoppedby\nScraping stopped by user.") except Exception as e: print(f"\nAnunexpectederroroccurredduring\nAn unexpected error occurred during scraping: {e}") finally: if wb: self.
saveworkbook(wb)if_save_workbook(wb) if
driver: driver.quit() self.after(100, self.
taskcompleted)defextractcombinedtextwithlatex(self,htmlstr):soup=_task_completed) def_extract_combined_text_with_latex(self, html_str): soup =
BeautifulSoup(htmlstr,html_str, "html.parser") result = "" mathtags=math_tags = set(soup.findall(find_all("math")) for elem in soup.descendants: if elem.name == "annotation": result += f" \
{elem.text.strip()} \
" elif any(parent in mathtagsormath_tags or parent.get("aria-hidden") == "true" for parent in elem.parents): continue elif isinstance(elem, NavigableString) and (stripped := elem.strip()): result += stripped + " " return result.strip() defsaveworkbook(self,def_save_workbook(self, wb): try: filepath=file_path = filedialog.asksaveasfilename( defaultextension=".xlsx", filetypes=[("Excel files", "*.xlsx"), ("All files", "*.*")], title="Save Scraped MCQ Data As", initialfile="mcqdata.xlsxmcq_data.xlsx" ) if filepath:file_path: wb.save(filepath)file_path) print(f"Data saved successfully filepath\to{file_path}") else: print("Save operation cancelled by user. Data not saved.") except Exception as e: print(f"Error saving file: {e}") # ================================================================================= # SCRIPT-2: UPLOADER LOGIC # ================================================================================= def
runuploaderlogic(self):driver=Nonerun_uploader_logic(self): driver = None
try: # Get number of questions from GUI try:
numtoupload=(self.numquestionsentry.get())ifnumtouploadnum_to_upload = \int(self.num_questions_entry.get()) if num_to_upload
<= 0: print("❌ Please enter a positive number of questions.") return except ValueError: print("❌ Invalid number. Please enter a valid integer.") return # Load Excel file filepath=file_path = filedialog.askopenfilename( title="Load MCQ Data From", defaultextension=".xlsx", filetypes=[("Excel files", "*.xlsx"), ("All files", "*.*")] ) if not filepath:file_path: print("No file selected. Aborting upload.") return wb1 = openpyxl.
loadworkbook(filepath)ws1=load_workbook(file_path) ws1 =
wb1.active print(f"Loaded data from: {file_path}") driver = self.
setupdriver()ifnot_setup_driver() if not
driver: return url = "https://admin.brritto.com/dashboard/mcq/create" driver.get(url) wait = WebDriverWait(driver, 15) self.waitforusercontinue(_wait_for_user_continue("Instruction: Apply filters on the 'Create MCQMCQ^{\prime} page, then press 'Continue.Continue^{\prime}.") for n in range(2,
numtoupload+2):ifnum_to_upload + 2): if
self.stopevent.isset():raisestop_event.is_set(): raise KeyboardInterrupt("Stop requested.") print(f"\nProcessingRown\n--- Processing Row {n} ---") # Get data from Excel row question, option1, option2, option3, option4, option5, explanation = ( ws1[f'A{n}'].value, ws1[f'B{n}'].value, ws1[f'D{n}'].value, ws1[f'F{n}'].value, ws1[f'H{n}'].value, ws1[f'J{n}'].value, ws1[f'L{n}'].value ) iframefields=[iframe_fields = ['questionText,questionText^{\prime}, 'options_0_text^{\prime}, 'options_1_text^{\prime}, 'options_2_text^{\prime}, 'options_3_text^{\prime}, 'options_4_text^{\prime}, '
explanation]iframecontent=[question,explanation^{\prime}] iframe_content = [question,
option1, option2, option3, option4, option5, explanation] # Click 'Add
Optionifa5thoptionexistsifoption5orOption^{\prime} if a 5th option exists if option5 or
ws1[f'U{n}'].value: try: addoptionbtn=add_option_btn = wait.until(EC.elementtobeclickable((By.XPATH,element_to_be_clickable((By.XPATH, "//button[.//span[text()='Add Option]]Option^{\prime}]]"))) driver.executescript(execute_script("arguments[0].scrollIntoView({block: 'center^{\prime}});",
addoptionbtn)addoptionbtn.click()add_option_btn) add_option_btn.click()
print(" - Added 5th option field.") except TimeoutException: print(" - Warning: Did not find 'Add Optionbuttonfor5thOption^{\prime} button for 5th option.") # Image Upload Logic imgcolumns=[img_columns = ['O,O^{\prime}, 'Q,Q^{\prime}, 'R,R^{\prime}, 'S,S^{\prime}, 'T,T^{\prime}, 'U,U^{\prime}, '
P]forimgcolidx,colletterinP^{\prime}] for img_col_idx, col_letter in
enumerate(
imgcolumns):basecolnum=img_columns): base_col_num =
openpyxl.utils.
columnindexfromstring(colletter)imgoffset=0whilecolumn_index_from_string(col_letter) img_offset = 0 while
True: targetcell=target_cell = ws1.cell(row=n, colum
n=basecolnum+imgoffset7)ifnottargetcell.value:breakn=base_col_num + img_offset * 7) if not target_cell.value: break
try: imgbtn=img_btn = wait.until(EC.elementtobeclickable((By.CSSSELECTOR,element_to_be_clickable((By.CSS_SELECTOR, f"textarea#tinymceEditoriframefields[imgcolidx]tinymceEditor_{iframe_fields[img_col_idx]} ~ div.tox.tox-tinymce button.tox-tbtn[aria-label*='image]image^{\prime}]"))) driver.executescript(execute_script("arguments[0].scrollIntoView({block: 'center^{\prime}});",
imgbtn)imgbtn.click()imginput=img_btn) img_btn.click() img_input =
wait.until(EC.presenceofelementlocated((By.CSSSELECTOR,presence_of_element_located((By.CSS_SELECTOR, "div.tox-dialog input.tox-textfield"))) jscommand=js_command = f"arguments[0].value = '{target_cell.value}'; arguments[0].dispatchEvent(new Event('change,bubbles:true))change^{\prime},{{bubbles : true}}))" driver.
executescript(jscommand,imginput)imginput.sendkeys(Keys.ENTER)execute_script(js_command, img_input) img_input.send_keys(Keys.ENTER)
print(f" - Uploaded image for {iframe_fields[img_col_idx]}.")
imgoffset+=1exceptimg_offset += 1 except
TimeoutException: print(f" - ❌ Failed uploadimageforiframefields[imgcolidx].\to upload image for {iframe_fields[img_col_idx]}.") break # Text Content Entry for j, field in enumerate(
iframefields):ifj==5andnotiframe_fields): if j == 5 and not
option5: continue # Skip 5th option if no data if iframecontent[j]:iframe_content[j]: try: wait.until(EC.frametobeavailableandswitchtoit((By.CSSSELECTOR,frame_to_be_available_and_switch_to_it((By.CSS_SELECTOR, f"iframe#tinymceEditor_{field}_ifr"))) body = wait.until(EC.presenceofelementlocated((By.ID,presence_of_element_located((By.ID, "tinymce"))) body.sendkeys(str(iframecontent[j]))send_keys(str(iframe_content[j])) # Ensure content is string driver.switchto.defaultcontent()switch_to.default_content() print(f" - Entered text for {field}.") except TimeoutException: print(f" - ❌ Timed out finding iframe for {field}.") driver.switchto.defaultcontent()switch_to.default_content() # Crucial switchback\to switch back # Select Correct Answer correctcols=[correct_cols = ['C,C^{\prime}, 'E,E^{\prime}, 'G,G^{\prime}, 'I,I^{\prime}, '
K]forK^{\prime}] for
idx, col in enumerate(
correctcols):ifcorrect_cols): if
ws1[fcolnf^{\prime}{col}{n}'].value: try: tickbox=tick_box = wait.until(EC.presenceofelementlocated((By.CSSSELECTOR,presence_of_element_located((By.CSS_SELECTOR, f"input#mcqForm_options_{idx}_isCorrect"))) driver.executescript(execute_script("arguments[0].scrollIntoView({block: 'center^{\prime}}); arguments[0].click();", tickbox)tick_box) print(f" - Marked Option {idx+1} as correct.") except TimeoutException: print(f" - ❌ Failed markOptionidx+1as\to mark Option {idx+1} as correct.") # Set Difficulty try: difficultyradio=difficulty_radio = wait.until(EC.presenceofelementlocated((By.CSSSELECTOR,presence_of_element_located((By.CSS_SELECTOR, "div[class^='ant-radio-group]group^{\prime}] input.ant-radio-input[value='Medium]Medium^{\prime}]"))) driver.executescript(execute_script("arguments[0].click();",
difficultyradio)exceptdifficulty_radio) except
TimeoutException: print(" - Warning: Could not set difficulty \to 'Medium.Medium^{\prime}.") # Submit try: submitbtn=submit_btn = wait.until(EC.elementtobeclickable((By.XPATH,element_to_be_clickable((By.XPATH, "//button[@type='submitand.//span[text()=submit^{\prime} and .//span[text()='Submit]]Submit^{\prime}]]"))) wait.untilnot(EC.presenceofelementlocated((By.CSSSELECTOR,until_not(EC.presence_of_element_located((By.CSS_SELECTOR, "div.ant-notification"))) submitbtn.click()submit_btn.click() print(f" ✅ Submitted MCQ for row {n}.") wait.until(EC.presenceofelementlocated((By.CSSSELECTOR,presence_of_element_located((By.CSS_SELECTOR, "div.ant-notification"))) time.sleep(2) # Wait for page
resetexcept\to reset except
TimeoutException: print(f" - ❌ Failed submitformforrown.Checkforerrormessagesonthe\to submit form for row {n}. Check for error messages on the page.") except KeyboardInterrupt: print("\nUploadprocessstoppedby\nUpload process stopped by user.") except Exception as e: print(f"\nAnunexpectederroroccurredduring\nAn unexpected error occurred during upload: {e}") finally: if driver: driver.quit() self.after(100, self.taskcompleted)_task_completed) # ================================================================================= # SCRIPT-3: TRANSFER LOGIC # ================================================================================= def
runtransferlogic(self):driver=Nonerun_transfer_logic(self): driver = None
try: driver = self.
setupdriver()ifnot_setup_driver() if not
driver: return wait = WebDriverWait(driver, 15) iframefields=[iframe_fields = ['questionText,questionText^{\prime}, 'options_0_text^{\prime}, 'options_1_text^{\prime}, 'options_2_text^{\prime}, 'options_3_text^{\prime}, 'options_4_text^{\prime}, '
explanation]url1=explanation^{\prime}] url_1 =
"https://admin.brritto.com/dashboard/mcq" driver.get(url1)url_1) self.waitforusercontinue(_wait_for_user_continue("STEP 1: Apply filters on the 'MCQ ListList^{\prime} page, then press 'Continue.Continue^{\prime}.") url2=url_2= "https://admin.brritto.com/dashboard/mcq/create" driver.executescript(execute_script("window.open(arguments[0], 'blank);_blank^{\prime});", url2)url_2) driver.switchto.window(driver.windowhandles[1])switch_to.window(driver.window_handles[1]) # Switch \to "Create" tab self.waitforusercontinue(_wait_for_user_continue("STEP 2: Apply filters on the 'Create MCQMCQ^{\prime} page, then press 'Continue.Continue^{\prime}.") driver.switchto.window(driver.windowhandles[0])switch_to.window(driver.window_handles[0]) # Switch back \to "List" tab
Globalindex=10whilenotGlobal_index = -10 while not
self.
stopevent.isset():questionlinks=stop_event.is_set(): question_links =
driver.findelements(By.XPATH,find_elements(By.XPATH, "//a[contains(@href, '/dashboard/mcq/view/')]") print(f"\nFoundlen(questionlinks)questionsonthis\nFound{len(question_links)} questions on this page.")
Globalindex+=10forGlobal_index += 10 for
index, link in enumerate(questionlinks,question_links, start=1): if self.stopevent.isset():raisestop_event.is_set(): raise KeyboardInterrupt("Stop requested.") href = link.getattribute(get_attribute("href") driver.executescript(execute_script("window.open(arguments[0], 'blank);_blank^{\prime});", href) driver.switchto.window(driver.windowhandles[2])switch_to.window(driver.window_handles[2]) # Switch new\to new "View" tab try: print(f" [{Global_index + index}] Processing: {href}") wait.until(EC.presenceofelementlocated((By.XPATH,presence_of_element_located((By.XPATH, "//h5[contains(text(), 'Question)]Question^{\prime})]"))) # Check number of options and which is correct optionblocks=option_blocks = driver.findelements(By.XPATH,find_elements(By.XPATH, "//div[contains(@class, 'pb-2') and contains(@class, 'flex)]flex^{\prime})]") optionflags=[bool(b.findelements(By.XPATH,option_flags = [bool(b.find_elements(By.XPATH, ".//span[@role='imgandimg^{\prime} and @aria-label='check-square]square^{\prime}]")) for b in
optionblocks]hasfifthoption=option_blocks] has_fifth_option =
len(optionblocks)==5option_blocks) == 5 # Click edit button editbtn=edit_btn = wait.until(EC.elementtobeclickable((By.XPATH,element_to_be_clickable((By.XPATH,"//button[./span[text()='Edit]]Edit^{\prime}]]"))) editbtn.click()edit_btn.click() time.sleep(1) # Wait for edit mode load\to load # Switch CreateTabandadd5thoptionifneeded\to Create Tab and add 5th option if needed driver.
switchto.window(driver.windowhandles[1])ifhasfifthoption:addoptionbutton=switch_to.window(driver.window_handles[1]) if has_fifth_option: add_option_button =
wait.until(EC.elementtobeclickable((By.XPATH,element_to_be_clickable((By.XPATH, "//button[.//span[text()='Add Option]]Option^{\prime}]]"))) driver.executescript(execute_script("arguments[0].scrollIntoView({block: 'center^{\prime}});",
addoptionbutton)addoptionbutton.click()add_option_button) add_option_button.click()
# Copy-paste content for j, field in enumerate(
iframefields):ifj==5andnothasfifthoption:continueiframe_fields): if j == 5 and not has_fifth_option: continue
# Copy from source driver.switchto.window(driver.windowhandles[2])switch_to.window(driver.window_handles[2]) wait.until(EC.frametobeavailableandswitchtoit((By.CSSSELECTOR,frame_to_be_available_and_switch_to_it((By.CSS_SELECTOR, f"iframe#tinymceEditor_{field}_ifr"))) body = wait.until(EC.presenceofelementlocated((By.ID,presence_of_element_located((By.ID, "tinymce"))) body.sendkeys(Keys.CONTROL,send_keys(Keys.CONTROL, "a") body.sendkeys(Keys.CONTROL,send_keys(Keys.CONTROL, "c") driver.switchto.defaultcontent()switch_to.default_content() # Paste destination\to destination driver.switchto.window(driver.windowhandles[1])switch_to.window(driver.window_handles[1]) wait.until(EC.frametobeavailableandswitchtoit((By.CSSSELECTOR,frame_to_be_available_and_switch_to_it((By.CSS_SELECTOR, f"iframe#tinymceEditor_{field}_ifr"))) body = wait.until(EC.presenceofelementlocated((By.ID,presence_of_element_located((By.ID, "tinymce"))) body.sendkeys(Keys.CONTROL,send_keys(Keys.CONTROL, "v") driver.switchto.defaultcontent()switch_to.default_content() print(f" - Content copied successfully.") # Close the source "Edit" tab driver.switchto.window(driver.windowhandles[2])switch_to.window(driver.window_handles[2]) driver.close() driver.switchto.window(driver.windowhandles[1])switch_to.window(driver.window_handles[1]) # Set correct option and difficulty for h, iscorrectinis_correct in enumerate(
optionflags):ifiscorrect:tickoption=option_flags): if is_correct: tick_option =
wait.until(EC.presenceofelementlocated((By.CSSSELECTOR,presence_of_element_located((By.CSS_SELECTOR, f"input#mcqForm_options_{h}_isCorrect"))) driver.executescript(execute_script("arguments[0].scrollIntoView({block: 'center^{\prime}}); arguments[0].click();",
tickoption)difficultyradio=tick_option) difficulty_radio =
wait.until(EC.presenceofelementlocated((By.CSSSELECTOR,presence_of_element_located((By.CSS_SELECTOR, "div[class^='ant-radio-group]group^{\prime}] input.ant-radio-input[value='Medium]Medium^{\prime}]"))) driver.executescript(execute_script("arguments[0].click();", difficultyradio)difficulty_radio) # Submit submitbutton=submit_button = wait.until(EC.elementtobeclickable((By.XPATH,element_to_be_clickable((By.XPATH, "//button[@type='submitand.//span[text()=submit^{\prime} and .//span[text()='Submit]]Submit^{\prime}]]"))) wait.untilnot(EC.presenceofelementlocated((By.CSSSELECTOR,until_not(EC.presence_of_element_located((By.CSS_SELECTOR, "div.ant-notification"))) submitbutton.click()submit_button.click() wait.until(EC.presenceofelementlocated((By.CSSSELECTOR,presence_of_element_located((By.CSS_SELECTOR, "div.ant-notification"))) print(f" - ✅ Transferred and submitted successfully.") time.sleep(2) except Exception as e: print(f" - ❌ An error occurred transferring question {href}: {e}") # Clean up failed tabs if len(driver.windowhandles)window_handles) > 2: driver.switchto.window(driver.windowhandles[2])switch_to.window(driver.window_handles[2]) driver.close() finally: driver.switchto.window(driver.windowhandles[0])switch_to.window(driver.window_handles[0]) # Switch back listview\to list view # Navigate nextpageinlistview\to next page in list view try: nextbtn=next_btn = driver.findelement(By.XPATH,find_element(By.XPATH, "//li[@title='Next PageandPage^{\prime} and not(@aria-disabled='true)]/buttontrue^{\prime})]/button") driver.executescript(execute_script("arguments[0].click();", nextbtn)next_btn) print("Navigating thenext\to the next page...") time.sleep(0.5) wait.untilnot(EC.presenceofelementlocated((By.CSSSELECTOR,until_not(EC.presence_of_element_located((By.CSS_SELECTOR, "div.ant-spin-container.ant-spin-blur"))) time.sleep(2) except: print("\nNomorepages\nNo more pages found. Transfer complete.") break except KeyboardInterrupt: print("\nTransferstoppedby\nTransfer stopped by user.") except Exception as e: print(f"\nAnunexpectederroroccurredduring\nAn unexpected error occurred during transfer: {e}") finally: if driver: driver.quit() self.after(100, self.
_task_completed) if __name__ ==
"__main__": app=MCQTool()p = MCQ_Tool() app.mainloop()

  • .affirmative/positive
  • .summit/bottom
  • .harmony/discord
  • .pertinent/irrelevant

উত্তর

affirmative/positive
AdmissionNDC - Prosthuti BoosterHumanities
12টি সম্পর্কিত প্রশ্ন — উত্তর ও ব্যাখ্যা লকড

1.n = 2 n = 1 ধাপান্তরের জন্য নিচের কোনটি ক্ষুদ্রতম তরঙ্গ দৈর্ঘ্যের ফোটন উৎপন্ন করে? (Which one of the following will produce photon of the smallest wavelength for n = 2 n = 1 transition?)

  • H
  • D
  • He +
  • Li 2+

উত্তর ও ব্যাখ্যা দেখতে ফ্রি রেজিস্ট্রেশন করো

ফ্রি শুরু করো

2.একটি প্রক্রিয়ায় একটি আদর্শ গ্যাসের চাপ দ্বিগুণ করা হয়, যেখানে গ্যাস কর্তৃক ত্যাগকৃত তাপ এর উপর কৃতকাজের সমান। এর ফলে গ্যাসের আয়তনের কী হবে? (The pressure of an ideal gas is doubled during a process in which the energy, given up as heat by the gas, is equal to the work done on the gas. What happens to the volume?)

  • দ্বিগুণ হবে (Doubled)
  • অর্ধেক হবে (Halved)
  • অপরিবর্তিত থাকবে (Unchanged)
  • আরো তথ্য প্রয়োজন (Need more information)

উত্তর ও ব্যাখ্যা দেখতে ফ্রি রেজিস্ট্রেশন করো

ফ্রি শুরু করো

3.পৃথিবীর পৃষ্ঠ থেকে m ভরের একটি বস্তু উল্লম্ব বরাবর উপরের দিকে নিক্ষিপ্ত হলো। বস্তুটি যদি সর্বোচ্চ r m উচ্চতায় উঠে তবে এর আদিবেগ v i কত? পৃথিবীর ব্যাসার্ধ এবং ভর যথাক্রমে R E এবং M E । (An object of mass m is thrown vertically upward from the earth's surface. If the object reaches a maximum height of r m , what is its initial speed v i ? The radius and mass of the earth are R E and M E respectively.)

  • vi=2GME(1RE1RE+rm)v_i=\sqrt{2 G M_E\left(\frac{1}{R_E}-\frac{1}{R_E+r_m}\right)}
  • vi=2GME(1RE+1RE+rm)v_i=\sqrt{2 G M_E\left(\frac{1}{R_E}+\frac{1}{R_E+r_m}\right)}
  • vi=2 g(RE+rm)\mathrm{v}_{\mathrm{i}}=\sqrt{2 \mathrm{~g}\left(\mathrm{R}_{\mathrm{E}}+\mathrm{r}_{\mathrm{m}}\right)}
  • vi=2GME(1RE+rm1RE)v_i=\sqrt{2 G M_E\left(\frac{1}{R_E+r_m}-\frac{1}{R_E}\right)}

উত্তর ও ব্যাখ্যা দেখতে ফ্রি রেজিস্ট্রেশন করো

ফ্রি শুরু করো

4.একটি আনুভূমিক ঘর্ষণহীন তলের উপর একটি কণা প্রাথমিকভাবে স্থির অবস্থায় আছে। কণাটির উপর একটি ধ্রুব আনুভূমিক বল F প্রযুক্ত হচ্ছে। নিচের কোন লেখচিত্রটি কৃতকাজ W বনাম কণাটির দ্রুতি v সঠিকভাবে প্রকাশ করে? (A particle is initially at rest on a horizontal frictionless surface. A constant horizontal force F is applied on it. Which of the following is the correct plot of work done W versus speed v of the particle?)

  • question image
  • question image
  • question image
  • question image

উত্তর ও ব্যাখ্যা দেখতে ফ্রি রেজিস্ট্রেশন করো

ফ্রি শুরু করো

5.তিনটি ভেক্টর

A=6i^8j^, B=8i^+3j^\overrightarrow{\mathrm{A}}=6 \hat{\mathrm{i}}-8 \hat{\mathrm{j}}, \overrightarrow{\mathrm{~B}}=-8 \hat{\mathrm{i}}+3 \hat{\mathrm{j}}
এবং
C=26i^+19j^\overrightarrow{\mathrm{C}}=26 \hat{\mathrm{i}}+19 \hat{\mathrm{j}}
দেওয়া আছে। যদি
a A+b B+C=\mathrm{a} \overrightarrow{\mathrm{~A}}+\mathrm{b} \overrightarrow{\mathrm{~B}}+\overrightarrow{\mathrm{C}}=
0\overrightarrow{0}
হয় তবে a ও b এর সম্ভাব্য মানগুলো হবে—

  • a = 7, b = 5
  • a = 5, b = 7
  • a = 5, b = 8
  • a = 3, b = 7

উত্তর ও ব্যাখ্যা দেখতে ফ্রি রেজিস্ট্রেশন করো

ফ্রি শুরু করো

6.একটি প্রোটনের গতিশক্তি এর মোট শক্তির 75% । প্রোটনটির দ্রুতি কত?

  • 154C\frac{\sqrt{15}}{4} \mathrm{C}
  • 34C\frac{3}{4} \mathrm{C}
  • 916C\frac{9}{16} \mathrm{C}
  • 1516C\frac{15}{16} \mathrm{C}

উত্তর ও ব্যাখ্যা দেখতে ফ্রি রেজিস্ট্রেশন করো

ফ্রি শুরু করো

7.নিম্নের কোন বিবৃতিটি একটি 2 ইনপুট বিশিষ্ট XOR গেটের জন্য সত্য?

  • উভয় ইনপুট 1 হলেই আউটপুট 1 হয়। (The output is 1 only when both inputs are 1.)
  • উভয় ইনপুট 0 হলেই আউটপুট 1 হয়। (The output is 1 only when both inputs are 0.)
  • ইনপুটগুলো ভিন্ন হলে আউটপুট 1 হয়। (The output is 1 when the inputs are different.)
  • ইনপুটগুলো ভিন্ন হলে আউটপুট 0 হয়। (The output is 0 when the inputs are different.)

উত্তর ও ব্যাখ্যা দেখতে ফ্রি রেজিস্ট্রেশন করো

ফ্রি শুরু করো

8.x = e –2t , y = 2 cos3t\cos 3t এবং z = 2 sin2t\sin 2t দ্বারা বর্ণিত বক্রপথে একটি কণা ভ্রমণ করে। t = 0 s সময়ে কণাটির বেগ কত হবে?

  • 2i^+4k^-2 \hat{\mathrm{i}}+4 \hat{\mathrm{k}}
  • 2i^6j^+4k^-2 \hat{i}-6 \hat{j}+4 \hat{k}
  • i^+2i^-\hat{i}+2 \hat{i}
  • 2i^+6j^+4k^2 \hat{i}+6 \hat{j}+4 \hat{k}

উত্তর ও ব্যাখ্যা দেখতে ফ্রি রেজিস্ট্রেশন করো

ফ্রি শুরু করো

9.নিচের কোনটি a থেকে e বিন্দু পর্যন্ত একটি দোলকের ববের ত্বরণ সবচেয়ে ভালোমতো চিত্রায়িত করে।

  • question image
  • question image
  • question image
  • question image

উত্তর ও ব্যাখ্যা দেখতে ফ্রি রেজিস্ট্রেশন করো

ফ্রি শুরু করো

10.1.1m দৈর্ঘ্য ও 2.0 cm ব্যাস বিশিষ্ট একটি আনুভূমিক রডের এক প্রান্ত একটি দেয়ালের সাথে সুদৃঢ়ভাবে আটকানো আছে। রডটির অপর প্রান্তে 31.4 kg ভর ঝুলানোতে এর কৌণিক বিকৃতি 0.01 রেডিয়ান হলো। রডটির উপাদানের দৃঢ়তার গুণাংক কত? g = 10 m/s 2 ।

  • 0.25 MPa
  • 0.024 GPa
  • 1.0 MPa
  • 0.1 GPa

উত্তর ও ব্যাখ্যা দেখতে ফ্রি রেজিস্ট্রেশন করো

ফ্রি শুরু করো

11.একটি বুলেট সোজা উপরে নিক্ষিপ্ত হওয়ার 10 s পর তার প্রারম্ভিক বিন্দুতে ফিরে আসে। বুলেটের চূড়ান্ত গতি কত? বায়ুর বাধা উপেক্ষা কর।

  • 9.8 m/s
  • 25.0 m/s
  • 49.0 m/s
  • 98.0 m/s

উত্তর ও ব্যাখ্যা দেখতে ফ্রি রেজিস্ট্রেশন করো

ফ্রি শুরু করো

12.একটি তাপগতীয় সিস্টেমকে দুটি ভিন্ন পথে A অবস্থা থেকে B অবস্থায় নেওয়া হয়। এই দুটি পথের তাপ শোষণ এবং সিস্টেম কর্তৃক কৃত কাজ যথাক্রমে Q 1 ও Q 2 এবং W 1 ও W 2 । এই প্রক্রিয়ার জন্য কোনটি সঠিক?

  • Q 1 = Q 2
  • W 1 = W 2
  • Q 1 + W 1 = Q 2 + W ­2
  • Q 1 – W 1 = Q 2 – W ­2

উত্তর ও ব্যাখ্যা দেখতে ফ্রি রেজিস্ট্রেশন করো

ফ্রি শুরু করো

আরো প্রশ্ন দেখো

n = 2 n = 1 ধাপান্তরের জন্য নিচের কোনটি ক্ষুদ্রতম তরঙ্গ দৈর্ঘ্যের ফোটন উৎপন্ন করএকটি প্রক্রিয়ায় একটি আদর্শ গ্যাসের চাপ দ্বিগুণ করা হয়, যেখানে গ্যাস কর্তৃক ত্যাগপৃথিবীর পৃষ্ঠ থেকে m ভরের একটি বস্তু উল্লম্ব বরাবর উপরের দিকে নিক্ষিপ্ত হলো। বস্একটি আনুভূমিক ঘর্ষণহীন তলের উপর একটি কণা প্রাথমিকভাবে স্থির অবস্থায় আছে। কণাটির তিনটি ভেক্টর [গণিত] এবং [গণিত] দেওয়া আছে। যদি [গণিত] হয় তবে a ও b এর সম্ভাব্য মাএকটি প্রোটনের গতিশক্তি এর মোট শক্তির 75% । প্রোটনটির দ্রুতি কত?নিম্নের কোন বিবৃতিটি একটি 2 ইনপুট বিশিষ্ট XOR গেটের জন্য সত্য?x = e –2t , y = 2 [গণিত] 3t এবং z = 2 [গণিত] 2t দ্বারা বর্ণিত বক্রপথে একটি কণা ভনিচের কোনটি a থেকে e বিন্দু পর্যন্ত একটি দোলকের ববের ত্বরণ সবচেয়ে ভালোমতো চিত্রা1.1m দৈর্ঘ্য ও 2.0 cm ব্যাস বিশিষ্ট একটি আনুভূমিক রডের এক প্রান্ত একটি দেয়ালের সএকটি বুলেট সোজা উপরে নিক্ষিপ্ত হওয়ার 10 s পর তার প্রারম্ভিক বিন্দুতে ফিরে আসে। বএকটি তাপগতীয় সিস্টেমকে দুটি ভিন্ন পথে A অবস্থা থেকে B অবস্থায় নেওয়া হয়। এই দুটি

আরো হাজারো প্রশ্ন + মডেল টেস্ট

ফ্রি রেজিস্ট্রেশন করো — ফেভারিট, AI টিউটর, লিডারবোর্ড ও অ্যানালিটিক্স আনলক করো।