-
Notifications
You must be signed in to change notification settings - Fork 126
Aritro connect frontend backend #85
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
aritro-datta
wants to merge
26
commits into
CAHLR:main
Choose a base branch
from
CAHLR:aritro-connect-frontend-backend
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This commit adds comprehensive personalization features to the OATutor platform, enabling dynamic, context-aware lesson orientation messages based on student intake data. Backend Changes (aws/lti-middleware/): - Added new personalizedMessage route handler that generates custom lesson messages using OpenAI GPT-4o-mini based on student intake responses - Implemented intelligent industry/field extraction from student responses with robust normalization to proper, grammatical industry names - Enhanced prompt engineering to understand context and nuance, transforming informal language (e.g., 'tech startup') into professional terminology (e.g., 'Tech Entrepreneurship') - Added lesson title parsing to extract meaningful topics from formatted titles (e.g., 'Lesson Professional: Skills' → 'Skills') - Implemented parallel API calls for industry extraction and message generation for improved performance - Added graceful error handling with fallback mechanisms for industry extraction - Updated Firebase initialization with try-catch for local development support Frontend Changes: - Enhanced LessonConfirmation component to fetch and display personalized messages and extracted industry names - Updated IntakeForm to show confirmation modal after submission - Improved UI to display industry-specific career support messaging - Added loading states and error handling for personalization API calls Key Features: - Context-aware industry extraction that understands student intent beyond literal responses - Grammatical normalization ensuring industry names work correctly in display sentences like 'How This Lesson Supports Your Career in [Industry]' - Lesson topic extraction from structured titles to avoid redundant prefixes - Comprehensive documentation with JSDoc comments throughout - All code properly attributed and documented Technical Details: - Uses OpenAI GPT-4o-mini for both message generation and industry extraction - Implements robust text cleaning and normalization for industry names - Handles edge cases with fallback extraction methods - Maintains backward compatibility with existing lesson confirmation flow Author: Aritro Datta
This commit addresses a UX issue where the lesson confirmation timer was starting immediately on page load, before users had a chance to read the personalized messages generated by the LLM. Changes made: - Modified the timer useEffect hook to wait until personalization loading is complete before starting the countdown - Added logic to check if both personalizedMessage and extractedIndustry are available (when intake data exists) before starting the timer - If no intake data exists, the timer starts immediately after loading completes since there are no messages to wait for - Updated the button text logic so the countdown in parentheses (e.g., 'Start Lesson (15)') only appears once the timer has actually started (elapsed > 0), rather than showing the full duration before the timer begins The timer now properly waits for both LLM-generated messages to be displayed, ensuring users have time to read the personalized lesson orientation before the countdown begins. This creates a better user experience by not rushing users through the confirmation screen before they've had a chance to see the personalized content. Technical details: - Timer state is reset (startRef and elapsed) when the timer actually starts, ensuring accurate timing - The useEffect dependencies include personalizationLoading, personalizedMessage, extractedIndustry, and personalizationError to properly react to all relevant state changes - The button text condition now checks both elapsed > 0 and !timerDone to show the countdown only during the active countdown period
40da2ea to
6a3359d
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Implement personalized lesson orientation with LLM-generated messages
Adds personalized lesson orientation messages using OpenAI, based on student intake responses. Students see tailored messages explaining how each lesson supports their career goals.
Features:
Backend:
/api/generate-personalized-messagethat uses OpenAI to generate personalized lesson messagesFrontend:
Technical details:
gpt-4o-minifor cost-effective personalizationFiles changed:
routes/personalizedMessage.js(backend API)components/problem-layout/IntakeForm.jscomponents/problem-layout/LessonConfirmation.js(integrated personalization)