File size: 4,253 Bytes
67ebcef
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
"""Fresh held-out visual tasks (4 per category), written and frozen BEFORE the mentor training and never used for the
curriculum or the advice. The curriculum was designed after seeing the student's weak skills on the 32 benchmark
tasks; this set checks that what it learned carries over to subjects nobody looked at.
"""
import json

from make_mentor_tasks import HTML_TAIL, LIB_NONE, LIB_THREE, SVG_TAIL  # noqa: E402  (also rewrites mentor_tasks.jsonl)

SVG = [
    "Draw a cartoon penguin standing on ice: a black back and head, a white belly, an orange beak and feet, two flippers and two small eyes.",
    "Draw a radial menu: a ring divided into six equal segments with a label in each (Home, Mail, Music, Photos, Maps, Settings) and a round 'Menu' button in the centre.",
    "Draw a pyramid diagram: a triangle split into four horizontal layers labelled from bottom to top Basics, Practice, Projects, Mastery, each layer in a different colour.",
    "Draw a side view of a steam locomotive on rails: a long boiler, a cab with a window, a chimney with a puff of smoke, and three wheels joined by a connecting rod.",
]
PAGES = [
    "Build a 'Contact us' page with two columns: a contact form (name, email, subject, message, send button) on the left and the office address, phone, email and opening hours on the right.",
    "Build a social media profile header: a cover image placeholder (a gradient), a round avatar overlapping its bottom edge, the name, a short bio, follower and following counts and a Follow button.",
    "Build an invoice page: a company header, a bill-to address, a table of four line items with quantity, unit price and amount, the subtotal, tax and total, and payment terms at the bottom.",
    "Build a weekly habit tracker: a table of five habits by seven days with cells that are checked by clicking, and a completion percentage for each habit that updates.",
]
CANVAS = [
    ("Make a constellation animation on a canvas: 80 slowly drifting points, joined by lines when they are closer than 120 pixels, with the line opacity fading with distance.", True),
    ("Make an aquarium animation on a canvas: fish of different colours swimming left and right at different speeds and depths, rising bubbles and swaying seaweed.", True),
    ("Make a tic-tac-toe game on a canvas: clicking places X and O in turn, a win or a draw is detected and shown, and a restart button starts a new game.", False),
    ("Make a kaleidoscope animation on a canvas: a pattern of shapes mirrored into 12 symmetric segments around the centre, slowly rotating and changing colour.", True),
]
THREE = [
    ("Make a three.js carousel: a round platform with a cone roof on a central pole and six horses represented by colourful boxes that move up and down while the carousel rotates.", True),
    ("Make a three.js bowling scene: a wooden lane, ten white pins arranged in a triangle and a ball rolling towards them.", True),
    ("Make a three.js lava lamp: a transparent glass capsule on a dark base with several orange blobs (spheres) slowly rising and sinking inside it.", True),
    ("Make a three.js Ferris wheel: a large ring on two supports with eight gondolas (boxes) hanging from it that stay upright while the wheel turns.", True),
]

tasks = [{"id": f"fresh/s{i}", "cat": "svg", "kind": "svg", "animated": False, "prompt": p + SVG_TAIL}
         for i, p in enumerate(SVG, 1)]
tasks += [{"id": f"fresh/p{i}", "cat": "html", "kind": "html", "animated": False,
           "prompt": p + HTML_TAIL.format(lib=LIB_NONE)} for i, p in enumerate(PAGES, 1)]
tasks += [{"id": f"fresh/a{i}", "cat": "canvas", "kind": "html", "animated": an,
           "prompt": p + HTML_TAIL.format(lib=LIB_NONE)} for i, (p, an) in enumerate(CANVAS, 1)]
tasks += [{"id": f"fresh/d{i}", "cat": "three", "kind": "html", "animated": an,
           "prompt": p + HTML_TAIL.format(lib=LIB_THREE)} for i, (p, an) in enumerate(THREE, 1)]
with open("data/visual/tasks_fresh.jsonl", "w", encoding="utf-8") as f:
    for t in tasks:
        f.write(json.dumps({"id": t["id"], "task": "visual", **{k: v for k, v in t.items() if k != "id"}},
                           ensure_ascii=False) + "\n")
print(len(tasks), "fresh held-out tasks -> data/visual/tasks_fresh.jsonl")