Skip to content

Commit

Permalink
Updated readme
Browse files Browse the repository at this point in the history
  • Loading branch information
sasasasumna committed Aug 30, 2020
1 parent 299ec30 commit c47b5f2
Showing 1 changed file with 14 additions and 45 deletions.
59 changes: 14 additions & 45 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,52 +1,21 @@
# School Rails App
# Goji Labs Inteview Take-Home Project

This is Rails app for the task

> I want you to create a project from scratch. We want to represent a school, so there are teachers, classes, classrooms, and students. Students have many classes, teachers have many classes, and a classroom has many classes. I want to be able to edit, add, and remove teachers, students, and classes.
## Overview
This application is meant to represent a school. There are teachers, subjects that they teach, and the relation between them. We want to add classrooms, students, and another model called sections. A section represents a teacher teaching a subject in a specific classroom at a specfic time with students who attend the class. Think of it like the join model between all the other entities, and with specific times. Some sections are taught only on Monday, Wednesday, and Friday, others are only taught on Tuesdays and Thursdays, and some are every day. Sections typically are 50 minutes long, but they can also be 80 minutes. The earliest sections start at 7:30am and the latest ones end at 10pm.

> I know these are very basic requirements, but please use your best judgement if anything is confusing. Feel free to use rails scaffolds to build this representation quickly, the front end can be simple and server rendered. Don’t include anything you don’t need, like devise, pundit, or sidekiq for now. I want to see how you build your models and controllers, and I want to see your best work. We will extend the functionality of this in our next interview. And please don’t spend more than 4 hours, if you cannot finish it in this time that’s ok.
## Goals
1. Students should be able to add/remove sections to their schedule
- A student cannot be in two sections that overlap
- For instance, if I add General Chemistry 1 to my schedule, and it's on MWF from 8:00 to 8:50am, I cannot enroll in any other sections between 8:00 and 8:50am on Mondays, Wednesdays, or Fridays.
2. Students should be able to download a PDF of their schedule.
- For each section include subject, start time, end time, teacher name, and classroom name

I created model for Subject, Teacher and TeacherSubject.
Class is reserved name, so I choose Subject and keep using that in views (also
renamed for activerecord in `config/locales/en.yml`).
## Guidelines
Develop this in your own fork. After you build your models, add a few different records for each model in seeds.rb or use either factories or fixtures. Use any frotend framework you like, or feel free to use server-side rendering. Refactor or remove any existing code necessary, the code currently here is a starting point. Do not bother setting up unnecessary systems right now, like Sidekiq or Devise. Assume that every browser user is a student, so you don't need to think about user management.

I added database validations, for example `null:false` for subjects.name, uniq
index for TeacherSubject.
## Time Constraints
Do not spend more than 4 hours implementing the goals above. It's not mandatory that the goals above are 100% working, due to the time constraint, we're most interested in seeing your best work. Write this code as if you're contributing to a larger project with multiple developers who will critique your work. If you're running out of time and something isn't funcional yet, that's okay, make sure that whatever is functional is both complete and polished.

On update Subject you can see select multiple so user can select/deselect
teachers. In controller I convert those teacher_ids to
teacher_subjects_attributes.
Thank you [Dusan Orlovic](https://blog.trk.in.rs/) for your work in building this

I prefer not to add logic in controller but this is just example how to use
select multiple.

On Teachers show page you can see ajax way of CRUD actions. I tested it using
system test.

Adding classrooms and students tables will just increase the size, but nothing
interesting could be created in this first 4 hours. In another 4 hours I would
like to add CRUD for students using Vue.js.

# Development

Standard Rails commands

```
rails db:setup
rails s
```

Run tests

```
rails test
```

Run system tests in browser

```
rails test:system
# run specific test
rails test test/system/subjects_test.rb:15
```

0 comments on commit c47b5f2

Please sign in to comment.