Add question db insert.
This commit is contained in:
942
testing.py
942
testing.py
@@ -1,37 +1,911 @@
|
||||
from functools import reduce
|
||||
from helper.token_counter import count_tokens
|
||||
import os
|
||||
import uuid
|
||||
|
||||
# model = whisper.load_model("base")
|
||||
# file_path = "audio-samples/mynameisjeff.wav"
|
||||
# audio_file = AudioSegment.from_file(file_path)
|
||||
# if os.path.exists(file_path):
|
||||
# result = model.transcribe(file_path, fp16=False, language='English', verbose=True)
|
||||
# print(result["text"])
|
||||
# else:
|
||||
# print("File not found:", file_path)
|
||||
import firebase_admin
|
||||
from firebase_admin import credentials, firestore
|
||||
|
||||
messages = [
|
||||
{
|
||||
"role": "user",
|
||||
"content": "You are a IELTS examiner.",
|
||||
},
|
||||
{
|
||||
"role": "user",
|
||||
"content": f"The question you have to grade is of type and is the following: ",
|
||||
},
|
||||
{
|
||||
"role": "user",
|
||||
"content": "Please provide a JSON object response with the overall grade and breakdown grades, "
|
||||
"formatted as follows: {'overall': 7.0, 'task_response': {'Task Achievement': 8.0, "
|
||||
"'Coherence and Cohesion': 6.5, 'Lexical Resource': 7.5, 'Grammatical Range and Accuracy': "
|
||||
"6.0}}",
|
||||
},
|
||||
{
|
||||
"role": "user",
|
||||
"content": f"Evaluate this answer according to ielts grading system:",
|
||||
},
|
||||
]
|
||||
token_count = reduce(lambda count, item: count + count_tokens(item)['n_tokens'],
|
||||
map(lambda x: x["content"], filter(lambda x: "content" in x, messages)), 0)
|
||||
from dotenv import load_dotenv
|
||||
|
||||
print(token_count)
|
||||
load_dotenv()
|
||||
|
||||
# Initialize Firebase Admin SDK
|
||||
cred = credentials.Certificate(os.getenv("GOOGLE_APPLICATION_CREDENTIALS"))
|
||||
|
||||
firebase_admin.initialize_app(cred)
|
||||
|
||||
reading_to_insert_1 = {
|
||||
"exercises": [
|
||||
{
|
||||
"allowRepetition": True,
|
||||
"id": str(uuid.uuid4()),
|
||||
"prompt": "Complete the summary below. Click a blank to select the corresponding word(s) for it.\\nThere are "
|
||||
"more words than spaces so you will not use them all. You may use any of the words more than once.",
|
||||
"solutions": [
|
||||
{
|
||||
"id": "1",
|
||||
"solution": "clean"
|
||||
},
|
||||
{
|
||||
"id": "2",
|
||||
"solution": "fossil"
|
||||
},
|
||||
{
|
||||
"id": "3",
|
||||
"solution": "sunlight"
|
||||
},
|
||||
{
|
||||
"id": "4",
|
||||
"solution": "alternative"
|
||||
},
|
||||
{
|
||||
"id": "5",
|
||||
"solution": "solar"
|
||||
},
|
||||
{
|
||||
"id": "6",
|
||||
"solution": "wind farms"
|
||||
},
|
||||
{
|
||||
"id": "7",
|
||||
"solution": "source"
|
||||
},
|
||||
{
|
||||
"id": "8",
|
||||
"solution": "flowing water"
|
||||
}
|
||||
],
|
||||
"text": "In recent years, the transition to {{1}} energy sources has surged, driven by growing concerns about "
|
||||
"{{2}} fuels and their impact on climate change. Renewable options, including {{3}}, wind, and water,"
|
||||
" are gaining momentum as a cleaner {{4}} to conventional energy production. Solar panels, harnessing {{5}} "
|
||||
"energy, are becoming more accessible, while wind turbines in {{6}} are providing a scalable and sustainable "
|
||||
"{{7}} of power. Moreover, hydropower, derived from {{8}}, contributes to the renewable energy landscape, "
|
||||
"offering a multifaceted approach to combat environmental challenges.",
|
||||
"type": "fillBlanks",
|
||||
"words": ["energy", "fossil", "alternative", "transition", "wind farms", "source",
|
||||
"contributes", "flowing water", "surged", "momentum", "scalable", "solar", "accessible",
|
||||
"climate",
|
||||
"environmental", "renewable", "impact", "clean", "options", "challenges"]
|
||||
|
||||
},
|
||||
{
|
||||
"id": str(uuid.uuid4()),
|
||||
"prompt": "Select the appropriate option.",
|
||||
"questions": [
|
||||
{
|
||||
"id": 1,
|
||||
"options": [
|
||||
{
|
||||
"id": "A",
|
||||
"text": "Economic benefits"
|
||||
},
|
||||
{
|
||||
"id": "B",
|
||||
"text": "Government regulations"
|
||||
},
|
||||
{
|
||||
"id": "C",
|
||||
"text": "Concerns about climate change"
|
||||
},
|
||||
{
|
||||
"id": "D",
|
||||
"text": "Technological advancement"
|
||||
}
|
||||
],
|
||||
"prompt": "What is the main reason for the shift towards renewable energy sources?",
|
||||
"solution": "C",
|
||||
"variant": "text",
|
||||
},
|
||||
{
|
||||
"id": 2,
|
||||
"options": [
|
||||
{
|
||||
"id": "A",
|
||||
"text": "Wind"
|
||||
},
|
||||
{
|
||||
"id": "B",
|
||||
"text": "Coal"
|
||||
},
|
||||
{
|
||||
"id": "C",
|
||||
"text": "Sunlight"
|
||||
},
|
||||
{
|
||||
"id": "D",
|
||||
"text": "Water"
|
||||
}
|
||||
],
|
||||
"prompt": "Which of the following sources is NOT mentioned as a renewable energy source?",
|
||||
"solution": "B",
|
||||
"variant": "text",
|
||||
},
|
||||
{
|
||||
"id": 3,
|
||||
"options": [
|
||||
{
|
||||
"id": "A",
|
||||
"text": "It generates a lot of waste"
|
||||
},
|
||||
{
|
||||
"id": "B",
|
||||
"text": "It produces greenhouse gases"
|
||||
},
|
||||
{
|
||||
"id": "C",
|
||||
"text": "It has no emissions"
|
||||
},
|
||||
{
|
||||
"id": "D",
|
||||
"text": "It requires large land areas"
|
||||
}
|
||||
],
|
||||
"prompt": "What advantage does solar energy have in terms of environmental impact?",
|
||||
"solution": "C",
|
||||
"variant": "text",
|
||||
},
|
||||
{
|
||||
"id": 4,
|
||||
"options": [
|
||||
{
|
||||
"id": "A",
|
||||
"text": "By burning fossil fuels"
|
||||
},
|
||||
{
|
||||
"id": "B",
|
||||
"text": "By harnessing wind's kinetic energy"
|
||||
},
|
||||
{
|
||||
"id": "C",
|
||||
"text": "By using sunlight"
|
||||
},
|
||||
{
|
||||
"id": "D",
|
||||
"text": "By utilizing underground heat"
|
||||
}
|
||||
],
|
||||
"prompt": "How do wind turbines generate electricity?",
|
||||
"solution": "B",
|
||||
"variant": "text",
|
||||
}
|
||||
],
|
||||
"type": "multipleChoice",
|
||||
}
|
||||
],
|
||||
"isDiagnostic": True,
|
||||
"minTimer": 20,
|
||||
"text": {
|
||||
"content": "In recent years, there has been a significant shift towards renewable energy sources as societies "
|
||||
"strive to reduce their dependence on fossil fuels and combat the effects of climate change. Renewable "
|
||||
"energy, derived from sources such as sunlight, wind, and water, offers a promising alternative to "
|
||||
"traditional energy generation methods.\\nSolar power, harnessed from the sun's rays, has gained immense "
|
||||
"popularity. Photovoltaic cells, commonly known as solar panels, capture sunlight and convert it into "
|
||||
"electricity. This technology has become more efficient and affordable, contributing to a growing number "
|
||||
"of solar installations on rooftops and solar farms. Solar energy not only reduces greenhouse gas "
|
||||
"emissions but also grants individuals and businesses the ability to generate their own power.\\nSimilarly, "
|
||||
"wind energy has emerged as a reliable and clean source of electricity. Wind turbines, often found in "
|
||||
"wind farms, harness the kinetic energy of moving air to turn blades and generate electricity. These "
|
||||
"structures are strategically placed in areas with consistent wind patterns, contributing to the overall "
|
||||
"energy grid. Wind power has the advantage of scalability, with both small and large installations being "
|
||||
"feasible options.\\nHydropower, generated from flowing water in rivers and dams, is another vital renewable "
|
||||
"energy source. The force of water is used to turn turbines, which then produce electricity. While hydropower "
|
||||
"has a long history, advancements in technology have led to more efficient and environmentally friendly "
|
||||
"designs. However, the construction of dams for hydropower can have significant ecological and social "
|
||||
"impacts, requiring careful consideration.\\nGeothermal energy, originating from the Earth's heat, is "
|
||||
"also gaining attention. This energy source is harnessed through underground steam and hot water reservoirs, "
|
||||
"which are tapped for electricity generation and heating. Geothermal power plants have a relatively small "
|
||||
"environmental footprint and provide a consistent source of energy, making them a viable option in regions "
|
||||
"with suitable geological conditions.\\nIn conclusion, the transition to renewable energy sources marks a "
|
||||
"pivotal step towards sustainable and environmentally conscious energy generation. Solar, wind, hydropower, "
|
||||
"and geothermal energy offer diverse options that can collectively contribute to reducing carbon emissions "
|
||||
"and combating climate change. As technology continues to evolve and economies adapt, the potential for "
|
||||
"widespread adoption of renewable energy remains promising.",
|
||||
"title": "The Rise of Renewable Energy"
|
||||
},
|
||||
"type": "academic"
|
||||
}
|
||||
reading_to_insert_2 = {
|
||||
"exercises": [
|
||||
{
|
||||
"allowRepetition": True,
|
||||
"id": str(uuid.uuid4()),
|
||||
"prompt": "Complete the summary below. Click a blank to select the corresponding word(s) for it.\\nThere are "
|
||||
"more words than spaces so you will not use them all. You may use any of the words more than once.",
|
||||
"solutions": [
|
||||
{
|
||||
"id": "1",
|
||||
"solution": "Earth"
|
||||
},
|
||||
{
|
||||
"id": "2",
|
||||
"solution": "ecosystems"
|
||||
},
|
||||
{
|
||||
"id": "3",
|
||||
"solution": "biodiversity"
|
||||
},
|
||||
{
|
||||
"id": "4",
|
||||
"solution": "pollination"
|
||||
},
|
||||
{
|
||||
"id": "5",
|
||||
"solution": "genetic"
|
||||
},
|
||||
{
|
||||
"id": "6",
|
||||
"solution": "protection"
|
||||
},
|
||||
{
|
||||
"id": "7",
|
||||
"solution": "healthy"
|
||||
},
|
||||
{
|
||||
"id": "8",
|
||||
"solution": "sustainable"
|
||||
}
|
||||
],
|
||||
"text": "Biodiversity, the range of life forms on {{1}}, is essential for ecosystem health and stability. "
|
||||
"Interactions among species in {{2}} support various ecological processes. However, human activities "
|
||||
"like habitat destruction and pollution threaten {{3}}, impacting natural systems and human well-being. "
|
||||
"Ecosystems, with species adapted over time, perform vital functions such as nutrient cycling and {{4}}. "
|
||||
"The loss of biodiversity disrupts these processes, affecting ecosystem stability. Preserving {{5}} diversity "
|
||||
"is crucial for disease resilience and adaptation. Addressing biodiversity decline requires habitat {{6}}, "
|
||||
"sustainable practices, and awareness. In conclusion, safeguarding biodiversity is vital for {{7}} ecosystems "
|
||||
"and human societies, demanding proactive conservation and {{8}} efforts.",
|
||||
"type": "fillBlanks",
|
||||
"words": ["Earth", "fossil", "alternative", "ecosystems", "healthy", "sustainable",
|
||||
"contributes", "genetic", "surged", "pollination", "scalable", "solar", "accessible",
|
||||
"climate", "environmental", "biodiversity", "impact", "protection", "options", "challenges"]
|
||||
|
||||
},
|
||||
{
|
||||
"id": str(uuid.uuid4()),
|
||||
"maxWords": 3,
|
||||
"prompt": "Answer the questions below.\\nChoose <b>NO MORE THAN THREE WORDS</b> from the passage for each answer.",
|
||||
"solutions": [
|
||||
{
|
||||
"id": 1,
|
||||
"options": ["Variety of life"]
|
||||
},
|
||||
{
|
||||
"id": 2,
|
||||
"options": ["Maintains health"]
|
||||
},
|
||||
{
|
||||
"id": 3,
|
||||
"options": ["Habitat destruction", "pollution", "climate change"]
|
||||
},
|
||||
{
|
||||
"id": 4,
|
||||
"options": ["Deforestation", "overfishing"]
|
||||
},
|
||||
{
|
||||
"id": 5,
|
||||
"options": ["Essential functions"]
|
||||
},
|
||||
{
|
||||
"id": 6,
|
||||
"options": ["Pollination"]
|
||||
},
|
||||
{
|
||||
"id": 7,
|
||||
"options": ["Disrupts relationships", "imbalances"]
|
||||
},
|
||||
{
|
||||
"id": 8,
|
||||
"options": ["Unchecked population growth", "effects on vegetation"]
|
||||
},
|
||||
{
|
||||
"id": 9,
|
||||
"options": ["Diseases"]
|
||||
},
|
||||
{
|
||||
"id": 10,
|
||||
"options": ["Supports pollination"]
|
||||
},
|
||||
],
|
||||
"text": "What is biodiversity?{{1}}\\nHow does biodiversity impact ecosystems?{{2}}\\nWhat activities threaten "
|
||||
"biodiversity?{{3}}\\nName a human activity impacting biodiversity.{{4}}\nWhat functions do ecosystems "
|
||||
"perform?{{5}}\\nWhat do bees support?{{6}}\\nHow does biodiversity loss affect ecosystems?{{7}}\\nWhat "
|
||||
"can result from apex predator decline?{{8}}\\nWhat does genetic diversity buffer against?{{9}}\\nWhy "
|
||||
"is genetic diversity important?{{10}}",
|
||||
"type": "writeBlanks"
|
||||
}
|
||||
],
|
||||
"isDiagnostic": True,
|
||||
"minTimer": 20,
|
||||
"text": {
|
||||
"content": "Biodiversity, the variety of life forms on Earth, plays a critical role in maintaining ecosystem health "
|
||||
"and stability. The interactions between different species within ecosystems create intricate networks "
|
||||
"that support various ecological processes. However, human activities such as habitat destruction, "
|
||||
"pollution, and climate change are placing immense pressure on biodiversity, leading to potential "
|
||||
"consequences for both natural systems and human well-being.\\nEcosystems are composed of a multitude "
|
||||
"of species that have evolved over millions of years, adapting to their environments and developing "
|
||||
"unique roles within their ecosystems. This diversity ensures that ecosystems can perform essential "
|
||||
"functions, such as nutrient cycling, pest control, and pollination. For instance, bees and other "
|
||||
"pollinators contribute to the reproduction of numerous plant species, thereby supporting food production "
|
||||
"for humans and other animals.\\nThe loss of biodiversity can disrupt these intricate relationships, "
|
||||
"leading to imbalances that reverberate throughout ecosystems. As species disappear, the stability of "
|
||||
"ecosystems may be compromised, and the services they provide can be compromised as well. For example, "
|
||||
"the decline of apex predators in a habitat can result in unchecked population growth of their prey, "
|
||||
"causing cascading effects on vegetation and other species.\\nBiodiversity is also vital for preserving "
|
||||
"genetic diversity within species. This diversity acts as a buffer against diseases, allowing some "
|
||||
"individuals to survive and reproduce when others succumb. Moreover, it enables species to adapt to "
|
||||
"changing environmental conditions over time. The genetic diversity of crops is especially crucial for "
|
||||
"ensuring food security and resilience in the face of changing climates and emerging diseases.\\nAddressing "
|
||||
"the decline in biodiversity requires a multifaceted approach. Conservation efforts should focus on "
|
||||
"protecting and restoring habitats, implementing sustainable land-use practices, and reducing pollution. "
|
||||
"In addition, raising public awareness about the value of biodiversity and its role in human well-being "
|
||||
"is essential. International cooperation is also necessary, as many species and ecosystems span multiple "
|
||||
"countries.\\nIn conclusion, biodiversity is a cornerstone of healthy ecosystems and is closely intertwined "
|
||||
"with human societies. As we recognize the intricate connections between species and ecosystems, it becomes "
|
||||
"imperative to take proactive steps to safeguard biodiversity for current and future generations. This "
|
||||
"requires a commitment to sustainable practices and a collective effort to protect the diverse web of "
|
||||
"life on our planet.",
|
||||
"title": "Biodiversity and Ecosystem Health"
|
||||
},
|
||||
"type": "academic"
|
||||
}
|
||||
|
||||
speaking_to_insert_1 = {
|
||||
"exercises": [
|
||||
{
|
||||
"id": str(uuid.uuid4()),
|
||||
"prompts": [],
|
||||
"text": "Do you have any hobbies? If so, what are they?\\nHow did you become interested in your hobbies?\\nWhat"
|
||||
" do you enjoy the most about your hobbies?\\nDo you think hobbies are important for people? Why or"
|
||||
" why not?",
|
||||
"title": "Hobbies",
|
||||
"type": "speaking"
|
||||
},
|
||||
{
|
||||
"id": str(uuid.uuid4()),
|
||||
"prompts": [
|
||||
"Describe the location and setting of the place.",
|
||||
"What natural features or attractions were present?",
|
||||
"How did you feel during your visit to this place?",
|
||||
"Explain why you found this place to be beautiful and memorable."
|
||||
],
|
||||
"text": "Describe a place you visited that has a lot of natural beauty.",
|
||||
"title": "Place with natural beauty",
|
||||
"type": "speaking"
|
||||
}
|
||||
],
|
||||
"isDiagnostic": True,
|
||||
"minTimer": 5,
|
||||
"module": "speaking"
|
||||
}
|
||||
speaking_to_insert_2 = {
|
||||
"exercises": [
|
||||
{
|
||||
"id": str(uuid.uuid4()),
|
||||
"prompts": [],
|
||||
"text": "What does your typical day look like?\\nAre there any activities you do regularly in the mornings?\\n"
|
||||
"How do you usually spend your evenings after work or school?\\nIs there anything you'd like to change "
|
||||
"about your daily routine? Why?",
|
||||
"title": "Daily Routine",
|
||||
"type": "speaking"
|
||||
},
|
||||
{
|
||||
"id": str(uuid.uuid4()),
|
||||
"prompts": [
|
||||
"Introduce the title and author of the book.",
|
||||
"Describe the plot or content of the book briefly.",
|
||||
"Explain why the book had a significant impact on you.",
|
||||
"Discuss how the book influenced your thoughts or actions."
|
||||
],
|
||||
"text": "Talk about a book that had a significant impact on you.",
|
||||
"title": "Impactful book",
|
||||
"type": "speaking"
|
||||
}
|
||||
],
|
||||
"isDiagnostic": True,
|
||||
"minTimer": 5,
|
||||
"module": "speaking"
|
||||
}
|
||||
speaking_to_insert_3 = {
|
||||
"exercises": [
|
||||
{
|
||||
"id": str(uuid.uuid4()),
|
||||
"prompts": [],
|
||||
"text": "Have you traveled to any foreign countries? Which ones?\\nWhat do you like about traveling?\\nHow do "
|
||||
"you decide on your travel destinations?\\nCan you share a memorable experience from one of your trips?",
|
||||
"title": "travel",
|
||||
"type": "speaking"
|
||||
},
|
||||
{
|
||||
"id": str(uuid.uuid4()),
|
||||
"prompts": [
|
||||
"Explain the situation or context where you had to make a quick decision.",
|
||||
"What factors influenced your decision-making process?",
|
||||
"How did you feel about making the decision quickly?",
|
||||
"Reflect on the outcome of your decision and what you learned from it."
|
||||
],
|
||||
"text": "Describe a time when you had to make a decision quickly.",
|
||||
"title": "Quick decision",
|
||||
"type": "speaking"
|
||||
}
|
||||
],
|
||||
"isDiagnostic": True,
|
||||
"minTimer": 5,
|
||||
"module": "speaking"
|
||||
}
|
||||
|
||||
writing_to_insert_1 = {
|
||||
"exercises": [
|
||||
{
|
||||
"id": str(uuid.uuid4()),
|
||||
"prefix": "You should spend about 40 minutes on this task.\nPresent a written argument or case to an educated "
|
||||
"reader with no specialist knowledge of the following topic:",
|
||||
"prompt": "Some people believe that technology has made communication between individuals less personal and "
|
||||
"more impersonal. Others argue that technology has improved communication by making it more accessible. "
|
||||
"Discuss both viewpoints and give your own opinion.",
|
||||
"suffix": "You should write at least 250 words.\nUse your own ideas, knowledge and experience and support "
|
||||
"your arguments with examples and relevant evidence.",
|
||||
"type": "writing",
|
||||
"wordCounter": {
|
||||
"limit": 250,
|
||||
"type": "min"
|
||||
}
|
||||
}
|
||||
],
|
||||
"isDiagnostic": True,
|
||||
"minTimer": 40,
|
||||
"module": "writing",
|
||||
"task": "2"
|
||||
}
|
||||
writing_to_insert_2 = {
|
||||
"exercises": [
|
||||
{
|
||||
"id": str(uuid.uuid4()),
|
||||
"prefix": "You should spend about 40 minutes on this task.\nPresent a written argument or case to an educated "
|
||||
"reader with no specialist knowledge of the following topic:",
|
||||
"prompt": "Some people think that the best way to reduce crime is to give longer prison sentences. Others, "
|
||||
"however, believe there are better alternatives for reducing crime. Discuss both sides and give "
|
||||
"your own opinion.",
|
||||
"suffix": "You should write at least 250 words.\nUse your own ideas, knowledge and experience and support "
|
||||
"your arguments with examples and relevant evidence.",
|
||||
"type": "writing",
|
||||
"wordCounter": {
|
||||
"limit": 250,
|
||||
"type": "min"
|
||||
}
|
||||
}
|
||||
],
|
||||
"isDiagnostic": True,
|
||||
"minTimer": 40,
|
||||
"module": "writing",
|
||||
"task": "2"
|
||||
}
|
||||
writing_to_insert_3 = {
|
||||
"exercises": [
|
||||
{
|
||||
"id": str(uuid.uuid4()),
|
||||
"prefix": "You should spend about 40 minutes on this task.\nPresent a written argument or case to an educated "
|
||||
"reader with no specialist knowledge of the following topic:",
|
||||
"prompt": "In many countries, children are engaged in part-time jobs alongside their studies. What are the "
|
||||
"advantages and disadvantages of this trend? Give your opinion and support it with relevant examples.",
|
||||
"suffix": "You should write at least 250 words.\nUse your own ideas, knowledge and experience and support "
|
||||
"your arguments with examples and relevant evidence.",
|
||||
"type": "writing",
|
||||
"wordCounter": {
|
||||
"limit": 250,
|
||||
"type": "min"
|
||||
}
|
||||
}
|
||||
],
|
||||
"isDiagnostic": True,
|
||||
"minTimer": 40,
|
||||
"module": "writing",
|
||||
"task": "2"
|
||||
}
|
||||
writing_to_insert_4 = {
|
||||
"exercises": [
|
||||
{
|
||||
"id": str(uuid.uuid4()),
|
||||
"prefix": "You should spend about 40 minutes on this task.\nPresent a written argument or case to an educated "
|
||||
"reader with no specialist knowledge of the following topic:",
|
||||
"prompt": "Some people argue that the government should provide free education at all levels. Others believe "
|
||||
"that individuals should be responsible for covering their educational expenses. Discuss both "
|
||||
"perspectives and support your opinion with examples.",
|
||||
"suffix": "You should write at least 250 words.\nUse your own ideas, knowledge and experience and support "
|
||||
"your arguments with examples and relevant evidence.",
|
||||
"type": "writing",
|
||||
"wordCounter": {
|
||||
"limit": 250,
|
||||
"type": "min"
|
||||
}
|
||||
}
|
||||
],
|
||||
"isDiagnostic": True,
|
||||
"minTimer": 40,
|
||||
"module": "writing",
|
||||
"task": "2"
|
||||
}
|
||||
writing_to_insert_5 = {
|
||||
"exercises": [
|
||||
{
|
||||
"id": str(uuid.uuid4()),
|
||||
"prefix": "You should spend about 40 minutes on this task.\nPresent a written argument or case to an educated "
|
||||
"reader with no specialist knowledge of the following topic:",
|
||||
"prompt": "Gender equality and women's rights have made significant progress in many parts of the world. "
|
||||
"However, some argue that there is still a long way to go in achieving true equality between men "
|
||||
"and women. Discuss both viewpoints and give your",
|
||||
"suffix": "You should write at least 250 words.\nUse your own ideas, knowledge and experience and support "
|
||||
"your arguments with examples and relevant evidence.",
|
||||
"type": "writing",
|
||||
"wordCounter": {
|
||||
"limit": 250,
|
||||
"type": "min"
|
||||
}
|
||||
}
|
||||
],
|
||||
"isDiagnostic": True,
|
||||
"minTimer": 40,
|
||||
"module": "writing",
|
||||
"task": "2"
|
||||
}
|
||||
|
||||
listening_to_insert_1 = {
|
||||
"audio": {
|
||||
"repeatableTimes": 3,
|
||||
"source": "https://firebasestorage.googleapis.com/v0/b/mti-ielts.appspot.com/o/listening_recordings%2Fhotel_reservation.mp3?alt=media&token=7c6a88f9-b71a-41f4-8581-d9a0574f4d44"
|
||||
},
|
||||
"exercises": [
|
||||
{
|
||||
"id": str(uuid.uuid4()),
|
||||
"maxWords": 3,
|
||||
"prompt": "You will hear a conversation between a customer and a receptionist at a hotel. Complete the form "
|
||||
"below using no more than three words or a number.",
|
||||
"solutions": [
|
||||
{
|
||||
"id": 1,
|
||||
"solution": ["Johnson", "Mr. Johnson"]
|
||||
},
|
||||
{
|
||||
"id": 2,
|
||||
"solution": ["15th of September", "fifteenth of September"]
|
||||
},
|
||||
{
|
||||
"id": 3,
|
||||
"solution": ["Deluxe double room"]
|
||||
},
|
||||
{
|
||||
"id": 4,
|
||||
"solution": ["Three nights", "3 nights"]
|
||||
},
|
||||
],
|
||||
"text": "Name of Customer:{{1}}\\nDate of Arrival:{{2}}\\nType of Room:{{3}}\\nNumber of Nights:{{4}}",
|
||||
"type": "writeBlanks"
|
||||
}
|
||||
],
|
||||
"isDiagnostic": True,
|
||||
"minTimer": 7,
|
||||
"module": "listening",
|
||||
"section": 1
|
||||
}
|
||||
listening_to_insert_2 = {
|
||||
"audio": {
|
||||
"repeatableTimes": 3,
|
||||
"source": "https://firebasestorage.googleapis.com/v0/b/mti-ielts.appspot.com/o/listening_recordings%2Forientation_day.mp3?alt=media&token=b6e57cce-dbfa-48e4-a910-6d63726ee694"
|
||||
},
|
||||
"exercises": [
|
||||
{
|
||||
"id": str(uuid.uuid4()),
|
||||
"prompt": "Select the appropriate option.",
|
||||
"questions": [
|
||||
{
|
||||
"id": 1,
|
||||
"options": [
|
||||
{
|
||||
"id": "A",
|
||||
"text": "To introduce students to their courses."
|
||||
},
|
||||
{
|
||||
"id": "B",
|
||||
"text": "To help students find accommodation."
|
||||
},
|
||||
{
|
||||
"id": "C",
|
||||
"text": "To give students a campus tour."
|
||||
},
|
||||
{
|
||||
"id": "D",
|
||||
"text": "To provide information about extracurricular activities."
|
||||
}
|
||||
],
|
||||
"prompt": "What is the purpose of orientation day?",
|
||||
"solution": "C",
|
||||
"variant": "text",
|
||||
},
|
||||
{
|
||||
"id": 2,
|
||||
"options": [
|
||||
{
|
||||
"id": "A",
|
||||
"text": "Lecture Hall A"
|
||||
},
|
||||
{
|
||||
"id": "B",
|
||||
"text": "Student Union Building"
|
||||
},
|
||||
{
|
||||
"id": "C",
|
||||
"text": "Sports Complex"
|
||||
},
|
||||
{
|
||||
"id": "D",
|
||||
"text": "Library Auditorium"
|
||||
}
|
||||
],
|
||||
"prompt": "Where will the welcome speech take place?",
|
||||
"solution": "D",
|
||||
"variant": "text",
|
||||
},
|
||||
{
|
||||
"id": 3,
|
||||
"options": [
|
||||
{
|
||||
"id": "A",
|
||||
"text": "To introduce students to their courses."
|
||||
},
|
||||
{
|
||||
"id": "B",
|
||||
"text": "To provide information about extracurricular activities."
|
||||
},
|
||||
{
|
||||
"id": "C",
|
||||
"text": "To help students find accommodation."
|
||||
},
|
||||
{
|
||||
"id": "D",
|
||||
"text": "To address university administration concerns."
|
||||
}
|
||||
],
|
||||
"prompt": "What is the main goal of the welcome speech during orientation day?",
|
||||
"solution": "B",
|
||||
"variant": "text",
|
||||
}
|
||||
],
|
||||
"type": "multipleChoice",
|
||||
}
|
||||
],
|
||||
"isDiagnostic": True,
|
||||
"minTimer": 7,
|
||||
"module": "listening",
|
||||
"section": 1
|
||||
}
|
||||
listening_to_insert_3 = {
|
||||
"audio": {
|
||||
"repeatableTimes": 3,
|
||||
"source": "https://firebasestorage.googleapis.com/v0/b/mti-ielts.appspot.com/o/listening_recordings%2Ftravel_agent.mp3?alt=media&token=e9bb9ba0-9a23-4d25-8e04-ce9b7dbc3021"
|
||||
},
|
||||
"exercises": [
|
||||
{
|
||||
"id": str(uuid.uuid4()),
|
||||
"allowRepetition": True,
|
||||
"options": [
|
||||
{
|
||||
"id": "A",
|
||||
"sentence": "Offers an opportunity to explore multiple cities at one fixed cost."
|
||||
},
|
||||
{
|
||||
"id": "B",
|
||||
"sentence": "Provides a leisurely way to see scenic landscapes along a river."
|
||||
},
|
||||
{
|
||||
"id": "C",
|
||||
"sentence": "Requires passengers to arrive at the airport well in advance."
|
||||
},
|
||||
{
|
||||
"id": "D",
|
||||
"sentence": "Allows travelers to follow their own route and schedule."
|
||||
},
|
||||
{
|
||||
"id": "E",
|
||||
"sentence": "Includes meals and onboard entertainment during the trip."
|
||||
}
|
||||
],
|
||||
"prompt": "Listen to a conversation between a travel agent and a customer regarding different travel options. "
|
||||
"Match the travel options with the appropriate descriptions.",
|
||||
"sentences": [
|
||||
{
|
||||
"id": "1",
|
||||
"sentence": "Train journey",
|
||||
"solution": "A"
|
||||
},
|
||||
{
|
||||
"id": "2",
|
||||
"sentence": "Cruise",
|
||||
"solution": "C"
|
||||
},
|
||||
{
|
||||
"id": "3",
|
||||
"sentence": "Flight",
|
||||
"solution": "D"
|
||||
},
|
||||
{
|
||||
"id": "4",
|
||||
"sentence": "Self-drive tour",
|
||||
"solution": "E"
|
||||
},
|
||||
{
|
||||
"id": "5",
|
||||
"sentence": "Bus tour",
|
||||
"solution": "B"
|
||||
}
|
||||
],
|
||||
"type": "matchSentences"
|
||||
}
|
||||
],
|
||||
"isDiagnostic": True,
|
||||
"minTimer": 7,
|
||||
"module": "listening",
|
||||
"section": 1
|
||||
}
|
||||
|
||||
listening_section_2_to_insert_1 = {
|
||||
"audio": {
|
||||
"repeatableTimes": 3,
|
||||
"source": "https://firebasestorage.googleapis.com/v0/b/mti-ielts.appspot.com/o/listening_recordings%2Fmuseum_guide.mp3?alt=media&token=bfb9aea9-4006-4e11-af9a-1594232b4c20"
|
||||
},
|
||||
"exercises": [
|
||||
{
|
||||
"id": str(uuid.uuid4()),
|
||||
"maxWords": 3,
|
||||
"prompt": "You will hear a guide giving information about a museum exhibition. Complete the sentences using no more than three words or a number.",
|
||||
"solutions": [
|
||||
{
|
||||
"id": 1,
|
||||
"options": ["Art and Culture"]
|
||||
},
|
||||
{
|
||||
"id": 2,
|
||||
"options": ["10 AM"]
|
||||
},
|
||||
{
|
||||
"id": 3,
|
||||
"options": ["ID", "Card", "student ID", "senior citizen card"]
|
||||
},
|
||||
{
|
||||
"id": 4,
|
||||
"options": ["day"]
|
||||
},
|
||||
{
|
||||
"id": 5,
|
||||
"options": ["45"]
|
||||
}
|
||||
],
|
||||
"text": "The exhibition is titled \"Exploring the History of {{1}}.\"\\nThe museum opens at {{2}} on weekdays."
|
||||
"\\nVisitors can get a discount with a valid {{3}}.\\nThe museum offers a guided tour every {{4}}."
|
||||
"\\nThe guided tour lasts approximately {{5}} minutes.",
|
||||
"type": "writeBlanks"
|
||||
}
|
||||
],
|
||||
"isDiagnostic": True,
|
||||
"minTimer": 7,
|
||||
"module": "listening",
|
||||
"section": 2
|
||||
}
|
||||
listening_section_2_to_insert_2 = {
|
||||
"audio": {
|
||||
"repeatableTimes": 3,
|
||||
"source": "https://firebasestorage.googleapis.com/v0/b/mti-ielts.appspot.com/o/listening_recordings%2Flecture_renewable_energy.mp3?alt=media&token=ccf7a033-c2a8-4c02-ae23-1375f6e94abe"
|
||||
},
|
||||
"exercises": [
|
||||
{
|
||||
"id": str(uuid.uuid4()),
|
||||
"maxWords": 2,
|
||||
"prompt": "Listen to a lecture about renewable energy sources. Answer the following questions in one or two words.",
|
||||
"solutions": [
|
||||
{
|
||||
"id": 1,
|
||||
"options": ["Solar power"]
|
||||
},
|
||||
{
|
||||
"id": 2,
|
||||
"options": ["Wind energy"]
|
||||
},
|
||||
{
|
||||
"id": 3,
|
||||
"options": ["Water heaters", "electric vehicles"]
|
||||
},
|
||||
{
|
||||
"id": 4,
|
||||
"options": ["Low emissions"]
|
||||
}
|
||||
],
|
||||
"text": "What is the most common source of renewable energy worldwide?{{1}}\\nWhat do wind turbines convert "
|
||||
"into electricity?{{3}}\\nWhat can solar panels be used to power in homes?{{4}}"
|
||||
"\\nWhat is the benefit of geothermal energy in terms of emissions?{{5}}",
|
||||
"type": "writeBlanks"
|
||||
}
|
||||
],
|
||||
"isDiagnostic": True,
|
||||
"minTimer": 7,
|
||||
"module": "listening",
|
||||
"section": 2
|
||||
}
|
||||
listening_section_2_to_insert_3 = {
|
||||
"audio": {
|
||||
"repeatableTimes": 3,
|
||||
"source": "https://firebasestorage.googleapis.com/v0/b/mti-ielts.appspot.com/o/listening_recordings%2Ffestival_presentation.mp3?alt=media&token=1602eebd-b292-49a3-93e5-5c0a003216a1"
|
||||
},
|
||||
"exercises": [
|
||||
{
|
||||
"id": str(uuid.uuid4()),
|
||||
"allowRepetition": True,
|
||||
"options": [
|
||||
{
|
||||
"id": "A",
|
||||
"sentence": "Cultural workshops"
|
||||
},
|
||||
{
|
||||
"id": "B",
|
||||
"sentence": "Street food vendors"
|
||||
},
|
||||
{
|
||||
"id": "C",
|
||||
"sentence": "Live music performances"
|
||||
},
|
||||
{
|
||||
"id": "D",
|
||||
"sentence": "Children's activities"
|
||||
},
|
||||
{
|
||||
"id": "E",
|
||||
"sentence": "Art exhibitions"
|
||||
}
|
||||
],
|
||||
"prompt": " Listen to a presentation about a local festival and match the activities with the appropriate festival days.",
|
||||
"sentences": [
|
||||
{
|
||||
"id": "1",
|
||||
"sentence": "Day One",
|
||||
"solution": "C"
|
||||
},
|
||||
{
|
||||
"id": "2",
|
||||
"sentence": "Day Two",
|
||||
"solution": "A"
|
||||
},
|
||||
{
|
||||
"id": "3",
|
||||
"sentence": "Day Three",
|
||||
"solution": "B"
|
||||
},
|
||||
{
|
||||
"id": "4",
|
||||
"sentence": "Day Four",
|
||||
"solution": "E"
|
||||
},
|
||||
{
|
||||
"id": "5",
|
||||
"sentence": "Day Five",
|
||||
"solution": "D"
|
||||
}
|
||||
],
|
||||
"type": "matchSentences"
|
||||
}
|
||||
],
|
||||
"isDiagnostic": True,
|
||||
"minTimer": 7,
|
||||
"module": "listening",
|
||||
"section": 2
|
||||
}
|
||||
|
||||
|
||||
# Falta section 3 e 4 do listening
|
||||
# writing task 1 com imagens ...
|
||||
# speaking 3 é discussao lol
|
||||
|
||||
# Get a reference to the Firestore database
|
||||
db = firestore.client()
|
||||
|
||||
# JSON data to insert
|
||||
|
||||
# Add the JSON data to Firestore
|
||||
collection_ref = db.collection('listening')
|
||||
document_ref = collection_ref.add(listening_section_2_to_insert_3)
|
||||
|
||||
print(f"Document added with ID: {document_ref}")
|
||||
|
||||
Reference in New Issue
Block a user