Skip to content

ScholAIstic Integration #8035

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Aug 17, 2025
Merged

Conversation

purfectliterature
Copy link
Contributor

@purfectliterature purfectliterature commented Aug 2, 2025

For local testing

Since ScholAIstic's local development host is nus.localhost:3000, you'll need to modify your hosts file to loop nus.localhost back to 127.0.0.1, otherwise Excon won't be able to make the server-to-server API calls.

127.0.0.1 nus.localhost

Otherwise, set dnsmasq up to create a local DNS server on your machine (assuming it's at 127.0.0.1), configure it to do the same as above, and add these lines to ScholaisticApiService.connection!.

+     dns_resolver = Resolv::DNS.new(nameserver: ['127.0.0.1'])
+     dns_resolver.timeouts = 3
+     resolver = Resolv.new([Resolv::Hosts.new, dns_resolver])

      connection = Excon.new(
        "#{api_base_url}/#{path}",
        headers: { Authorization: "Bearer #{api_key}" },
        method: method,
        timeout: DEFAULT_REQUEST_TIMEOUT_SECONDS,
        **options,
        body: options[:body]&.to_json,
        expects: [200, 201, 204],
+       resolv_resolver: resolver
      )

Platforms integration

  1. Go to ScholAIstic's admin dashboard and access the new API keys section.
  2. Generate one API key for Coursemology.
  3. Set these .env values on Coursemology accordingly. For example,
SCHOLAISTIC_BASE_URL='http://nus.localhost:3000'
SCHOLAISTIC_API_BASE_URL='http://nus.localhost:8000/api/api/v1'
SCHOLAISTIC_API_KEY='<API key>'

SCHOLAISTIC_BASE_URL refers to the base URL of the ScholAIstic website. On local development environments, it should be the Vite server. SCHOLAISTIC_API_BASE_URL refers to the base URL for all API key protected routes (i.e., ScholAIstic public APIs).

Main test plan

  1. When a course isn't integrated with ScholAIstic, there shouldn't be any ScholAIstic-related sidebar items.
  2. When a course is integrated with ScholAIstic, the sidebar should show (a) published assistants (with their alternate title, if set) and Role-Playing Assessments, and (b) only for the instructors, "Assistants" under "Administration".
  3. When these pages are accessed, it should show a fully embedded experience from ScholAIstic, signed in as the adjacent course user in ScholAIstic.
    1. Role-Playing Assessments → New Assessment
    2. Role-Playing Assessments → [A row] → Submissions
    3. Role-Playing Assessments → [A row] → Attempt/Resume/View
    4. Role-Playing Assessments → [A row's title]
    5. [An assistant]
    6. Administration → Assistants
  4. When you access Role-Playing Assessments → [A row] → Edit Assessment, the first section should be a framed embedded experience of the Edit Assessment Details page from ScholAIstic, and there's a Base EXP section at the bottom of the page. These two fields are to be saved separately.
  5. When a student accesses Role-Playing Assessments, they can only see published assessments.
  6. If these values of a ScholAIstic assessment is modified from ScholAIstic, they should be reflected on Role-Playing Assessments.
    1. Title
    2. Description (there's currently no UI that shows this, though)
    3. Starts at
    4. Ends at
    5. Published/Draft
  7. If an assessment is deleted on ScholAIstic, it should disappear on Role-Playing Assessments on Coursemology respectively. Directly accessing their Coursemology URL should also fail.
  8. If an assessment is created on ScholAIstic, it should appear on Role-Playing Assessments on Coursemology.
  9. If a submission is created/updated on ScholAIstic, its status should be reflected by the Attempt/Resume/View button appearance of Role-Playing Assessments on Coursemology for the submission's creator signed in session.
  10. If a submission is graded on ScholAIstic, its Base EXP, if configured, should be disbursed to the creator's course user on Coursemology.
  11. If a submission is unsubmitted or deleted on ScholAIstic, its Base EXP, if configured and already previously disbursed, should be undisbursed, i.e., the EXP record must be deleted.
  12. If a Lesson Plan Item on Coursemology has a ScholAIstic assessment set as a condition, it should only be available for a course user if they have a graded submission for said ScholAIstic assessment.

@purfectliterature purfectliterature self-assigned this Aug 2, 2025
@purfectliterature purfectliterature added Technical Story Ruby Pull requests that update Ruby code JavaScript Pull requests that update JavaScript code ScholAIstic labels Aug 2, 2025
@purfectliterature purfectliterature force-pushed the phillmont/scholaistic-integration branch 2 times, most recently from 4b91b62 to ed60f9e Compare August 7, 2025 05:09
@purfectliterature purfectliterature force-pushed the phillmont/scholaistic-integration branch 3 times, most recently from b60423a to df49eae Compare August 8, 2025 05:12
@purfectliterature purfectliterature marked this pull request as ready for review August 8, 2025 05:29
@purfectliterature
Copy link
Contributor Author

purfectliterature commented Aug 8, 2025

@cysjonathan Some things to note when you're testing.

  1. The <iframe>s may cook your browser's back/forward button navigations. Unfortunately, there's nothing we can do about this, especially with the src being of a different origin from Coursemology. As a compromise, I've ensured that the breadcrumbs are always correct.
  2. ScholAIstic's <iframe>s may navigate elsewhere since it's their app we're embedding. Some may be expected ("Continue chat" brings you to the chat room, all other question-related pages, etc.), and some may be unexpected ("Save changes" on Edit Assessment brings you to the "Manage assessments" table on ScholAIstic).
  3. Depending on your browser's policy on third-party cookies, your ScholAIstic session on top-level tabs may be affected since the embeds on Coursemology actually signs you in to a ScholAIstic account. This won't be an issue since usually one person has one Coursemology and ScholAIstic accounts, but if you're masquerading on Coursemology, don't be alarmed if,
    1. your browser allows third-party cookies sharing, and
    2. your ScholAIstic session on top-level tabs change to the associated ScholAIstic account of the Coursemology user you're masquerading as.

You can check the coursemology-integration branch out on ScholAIstic to test this integration.

@cysjonathan cysjonathan force-pushed the phillmont/scholaistic-integration branch from df49eae to cacafb5 Compare August 15, 2025 14:45
Copy link
Contributor

@cysjonathan cysjonathan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, take note that the embed pages doesn't load on my Brave browser, likely due to default privacy configuration of Brave browser. Ok on Firefox.

@cysjonathan cysjonathan merged commit 681e965 into master Aug 17, 2025
11 of 14 checks passed
@cysjonathan cysjonathan deleted the phillmont/scholaistic-integration branch August 17, 2025 18:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
JavaScript Pull requests that update JavaScript code Ruby Pull requests that update Ruby code ScholAIstic Technical Story
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants