Coder Social home page Coder Social logo

How are assignments created? about anubis HOT 3 CLOSED

anubislms avatar anubislms commented on June 8, 2024
How are assignments created?

from anubis.

Comments (3)

AlpacaMax avatar AlpacaMax commented on June 8, 2024 1

That's a super detailed answer! Thanks!

from anubis.

wabscale avatar wabscale commented on June 8, 2024

So the CLI is here under where the theia-admin ide stuff is defined. It needs to be here to be copied into the theia-admin docker image (it is annoying that it needs to be here I know).

Creating an assignment

You create assignments by launching an admin ide and running anubis assignment init "assignment-name", makeing whatever changes to the template that is created, then running anubis assignment sync && anubis assignment build --push. The first init command creates a new directory in the assignment test repo (each course on anubis should have their own repo). The sync command sends off the metadata to the api (like the assignment name, due date, etc...). Then the build command builds the pipeline docker image and pushes it to the container registry.

Relevant places that are called

Specifically the view on the api that is called when the assignment sync command is run is anubis.views.admin.assignments.private_assignment_sync which uses anubis.utils.lms.assignments.assignment_sync to . There is a separate view for when assignment metadata is changed from the website that is above that is anubis.views.admin.assignments.private_assignment_save. The reason for there being two endpoints that do basically the same thing is that the meta.yaml in the assignment tests template does not have exactly the same structure as the assignment table in the database (and therefore needs to be treated a bit different).

To be honest I do not think this is a great first issue. The idea that I have about how to do the email notification is quite complex. I would be happy to include you on.

The plan with that task:

  • Add some card to the profile page that has a bunch of checkboxes for opting into different email events (like when assignment are released, about to be due without a submission, lecture notes published, notifications from instructors...)
  • Extend the anubis.models.InCourse to include boolean values for these email preferences. (We put it on the InCourse table so preferences are specific to the course)
  • Add endpoints to anubis.views.public.profile for changing the opt-in email values. (Maybe some admin views too for changing a whole class email preferences).
  • Add rpc functions for sending out email notifications.
  • Use the scheduling features of rq to schedule email notifications functions. We could then schedule assignment notifications to run when those two views I mentioned earlier are run.
  • We probably need to also add some kind of notification tracking as a table in the database. Without that we may accidentally send notifications twice, or not at all if something gets wonked when we are sending.

There are a couple of gotchas that we will need to handle:

  • If we are scheduling notification rpc jobs, we will need to confirm that the timing is still correct when the job is run.
  • We also need this system to be fault tolerant. The rpc job queues are stored in redis. Redis is meant to not be persistent in Anubis. If redis is restarted or the container is lost or destroyed for any reason, everything on it will be lost (including jobs in the queues). Normally jobs live in queues for no more than 60-120 seconds, so there is normally no issue. My worry with scheduling jobs is that we would need to be able to detect and re-enqueue scheduled jobs if they are lost.

An alternative to scheduling notification rpc jobs is just adding a function to detect when notifications need to be sent out, and put it in a k8s CronJob that could be run every 5 minutes or so. We could then enqueue jobs to send out the notifications from there. This setup would be much more fault tolerant than scheduling rpc notification jobs.

Then the last thing is that I have not decided if I want to use the google gmail api, or just a simple smtp server setup. In Anubis version 0.0.1 back in January of 2020 there was no website. I sent out emails for every submission to students via a simple smtp server setup. We ended up getting rate limited by gmail in the like 3 hours before the deadline in that first assignment. i.e. emails were not being delivered to students. Then alternatively maintaining google api credentials is just annoying. I have done it in k8s before and could copy some code over, but it is just more annoying than something simple like an smtp server.

from anubis.

wabscale avatar wabscale commented on June 8, 2024

BTW, we have a somewhat similar k8s CronJob that is defined at k8s/chart/templates/reaper-cron.yml and calls anubis.jobs.reaper. It is called the "reaper" job. It basically looks for stale resources (like broken submissions, or stale cloud ide resources) and cleans them up.

We would probably just model a new notfication-cronjob off of how that job is defined.

from anubis.

Related Issues (20)

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.