This blog is dedicated to summarise the progress for the first phase of the project “CircuitVerse Practice Section” in Google Summer of Code'2024.
The project aims to address the need for a comprehensive practice section within CircuitVerse, enhancing learning and engagement in digital logic design. It includes developing a Question Bank Management system for convenient access to categorized questions, each featuring a Circuit Template with input/output probes and a pre-configured testbench. Markdown support will be integrated for improved readability and flexibility in displaying questions. A Question Bank Moderator role will be introduced for selected users to add and modify questions. Answers submitted by users will be automatically verified using CircuitVerse’s testbench feature, enhancing the learning experience. Additionally, a Progress Dashboard within user profiles will track submission history and progress, with users able to choose between public or private visibility.
In the first phase, we have covered
During the community bonding period for GSoC at CircuitVerse, there were various activities to provide more context for the project. The project begins with a meet-and-greet sessions with mentors, contributors, and admins, where everyone shared their excitement for GSoC, discussed their journeys, and discussed about the projects. Mentors Vaibhav Upreti, Vedant Jain, and Tanmoy Sarkar, answered questions about the CircuitVerse Practice Section project, and Aboobacker MK provided insights into the 12-week project process and discussed open defects in CircuitVerse.
Following this, we revisited key technologies by refreshing knowledge of Ruby on Rails through The Odin Project documentation and Vue JS with a YouTube crash course. This preparation was essential for upcoming work on the CircuitVerse codebase.
Then, the focus got shifted to detailed exploration of the CircuitVerse codebase, identifying areas for modification and making initial changes. we had in-depth discussions with Ruturaj Mohite, about potential edge cases and the development of the question practice simulator versus the standard simulator, including how to track and save user progress.
Overall, the community bonding period was an enriching experience that laid a strong foundation for the project.
In the initial three weeks of development, the focus was on establishing the backend components of the Question Management System. This included schema creation, controller development, and user authorization features.
DB Diagram
New Tables:
Questions
: Stores question details with a foreign key linking to Categories
and an enum for difficulty levels.Categories
: Stores category information used for organizing questions.Modifications:
difficulty_level
enum to the Questions
table with values: easy
, medium
, hard
, expert
.Users
table:submission_history
(JSONB array to track user submissions)public
(Boolean to indicate if the user’s dashboard is public)question_bank_moderator
(Boolean to indicate if the user is a moderator)Foreign Key:
Questions
to Categories
.Question
Model:
belongs_to :category
difficulty_level
: easy
, medium
, hard
, expert
Category
Model:
has_many :questions
, dependent on destroyFunctions:
index
: Fetch all categories.create
: Create a new category (requires user to be a moderator).Authorization:
authorize_moderator
: Checks if the current user is a moderator.Functions:
index
: Fetch all questions.show
: Get a question by ID.create
: Create a new question.update
: Update an existing question.destroy
: Delete a question.filter
: Filter questions by category_id
and difficulty_level
.status
: Fetch questions based on user status (unattempted
, attempted
, solved
).search
: Search questions by heading
or statement
.Private Methods:
authorize_moderator
: Ensures the user is a moderator.set_question
: Fetches a question by ID.question_params
: Permits parameters for Question
creation and updates.post_submission
: Handles user submission of responses.show_submission
: Retrieves a specific submission from the user’s history.New Fields:
submission_history
(JSONB array of submissions)public
(Boolean to toggle dashboard privacy)question_bank_moderator
(Boolean to manage moderator access)New Methods:
submission_status
: Retrieves the submission history for a user.toggle_dashboard_privacy
: Toggles the user’s dashboard privacy setting.For more detailed information, please refer to this blog post
In the fourth week, the focus was on enhancing the admin dashboard to allow admins to manage moderators who can create questions on the UI. A new button was added to the admin’s dashboard to facilitate the addition and removal of moderators.
Add Moderators:
add_moderators
function processes the email addresses entered by the admin and updates the question_bank_moderator
field for the corresponding users.Manage Moderators:
manage_moderators
function lists current moderators and allows the admin to remove them by updating their question_bank_moderator
field.For more detailed information, please refer to this blog post
During the fifth and sixth week, the focus was on enabling moderators to create questions through the UI and integrate these functionalities with the backend. A new option was added to the navbar for moderators and admins to access the question creation form.
/questions/new/:question_id
, where question_id
is a unique string generated using the ShortUniqueID package.Circuit Boilerplate and Test Data:
/simulator?question_id=:qid
to create and save circuit data.LocalStorage Handling:
question_id
is found in localStorage, the corresponding circuit data is loadedAdd question flowchart
Add question preview
For more detailed information, please refer to this blog post