Skip to content
Snippets Groups Projects
Commit 7513aabf authored by fibasile's avatar fibasile
Browse files

initial import

parents
No related branches found
No related tags found
No related merge requests found
.venv
# Tests for machine-friendly assessment rules
This is a small test, to try ways to represent assessment rules in a git-friendly format that can be converted easily
in UI for the evaluation.
In the test the rules are represented using [YAML](http://yaml.org/)
## Rule file format
The structure follows this general model:
unit: <Unit name>
tasks:
- name: Task name
description: markdown description
outcomes: list of outcomes
checklist: student checklist
-..
faq: Markdown faq
Take a look to the provided .yaml for a full example
## Build.py
This script takes an (hardcoded) list of yaml files and can:
**Test them for correctness**
python build.py test
**Convert them to Markdown**
python build.py gitbook
**Convert them to JSON**
python build.py json
## Try it yourself
To be able to run build.py you need to intsall the packages in requirements.txt
pip install -r requirements.txt
## Next steps
This format should allows us to build the gitbook and nueval version from the YAML files,
so we might convert the remaining pagese using the format.
build.py 0 → 100644
import yaml
import sys,traceback
import os
import json
from cStringIO import StringIO
SOURCE_FILES = [
'computer-controlled_cutting'
]
def readYAML(source):
print 'Reading %s' % source
f = open(source, 'r')
data = yaml.load(f.read())
f.close()
return data
def makeTask(task):
taskMD = StringIO()
print >>taskMD, '## %s\n' % task['name']
print >>taskMD, task['description']
print >>taskMD, '### Learning outcomes\n'
for o in task['outcomes']:
print >>taskMD, o
print >>taskMD, '### Have you?\n'
for c in task['checklist']:
print >>taskMD, c
return taskMD.getvalue()
def makeBookPage(data):
md = StringIO()
print >>md, '# %s\n' % data['unit']
for task in data['tasks']:
print >>md, makeTask(task)
print >>md, '## FAQ\n'
print >>md, data['faq']
return md.getvalue()
if __name__ == '__main__':
if len(sys.argv) < 2:
print 'Usage: build.py [command]\n'
print 'Available commands'
print ' test: Check if file syntax is ok'
print ' json: Export rules to nueval-app json'
print ' gitbook: Build markdown pages from YAML source\n\n'
sys.exit(-1)
command = sys.argv[1]
for source in SOURCE_FILES:
if command == 'test':
try:
data = readYAML(os.path.join(os.getcwd(), '%s.yaml' % source))
print 'Syntax OK'
except Exception:
print 'Syntax Error'
elif command == 'json':
try:
data = readYAML(os.path.join(os.getcwd(), '%s.yaml' % source))
print json.dumps(data, indent=4)
except Exception:
print 'Syntax Error'
elif command == 'gitbook':
try:
data = readYAML(os.path.join(os.getcwd(), '%s.yaml' % source))
print makeBookPage(data)
except Exception,ex:
traceback.print_exc()
\ No newline at end of file
unit: Computer-Controlled Cutting
unit_id: computer_controlled_cutting
version: 2017
tasks:
- name: Laser Cutting
description: |
* make lasercutter test part(s), varying slot dimensions using parametric functions, testing your laser kerf & cutting settings (group project)
* cut something on the vinylcutter
* design, make, and document a parametric press-fit construction kit, accounting for the lasercutter kerf, which can be assembled in multiple ways
outcomes:
- Demonstrate and describe parametric 2D modelling processes
- Identify and explain processes involved in using the laser cutter.
- Develop, evaluate and construct the final prototype
checklist:
- Explained how you parametrically designed your files
- Shown how you made your press-fit kit
- Included your design files and photos of your finished project
- name: Vinyl Cutting
description: |
There is no specific project that is focussed on this very useful tool.
There are a range of ways you might utilise it throughout the programme, or your local
instructor may set a specific project. You might make:
* stickers
* flexible circuit boards
* a textured surface/relief pattern
* screenprint resists/stencils
Ensure that you have used it in some way during this time and met the objectives below.
outcomes:
- Identify and explain processes involved in using this machine.
- Design and create the final object
checklist:
- Explained how you drew your files
- Shown how you made your vinyl project
- Included your design files and photos of your finished project
faq: |
### Can I use the Inkscape clone tool for my pressfit kit?
> Answer:
1. No. The clone tool is not a real parametric software.
### Is it compulsory to design my own file in Vinyl cutting?
> Answer:
1. Yes. Or modify existing one, and acknowledge where you found it.
\ No newline at end of file
PyYAML==3.12
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment