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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

馃殌 Feature: Update test-case UI + functionality #239

Open
RahulKhanna14 opened this issue Jan 24, 2024 · 0 comments
Open

馃殌 Feature: Update test-case UI + functionality #239

RahulKhanna14 opened this issue Jan 24, 2024 · 0 comments
Assignees
Labels
enhancement New feature or request

Comments

@RahulKhanna14
Copy link
Contributor

RahulKhanna14 commented Jan 24, 2024

Context

Currently, many of the exercises end in a "Finish the Code" component, where students are expected to correctly fill in the missing code from a set of given options.
image

This component can only currently handle 1 test case (given in the statement), and the UI for test-case feedback is relatively minimalistic.

image

Problem

We'd like the ability to test the students' code with more test cases, (e.g. 2-3) instead of just 1. We also want to update the UI (within that large gray square above to resemble that of Leetcode; where students can click between the test cases like Tabs and see the input / output based on their attempted code.

image

Proposed Solution

  1. Start by implement the functionality to handle multiple test cases for each of the "Finish the Code!" components; You will have to modify src/components/shared/FinishCode.tsx, specifically the props correct_answer, chosen_function, and given_function. Note that this will require quite a bit of change, so feel free to change what's needed to achieve the necessary functionality. Please let Edwin or Rahul know how you plan on doing this since it can get a little tricky.

  2. After having the functionality work, we will have to implement this change into the individual uses of FinishCode, such as src/components/binary-comps/BinaryCode.tsx.

  3. You could then transition to implementing the front-end visual aspects:

Screenshot 2024-01-23 at 10 14 31鈥疨M

Test Cases for each FinishCode

Intro Page: Factorial(n)
input = 5
expected = 120

input = 3
expected = 6

input = 0
expected = 1

Excursion 1: recurSum(n)
input = 5
expected = 15

input = 3
expected = 6

input = 1
expected = 1


This is a 馃殌 Feature Request

@EDWIN1669086 EDWIN1669086 added the enhancement New feature or request label Feb 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants