runestoneinteractive / bookserver Goto Github PK
View Code? Open in Web Editor NEWThis new server separates book page serving and api requests from the instructor interface in RunestoneServer.
License: Other
This new server separates book page serving and api requests from the instructor interface in RunestoneServer.
License: Other
If you try to run an alembic migration on a database that has been created by a docker build you end up in a bad state.
create table alembic_version ( version_num varchar(32) not null );
alembic puts the latest revision in the table so it knows where it should start.
Somewhere in our build / initialization process for docker we should insert the command
alembic stamp head
This will create the table and populate it with the latest.
@bjones1 -- pinging you FYI -- or maybe you know right where to put this in the build process?
It may be obvious but I guess I should add that this should not be done for production. It would maybe be nice to automatically run the migration on a production build, but I think I feel more comfortable running migrations manually.
This would be a big hit for coverage as well as testing ajax.py
@bjones1 do you have any interest in getting these moved over?
Should we revalidate here, now that we know what exactly to validate against?
This is a start on a migration of the book server to FastAPI - Lets use this Issue to discuss.
I want to polish up this first bit to set the stage for the rest of what needs to come. So getting this as "right" as we can is the goal.
You should be able to run this yourself with the following:
poetry install
to install all of the dependencies (you can either make your own virtualenv or let Poetry)uvicorn app.main:app --reload
You can then exercise the API call for logger/bookevent using the autogenerated documentation.
Next up getting a unittest set up for this first endpoint.
Tagging @bjones1
Per the TODO in https://github.com/bnmnetp/BookServer/blob/main/docs/design.rst, should we delete goals.rst?
If it's useful, I found an example of how to raise Pydantic errors:
We have a nasty problem in the latest version of _sphinx_static_files.html
.
On the one hand jquery needs to be imported before the loop over the files in webpack_static_imports.json
. But, when we do the menus in the instructor interface to not work! On the other hand if we import jquery AFTER webpack_static_imports.json
then all kinds of stuff including selectquestion fails badly.
We need a solution where it all works! Any ideas? Does the user menu work for you on your servers?? when you are using the instructor interface??
Generally adding to the useinfo and xxx_answers tables seems to be working. Next step is to add authentication. checking so we use the correct username.
I'm getting a ton of crashes in the log due to this code:
# Do server-side grading if needed, which restores the answer and feedback.
if feedback := await is_server_feedback(request_data.div_id, request_data.course):
rcd = runestone_component_dict[EVENT2TABLE[request_data.event]]
# The grader should also be defined if there's feedback.
assert rcd.grader
# Use the grader to add server-side feedback to the returned dict.
ret.update(await rcd.grader(row, feedback, user.is_exam_mode))
The error is 'AuthUserValidator' object has no attribute 'is_exam_mode'
In all of bookserver this is the only place that is_exam_mode
is used. It is not in the model. Nor is it in RunestoneServer code.... Maybe I"m missing a PR? Does it even make sense that is_exam_mode
would be an attribute of the user??
Currently, we have to both create sqlalchemy tables then duplicate this effort with a Pydantic schema. We should write code that auto-generates the schema directly from table reflection instead. See https://github.com/bnmnetp/BookServer/pull/8/files#r619875041.
What Course are you in
The course I'm enrolled in is CSAwesome AP CSA.
What Page were you on
Section 2.12 of CSAwesome (https://runestone.academy/ns/books/published/csawesome/Unit2-Using-Objects/topic-2-11-practice-mixed-code-toggle.html?mode=browsing)
What is your username
Not available, as I'm using the website logged-out.
Describe the bug
Section 2.12 of the CSAwesome curriculum has a few "dynamic questions" to test the student's understanding of the course material. However, this fails to load and is stuck on "Loading a dynamic question ..."
Looking through the Web Console, it appears that the assessments don't load due to a 500 Internal Server Error.
This seems to be a server-side issue, as I've confirmed that the same happens across different browsers on both mobile and desktop platforms.
Traceback
A traceback doesn't seem to be available.
Javascript Errors
Many many errors can be quickly diagnosed from the Javascript Console error log. On Chrome this is View --> Developer --> Javascript Console, on Safari โฅโi or Develop --> Show Web Inspector on Firefox Tools --> Web Developer --> Toggle Tools
The Javascript console indicates that the XHR request to runestone.academy/ns/assessment/htmlsrc?acid...
fails due to a 500 Internal Server Error. Please refer to the above screenshot of the console for more details.
Per https://github.com/bnmnetp/BookServer/pull/8/files#r619874882, remove the use of databases
in favor of direct use of sqlalchemy async instead.
Can this and the commented-out code be removed now?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.