Skip to content

Trying to create a lab without specifying ANY request type leads to OOPS screen

Summary

When trying to create a lab as a teacher, if you do not specify the request type (Question,Submission) in ALL of the modules (leave them all blank), it results in the error screen, instead of informing the user that he/she has to fill them out. If the user fills even 1 out, the lab is created successfully. The issue ONLY persists when they leave them all blank.

Steps to reproduce

Disclaimer: This error was observed in regular labs and slotted labs, did not test with the other 2.

  1. As a teacher create a lab for an edission he/she teaches

  2. Set the lab up like the following: image

  3. Press Create New lab

Possible Fix

A constraint violation is occuring (as seen in logs), all that needs to be done is to force the user to specify the request type. This can be done in either the HTML or the View. What is weird is that when just 1 is selected (but the rest are left blank), it creates the lab successfully, leading me to believe that the intended feature here is that if it is not selected, it selects a value by default.

Logs

javax.validation.ConstraintViolationException: Validation failed for classes [nl.tudelft.queue.model.labs.RegularLab] during persist time for groups [javax.validation.groups.Default, ] List of constraint violations:[ ConstraintViolationImpl{interpolatedMessage='must not be empty', propertyPath=allowedRequests, rootBeanClass=class nl.tudelft.queue.model.labs.RegularLab, messageTemplate='{javax.validation.constraints.NotEmpty.message}'} ]

Edited by Henry Page