Reference

The coLearn-AI Markup Language

For when you want the details ← Back to Part 3
You don’t need to memorize this. Most authors never write markup from scratch. They describe an activity to an LLM, edit in the Visual Editor, and open the Source view only to fine-tune. This page is here for when you want to know exactly what a tag does.

An activity is a plain-text document. The platform reads it to build the student view, configure the AI feedback, and record the epistemic trace. Tags start with a backslash, take arguments in braces, and blocks are closed with a matching \end… tag.

Example Activity settings Question groups Questions Feedback style AI help blocks Info bubbles Code blocks Text, lists, tables, images Scoring Ground rules

A Small Complete Activity

\title{Counting with range()} \name{range_intro} \studentlevel{CS1 Python, week 5} \activitycontext{Groups explore how range() generates a sequence. Focus on the excluded stop value.} \aicodeguidance{Require a real loop. Accept any variable names.} \section{Predict, then run} \questiongroup{What does range() produce?} \text{Read the code with your group before you run it.} \question{Before running it, predict exactly what this prints. Then run it and explain any difference.} \python for i in range(2, 10, 3): print(i) \endpython \textresponse{4} \sampleresponses{It prints 2, 5, 8. 10 is the stop value and is never included.} \feedbackprompt{Accept if the group gives 2, 5, 8 and says why 10 is not printed. If they include 10 or 11, ask what the stop value means.} \endquestion \endquestiongroup

1. Activity Settings

These go at the top of the document, before any question group.

TagWhat it does
\title{...}Title shown to students.
\name{...}Unique internal identifier.
\studentlevel{...}Who the students are, e.g. CS1 Python, week 5. Calibrates the AI’s language.
\activitycontext{...}Topic scope and teaching goals for the AI (activity-level guidance).
\aicodeguidance{...}Activity-wide rules for the AI: follow-ups, scope limits, how strict to be with code.
\aimode{...}How accepted answers are shown. See Feedback style.
\language{...}Language the AI must respond in, e.g. \language{Swedish}. Default English.
\mode{group}Normal collaborative activity (the default). Each group of questions must be submitted before the next opens.
\mode{test}Graded assessment. \test is an older spelling of the same thing.
\mode{demo}Every question group is open at once, there is no submit button, and each student works in their own saved copy.

2. Question Groups & Sections

TagWhat it does
\section{Title}A heading. Structural only: nothing to answer.
\questiongroup{Title} … \endquestiongroupA set of related questions the group answers and submits together. Everything students answer must be inside a question group.

3. Questions

TagWhat it does
\question{...} … \endquestionA question. The closing \endquestion is required.
\textresponse{n}An answer box n lines tall.
\sampleresponses{...}A model answer. Hidden from students; helps the AI recognise good answers.
\feedbackprompt{...}Your instructions to the AI for judging this question. Hidden from students. This is the most important thing you write.
\followupprompt{...}Optional follow-up the AI can use, e.g. Why might greedy fail?
\questiontype{...}Optional research label: what kind of thinking the question asks for, so the trace can be analyzed by question type. One of code_writing, code_reading, output_prediction, debugging, conceptual_explanation, application_problem_solving, reflection, other. Hidden from students; never changes how the question works.
\responsemode{questions}Students write questions rather than answers (e.g. interview questions). The default, answer, never needs to be written.
\multiplechoice{key} … \endmultiplechoiceSingle-answer multiple choice; the argument is the correct choice. Each option is a \choice{...}.
\multiplechoice{multiple}Ungraded “select all that apply” survey.
\aimode{...}Overrides the activity’s feedback style for this one question.

Feedback style: \aimode

The AI makes one of two decisions about each submission: accepted (the group moves on) or revise (yellow guidance asking them to think again). After the allowed number of tries the group can choose to continue anyway. \aimode takes a comma-separated list:

ValueMeaning
no-positiveDefault. Accepted answers advance without a praise message.
positiveAccepted answers get a short affirmative message in green.
briefWith positive, keep that message to one sentence.
lenientAccept relevant, on-track work without demanding small refinements. Incorrect work still gets revise.

4. AI Help Blocks

An \ai block puts a small AI assistant between questions. It is a learning tool, not a question: it creates no answer and is never graded. Your guardrail keeps it from handing over the worksheet answers.

\ai{explain} \aititle{AI Coach} \aiprompt{Ask the AI for help understanding what this code does.} \aiguardrail{Help the student reason about the code. Do not give away the worksheet answers.} \aicontext{current-question,current-code,student-response} \aiinput{5} \endai
TagWhat it does
\ai{mode} … \endaiMode is explain, critique, testgen or generate. Place directly inside a question group.
\aititle{...}Card title students see.
\aiprompt{...}Instructions students see.
\aiguardrail{...}Hidden limits on what the AI may do.
\aicontext{...}What the AI can see: current-question, current-code, student-response, nearby-text.
\aiinput{n}Height of the student’s input box.
\aimodel{...}Optional: gpt-5-mini (default) or gpt-4o-mini.

5. Info Bubbles

\info{target,seconds}{message} shows a short coaching tip near part of the page, e.g. \info{textresponse,10}{The active student types here.}. Targets: questiongroup, question, textresponse, coderesponse, submitbutton, aifeedback. Keep the message to a handful of words.

6. Code Blocks

The text between the tags is the starter code students see. Each block can run; an optional argument sets a timeout in milliseconds.

TagWhat it does
\python … \endpythonPython that runs in the browser. \python{50000} sets a timeout.
\pythonremote … \endpythonremotePython that runs on the server (for libraries such as pandas).
\pythonturtle{WxH,timeout} … \endpythonturtlePython Turtle with a drawing canvas, e.g. \pythonturtle{900x600,50000}.
\cpp … \endcppC++, compiled and run on the server.

7. Text, Lists, Tables & Images

TagWhat it does
\text{...}A paragraph.
\textbf{...}, \textit{...}Bold and italic.
\begin{itemize} … \end{itemize}Bulleted list; each line starts with \item. Use enumerate for a numbered list.
\table{caption} … \endtableA table. Each row is \row a & b & c; put \tresponse in a cell students fill in.
\image{URL}{Caption}{Width}An image; caption and width (e.g. 50%) are optional.
\link{URL}{Text}A hyperlink.

8. Scoring (Test Mode)

In \mode{test}, a \score{points,type} … \endscore block inside a question holds the rubric. Type is response, code or output.

\score{6,response} 6: Clear, correct explanation with example 3-5: Mostly correct 1-2: Partial understanding 0: Incorrect or missing \endscore

Ground Rules

  1. Everything students answer goes inside a \questiongroup.
  2. Every \question ends with \endquestion.
  3. Only \score blocks grade; feedback prompts guide, they don’t score.
  4. The AI responds only to what students actually submit.