A construction of quasi-Gorenstein rings