Skip to main content
Glama
temp_methods_used.js9.45 kB
generateTopicSpecificQuizQuestions(mainTopic, subject, prompt) { const topicLower = mainTopic.toLowerCase(); if (topicLower.includes('fotossíntese')) { return [ { id: this.generateUUID(), question: "<p><strong>Onde ocorre principalmente a fotossíntese nas plantas?</strong></p>", image: null, video: null, answered: false, feedback_default: { text: null, image: null, video: null, media_max_width: null }, feedback_correct: { text: "<p><strong>Parabéns!</strong> 🌱 Você acertou! A fotossíntese ocorre principalmente nas folhas.</p>", image: null, video: null, media_max_width: null }, feedback_incorrect: { text: "<p>Não se preocupe! 📚 A fotossíntese ocorre principalmente nas folhas, onde há mais clorofila.</p>", image: null, video: null, media_max_width: null }, no_correct_answer: false, no_feedback: false, choices: [ { id: this.generateUUID(), correct: true, text: "<p>Nas folhas</p>" }, { id: this.generateUUID(), correct: false, text: "<p>Nas raízes</p>" }, { id: this.generateUUID(), correct: false, text: "<p>No caule</p>" }, { id: this.generateUUID(), correct: false, text: "<p>Nas flores</p>" } ] }, { id: this.generateUUID(), question: "<p><strong>O que a planta absorve da atmosfera durante a fotossíntese?</strong></p>", image: null, video: null, answered: false, feedback_default: { text: null, image: null, video: null, media_max_width: null }, feedback_correct: { text: "<p><strong>Excelente!</strong> 🌍 O CO₂ é essencial para a fotossíntese!</p>", image: null, video: null, media_max_width: null }, feedback_incorrect: { text: "<p>Lembre-se! 🌱 As plantas absorvem CO₂ (dióxido de carbono) do ar.</p>", image: null, video: null, media_max_width: null }, no_correct_answer: false, no_feedback: false, choices: [ { id: this.generateUUID(), correct: true, text: "<p>Dióxido de carbono (CO₂)</p>" }, { id: this.generateUUID(), correct: false, text: "<p>Oxigênio (O₂)</p>" }, { id: this.generateUUID(), correct: false, text: "<p>Nitrogênio (N₂)</p>" }, { id: this.generateUUID(), correct: false, text: "<p>Hidrogênio (H₂)</p>" } ] }, { id: this.generateUUID(), question: "<p><strong>Qual pigmento é responsável pela cor verde das plantas?</strong></p>", image: null, video: null, answered: false, feedback_default: { text: null, image: null, video: null, media_max_width: null }, feedback_correct: { text: "<p><strong>Perfeito!</strong> 🍃 A clorofila dá a cor verde e captura luz solar!</p>", image: null, video: null, media_max_width: null }, feedback_incorrect: { text: "<p>Quase lá! 🌿 A clorofila é o pigmento verde das plantas.</p>", image: null, video: null, media_max_width: null }, no_correct_answer: false, no_feedback: false, choices: [ { id: this.generateUUID(), correct: true, text: "<p>Clorofila</p>" }, { id: this.generateUUID(), correct: false, text: "<p>Caroteno</p>" }, { id: this.generateUUID(), correct: false, text: "<p>Antocianina</p>" }, { id: this.generateUUID(), correct: false, text: "<p>Xantofila</p>" } ] } ]; } // Fallback for other topics return [ { id: this.generateUUID(), question: `<p><strong>Baseado no que estudamos sobre ${mainTopic}, qual a principal característica deste conceito?</strong></p>`, image: null, video: null, answered: false, feedback_default: { text: null, image: null, video: null, media_max_width: null }, feedback_correct: { text: "<p><strong>Parabéns!</strong> 🎉 Você demonstrou excelente compreensão do conceito. Continue assim!</p>", image: null, video: null, media_max_width: null }, feedback_incorrect: { text: "<p>Não se preocupe! 📚 Revise o conteúdo anterior e tente novamente. O aprendizado é um processo!</p>", image: null, video: null, media_max_width: null }, no_correct_answer: false, no_feedback: false, choices: [ { id: this.generateUUID(), correct: true, text: "<p>É um conceito fundamental para compreender a matéria</p>" }, { id: this.generateUUID(), correct: false, text: "<p>Não tem aplicação prática no dia a dia</p>" }, { id: this.generateUUID(), correct: false, text: "<p>É muito complexo para ser compreendido</p>" }, { id: this.generateUUID(), correct: false, text: "<p>Só é importante para especialistas</p>" } ] } ]; } generateTopicSpecificSummary(mainTopic, subject) { const topicLower = mainTopic.toLowerCase(); if (topicLower.includes('fotossíntese')) { return `<h3>🌱 Missão Cumprida!</h3> <p><strong>Parabéns por concluir esta aula sobre Fotossíntese!</strong></p> <p>Hoje você aprendeu sobre:</p> <ul> <li>✅ O que é fotossíntese e como ela funciona</li> <li>✅ A importância da clorofila para capturar luz solar</li> <li>✅ Os reagentes: luz solar, CO₂ e água</li> <li>✅ Os produtos: glicose e oxigênio</li> <li>✅ A importância da fotossíntese para a vida na Terra</li> </ul> <p><em>A fotossíntese é fundamental para toda a vida no planeta! Continue explorando o fascinante mundo das ${subject}!</em></p> <p><strong>Próximos passos:</strong> Observe as plantas ao seu redor e lembre-se de que elas estão constantemente fazendo fotossíntese!</p>`; } // Fallback for other topics return `<h3>🎯 Missão Cumprida!</h3> <p><strong>Parabéns por concluir esta aula sobre ${mainTopic}!</strong></p> <p>Hoje você:</p> <ul> <li>✅ Aprendeu os conceitos fundamentais</li> <li>✅ Explorou aplicações práticas</li> <li>✅ Testou seus conhecimentos</li> <li>✅ Desenvolveu seu pensamento crítico</li> </ul> <p><em>Continue praticando e explorando ${subject}. O conhecimento é uma jornada contínua de descobertas!</em></p> <p><strong>Próximos passos:</strong> Aplique o que aprendeu em atividades do dia a dia e compartilhe seu conhecimento com colegas.</p>`; } getTopicSpecificImage(mainTopic, subject) { const topicLower = mainTopic.toLowerCase(); // Topic-specific images if (topicLower.includes('fotossíntese')) { return 'https://images.unsplash.com/photo-1441974231531-c6227db76b6e?w=760'; // Plant leaves in sunlight } if (topicLower.includes('célula')) { return 'https://images.unsplash.com/photo-1559757148-5c350d0d3c56?w=760'; // Microscope/cells } if (topicLower.includes('sistema solar')) { return 'https://images.unsplash.com/photo-1446776653964-20c1d3a81b06?w=760'; // Solar system } // Subject-specific fallback return this.getSubjectImage(subject); } getTopicSpecificHeaderImage(mainTopic, subject) { const topicLower = mainTopic.toLowerCase(); // Topic-specific header images if (topicLower.includes('fotossíntese')) { return 'https://images.unsplash.com/photo-1516026672322-bc52d61a55d5?w=1920&h=400&fit=crop'; // Green forest } if (topicLower.includes('célula')) { return 'https://images.unsplash.com/photo-1559757175-0eb30cd8c063?w=1920&h=400&fit=crop'; // Science lab } if (topicLower.includes('sistema solar')) { return 'https://images.unsplash.com/photo-1419242902214-272b3f66ee7a?w=1920&h=400&fit=crop'; // Space/stars } // Subject-specific fallback const subjectImages = { 'Ciências': 'https://images.unsplash.com/photo-1507003211169-0a1dd7228f2d?w=1920&h=400&fit=crop', 'Matemática': 'https://images.unsplash.com/photo-1509228468518-180dd4864904?w=1920&h=400&fit=crop', 'História': 'https://images.unsplash.com/photo-1604580864964-0462f5d5b1a8?w=1920&h=400&fit=crop' }; return subjectImages[subject] || 'https://images.unsplash.com/photo-1503676260728-1c00da094a0b?w=1920&h=400&fit=crop'; } generateEnhancedTemplateElements(prompt, subject, gradeLevel) { // Enhanced template fallback with better topic extraction const mainTopic = this.extractEnhancedMainTopic(prompt); console.log(`🔧 [FALLBACK] Using enhanced templates for topic: "${mainTopic}"`); const elements = []; // Use intelligent methods even in fallback elements.push(this.generateIntelligentHeader(subject, gradeLevel, mainTopic)); elements.push(this.generateIntelligentTextWidget(mainTopic, subject, gradeLevel)); elements.push(this.generateIntelligentImageWidget(mainTopic, subject)); elements.push(this.generateIntelligentFlashcards(mainTopic, subject, prompt)); elements.push(this.generateIntelligentQuiz(mainTopic, subject, prompt)); elements.push(this.generateIntelligentSummary(mainTopic, subject)); return elements; }

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/rkm097git/euconquisto-composer-mcp-poc'

If you have feedback or need assistance with the MCP directory API, please join our Discord server