Kohana is an elegant, open source, and object oriented HMVC framework built using PHP5, by a team of volunteers. It aims to be swift, secure, and small.
Faculty: {faculty_id, faculty_name, faculty_description}
Speciality: {speciality_id, speciality_code, speciality_name}
Group: {group_id, group_name, speciality_id, faculty_id}
Subject: {subject_id, subject_name, subject_description}
Test: {test_id, test_name, subject_id, tasks, time_for_test, enabled, attempts}
TestDetail: {id, test_id, level, tasks, rate}
TimeTable: {timetable_id, group_id, subject_id, start_date, start_time, end_date, end_time}
Question: {question_id, test_id, question_text, level, type, attachment}
Answer: {answer_id, question_id, true_answer, answer_text, attachment}
Student: {user_id, gradebook_id, student_surname, student_name, student_fname, group_id, plain_password, photo}
User [AdminUser]: {id, email, username, password, logins, last_login}
Log: {log_id, user_id, test_id, log_date, log_time, remote_ip}
Result: {session_id, student_id, test_id, session_date, start_time, end_time, result, questions, true_answers, answers}
HTTP_METHOD / URL
GET/ http://<host>/<entity>/getRecords
-- returns JSON with all records of databaseGET/ http://<host>/<entity>/getRecords/<id>
-- returns JSON with one record of database with IDGET/ http://<host>/<entity>/getRecordsRange/<limit>/<offset>/[<fieldName>]/[direction]
-- returns JSON with records of database for pagination Optional parameters: fieldName and direction (1 or -1) using for sorting dataGET/ http://<host>/<entity>/countRecords
-- returns JSON in following format {"numberOfRecords": "10"} using for paginationGET/ http://<host>/<entity>/getRecordsBySearch/<search_string>
-- using for filtering by xxxx_name property of some entity (not implemented for all entities)POST/ http://<host>/<entity>/insertData
-- using for insert new record. Returns JSON with new record id and some statusPOST/ http://<host>/<entity>/update/<id>
-- using for update info about record with IDDELETE (GET)/ http://<host>/<entity>/del/<id>
-- using for remove record with ID
GET/ http://<host>/<entity>/getRecordsBySearch/<search_criteria_string>
-- returns JSON with all records of database which are suitable for search criteria```- System do search only by using entity fields like: xxxx_name
- EntityManager is a special functionality for simplify requests to the server-side
- For perform the action please do request which are placed below.
POST/ http://<host>/EntityManager/getEntityValues
-- returns JSON with entitites- In request body we need to use JSON with following structure:
{"entity":"Subject", "ids":[1,2,3,4,5]}
- Value of entity property should start from capital letter
POST/ http://<host>/login/index
-- returns JSON with roles and something else if successGET/ http://<host>/login/logout
-- returns JSON {"user has been logout"} if OKGET/ http://<host>/login/isLogged
-- for auth checking, returns JSON with roles if logged or {"response":"not logged"}- How to login (enter to the system)
Need to request with following JSON
{"username":"some_user_name", "password":"some_password"}
- Important: you need to transfer field
confirm_password
when creating users - Rules (Validation): username have to be unique, password - min length: 8 symbols
- How to create new student: needs to give following JSON
{"email":"vzasranets@gmail.com","username":"vzasranets","password":"throw_Pe5","password_confirm":"throw_Pe5","gradebook_id":"АУ-020203", "student_surname":"Засранець", "student_name":"Василь", "student_fname":"Васильович", "group_id":1, "photo":"", "plain_password":"throw_Pe5"}
- Almost all CRUD operations are allowed
GET/ http://<host>/question/getQuestionsByLevelRand/<test_id>/<level>/<number>
-- returns JSON with random generated list of questions [@deprecated]GET/ http://<host>/question/getQuestionIdsByLevelRand/<test_id>/<level>/<number>
-- returns JSON with a list of random generated question idsGET/ http://<host>/question/getRecordsRangeByTest/<test_id>/<limit>/<offset>/<[wi]>
-- returns JSON with records for pagination (if parameter [wi] is provided the question structure will be send from server without "attachment" fieldGET/ http://<host>/question/countRecordsByTest/<test_id>
-- returns JSON in following format {"numberOfRecords": "10"} using for paginationGET/ http://<host>/answer/getAnswersByQuestion/<question_id>/<[wi]>
-- returns JSON with answers which related to question with question_id (if parameter [wi] is provided the answer structure will be send from server without "attachment" field
- Almost all CRUD operations are allowed
GET/ http://<host>/test/getTestsBySubject/<subject_id>
-- returns JSON with tests which related to the subject with subject_id
GET/ http://<host>/testDetail/getTestDetailsByTest/<test_id>
-- returns JSON with test's parametersGET/ http://<host>/testDetail/getTestRate/<test_id>
-- returns JSON in following format {"testRate": 28} with maximum mark for the test
GET/ http://<host>/group/getGroupsBySpeciality/<speciality_id>
-- returns JSON with groups which related to the speciality with speciality_idGET/ http://<host>/group/getGroupsByFaculty/<faculty_id>
-- returns JSON with groups which related to the faculty with faculty_id
GET/ http://<host>/timeTable/getTimeTablesForGroup/<group_id>
-- returns JSON with timetables by groupGET/ http://<host>/timeTable/getTimeTablesForSubject/<subject_id>
-- returns JSON with timetables by subjectGET/ http://<host>/timeTable/getTimeTableForGroupAndSubject/<group_id>/<subject_id>
-- returns JSON with timetables by group and subject
GET/ http://<host>/Result/getRecordsbyStudent/<student_id>
-- returns JSON with student's resultsGET/ http://<host>/Result/countTestPassesByStudent/<student_id>/<test_id>
-- returns JSON {"numberOfRecords": someValue}GET/ http://<host>/Result/getRecordsByTestGroupDate/<test_id>/<[group_id]>/<[tdate]>
-- returns JSON with student's results by test_id, group_id (optional) and date (optional)GET/ http://<host>/Result/getResultTestIdsByGroup/<group_id>
-- returns JSON test_ids which were passed by students of some group (group_id)
GET/ http://<host>/TestPlayer/getTimeStamp
-- returns JSON{"unix_timestamp":1458060816,"offset":"7200","curtime":1458068016}
POST/ http://<host>/SAnswer/checkAnswers
-- returns JSON with result{"full_mark":5,"number_of_true_answers":2}
POST/ http://<host>/TestPlayer/saveData
-- the server's storage slot for save some needed informationGET/ http://<host>/TestPlayer/getData
-- returns JSON with information from server's torage slotPOST/ http://<host>/TestPlayer/saveEndTime
-- the second server's storage slot good for save endtime for userGET/ http://<host>/TestPlayer/getEndTime
-- returns JSON with infromation from second server's storage slotGET/ http://<host>/TestPlayer/resetSessionData
-- clear infromation from all server's storage slotsGET/ http://<host>/TestPlayer/getTest
-- checking possibility to make a test by some user using infromtation from timetables, returns Test entity or HTTP400 error
GET/ http://<host>/AdminUser/checkUserName/{username}
-- returns JSON{"response": true}
if the {username} already exist at the system or{"response": false}
this functionality also can use for check student's usernameGET/ http://<host>/AdminUser/checkEmailAddress/{emailaddress}
-- returns JSON{"response": true}
if the {emailaddress} already exist at the system or{"response": false}
this functionality also can use for check student's email- How to create new admin: needs to give following JSON
{"email":"vzasranets@gmail.com","username":"vzasranets","password":"throw_Pe5","password_confirm":"throw_Pe5"}
- Added HTTP 400 Exception when wrong request
- Fixed response when "no records" changed two-dim array to normal JSON
- Some other little fixes