minor improvement to reading generation

This commit is contained in:
Cristiano Ferreira
2024-03-24 23:54:00 +00:00
parent 894cabdeb0
commit 373867d520
2 changed files with 9 additions and 10 deletions

View File

@@ -202,7 +202,6 @@ topics = [
"Renewable Energy Sources",
"Cultural Heritage Preservation",
"Modern Art Movements",
"Immigration Issues",
"Sustainable Transportation",
"The History of Medicine",
"Artificial Neural Networks",
@@ -225,7 +224,6 @@ topics = [
"Education Technology",
"Renaissance Art",
"Renewable Energy Policy",
"Cultural Festivals",
"Modern Architecture",
"Climate Resilience",
"Artificial Life",
@@ -248,11 +246,9 @@ topics = [
"Cultural Exchange",
"Modern Sculpture",
"Climate Mitigation",
"Artificial Intelligence Ethics",
"Mindfulness",
"Literary Criticism",
"Wildlife Conservation",
"Political Activism",
"Renewable Energy Innovations",
"History of Mathematics",
"Human-Computer Interaction",
@@ -260,13 +256,11 @@ topics = [
"Cultural Appropriation",
"Traditional cuisine and culinary arts",
"Local music and dance traditions",
"Cultural festivals and celebrations",
"History of the region and historical landmarks",
"Traditional crafts and artisanal skills",
"Wildlife and conservation efforts",
"Local sports and athletic competitions",
"Fashion trends and clothing styles",
"Literature and poetry from the region",
"Education systems and advancements",
"Healthcare services and medical innovations",
"Family values and social dynamics",
@@ -276,8 +270,7 @@ topics = [
"Entrepreneurship and business ventures",
"Youth empowerment initiatives",
"Art exhibitions and cultural events",
"Philanthropy and community development projects",
"Political developments and civic engagement efforts"
"Philanthropy and community development projects"
]
two_people_scenarios = [

View File

@@ -23,6 +23,8 @@ def gen_reading_passage_1(topic, req_exercises, difficulty):
number_of_exercises_q = divide_number_into_parts(TOTAL_READING_PASSAGE_1_EXERCISES, len(req_exercises))
passage = generate_reading_passage(QuestionType.READING_PASSAGE_1, topic)
if passage == "":
return gen_reading_passage_1(topic, req_exercises, difficulty)
start_id = 1
exercises = generate_reading_exercises(passage["text"], req_exercises, number_of_exercises_q, start_id, difficulty)
if contains_empty_dict(exercises):
@@ -44,10 +46,12 @@ def gen_reading_passage_2(topic, req_exercises, difficulty):
number_of_exercises_q = divide_number_into_parts(TOTAL_READING_PASSAGE_2_EXERCISES, len(req_exercises))
passage = generate_reading_passage(QuestionType.READING_PASSAGE_2, topic)
if passage == "":
return gen_reading_passage_2(topic, req_exercises, difficulty)
start_id = 14
exercises = generate_reading_exercises(passage["text"], req_exercises, number_of_exercises_q, start_id, difficulty)
if contains_empty_dict(exercises):
return gen_reading_passage_1(topic, req_exercises, difficulty)
return gen_reading_passage_2(topic, req_exercises, difficulty)
return {
"exercises": exercises,
"text": {
@@ -65,10 +69,12 @@ def gen_reading_passage_3(topic, req_exercises, difficulty):
number_of_exercises_q = divide_number_into_parts(TOTAL_READING_PASSAGE_3_EXERCISES, len(req_exercises))
passage = generate_reading_passage(QuestionType.READING_PASSAGE_3, topic)
if passage == "":
return gen_reading_passage_3(topic, req_exercises, difficulty)
start_id = 27
exercises = generate_reading_exercises(passage["text"], req_exercises, number_of_exercises_q, start_id, difficulty)
if contains_empty_dict(exercises):
return gen_reading_passage_1(topic, req_exercises, difficulty)
return gen_reading_passage_3(topic, req_exercises, difficulty)
return {
"exercises": exercises,
"text": {