Tasks - adaptive-learning/flocs GitHub Wiki

Task fixture

Tasks are defined in tasks/fixtures/tasks.xml.

Changes can be transferred from the fixture to the DB using make db-load-data command.

You can preview tasks on http://localhost:8000/task-preview url (after calling ./manage.py gruntserver).

Fixture format

<?xml version="1.0" encoding="utf-8"?>
<django-objects version="1.0">

  <!-- definition of one task -->
  <object model="practice.taskmodel">
    <field name="maze_settings">
    // maze settings in JSON
    </field>
    <field name="workspace_settings">
    // workspace settings in JSON
    </field>
  </object>

  <!-- definition of another task -->
  <object model="practice.taskmodel">
    <field name="maze_settings">
    // maze settings in JSON
    </field>
    <field name="workspace_settings">
    // workspace settings in JSON
    </field>
  </object>

  <!-- ... -->

</django-objects>

Maze settings

{
  "grid": "2D array of square types: 0=free, 1=wall, 2=goal, 3=red, 4=green, 5=blue, 6=pit",
  "tokens" : "2D array of positions of tokens",
  "hero": {
    "position": "[x, y], indexed from zero",
    "direction": "0 = east, 1 = north, 2 = west, 3 = south"
  }
}

Example:

{
  "grid": [
    [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1],
    [1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1],
    [1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1],
    [1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1],
    [1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1],
    [1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1],
    [1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1],
    [1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1],
    [1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1],
    [1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1],
    [1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1],
    [1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1],
    [1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1],
    [1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1],
    [1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1],
    [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]],
  "tokens": [ [4,2], [4,4], [4,6] ],
  "hero": {
    "position": [4, 1],
    "direction": 3
  }
}

Try to stick with either 10x10 (small) or 12x16 (large) maze.

Workspace settings

{
  "toolbox": "list of blocks/categories names",
  "blocksLimit": "[optional] maximum number of blocks which can be used (int)"
}

Example:

{
  "toolbox": [
    "maze_move_forward",
    "maze_turn_left",
    "maze_turn_right"
  ],
  "blocksLimit": 6
}

List of blocks and categories

⚠️ **GitHub.com Fallback** ⚠️