Quantum variational principle and quantum multiform structure: The case of quadratic Lagrangians