Coder Social home page Coder Social logo

venhance / otis-web Goto Github PK

View Code? Open in Web Editor NEW
37.0 5.0 70.0 5.72 MB

OTIS course management system

Home Page: https://web.evanchen.cc/otis.html

License: MIT License

Python 70.32% HTML 18.86% TeX 0.81% CSS 2.19% JavaScript 6.58% Shell 0.14% Jinja 1.07% Dockerfile 0.03%
python3 django course-management-system

otis-web's Introduction

Top languages MIT License Last update Forks Stars OTIS-WEB status OTIS-WEB status

djlint style: black types: pyright lint: ruff Coverage status

OTIS-WEB

These are the source files for the internal website that I use to teach my course OTIS. It is pretty standard Django, so you should be able to spin up a local server on a standard Unix environment.

Installation instructions

Video tutorial: https://youtu.be/W27XcqeXp20

Standard Linux environment

If you're just trying to get a local copy of the OTIS-WEB code and don't plan to submit any code back, then skip steps 0 and 4, and replace YOUR_USERNAME in step 2 with vEnhance.

  1. Create an account on GitHub if you haven't already, and fork the repository.

  2. Install the following standard tools: python (version 3.10), pip, git. (For each tool, search "[name of thing to install] [your OS]" on the web.)

  3. Clone this repository using the command git clone https://github.com/YOUR_USERNAME/otis-web.

  4. Run git submodule update --init --recursive in order to pull the evans_django_tools submodule.

  5. Type git checkout -b feature to checkout a new branch named feature; this will make your life a bit easier than working on main. If you already know what feature you're trying to implement, you can use that, e.g. git checkout -b add-bunny-pictures.

  6. Install Poetry. This enables you to use the poetry command; verify this by checking poetry --help produces a help message.

  7. Once you have poetry, hit poetry install. This will automatically create a Python virtual environment and install stuff inside it. (If you are an expert familiar with Python virtual environments and want to use your own rather than Poetry's auto-created one, then activate said environment before running poetry install.)

    On some systems, poetry install could fail when trying to install mysqlclient. You will have to separately install pkg-config mysql in that case; see that link for instructions, under the "Install" section.

  8. If it isn't already activated, activate the Python virtual environment that was created in the previous step. The easiest way to do so is to run poetry shell.

    (Note: you have to do this step every time you start working on the project. That is, always run poetry shell before doing any work, or for experts, activate the virtual environment using your preferred method.)

  9. If everything is working, python manage.py check should run with no errors.

  10. Run python manage.py migrate to create the local database.

  11. Run python manage.py createsuperuser to create an admin user.

  12. Run python manage.py runserver. The command will spin up a continuously running server.

  13. Point your browser to http://127.0.0.1:8000. You should be able to log in with the user you defined in step 9.

  14. The website is functional now, but it is a bit bare-bones. To populate it with some test data, use http://127.0.0.1:8000/admin or run ./fixtures/load-all.sh.

Optional steps:

  • If you need to set up environment variables, copy env to .env and uncomment the relevant lines.
  • If you want to test the Stripe stuff, a few more steps are needed. Briefly: install the Stripe CLI. Create some API keys and stripe login. Add these API keys to .env (the three STRIPE_* variables). Then run stripe listen --forward-to localhost:8000/payments/webhook/.

Using Docker

  1. Follow steps 0 - 3 from the above tutorial.
  2. Make sure to install Docker and make sure you download a version compatible with your computer.
  3. Set up the 3 environment variables at the bottom of env by copying them to .env and uncommenting them. Note that you should not have any spaces (it is fine to leave the values as it is, but if you want to change anything, just make sure there is no whitespace surrounding the =).
  4. Run docker compose build. Wait for it to finish.
  5. To start the server, run docker compose up -d. To execute a command inside the container, run docker exec -it otis-web /bin/bash. To stop the server, run docker compose down.
  6. Follow steps 11 - 12 from above.

Note: You may need to delete db.sqlite3 if you're not getting desired results, as it serves as a cache. At this point, spinning up 2 separate containers with separate data stores is not supported.

Feature requests or bug reports

Submit an issue on GitHub.

Pull requests

For OTIS students: pull requests welcome! If you think the website can be improved in some way, feel free to implement it. See contributing guidelines. It's OK if you don't have much code experience; I'm willing to guide you along.

526561645265616452656164

otis-web's People

Contributors

adamisntdead avatar amoler avatar chennisden avatar coolbluealan avatar dependabot[bot] avatar dlee888 avatar ets1331 avatar howard36 avatar incompleteusern avatar jatloe avatar lvj-dev avatar menezesd avatar oz121 avatar psi25omega avatar radialfunc avatar sky2025 avatar tenthmascot avatar thecooldinosuar avatar uenhance avatar venhance avatar vinaybadgujar102 avatar waystern avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

otis-web's Issues

More spade awards

  • Change spades model to allow floats
  • View that allows an admin to input a sequence of SID's and reward students for gradescope
  • Change spades models to have a few categories: general, github, tests, markets, ???

More general spades system

  • Delete the usemo_score field
  • Create a model that foreignkey's a User, contains a value, date, category.
  • Integrate it with the meters display

Viewing suggestion causes 500 error

When I attempt to view my (one and only) suggestion (which is resolved) by going home -> suggestions -> list of suggestions I have made -> click on suggestion, I get a 500 error.

Note that I am not currently an active OTIS student.

Clock Emoji in Stats Display

The clock emoji in the Wisdom display blocks the first number of the wisdom statistic.

Wisdom Clock issue

In the image above, I have 17 wisdom and the first number is blocked by the clock.

Undrop Units

Should be able to add back units that were previously dropped

(I will fix this myself and submit a PR)

Better Dockerfile + Development Set-up

Right now in development, it's kind of weird to be starting off with a really weird superuser (interactive mode), no units/students, etc. It'll be probably beneficial to:

  • Get someone to review/optimize Dockerfile.dev
  • Make a script (python or otherwise) that creates some dummy units, users, and a superuser

Feedback on quizzes

Probably just a text box on the website, corresponding to a 1-1 model against
quiz attempts or something like that? Commiserate about arithmetic errors and
the like.

Unit tests

In progress but it might take a while because there are so many views

Boss scenes

Program a capability for special units that appear only when a certain level is reached

Blocked on #16

Use a better problem model

The current ecosystem for OTIS problems is inelegant and separated into several parts:

  • VON, the problem database
  • Handout TeX files that are uploaded using a static script that list problems
  • ARCH, and its interaction with Evil Chin

In particular, ARCH seems to have information that is redundant with the VON database entry, and relies on users to create entries they don't already exist.

Validate PUID on client side

Javascript-only task. Modify arch/problem_form.html so that if #id_puid does
not match the regular expression [0-9A-Z]+ it warns the user and prevents them
from submitting the form. This mirrors the analogous validation done on the
server side but improves UX since the feedback is faster.

Clearer error message when required PDF missing

Right now when a sufficiently large PDF is uploaded (more than 10MB or so) there
is a limitation on my systems where the file does not make it to the server.
From the server's perspective, the form was submitted with no file at all (even
though the client's browser should have stopped them in such a situation).

It would be good to have a clearer error message in this case on the submission
form stating that the user may want to check the file size as a possible
culprit.

Spade awards for problem suggestions

Pretty small since it's a token of thanks

  • Edit problem suggestion model to have a boolean reward field of some sort
  • Hook up aincrad
  • In level formula, add some function of number of problem suggestions with approved=True and reward=True

Small display bug on ARCH problem-update view

When going to a problem editing ARCH URL; e.g. https://otis.evanchen.cc/arch/04IMO6/edit/, the stats section at the bottom (X problems written + Y hints written) is displayed, but the values of X and Y are not substituted in correctly.

I'm not sure what the intended behavior is, but to me, it makes the most sense to not have the stats section displayed on the problem-update view at all: it should only be shown on the arch-index view.

Solution from Wiki redirect

Currently, when we click on the “Get problem solution from Wiki” in the ARCH page, it’ll redirect us to the problem wiki page with editing options.
We can make it such that it redirects just to the wiki page by changing the url wiki-problem in wikihaxx/views.py…
Ideally a quick fix but not sure whether it’s supposed to work the way it’s right now (I.e. the edit problem page)

Segregate mailchimp stuff

It's a pain for debugging and whatever

We should move it into a separate file and have it so that the data can be
override on development or testing envirnoments

Arch Integration with Wiki

Arch seems to be integrated with the wiki using the problem tag, but here are a few suggestions:

  • Change syntax from [problem PUID][/problem] to [problem]PUID[/problem]`.
  • Actually connect to problem database to access problem of said PUID.
  • Allow a features flag (e.g. by default, problem will be hidden with a show/hide option. To directly show it, just do [problem show]PUID[/problem] or a similar syntax.

This issue isn't thought out in full, and I'll probably need @vEnhance input on how to connect to database (if possible). If anyone has anything else they want me to try to look at, let me know.

Toggle Lock in Unit viewing.

Currently in the "Your Units" section of the site there are two buttons for toggling which units are visible. However, when you reload the site (for example, by clicking "View Stats" then coming back) the unit view defaults to showing all units. Perhaps there could be a setting that each User can set so that these toggles are locked. That is, so that when the site is reloaded, the unit viewing defaults to the user selected option (like not showing completed).

Separate Production Dependencies from Development Dependencies

Trying to build my Dockerfile, but I keep getting:

ERROR: Could not build wheels for google-crc32c which use PEP 517 and cannot be installed directly

Maybe, as google-crc32c is not needed for core functionality but is needed for production, segregation of these should ideally occur?

User settings model

  • Create model
  • Support for specifying a timezone
  • Option to hide level meters from front page

Update Tables

In wikihaxx/mdx/otis.py, change the table from a lazy float: right to an actual alignment, such as below from Wikipedia.

Wikipedia Demonstration of Proper Alignment

Unit Unlock

Maybe the choice 'next unit to unlock' can be shown in the submission review page
https://otis.evanchen.cc/dash/psetxxx
later, so that we do not choose an unit more than once when we submit more than one unit before the previous ones are checked off. I think that the code for preventing double unlocking can be implemented, if possible.

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.