edwardUL99 / StudSysCppCLI

A CLI UI for the StudSysCpp Project. This is a "dummy" project that is not used but done to practise C++ and also software engineering in terms of issues, issue tracking, issue refinement, requirements engineering, releases and also databases
GNU General Public License v3.0
0 stars 0 forks source link

Add functionality to delete an exam #79

Closed edwardUL99 closed 4 years ago

edwardUL99 commented 4 years ago

Add functionality to be able to delete an Exam. An exam should only be able to be deleted if and only if no student has taken the exam.

Foreign keys may take care of deleting questions and answers if they are set correctly. You will need to check if deletes are casade and not restrict in StudSysCppLibrary

edwardUL99 commented 4 years ago

If the exam you delete i the last exam, reset the Exam::lastId to Exam::lastId - 1 to ensure the next exam created will be the correct ID. If it's not the last exam we can't do anything about it as it would be too tedious to go through all exams after the deleted one and decrement their Ids by 1 and then the Exam::lastId. It's doable but can be performance intensive