Skip to content

Test creation Validation #84

@JadeMaveric

Description

@JadeMaveric

Describe the bug
There are multiple validation failures while creating tests.

  • The test can be give negative marks
  • Duration can be negative (rolls over when processed by backend)
  • Answer provided in MCQ questions doesn't need to be one of the options (see bitfield in Multiple Select and Numerical Answer Type Questions + (Dynamic #choices) #82 for a solution)
  • Number of questions can be negative
  • Total marks and number of questions required in the generated test aren't validated with the number of questions in the question bank

To Reproduce
Steps to reproduce the behavior:

  1. Create a new test

  2. Give it negative marks (-100)

  3. Give it negative duration (0 hours, -20 mins) (-ve hours gives a warning)
    image

  4. Add question, all 4 options need to be selected
    image

  5. Add negative no. of questions and negative marks
    image

  6. Press next after verifying
    image

  7. Check the dashboard (local build on latest master branch)
    image

Expected behavior
Error message should be shown whenever a validation fails. And the next button blocked until the mistakes are corrected.

Desktop (please complete the following information):

  • OS: ArchLinux
  • Browser firefox
  • Version 86.0

Metadata

Metadata

Assignees

Labels

featureNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions