Code Monkey home page Code Monkey logo

prairielib's Introduction

PrairieLearn

PrairieLearn is an online problem-driven learning system for creating homeworks and tests. It allows questions to be written using arbitrary HTML, JavaScript, and Python, thus enabling very powerful questions that can randomize and autograde themselves, and can access client- and server-side libraries to handle tasks such as graphical drawing, symbolic algebra, and student code compilation and execution.

GitHub Actions build status

Documentation: https://prairielearn.readthedocs.io/

Paid hosting and support: https://www.prairielearn.com/

prairielib's People

Contributors

dependabot-preview[bot] avatar greenkeeper[bot] avatar mwest1066 avatar nwalters512 avatar trombonekenny avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

prairielib's Issues

sprocs and migrations

I have the need for migrations in PrairieSchedule. I'd like to revisit the idea of modularizing the database initialization parts of PrairieLearn into PrairieLib.

I was thinking some way to pass in the project name and path into the migrations.init() function. The migrations table would need to be updated with a unique index and project so each one has its own numbers.

The sprocs stuff could use some updating too, like getting its file list from the directory (like migrations does). Maybe rename it to something like initializations since those are run each time the server runs.

Both functions could be pulled into the same library?

I'm just brainstorming before actually changing anything. Worth the effort?

Action required: Greenkeeper could not be activated 🚨

🚨 You need to enable Continuous Integration on Greenkeeper branches of this repository. 🚨

To enable Greenkeeper, you need to make sure that a commit status is reported on all branches. This is required by Greenkeeper because it uses your CI build statuses to figure out when to notify you about breaking changes.

Since we didn’t receive a CI status on the greenkeeper/initial branch, it’s possible that you don’t have CI set up yet. We recommend using Travis CI, but Greenkeeper will work with every other CI service as well.

If you have already set up a CI for this repository, you might need to check how it’s configured. Make sure it is set to run on all new branches. If you don’t want it to run on absolutely every branch, you can whitelist branches starting with greenkeeper/.

Once you have installed and configured CI on this repository correctly, you’ll need to re-trigger Greenkeeper’s initial pull request. To do this, please click the 'fix repo' button on account.greenkeeper.io.

sql-db Unhandled 'error' event

The locking race condition we're facing on PL right now logs the following after a client idles for 10 minutes:

Oct 24 22:28:19 ip-10-0-0-204 node: throw er; // Unhandled 'error' event
Oct 24 22:28:19 ip-10-0-0-204 node: ^
Oct 24 22:28:19 ip-10-0-0-204 node: error: terminating connection due to idle-in-transaction timeout
Oct 24 22:28:19 ip-10-0-0-204 node: at Connection.parseE (/PrairieLearn/node_modules/@prairielearn/prairielib/node_modules/pg/lib/connection.js:604:11)
Oct 24 22:28:19 ip-10-0-0-204 node: at Connection.parseMessage (/PrairieLearn/node_modules/@prairielearn/prairielib/node_modules/pg/lib/connection.js:401:19)
Oct 24 22:28:19 ip-10-0-0-204 node: at Socket.<anonymous> (/PrairieLearn/node_modules/@prairielearn/prairielib/node_modules/pg/lib/connection.js:121:22)
Oct 24 22:28:19 ip-10-0-0-204 node: at Socket.emit (events.js:203:13)
Oct 24 22:28:19 ip-10-0-0-204 node: at Socket.EventEmitter.emit (domain.js:471:20)
Oct 24 22:28:19 ip-10-0-0-204 node: at addChunk (_stream_readable.js:294:12)
Oct 24 22:28:19 ip-10-0-0-204 node: at readableAddChunk (_stream_readable.js:275:11)
Oct 24 22:28:19 ip-10-0-0-204 node: at Socket.Readable.push (_stream_readable.js:210:10)
Oct 24 22:28:19 ip-10-0-0-204 node: at TCP.onStreamRead (internal/stream_base_commons.js:166:17)
Oct 24 22:28:19 ip-10-0-0-204 node: Emitted 'error' event at:
Oct 24 22:28:19 ip-10-0-0-204 node: at connectedErrorHandler (/PrairieLearn/node_modules/@prairielearn/prairielib/node_modules/pg/lib/client.js:199:10)
Oct 24 22:28:19 ip-10-0-0-204 node: at Connection.connectedErrorMessageHandler (/PrairieLearn/node_modules/@prairielearn/prairielib/node_modules/pg/lib/client.js:206:7)
Oct 24 22:28:19 ip-10-0-0-204 node: at Connection.emit (events.js:203:13)
Oct 24 22:28:19 ip-10-0-0-204 node: at Connection.EventEmitter.emit (domain.js:471:20)
Oct 24 22:28:19 ip-10-0-0-204 node: at Socket.<anonymous> (/PrairieLearn/node_modules/@prairielearn/prairielib/node_modules/pg/lib/connection.js:126:12)
Oct 24 22:28:19 ip-10-0-0-204 node: at Socket.emit (events.js:203:13)
Oct 24 22:28:19 ip-10-0-0-204 node: [... lines matching original stack trace ...]

It's been bugging me to track down why we're getting an uncaught error event (and subsequently crashing) when we are passing an error handling function to

pool.on('error', function(err, client) {

My running theory is we also need to hook into the client.on('error') a little further down in that function

done();

with something like

client.on('error', idleErrorHandler);

I don't have a great way of testing that, but I would like to get to the bottom of this, so I figured I'd start a discussion/PR here.

Other things to port in:

  • logger.js
  • csrf.js

Dave also has some shared library code between PS and PL in plps-utilities that should get ported over too.

Mark As Deprecated?

I was just poking around the PrairieLearn codebase and realised that this is over there now.

Should this repository be marked as deprecated now to avoid confusion?

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.