Actually if you spell it out in your contract or master services agreement you can retain rights to the majority of the project for re-use. This is pretty common, most projects are modular and you can save them and future clients cost by re-using similar portions of code.
If they don't like this, then quote them a larger price if they don't want you to re-use their code in the future. Be careful not to give up your rights to create quiz apps for future clients or a possible future SaaS.
You'll want too include something like this, so they are clear you have the rights to re-use parts of their project on future projects. I would include wording that covers the quiz format/process in Type B as you might want to roll your own quiz SaaS app someday.
I am not an attorney, so have your's review prior to using.
4.4.2 "Type A Deliverables" shall mean Deliverables that are specific to Client's Business, including, but not limited to logos, images, unique business logic related source code and documentation associated therewith. Examples of Type A Deliverables include custom graphics and unique business logic code.
4.4.3 "Type B Deliverables" shall mean Deliverables that are not specific to Client's Business, including, but not limited to front end and back end code, framework modifications, tools, methodologies, plug-in and third party source code and documentation associated therewith. Examples of Type B Deliverables might include HTML, CSS, javascript, jQuery, Ruby/PHP Code, Objects, UI Features, App Features, CRUD interaction with objects, sorting, filtering data, search, manipulating data, patches and enhancements to open source frameworks and libraries, open source plug-ins available from third parties, contributions to which are generally-accepted practice in the open-source world. Along with standard features and functionality that are common across websites and web applications.
4.5 Ownership
Except as otherwise set forth herein, the entire right, title and interest in to Type A Deliverables, are the exclusive property of the Client. Under no circumstances may Consultant use the Type A Deliverables, or any component part thereof, for its own benefit or for the benefit of any third-party. Consultant grants the client a perpetual right to use and modify Type B Deliverables. The consultant reserves the right to use, reuse, modify the Type B Deliverables on past, present and future projects.