Timer Functions
isTimerActive
Check if a timer is currently running.Event ID or
'crono_livre' for the free timertrue if timer is active, false otherwisegetElapsedSeconds
Calculate total elapsed time for an event in seconds.Event object with
tempoAcumulado and optional _timerStartTotal elapsed seconds (accumulated + current session if running)
toggleTimer
Start or pause a timer.Event ID or
'crono_livre'- Sets
_timerStartto current timestamp - Calls
reattachTimers()to start interval - Dispatches
app:refreshEventCardevent
- Accumulates elapsed time into
tempoAcumulado - Removes
_timerStart - Clears interval
All timer state changes automatically trigger
scheduleSave().toggleTimerMode
Toggle between continuous and Pomodoro timer modes.- Timer auto-pauses after focus period (default 25 min)
- Plays alarm sound
- Shows desktop notification if permitted
- Dispatches toast with break reminder
reattachTimers
Reattach interval updates for all active timers.- Clears all existing intervals
- Finds all events with
_timerStart - Creates new intervals that update UI every second
- Implements Pomodoro auto-pause logic
addTimerMinutes
Add extra time to an event’s target duration.Event ID or
'crono_livre'Minutes to add to the duration
discardTimer
Discard a timer session (resets accumulated time to zero).Event ID or
'crono_livre'marcarEstudei
Mark an event as studied (complete the session).Event ID to mark as studied
- Opens the session registration modal (if available)
- Falls back to
_marcarEstudeiDirect()if modal not loaded - Stops timer and accumulates time
- Updates event status to
'estudei' - Marks associated topic as completed if applicable
deleteEvento
Delete an event permanently.Event ID to delete
totalStudySeconds
Calculate total study time in seconds.Optional number of days to look back (null for all time)
Total seconds studied across matching events
Revision Functions
calcRevisionDates
Calculate scheduled revision dates based on spaced repetition.Completion date in ‘YYYY-MM-DD’ format
Array of completed revision indices
Number of days to postpone the schedule
Array of date strings for remaining revisions
Results are cached using a Map for performance. Call
invalidateRevCache() when frequency settings change.getPendingRevisoes
Get all revisions due today or earlier.Array of revision objects with:
assunto: Topic objectdisc: Discipline objectedital: Exam notice objectdata: Due date string
invalidateRevCache
Clear the revision dates cache.invalidatePendingRevCache
Clear the pending revisions cache.Discipline Functions
getAllDisciplinas
Get all disciplines from all exam notices with parent context.Array of objects with
disc and edital propertiesResults are cached. Call
invalidateDiscCache() when editais change.getDisc
Get a discipline by ID with parent context.Discipline ID
Object with
disc and edital properties, or null if not foundinvalidateDiscCache
Clear the disciplines cache.Analytics Functions
getPerformanceStats
Get question performance statistics.Object with:
questionsTotal: numberquestionsCorrect: numberquestionsWrong: number
getPagesReadStats
Get total pages read across all study sessions.Total pages read
getSyllabusProgress
Get completion progress for course lessons.Object with:
totalAssuntos: Total number of lessonstotalConcluidos: Number of completed lessons
getConsistencyStreak
Calculate study consistency and generate heatmap.Object with:
currentStreak: number - Consecutive days studied up to todaymaxStreak: number - Longest historical streakheatmap: array - Boolean array of last 30 days (true = studied)
getSubjectStats
Get per-discipline study statistics.Array of objects with:
id: stringnome: stringtempo: number - Total seconds studiedacertos: number - Correct answerserros: number - Wrong answers
getCurrentWeekStats
Get current week study statistics.Object with:
startStr: string - Week start dateendStr: string - Week end datetotalSeconds: number - Total study time this weektotalQuestions: number - Total questions this weekdailySeconds: array - Study time per day (7 elements)
getPredictiveStats
Get predictive analytics and weekly goal tracking.Weekly study goal in hours
Object with:
status: string - ‘verde’, ‘amarelo’, or ‘vermelho’projectedPerc: number - Projected percentage of goalsuggestion: string - Actionable recommendationprojectedSeconds: number - Projected total by week endtargetSeconds: number - Target seconds from goalburnRate: number - Current seconds per day ratedaysRemaining: number - Days left in week
Planning Functions
calculateRelevanceWeights
Calculate study time distribution based on importance and knowledge.Object mapping discipline IDs to
{importancia, conhecimento} ratings (1-5 scale)Object mapping discipline IDs to calculated weights with
percentual propertyFormula:
peso = importancia × (6 - conhecimento). Lower knowledge increases weight.generatePlanejamento
Generate automated study plan from wizard configuration.Planning configuration with
tipo, disciplinas, relevancia, and horariosComplete planning object with generated
sequencia array- Calculates relevance weights
- Distributes weekly hours proportionally
- Breaks sessions into min/max durations
- Creates sequenced study blocks
- Saves to
state.planejamento - Calls
syncCicloToEventos()to generate events
deletePlanejamento
Delete the current study plan.iniciarEtapaPlanejamento
Start a study session for a planning sequence item.Sequence item ID from
state.planejamento.sequencia- Creates an event for the sequence item
- Starts the timer automatically
- Navigates to the timer view
syncCicloToEventos
Generate future events from the planning sequence.- Removes auto-generated future events
- Keeps events with study time or status=‘estudei’
- Generates events for next 14 days based on sequence
- Respects
materiasPorDiaconfiguration - Honors weekly schedule if tipo=‘semanal’