← All Lessons Student Assignment →

CiTi · Computer Coding · Year Two · Unit 1

Roster Admin: An Inline Edit Form

A project within “Building Data-Driven Applications”

Program Computer Coding: Year 2
Unit 1: Building Data-Driven Applications
Duration About 6 class periods (~55 min each)
Grouping Individual build, pair testing
Deliverable A one-page admin form for roster.db + written test plan (100 pts)

Essential Question

From the Year 2 curriculum map
How do I map out my data design?

Before students can build an admin page, they have to map every field in a table to the right form control, and every stored code (6) to the word a person reads (Oswego). The roster table is one they already live in: it is the record behind their own login. That makes the data design concrete before they map their own Unit 1 project.

Curriculum Map Alignment

Verbatim from Yr 2 curriculum

Concept / Knowledge / Content: Mapping Tables

  • Edit tables using a database authoring tool
  • Create forms that will display table components with a database authoring tool
  • Identify the structural elements of a relational database table
  • Link a web site to create a web-enabled interface to the client’s existing database
  • Edit created forms and specify appropriate field labels for data entry

Relational Databases

  • Describe the purpose of primary keys and foreign keys

Precision Web Development 2 Assessment

  • Standard 1 Fundamentals of HTML5
    • Obj 1 Use advanced HTML5 elements to create a website
  • Standard 2 Cascading Style Sheets
    • Obj 2 Format page layout with advanced CSS
    • Obj 3 Build responsive websites
  • Standard 3 Site Planning and Design
    • Obj 3 Uploading and maintaining a site
  • Standard 5 Comprehensive Website
    • Obj 1 Build an interactive response website

Skills / Tasks

Demonstrate proficiency with:

Database Fundamentals Managing Data-Driven Application Abilities Backend Administration Design & Development

Essential Standards (CDOS 3b)

  • ITPD01.10.02: Create, populate, and maintain a database.
  • ITPD01.10.03: Perform database interfacing with web applications.
  • ITPD01.06.02: Demonstrate proficiency in developing an application using an appropriate programming language.
  • ITPD01.07.02: Perform testing and validation.
  • ITPD01.07.03: Document test results.
Standards touched: The JavaScript part (Part 3) previews Yr 2 Unit 3, Technical Assessment Standard 4, JavaScript Understanding (Obj. 1 Intro to JavaScript, Obj. 2 Functions). It uses only events, a confirm box, and class changes, so it can run before Unit 3 as a guided preview, or be held back and finished during Unit 3.

Program Connections

Skills & Portrait alignment

Program Skills: What I’m Building Toward

Hands-On:

#1 Write valid, semantic HTML5
#5 Write and execute database queries
#7 Validate and debug my own work
#8 Write JavaScript that responds to a user

Professional:

#5 Work through ambiguity
#7 Treat a mistake as data, not failure
#9 Document as you go

NYS Portrait of a Graduate

Critical Thinker Academically Prepared Reflective and Future Focused

Guaranteed & Viable Curriculum Framework

3 Dimensions for this project

Integrated Academic Knowledge

Data as codes: a stored number stands for a meaning (1 = AM, 6 = Oswego), and a page translates both ways. Unique identifiers: a record number finds exactly one row, and a username must be unique across the table. Ordering: text order puts 10 before 2, number order does not.

Employability Skills

Building a back-end tool for a non-technical user: clear labels, safe defaults, a confirm before anything destructive. Handling live data with care (test on your own records only). Writing and running a test plan and recording the results, the way a QA step works on a real team.

Technical Skills

HTML: one form per record, open-and-close rows with the details/summary pair, grouped fields with fieldset and legend, the right input types, submit buttons that carry their own value. WebDNA: search with view and sort options (numeric sort), found-items loops, a related table (district.db) through a foreign key: a lookup for the summary and a nested search for the dropdown, pre-selecting dropdowns, append with an auto-numbered record, replace and delete by record number, URL-encoding every saved value, a duplicate check, post-then-redirect, code-word messages, blanking fields that were never sent, closing the database. JavaScript: events, a confirm box, data attributes, class toggling, the leave-page warning.

Learning Intention

“Unwrapped” from the standard

Students will understand how one page can be a complete, safe interface to an existing database: and will build an inline admin form for the program roster that lists, adds, edits, and deletes records, then prove it works with a written test plan.

Success Criteria

  • I can map every field in a table to the right labeled form control, and translate stored codes into words.
  • I can use a foreign key (r_district) to show and choose a value from a related table (district.db).
  • I can list records from a database with a working view filter and sort, including a numeric sort.
  • I can add, save, and delete a single record by its record number, and every dropdown opens on the saved value.
  • I can keep bad input from breaking the data: encoded values, a duplicate-username check, and blanked never-sent fields.
  • I can explain why the page redirects after every change, and why its messages are code words, not text from the address bar.
  • I can add JavaScript helpers that protect the user without being needed for the page to work.
  • I can run a written test plan on my live page and record the results.

Authenticity Continuum

Where this project sits today
Instruction & Skill Practice
Teacher-Designed Simulation
Realistic Industry Task
Authentic Audience / Client
Product, Service, Impact, Solution

Students build a back-end admin page against the real structure of the program’s own roster table: the same “admin CRUD page for an existing database” job a junior developer gets. Push further: build the same admin page for the student’s own Unit 1 project table (Online Journal, Student Project, Material Inventory, or Tournament Laddering), with the instructor or a staff member acting as the client who will use it.

Materials & Prep

  • Student Assignment (y2-u1-l2-so): the goal, the field map, steps and “done when” checks for each part, the test plan, and grading. It has no code on purpose.
  • Practice roster: roster.zip (linked on the student page). It holds two tables: roster.db with 12 made-up students (10 active, 2 inactive, mixed sessions, levels, and districts; computer numbers 2, 10, and 19 for the numeric-sort test), with fake passwords and example.org emails, and district.db (sku, district) with the 9 districts. roster.db’s r_district holds a district sku. Students put both in lessons/assignments/databases/ and build lessons/assignments/week2.html. Never hand out the live roster: it holds real logins.
  • Teacher reference build: /citi/coding/ajm/multform/index.html, the finished page, which is also the answer key. It writes to its own copy of roster.db, so demo Add, Save, and Delete only on a test record, and don’t share the URL with students: anyone with the link can change the data. Last year’s student version is next to it as indexex.html (useful as a “find the bugs” warm-up).
  • Fetch (SFTP) and BBEdit (plain-text editor), Chrome with DevTools (Console and View Source). The student page names the protocol and the job (SFTP upload, plain-text editor), not the apps, so any SFTP client or editor works.
  • Two reference screenshots on the student page (a student open for editing, and the open Add form), taken from the reference build running on the practice roster, so no real student data shows.
  • A blank test-plan document template for students (the 12 tests from the assignment page).

The Three Parts

What students are given

Part 1 · UI (30 pts)

A finished-looking static page with hand-typed sample students. Each student is a closed summary row that opens to a labeled, grouped edit form with Save, Delete, and Undo. Plus an Add form, a Show/Sort toolbar, an inactive style, and phone width. No database.

Part 2 · DNA / Data (50 pts)

Replace the samples with a search of roster.db. Show and Sort, count, numbers translated to words, pre-selected dropdowns. Add, Save, Delete with encoded values, duplicate-username check, redirect after every change, code-word messages, blanked never-sent fields. Must work with JavaScript off.

Part 3 · JavaScript (15 pts)

Delete confirm (name from a data attribute), Expand/Collapse all, “unsaved” row marker, leave-page warning. No data is ever saved by JavaScript.

Test Plan (5 pts)

12 written tests run on the live page, results recorded. Covers special characters, duplicates, school year, inactive, refresh, numeric sort, unsaved, delete cancel, View Source, phone width.

Students show the teacher at the end of each part before moving on. Each part is a checkpoint grade.

Teacher Watch List

Symptom → cause
What students seeUsual cause
Saving a student changes their school yearThe year dropdown pre-selects this year instead of the record’s year (last year’s student version had this bug)
“O’Brien & Sons” saves as “O’Brien ”; a password is cut off at =Values in append/replace are not URL-encoded
A box or message shows its own name in brackets, like [fname]Field was never sent on this request; it must be blanked at the top of the page
Refresh adds the same student againNo redirect after the append
Save does nothing, or only Enter savesSubmit button missing or hidden; or the form wraps table cells (one form per record must wrap the whole record)
Every record changes at once, or none doThe hidden record number is missing, or misnamed (never call the field sku)
District shows blank or “Unknown” for everyoneLookup written with the wrong setting name (it takes value=), or a path or field name typo (r_district, district)
Every student’s district dropdown opens on the same district, or no district is selectedInside the district search, sku is the district’s sku. The student’s r_district must be saved in a text variable before the inner search, and compared to that
Saving a student blanks their districtThe dropdown is still named district; it must be r_district to match the field
Computer # sort puts 10 before 2Numeric sort missing its “type = number” setting
Changes don’t show up, or the db file looks stale over SFTPNo close-database at the end of the page
Whole list disappears after a student edits roster.dbThe file was resaved in an editor: line endings or tabs changed. Download roster.zip again for a fresh copy
JavaScript breaks or prints oddlySquare brackets in the script were read as WebDNA (for example an attribute selector or array index)
Delete confirm breaks on some namesName pasted into the script; an apostrophe ends the string. Use a data attribute

Lesson Flow

About 6 periods, ~55 min each
DayPhaseWhat happens
Day 1 Hook + Data Map + Part 1 Show last year’s student version: pairs list everything an admin would trip over (hidden Save, wrong year, no confirm). Walk the Know Your Data table: codes vs. words, the record number, why usernames must be unique, and the district.db link (primary key sku, foreign key r_district). Students sketch the page on paper, then start the shell and one open-and-close row.
Day 2 Part 1 build Full edit form, grouping, buttons, Add form, toolbar, inactive style, phone width. Checkpoint: Part 1 shown to teacher by end of day.
Day 3 Part 2: Read Mini-lesson: the page layout (settings, action section, HTML, close). Students replace samples with the search, translate codes, look up district names and build the district dropdown from district.db, pre-select dropdowns, add the count, Show and Sort.
Day 4 Part 2: Write Mini-lesson: forms that post to themselves, buttons that carry an action, encoding. Students build Add, Save, Delete on test records, then run the O’Brien & Sons test.
Day 5 Part 2: Make it safe Mini-lesson: what Refresh does after a post; why a message from the address bar is dangerous. Students add the duplicate check, redirect, code-word messages, and blank never-sent fields. Test with JavaScript off. Checkpoint: Part 2 shown to teacher.
Day 6 Part 3 + Test Plan Short demo: events and a confirm box. Students add the four helpers, then pairs run each other’s 12-test plan on the live page and record results. Students delete their test records. Checkpoint: Part 3 + test plan.

Assessment

Formative: the three checkpoints. Each part’s “Done when” list on the assignment page is the checklist.

Summative (100 pts): UI 30, DNA / Data 50, JavaScript 15, Test Plan 5. Grade the live page, not the source alone: run the 12 tests yourself, then View Source.

Exit question (after Part 2): “Why does the page redirect after every save? What would happen without it?”

Extension: (1) Add a simple admin login check so only admins reach the page. (2) Add a quick filter box that hides rows as you type. (3) Build the same admin page for the student’s own Unit 1 project table.