/**
 * Updates an instance of the hvp in the database
 *
 * Given an object containing all the necessary data,
 * (defined by the form in mod_form.php) this function
 * will update an existing instance with new data.
 *
 * @param stdClass $hvp An object from the form in mod_form.php
 * @return boolean Success/Fail
 */
function hvp_update_instance($hvp)
{
    // Make ID available for core to save
    $hvp->id = $hvp->instance;
    // Save content
    hvp_save_content($hvp);
    // Update grade item with 100% max score, reset user records.
    $hvp->rawgrademax = '100';
    hvp_grade_item_update($hvp, 'reset');
    return true;
}
Exemple #2
0
/**
 * Updates an instance of the hvp in the database
 *
 * Given an object containing all the necessary data,
 * (defined by the form in mod_form.php) this function
 * will update an existing instance with new data.
 *
 * @param stdClass $hvp An object from the form in mod_form.php
 * @return boolean Success/Fail
 */
function hvp_update_instance($hvp)
{
    // Make ID available for core to save
    $hvp->id = $hvp->instance;
    // Save content
    hvp_save_content($hvp);
    hvp_grade_item_update($hvp, 'reset');
    return true;
}