Skip to content

Language options #1247

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

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open

Language options #1247

wants to merge 4 commits into from

Conversation

tohlh
Copy link

@tohlh tohlh commented Apr 5, 2025

This PR aims to add language options to Source Academy missions. The use case for now is allowing instructors to configure type strictness in Source Typed variants.

Library Schema

The Library Schema is used to describe the language configuration for an assessment question. An optional field languageOption is added into the Library schema to achieve our objective.

XML Parsing

This changes the XML parser. Specifically, the XML tags <DEPLOYMENT> and <GRADERDEPLOYMENT> are renamed to <PROGRAMMINGLANGUAGE>, <GRADERPROGRAMMINGLANGUAGE>, as per discussion. <LANGUAGEOPTIONS> tags are also added to configure programming language flags.

Example usage of <PROGRAMMINGLANGUAGE>, <GRADERPROGRAMMINGLANGUAGE> and <LANGUAGEOPTIONS> tag:

<PROGRAMMINGLANGUAGE chapter="2" variant="typed">
  <OPTION key="typedAllowAnyInVariables" value="false" />
  <OPTION key="typedAllowAnyInParameters" value="false" />
  <OPTION key="typedAllowAnyInReturnType" value="false" />
  <OPTION key="typedAllowAnyInTypeAnnotationParameters" value="false" />
  <OPTION key="typedAllowAnyInTypeAnnotationReturnType" value="false" />
</PROGRAMMINGLANGUAGE>

<GRADERPROGRAMMINGLANGUAGE chapter="2" variant="typed">
  <OPTION key="typedAllowAnyInVariables" value="false" />
  <OPTION key="typedAllowAnyInParameters" value="false" />
  <OPTION key="typedAllowAnyInReturnType" value="false" />
  <OPTION key="typedAllowAnyInTypeAnnotationParameters" value="false" />
  <OPTION key="typedAllowAnyInTypeAnnotationReturnType" value="false" />
</GRADERPROGRAMMINGLANGUAGE>

These changes are not breaking and should work with existing assessments. For future assessments, XMLs have to be changed.

Copy link
Contributor

@GabrielCWT GabrielCWT left a comment

Choose a reason for hiding this comment

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

Looks fine to me. Please format and fix any other failing CI

RichDom2185
RichDom2185 previously approved these changes Apr 6, 2025
Copy link
Member

@RichDom2185 RichDom2185 left a comment

Choose a reason for hiding this comment

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

LGTM, thanks!

@RichDom2185 RichDom2185 enabled auto-merge (squash) April 6, 2025 03:25
@RichDom2185 RichDom2185 dismissed their stale review April 6, 2025 03:34

CI fail

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants