0% found this document useful (0 votes)
7 views5 pages

Python Program: Bloom's Taxonomy Levels

The document contains a Python script that determines the Bloom's taxonomy level of questions based on specific keywords. It reads questions from an input file, categorizes them, and writes the rewritten questions with their respective Bloom's level to an output file. An error handling mechanism is included to manage file not found and other exceptions.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views5 pages

Python Program: Bloom's Taxonomy Levels

The document contains a Python script that determines the Bloom's taxonomy level of questions based on specific keywords. It reads questions from an input file, categorizes them, and writes the rewritten questions with their respective Bloom's level to an output file. An error handling mechanism is included to manage file not found and other exceptions.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

NAME : SINDHUJA

ROLL NO : 160123862014
SUBJECT : PYTHON PROGRAMMING
ASSIGNMENT -||

def determine_blooms_level(question):

levels = {

'knowledge': ['define', 'identify', 'list', 'name', 'state'],

'comprehension': ['describe', 'explain', 'interpret', 'summarize', 'classify'],

'application': ['apply', 'demonstrate', 'solve', 'use', 'illustrate'],

'analysis': ['analyze', 'compare', 'contrast', 'differentiate', 'organize'],

'synthesis': ['synthesize', 'create', 'design', 'generate', 'compose'],

'evaluation': ['evaluate', 'judge', 'assess', 'critique', 'justify']

for level, keywords in [Link]():

for keyword in keywords:

if keyword in [Link]():

return level

return 'knowledge'

def rewrite_questions(input_file, output_file):

try:

with open(input_file, 'r') as f:

questions = [Link]()

with open(output_file, 'w') as f:

for question in questions:

blooms_level = determine_blooms_level(question)

rewritten_question = f"{[Link]()} [{blooms_level.capitalize()}]\n"

[Link](rewritten_question)

print("Questions rewritten with Bloom's level and written to file successfully.")

except FileNotFoundError:
print("Input file not found.")

except Exception as e:

print(f"An error occurred: {str(e)}")

input_file = 'input_questions.txt'

output_file = 'output_questions.txt'

rewrite_questions(input_file, output_file)

output:

Input file not found.

=== Code Execution Successful ===

You might also like