Skip to content
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

Support Student-written Executable Examples (WiP) #220

Draft
wants to merge 10 commits into
base: staging
Choose a base branch
from

Conversation

rjtsai
Copy link

@rjtsai rjtsai commented May 23, 2022

This feature enables students to submit their own test cases as a javadoc comment above the method signature in coding exercises. These test cases are run against a provided instructor solution and displayed in the same manner as the instructor provided tests. The hope here is to increase student comprehension of what the prompt is asking for and its expected behavior.

Changes:

  • added student_test_cases and student_test_case_results table to db
  • added reference_solution column to coding_prompts table
  • parsing functionality to grab test cases from the current attempt to save into db
  • refactored some common code to app/helpers/test_case_helper.rb
  • updated haml form for displaying student test case results

Demo:
Screen Shot 2022-05-19 at 7 19 13 PM

  • execution of student-written tests invoked by the "check" button, alongside its standard behavior
  • a new reference directory is now created in usr/attempts/{term}/{current_attempt}, containing student_test_case_res
    ults and other relevant files

TODO

  • cleanup perform method in app/jobs/codeworker.rb
  • additional refactoring of duplicated code to test_case_helper.rb
  • when instructors are creating workouts, they should be able to select whether or not to require student-written executables, and to provide a correct solution to be tested against
  • Decide whether default test cases should be executed/displayed if not all student-written cases are passing

working with @ayaankazerouni

- Added functionality to parse and store (java) student test cases into db
- Migrated student_test_cases table
- CodingPromptAnswer now has many student_test_cases
- student_test_cases created and saved to db
- created student_test_case_results
- add column reference_solution to coding_prompts
+ testcase_helper.rb module
TestcaseHelper -> TestCaseHelper

testcase_helper.rb -> test_case_helper.rb

cp_answer param in generate_CSV_tests defaults to nil
Copy link
Member

@ayaankazerouni ayaankazerouni left a comment

Choose a reason for hiding this comment

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

Left some initial comments.

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.

2 participants