CircuitVerse Platform Improvement: Final Report (GSoC 2022)

gsoc22_final_phase

This blog is about the work we have done and goals we have accomplished in the GSoC'22.

Let’s Dive in…

Project Description


CircuitVerse is a Digital Logic Simulator on web. It is an educational tool for students interested in electronics to simulate and make circuits on their browser.

This project aimed to improve the main platform by integrating new features. So intially the project consist of 6 features but after mentor discussion we have added more features into the project context.

Project goals


The features we have successfully implemented:

  • gitlab authentication integration
  • sso integration
  • support multiple mentors for groups
  • improve embed feature
  • assignment restriction
  • noticed integration (Notification Page)
  • notification api(Mobile-app).
  • suggested tags for project.
  • circuitVerse contest.

Feature: gitlab authentication integration


This feature enables user to authenticate using thier gitlab account in CircuitVerse. For achieving this, I used omniauth-gitlab gem. Initially, I faced issues because of the old version of omniauth gem in CircuitVerse, so I first update the gem along with it’s dependencies and configurations. After omniauth update, gitlab authentication works smoothly. I also updated the documentation to integration application for config.

PR

Feature: SSO Integration


SSO stands for Single-Sign On. I have used devise_saml_authenticatable gem. For the testing I used Okta IDP. I faced issues during integration but as always mentor guided me the way, and I was able to solve it.

PR

Feature: Support Multiple Mentors Support in Group


This feature enables group to have multiple mentor. There will be 1 primary mentor(owner), and primary mentor can add mentors, make member a mentor and vise-versa. Mentors can grade, CRUD, and reopen assignments. Ruturaj has already raised a PR for it and had implemented mot of the stuffs, but there is still need to rafactor, cleanup and stimulus JS migration.

Owner view: Screenshot from 2022-06-21 21-43-00

Mentor View: Screenshot from 2022-06-21 21-43-18

PR

Feature: Improve embed feature


Initially the embed feature was basic. This feature advance it by providing the customization options. When a user click on embed button, a popup will be displayed with the options to customize your embed. The customization options:

  • Iframe width and height.
  • Border width and color.
  • Optionally Disable stuff like Clock Enable/Clock-Time, Interval/Zoom, Display Name.
  • Change theme.

embed

Kartikay already have made a PR with the integration for Iframe width & height, border with & color. I worked on integrating advance options, revamp and cleanup.

PR

Feature: Assignment restriction


We already have element restrictions for the assignment i.e., to restrict the group members with the use of elements for the Project. But we have got quite a few complaints from professors that CircuitVerse allows cheating easily. For example, users can easily copy/paste any public circuit. They can give collaborators access to their own circuit and copy-paste etc. So it has been requested by professors to disable this feature. This PR enables that feature into CircuitVerse.

assignment

PR

Feature: Improve Notification Page


Notifications are very important aspect, we were using activity_notification gem before, but it makes the page lacky and the gem is not maintained any more, so we decided to shift to new gem, and we found noticed gem for it.

Noticed gem is really very easy to use and had really cool and amazing features. You can learn about the noticed gem here.

We have covered 2 events for notification:

  • Notify the author when someone forks the project.
  • Notify the author when someone stars the project.

We have implemented a section in the navbar to get quick access to your notification.

notification_2

Notification Page

Notification page for a respective user shows all the notification for the user logged in. You can mark a notification as read by clicking to it, or you can click mark_all_as_read to mark all notifications as read.

notification_2

Challenges

The noticed implementation was comparatively easy, but the major challenge was to migrate the old data under the activity_notifications as both gem have different implementation, different schemas and methods. So we finally made a data migration file in which we made a script to migrate the data from notification table to noticed_notification table.

PR

We also reimplemented the web push notification, for which the PR is under review! There are some production issue we are facing, we are trying to solve it!

Feature: Notification api(Mobile-app)


Notification api is used to provide the different endpoints for the Mobile-app.

Endpoints:
  • GET /api/v1/notifications

To get all the notification for current authorized user.

  • PATCH /api/v1/notifications/mark_as_read/:notification_id

To mark a particular notification as read.

  • PATCH /api/v1/notifications/mark_all_as_read

To mark all notifications as read.

PR

Feature: Suggest tags for Project


This feature intends to improve tagging feature in projects. This feature helps to suggest tags for the project to the user in the project edit page. The tags are extracted from circuit elements used, project name, description.

Progress

suggested_tags

  • We were able to accomplish this feature to suggest tags from circuit elements and project name. Extracting valid tags from description needs more complex logic as description includes some data which are irrelevant to be suggested as tags for the project.

  • We use slim-select which is select2 alternative without jquery dependencies. Slim-select is an advanced select dropdown library.

The PR is still under review and work is under progress.

Future Scope

This feature needs more solified logic to increase the accuracy of valid suggested tags.

PR

Feature: CircuitVerse Contest


This feature intends to increase user engagements in CircuitVerse. Contest are for all users to showcase there awesome creation using CircuitVerse simulator and get chance to feature there creation in CircuitVerse Featured Circuits. Winner of the contest will automatically get featured(after deadline).The winning circuit is shortlisted by the maximum votes gained.

More
  • Contest duration: 1 month(for now).
  • Maximum Winners: 1 per contests(for now).
  • Concurrent Contest not allowed.
  • Maximum votes per user: 3.
  • No limit to the circuit submission(for now).
  • Duplicate circuits not allowed.
  • User can vote the submission one and the action is not reversible.
  • Users can:
    • Submit their circuit.
    • Withdraw there submission from contest(action is not reversible).
    • Vote other submission(maximum 3 per contest).
  • Admin can:
    • Start new contest(other contest must have status: “completed”).
    • Close the live contest(manually).
  • Contest can be closed manually(admin) and automatically(active jobs scheduler).
  • Users will get notified for each new contests.

The feature is under testing phase.

Glimpse of the Contest
  • All Contest Page

    Route: /contests all_contest_page

  • Contest Page

    Route: /contests/:contest_id contest_page

  • Project Submission

    Route: /contests/:contest_id/new project_submission

  • Withdraw Submission

    withdraw_submission

  • Vote Submission

    vote_submission

  • Completed Contest & Winners

    completed_contest

PR

Future Scope

  • To customize deadline of the contest.
  • To have some prizes for the winning circuit author(user).
  • Automate the contest creation process.
  • Slack and twitter updates for new contest.

CircuitVerse Main Platform Future Scope

Issue is created for this here and is open for suggetion. Feel free to suggest more features to add up in CircuitVerse Main Platform. Thanks in advance!!!

Blog posts written


Experience

  • Mentor: Aboobacker MK, Nitin Singhal, Pavan Joshi, Samiran Konwar
  • Contributor: Vedant Jain

I have experienced my best productive, learning phase of my life in GSoC with CircuitVerse. The mentors were so supportive. They helped me in every blocker, appreciate me in my good works and guided me for any failures. My bonding with mentors and other contributors becomes more close. I love contributing in CircuitVerse and will continue contributing in CircuitVerse. I wanted to thank specially Aboobacker, Ruturaj and Nitin for being great mentor. Pavan and Ayan for being so supportive during my starting phase in CircuitVerse. Devjit, Pulkit and Aman for being awesome co-workers and friend.

Conclusion


This project was of 15 weeks(extended). We were able to accomplish most of the task we decided. There are many features coming up in the future projects as well.

Thanks for reading!!!

comments powered by Disqus