Tools for tracking students' progress within Mumuki
First, we need to install some software: MongoDB and some common Ruby on Rails native dependencies
This process depends on you OS. On ubuntu, follow these instructions:
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 0C49F3730359A14518585931BC711F9BA15703C6 &&
echo "deb [ arch=amd64 ] http://repo.mongodb.org/apt/ubuntu trusty/mongodb-org/3.4 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-3.4.list &&
sudo apt-get update &&
apt-get remove --purge mongo* -y &&
apt-get autoremove -y &&
apt-get install mongodb-org -y
And then reboot
your machine.
sudo apt-get install autoconf curl git build-essential libssl-dev autoconf bison libreadline6 libreadline6-dev zlib1g zlib1g-dev rabbitmq-server
```ruby
### 2. Install rbenv
> [rbenv](https://github.com/rbenv/rbenv) is a ruby versions manager, similar to rvm, nvm, and so on.
```bash
curl https://raw.githubusercontent.com/rbenv/rbenv-installer/master/bin/rbenv-installer | bash
echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bashrc # or .bash_profile
echo 'eval "$(rbenv init -)"' >> ~/.bashrc # or .bash_profile
Now we have rbenv installed, we can install ruby and bundler
rbenv install 2.3.1
rbenv global 2.3.1
rbenv rehash
gem install bundler
gem install escualo
Because, err... we need to clone this repostory before developing it 😛
git clone https://github.com/mumuki/mumuki-classroom-api classroom-api
cd classroom-api
If you want to start the server quickly in developer environment, you can just do the following:
./devstart
This will install your dependencies and boot the server.
If you just want to install dependencies, just do:
bundle install
You can boot the server by using the standard rackup command:
# using defaults from config/puma.rb and rackup default port 9292
bundle exec rackup
# changing port
bundle exec rackup -p 8080
# changing threads count
MUMUKI_CLASSROOM_API_THREADS=30 bundle exec rackup
Or you can also start it with puma
command, which gives you more control:
# using defaults from config/puma.rb
bundle exec puma
# changing ports and threads count, using puma-specific options:
bundle exec puma -t 2:30 -p 8080
# changing ports and threads count, using environment variables:
MUMUKI_CLASSROOM_API_PORT=8080 MUMUKI_CLASSROOM_API_THREADS=30 bundle exec puma
bundle exec rspec
# starts commands consumer
bundle exec rake commands:listen
# starts submissions consumer
bundle exec rake submissions:listen
# starts resubmissions consumer
bundle exec rake resubmissions:listen
# registered and active users reports
bundle exec rake students:reports:registered[<organization>,<course>,<from>,<to>,<json|table|csv>]
bundle exec rake students:reports:active[<organization>,<course>,<from>,<to>,<json|table|csv>]
# migration_name is the name of the migration file in ./migrations/, without extension and the "migrate_" prefix
bundle exec rake db:migrate[<migration_name>]
Minimal permission: janitor
POST /api/courses/:course/exams/:exam_id/students/:uid
Response
{
"status": "updated",
"id": "9d0045448aae977a"
}
Forbidden Response
{
"status": 403,
"error": "Exception"
}
Minimal permission: teacher
GET /api/courses/:course/guides
Response
{
"guides": [
{
"slug": "sagrado-corazon-alcal/mumuki-guia-fundamentos-primeros-programas",
"name": "Primeros Programas",
"parent": {
"type": "Lesson",
"name": "Primeros Programas",
"position": 1,
"chapter": {
"id": 13,
"name": "Fundamentos"
}
},
"language": {
"name": "gobstones"
},
"lesson": {
"id": 13,
"name": "Fundamentos"
}
}
]
}
Forbidden Response
{
"status": 403,
"error": "Exception"
}
Minimal permission: teacher
GET /api/courses/
Response
{
"courses": [
{
"uid": "staging-digitalhouse/2017-1",
"days": [
"Lunes"
],
"code": "1",
"shifts": [
"Mañana"
],
"period": "2017",
"description": "Curso de prueba",
"slug": "staging-digitalhouse/2017-1"
}
]
}
Forbidden Response
{
"status": 403,
"error": "Exception"
}
Minimal permission: teacher
GET /api/courses/:course/students
{
"students": [
{
"name": "johndoe",
"email": "johndoe@gmail.com",
"image_url": "https://s.gravatar.com/avatar/ca995a4f4ba1aafbd71a6403aa78635c?s=480&r=pg&d=https%3A%2F%2Fcdn.auth0.com%2Favatars%2Fsa.png",
"social_id": "auth0|57e035e9e6379dd660dbcd",
"first_name": "John",
"last_name": "Doe",
"last_assignment": null,
"uid": "johndoe@gmail.com",
"created_at": "2016-09-19T19:01:11.000Z"
}
]
}
Forbidden Response
{
"status": 403,
"error": "Exception"
}
Minimal permission: teacher
GET /api/courses/:course/students/:uid
{
"guide_students_progress": [
{
"guide": {
"slug": "sagrado-corazon-alcal/mumuki-guia-fundamentos-primeros-programas",
"name": "Primeros Programas",
"parent": {
"type": "Lesson",
"name": "Primeros Programas",
"position": 1,
"chapter": {
"id": 13,
"name": "Fundamentos"
}
},
"language": {
"name": "gobstones"
}
},
"student": {
"uid": "john.doe@gmail.com",
"email": "john.doe@gmail.com",
"last_name": "Doe",
"first_name": "John"
},
"stats": {
"passed": 13,
"failed": 0,
"passed_with_warnings": 0
},
"last_assignment": {
"exercise": {
"id": 290,
"name": "Sacar Bolitas",
"number": 11
},
"submission": {
"id": "12345667890abcdg",
"status": "passed",
"result": "",
"content": "program {\r\n Mover(Sur)\r\n Sacar(Rojo)\r\n}",
"feedback": "",
"created_at": "2017-01-06T00:43:48.176Z",
"test_results": [
{
"title": null,
"status": "passed",
"result": "foo"
}
],
"submissions_count": 2,
"expectation_results": [
{
"binding": "program",
"inspection": "HasBinding",
"result": "passed"
}
]
}
}
}
]
}
Forbidden Response
{
"status": 403,
"error": "Exception"
}