Rather than looping over all keys and values, you can just do `xmodule.update(fields)`