rage / secret-project-331 Goto Github PK
View Code? Open in Web Editor NEWHome Page: https://courses.mooc.fi/
License: Apache License 2.0
Home Page: https://courses.mooc.fi/
License: Apache License 2.0
Reproduce:
[2021-05-06T08:57:29Z ERROR actix_http::response] Internal Server Error: InternalServerError("error returned from database: duplicate key value violates unique constraint \"pages_url_path_course_id_deleted_key\"")
[headless-lms] [2021-05-06T08:57:29Z INFO actix_web::middleware::logger] "DELETE /api/v0/cms/pages/7d3e3666-7491-439f-9c98-80f718bfabfa HTTP/1.1" 500 213 "http://project-331.local/cms/courses/d86cf910-4d26-40e9-8c9c-1cc35294fdbb/overview" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.93 Safari/537.36" 172.17.0.2:35108 14.703912ms
Script to extract types from gutenberg and copy to course material.
Pending on #22.
automatically_open_at timestamp to db
status enum which tells whether a chapter is opened
in course grid, chapters not open greyed out and they will have a timestamp (date and time).
in the last ten minutes, show a countdown to the time. e.g. "Chapter opens in 9minutes 31 seconds"
https://wordpress.org/support/article/blocks/
This system is meant to use the mooc.fi's new login system but as that is not ready yet, we'll implement a temporary solution based on TMC.
Steps:
main-frontend
microservice.Implement distributed tracing.
The endpoint is meant for teachers who want to list all submissions to a exercise.
Accepted endpoint paths:
/api/v0/cms/exercises/:exercise_id/submissions
=> defaults to page 1 and page size 100/api/v0/cms/exercises/:exercise_id/submissions?page=2
=> page 2 and page size 100/api/v0/cms/exercises/:exercise_id/submissions?page=3&limit=1000
=> page 3 and page size 1000Endpoint accepts all page sizes under or equal to 1000.
The endpoint should return all fields that's in the exercises table.
Output could be something like this:
{
"data": [...],
"total_pages: 22
}
For the controller we need a exercises module here: https://rage.github.io/secret-project-331/headless_lms_actix/controllers/cms/index.html
https://wordpress.org/support/article/blocks/
Permissions are mappings from users to different roles.
The roles we currently have are: admin, assistant, teacher, reviewer.
For managing permissions we need a view where some people can edit the roles and where some people can only observe the roles. Starting point could be something like this:
The roles can be specified on three levels:
I was thinking for each level we could have a different view but all of them would look similar.
Pending: Planning & Implementation of unlocking exercises/parts based on something
user_exercise_state, new column with randomized selected exercise task id
Similar to tmc exercise repos, except the contents of folders are checksummed with https://rage.github.io/secret-project-331/headless_lms_actix/utils/folder_checksum/index.html and individual exercise folders are sent to be processed to exercise-specific microservices.
in cms page: /exercises/:id/edit
-> would render the gutenberg editor only for the exercise id specified.
Need to call document_schema_processor::denormalize
We also need endpoints to headless-lms for getting the single exercise end updating the exercise.
get_exercise_by_id: https://rage.github.io/secret-project-331/headless_lms_actix/controllers/cms/exercises/index.html
Intstructions: https://github.com/rage/secret-project-331/blob/e173d9ec08466e8d5637ad5bb0722c4e95836cc4/docs/headless-lms.md#new-endpoint
GET /api/v0/course-material/pages/:current_page_id/next-page
New pages module here: https://rage.github.io/secret-project-331/headless_lms_actix/controllers/course_material/index.html
{
"path": "/path-to-next/page",
"name": "Name of the next page",
"part": 1,
}
Most stuff from here: https://github.com/rage/secret-project-331-db-docs/blob/master/public.pages.md
Part number from here: https://github.com/rage/secret-project-331-db-docs/blob/master/public.course_parts.md
Uniqueness constraint:
CREATE UNIQUE INDEX xxx ON yyyy (order_number, chapter_id)
WHERE deleted_at IS NOT NULL;
Just a simple list like in screenshot, no link for now
Here: http://project-331.local/manage/exercises/:id/submissions
Check applicable mime types as well in frontend before sending post request?
Look into @wordpress/notices package to support error messages to users
The system will feature role-based access control where roles can either be global, organization-specific or course-specific.
Different roles are able to perform different actions.
For this we'll need:
I think one table for all the roles is enough. The table should include columns for user_id, organization_id, course_id and one for the role enum.
User id and role enum are mandatory fields, the others are optional.
If course_id and organization_id are null the role is considered global.
If organization_id is not null and course_id is null the role is considered organization-specific.
If course_id is not null the role is considered course-specific.
Functions sound like a better idea than a middleware because that enables us to do the check at any point in the request's lifecycle. For the function signature I'd take inspiration from the cancancan library: https://github.com/CanCanCommunity/cancancan
Rough idea:
pub fn authorize(action: &Action, user_id: &Uuid, resource: x) -> Result
If the result is ok, the authorization succeeded, if the result is err, the authorization failed.
For the implementation we'll also need a mapping from roles to allowed actions. It could be something like this: https://github.com/rage/quizzes/blob/99de38798a0e20536bf198abf457a685ccdc8dd1/packages/backendv2/src/controllers/dashboard/util.ts#L51-L56
Here: http://project-331.local/manage/courses/d86cf910-4d26-40e9-8c9c-1cc35294fdbb
Data from this table: https://github.com/rage/secret-project-331-db-docs/blob/master/public.user_exercise_states.md -- course progress for current logged in user for the current course instance.
Rendering implemented by adding a new block to the course material: https://github.com/rage/secret-project-331/blob/master/services/course-material/src/components/ContentRenderer/index.tsx#L41
{
"score_given": 3,
"score_maximum": 10,
"total_exericises": 66,
"completed_exercises": 13
}
Endpoint:
GET /api/v0/course-material/course-instances/:course_instance_id/progress
enum
marketing_page_for_before_publishing_id REFERENCES pages
"Support for automatically opening and closing a course variant based on timestamp
[[bin]]
name = "update-course-variant-statuses"
path = "update_course_variant_statuses.rs"
Example chronjob: https://github.com/rage/mooc.fi/blob/master/helm/templates/update-course-statuses-cronjob.yml
command: cargo run --bin update-course-variant-statuses
Starting cronjob manually: kubectl create job --from cronjob/cronjob-name random-unique-name
https://wordpress.org/support/article/blocks/
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.