Assigned Tasks Get More Personal - Leave notes for students and teachers | Teachery 1.2 Preview | Daniel.Me

Assigned Tasks Get More Personal - Leave notes for students and teachers | Teachery 1.2 Preview

Date: February 18th, 2022

In the latest update to Teachery, I have introduced the ability to send messages between students and teachers, directly through an assigned task. Previously, the only way to contact your teacher or student was via email a general chat room, but anyone could see the messages. Now, messaging is more direct and makes assigned tasks a whole lot more useful.

Assigned task card have been updated with the new notes button. The button has a very basic counter that shows how many notes. A future update will make the notes button light up when there are unread messages, as well as having unread messages displayed on the dashboard.

The notes modal that pops up has a familiar messaging interface as the old chat system, with a slightly updated new look. Teacher and student colors are highlighted in different colors, via passing user roles to the respective Styled Components. Notes that are created automatically display upon completion.

import { gql } from "apollo-server-express";

export default gql`
  extend type Query {
    notes(cursor: String, limit: Int): NoteConnection!
    note(id: ID!): Note!
  }

  extend type Mutation {
    createNote(assignedTaskId: Int!, text: String!): Note!
    deleteNote(id: ID!, assignedTaskId: Int!): Boolean!
  }

  type NoteConnection {
    edges: [Note!]!
    pageInfo: PageInfo!
  }

  type NotePageInfo {
    hasNextPage: Boolean!
    endCursor: String!
  }

  type Note {
    id: ID!
    text: String!
    createdAt: Date!
    user: User!
    assignedTask: AssignedTask!
  }
`;

On the back-end, I created a whole new table for the notes section, which is joined with the assigned tasks. The schema is fairly straightforward, and getting working resolvers was the least of the difficulties. Most of my time was spent tying the new notes into the front-end assigned tasks and updating the data after a mutation.

After Version 1.2

Once I resolve a couple bugs that cropped up with assignments, v1.2 will be migrated to production. In v1.3, the final piece of the notes feature is to show read/unread messages, and add this information to the dashboard. This, along with the new Groups feature will be coming, so teachers can finally have groups of students, like a class, and easily submit assignments to all of them, instead of individually one by one.

Contact Me
Menu