Skip to content

Unittest Failures Not Displayed For Optional Questions #464

Description

@HassanAbouelela

Description

Submitting a failing solution to a non-required tested field blocks submission silently and rejects submission.

Reproduction:

form question:

"questions": [
    {
        "_id": "code",
        "name": "Code",
        "type": "code",
        "required": false,
        "data": {
            "language": "python",
            "unittests": {
                "allow_failure": false,
                "tests": {
                    "test_something": "self.assertTrue(False)"
                }
            }
        }
    }
]

Submit anything to a form with this question.

Desired Behavior

This is a bit of an edge case, but I believe the correct behavior should be:

  1. If the field has data, and that fails, show the user the failure
  2. If it does not have data, submit without a solution

Scenario 2 requires modifying the backend, while 1 is purely frontend.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions