Bringing AI APIs into the classroom
with a JavaScript coding site

Dr. Mark Humphrys

School of Computing, Dublin City University.
Site: ancientbrain.com
Email: mark@ancientbrain.com

5th International Conference on Education and Artificial Intelligence Technologies (EAIT 2024), 17-19 Oct 2024, London.

 


World: Ammo for AB at Ancient Brain.
  

AI in secondary and third-level education

Audience for this:

Anyone interested in bringing AI into coding classes in secondary and third-level education.

This talk is mainly about coding for AI APIs.
We have some discussion on coding local AI also.

  

AI APIs

  

Web page access to an AI model.

How do we bring code access to an AI model to the classroom?

  

HTTP POST calls

  

HTTP POST call may not be for the beginner!

This is a tutorial: Accessing ChatGPT-4 in JavaScript Through OpenAI APIs

Can we simplify access for learning coders?

  

Principles of a shared coding environment

  1. Users can view collections of programs written by other users.
  2. Users can run these programs without any install.
  3. Users can run untrusted code securely.
  4. Users can edit their programs without any install.
  5. By default other users can view source code of programs.
  6. By default other users can clone your program and edit their copy.
  7. Programs can do advanced graphics.
  8. System should scale to large number of users and programs.
  

Ancient Brain, a JavaScript-based solution

JavaScript-based solution addresses the previous points as follows:

  1. Programs (called "Worlds") are stored on server. Users browse lists of what programs exist.
  2. Code is in JavaScript. Users can run it without any install.
  3. Users can run untrusted JavaScript securely, because the JavaScript security model is mature.
  4. Users can edit code inside browser with no install. (Uses a JavaScript library.)
  5. Users can "view source" to view any JavaScript delivered to the client side.
  6. Users can clone programs.
  7. JavaScript graphics libraries such as Three.js and P5 enable advanced 3D and 2D graphics, all on client side.
  8. Code runs on the client side, so the system scales well.
  
Details in paper: Ancient Brain: A JavaScript coding platform for education with 3D graphics, Websockets, AI and support for teachers,
Mark Humphrys, 8th International Conference on Digital Technology in Education (ICDTE 2024), 7-9 Aug 2024, Berlin, Germany.
  

Live demo

Switching to live demo at: ancientbrain.com

So far: programs written by coders.

  

Features of Ancient Brain

  1. Editor. Error checking. Intelligent code help.

  2. 2D and 3D graphics. Three.js, P5, Phaser, raw WebGL.

  3. Text-only Worlds. (Regular web pages with HTML.)

  4. Upload images, textures, music, sound effects, JavaScript libraries, JSON data files and 3D models to use in Worlds.

  

Features of Ancient Brain (continued)

  1. Mouse re-definition. Mouse drag and click can call your code.

  2. Mobile. Touch tap and drag. Students show off work to parents on their mobile.

  3. 3D models (e.g. houses, people) can be uploaded and used in Worlds.

  4. Physics with gravity, momentum, etc.

  5. Websockets support. Coders can create multi-user Web games and real-time chat Worlds.

  6. File system. Read and write to server.

  7. Internet calls. Call remote APIs. Get remote data.

  

Features of Ancient Brain (continued)

  1. Search engine. Code search.

  2. Can obfuscate JavaScript.
    Others can see your World exists, but source code is hard to find, and when found it is obfuscated.

  3. Can set "hidden URL".
    Others cannot see your World exists.

  4. "Teacher" and "Student" Worlds.
    Student Worlds hidden from everyone except teacher.
    Teacher can see them and run them.
    Teacher can run untrusted code.

  5. Teacher can edit student code.
    Bug-fix student code. Insert console.log.

  

The AI API experiment

  

Sample World: Infinite story book

  

Click to go to World: Infinite story book at Ancient Brain.
  
  

Sample World: Landmark Museum

  

Click to run World: Landmark Museum at Ancient Brain.
  
  

Issues

Issues specific to the AI API experiments
  

Related work

  

The AI API collection

A collection of AI API programs in JavaScript that can be run, copied, edited by others.

AI API undergraduate Worlds

AI API postgraduate Worlds

  
Comp.Sci. students were well able to construct HTTP POSTS to diverse APIs.
Now introductory students can take their Worlds and modify them.

Future Work: Write exercises for students to clone and modify these API Worlds.

  

AI coding course

Local AI (not API calls).
In use with undergrad and postgrad courses at DCU.

AI coding course

  
Each World has exercises. Typical format:
  1. Clone. Edit.
  2. Make changes (like change learning rate, population size, number of nodes).
  3. Run. Explain why different.
  

Click to run World: A star at Ancient Brain.

  

Click to run World: Character recognition neural network at Ancient Brain.

  

Partner needed

Partner needed to bring AI coding (API calls or local AI) into schools.

AI course and textbook for schools using Ancient Brain functionality.

 

Drag and zoom.
This is a program, not a video.

  

World: Ammo for AB at Ancient Brain.