Coder Social home page Coder Social logo

sardonyxapp / sardonyx-server Goto Github PK

View Code? Open in Web Editor NEW
2.0 2.0 0.0 4.41 MB

Full stack web app for Sardonyx

Home Page: https://sardonyx.natsuozawa.com

License: MIT License

JavaScript 68.06% HTML 23.80% CSS 2.31% SCSS 5.84%
tasklist managebac javascript

sardonyx-server's Introduction

sardonyx-server

Server for Sardonyx

About

Sardonyx is an online solution to transform how high school students and teachers use technology to manage workloads. Sardonyx offers a cross-platfrom experience for all its users, through its mobile and web platforms. This repository contains code for Sardonyx's web application, targeted for computers and tablets.

The web application offers a group tasklist accessible by both teachers and students. Students and teachers benefit from the transparency of the workload, organized by due dates, subjects, and task categories. Each task on the list can be given a detailed description.

Note

The Managebac integration is deprecated.

How to Use

Navigate to sardonyx.app, then enter your credentials.

API

Sardonyx's Managebac API can be accessed at the following endpoints.

Web-based Authentication API

Login

POST /login 

Required: multipart form in request body with Sardonyx login and password

Logout

GET /logout

Required: valid signed JWT cookie

Change Password

POST /password

Required: valid signed JWT cookie with email and JSON request body in request body with new_password

Tasklist API

Load user details

GET /app/user
GET /app/user?tasklist=:tasklist

Note: Tasklists can be specified for retrieving default labels

Required: valid signed JWT cookie with email property and tasklist property or a tasklist URL parameter

Returns: user object

  {
    id: number,
    name: string,
    tasklist_id: number, // default tasklist
    subjects: Array<number>, // default subjects
    categories: Array<number> // default categories
  }

Change default labels

Add default labels

POST /app/user/subjects?id=:id
POST /app/user/categories?id=:id

Remove default labels

DELETE /app/user/subjects?id=:id
DELETE /app/user/categories?id=:id

Required: valid signed JWT cookie with id property and id URL parameter (for label's id)

Change default tasklist

PATCH /app/user/tasklist?id=:id

Required: valid signed JWT cookie with id property and id URL parameter (for tasklist's id)

Load tasklist

GET /app/tasklist
GET /app/tasklist?tasklist=:tasklist
GET /app/tasklist?tasklist=all

Note: To select all tasklists, pass all as the tasklist URL parameter

Required: valid signed JWT cookie with tasklist property or a tasklist URL parameter

Returns: tasklist object

{
  id: number,
  name: string,
  description: string || null 
}

Load tasks

GET /app/tasks
GET /app/tasks?tasklist=:tasklist
GET /app/tasks?full=true

To select labels associated with tasks, pass true for full.

Required: valid signed JWT token with tasklist property or a tasklist URL parameter

Retuurns: tasks object

[
  {
    id: number,
    name: string,
    description: string || null,
    due: string || null, // ISODateString 
    teasklist_id: number || null,
    user_id: number || null,
    subject_id: number || null,
    category_id: number || null,
    managebac: string // URL to related managebac page 
  },

  // ...
]

Change tasks

Create tasks

POST /app/task

Required: valid signed JWT cookie and JSON request body with task information

Edit tasks

PATCH /app/task?id=:id

Required: valid signed JWT cookie, id URL parameter, and JSON request body with task information.

Delete tasks

DELETE /app/task?id=:id

Required: valid signed JWT cookie and id URL parameter.

Load subjects or categories labels

GET /app/subjects
GET /app/subjects?tasklist=:tasklist
GET /app/categories
GET /app/categories?tasklist=:tasklist

Required: valid signed JWT with tasklist property or a tasklist URL parameter

Returns: subjects or categories object

[
  {
    id: number,
    name: string,
    color: string, // length: 7
    tasklist_id: number,
    managebac: string // URL to related managebac class or group, subjects only 
  },

  // ...
]

Change subjects or categories labels

Add labels

POST /app/subjects
POST /app/categories

Required: valid signed JWT cookie and JSON request body with label information.

Edit labels

PATCH /app/subjects?id=:id
PATCH /app/categories?id=:id 

Required: valid signed JWT cookie, id URL paramter, JSON request body with label information

Delete labels

DELETE /app/subjects?id=:id
DELETE /app/categories?id=:id

Required: valid signed JWT cookie and id URL parameter

Contribution

For contribution, see CONTRIBUTING.md in SardonyxApp/sardonyx repository.

sardonyx-server's People

Contributors

dependabot[bot] avatar natsuozawa avatar yutotakano avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

sardonyx-server's Issues

Cannot imitate checked/unchecked Learning Outcomes when sending a reflection to Managebac

Description

Upon creating or editing a CAS reflection, the user should have the ability to check or uncheck learning outcomes as demonstrated in the reflection. The form is sent by the browser as a string representing an array of Learning Outcome ids.

...
evidence[type]: 'JournalEvidence'
evidence[body]: 'This is the body of the reflection.'
evidence[educational_outcome_ids][]: '[0, 12345]' 
...

When the request is replicated on the Request Client, it receives a 404 response. The request succeeds if the evidence[educational_outcome_ids[]] property is omitted.

Currently, the request defaults to unchecked Learning Outcomes for all requests.

Steps to reproduce

  1. Set up a proper request involving this issue. (POST /api/cas/:casId/reflections or PATCH /api/cas/:casId/reflections/:reflectionId)
  2. Comment and uncomment the property in the methods craftNewReflection and craftReflection in helpers/managebac.js to see the issue.

Fix

A fix for this issue is being investigated.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.