Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/elenacarino-max/Pildora4_ext_StarWars/llms.txt

Use this file to discover all available pages before exploring further.

The teacher panel provides a set of real-time interventions that let you keep the activity flowing without interrupting the class narrative. All controls are scoped to a single selected team and take effect immediately — no page reload is required. Alongside these interventions, the panel exposes every team’s live scoring data and their submitted defenses, and gives you one-click export to JSON or CSV when the session ends.

Team monitoring table

The Seguimiento de equipos table is built from list_teams() in database.py. It joins the teams, mission_runs, and attempts tables so that every row is fully up to date. The columns visible to the teacher are:
ColumnSource fieldDescription
EquiponameTeam name chosen at join time
EstadophaseCurrent phase: chambers, missions, comparator, defense, or completed
Cámarachamber_indexChambers unlocked, displayed as x/6 (capped at 6)
Misionesmissions_completedDistinct missions submitted, displayed as x/3
IntentosattemptsTotal code submission attempts across all challenges
Pistashints_usedCumulative hints requested (each costs 5 points)
PuntosscoreCurrent score
Holocrónholocron_idTitle of the assigned holocron challenge, or if not yet assigned
The table renders with st.dataframe() and hides the index. It refreshes automatically whenever the teacher triggers any intervention.

Available interventions

All interventions are grouped in the Intervenciones del Consejo section. Select a team from the dropdown, then use the action buttons.

Unlock next chamber

Function: unlock_next_chamber(team_id) Advances the selected team to the next chamber without requiring a correct code submission. Internally this calls complete_chamber(), which adds +20 points to the team’s score and increments chamber_index. If chamber_index reaches 6, the team’s phase transitions to missions. Use this when a team is genuinely stuck and you want to preserve the session’s pace rather than leaving them blocked at a single challenge.
# database.py — unlock_next_chamber
def unlock_next_chamber(team_id: str) -> None:
    team = get_team(team_id)
    if team and team["phase"] == "chambers":
        complete_chamber(team_id, int(team["chamber_index"]))
The automatic five-failure path (triggered by the student portal, not the teacher) uses force_advance_chamber() instead, which deducts 10 points as a penalty. The teacher-side unlock via complete_chamber() does not apply that penalty.

Reset team

Function: reset_team(team_id) Returns the selected team to a completely clean state. The function deletes all records associated with the team and resets the team row itself:
  • Deletes all rows from attempts, hint_usage, mission_runs, and defenses
  • Sets chamber_index = 0, phase = 'chambers', score = 0, hints_used = 0, holocron_id = NULL
A confirmation checkbox (Confirmar reinicio) must be checked before the Reiniciar equipo button becomes active.
# database.py — reset_team
def reset_team(team_id: str) -> None:
    with connect() as db:
        db.execute("DELETE FROM attempts WHERE team_id=?", (team_id,))
        db.execute("DELETE FROM hint_usage WHERE team_id=?", (team_id,))
        db.execute("DELETE FROM mission_runs WHERE team_id=?", (team_id,))
        db.execute("DELETE FROM defenses WHERE team_id=?", (team_id,))
        db.execute(
            "UPDATE teams SET chamber_index=0, phase='chambers', score=0, "
            "hints_used=0, holocron_id=NULL WHERE id=?",
            (team_id,),
        )
reset_team is irreversible. The team loses all progress, scores, submitted mission runs, and sealed defenses. There is no undo. Use only when a team genuinely needs to start over (e.g. wrong team name was used at join time).

Reassign holocron

Function: reassign_holocron(team_id, holocron_id) Swaps the defense challenge assigned to a team. Seven holocron challenges are available, each with a different analytical focus:
Holocron IDTitleFocus
consejo-desconfiadoConsejo desconfiadoMulti-metric evidence
recursos-limitadosRecursos limitadosComplexity vs. performance
auditoria-imperialAuditoría imperialTraceability
senado-galacticoSenado galácticoNon-technical communication
lado-oscuro-metricaEl lado oscuro de la métricaPer-class recall (digit 8)
rescate-prioritarioRescate prioritarioPer-class recall (digit 1)
mision-produccionMisión en producciónProduction readiness
Select the desired title from the Reasignar holocrón dropdown and click Asignar holocrón. The change takes effect immediately; the team will see the new challenge on their next page load.

Global hint

Function: set_global_hint(session_id, hint) Broadcasts a plain-text message (up to 500 characters) to all teams in the session. The message appears in every team’s sidebar immediately. Use this for time announcements, conceptual nudges, or clarifications that apply to the whole class — for example:
“Remember: data known before training goes in Parameters, not Metrics.”
The hint is stored at the session level and overwrites the previous message. See Sessions for full details.

Exporting results

Export controls appear in the Copias de seguridad y exportación section at the bottom of the panel. Two formats are available, both generated by export_session() in database.py.

JSON export

Downloads a complete backup of the session as a UTF-8 encoded JSON file named {session_code}-resultados.json. The JSON array contains one object per team. Each object includes all fields from list_teams() plus two nested keys:
  • runs — all mission_runs rows for the team, with metrics_json decoded to a metrics dict
  • defense — the team’s defenses row, or null if no defense was submitted
Use JSON export for archiving, post-session analysis, or feeding results into other tools.

CSV export

Downloads a UTF-8-BOM encoded summary table named {session_code}-resumen.csv with the following columns:
ColumnDescription
nameTeam name
phaseFinal phase reached
chamber_indexNumber of chambers completed
missions_completedNumber of missions completed
scoreFinal score
hints_usedTotal hints used
holocron_idAssigned holocron challenge ID
Use CSV export for grade sheets and quick comparisons in a spreadsheet.
# database.py — export_session (CSV path)
fields = [
    "name", "phase", "chamber_index", "missions_completed",
    "score", "hints_used", "holocron_id"
]
writer = csv.DictWriter(output, fieldnames=fields)
writer.writeheader()
writer.writerows({key: team.get(key) for key in fields} for team in payload)
Export both JSON and CSV at the end of every session before closing it. The JSON gives you a full audit trail including all mission run metrics and defense text; the CSV is ready to paste directly into a gradebook.

Viewing defenses

The Defensas selladas section lists all completed defenses directly in the panel. Each defense expands into a detailed view showing every field the team submitted:
FieldDescription
selected_runThe MLflow run ID the team chose as their recommendation
evidenceFree-text justification for the selected run
artifactName of the artifact the team consulted (e.g. confusion matrix)
discarded_runThe run ID the team chose to reject
discard_reasonFree-text explanation for the rejection
limitationAn acknowledged limitation of the team’s decision
recommendationFinal recommendation displayed as an info callout
If no teams have submitted a defense yet, the section displays “Todavía no hay defensas completas.” Defenses are read-only in the teacher view — they can only be modified by the team via a new submission, or wiped entirely by a team reset.

Build docs developers (and LLMs) love