I am assuming I could alter the admin_quiz.php file in this area somehow:
Code:
// ###################### Do Inferno Quiz Delete Result ########################
if ($_POST['do'] == "do_delete_result") {
// ----------------------------
// Assume The Result Exists
// ----------------------------
if(!$result = $DB->query_first("select u.username,r.* from ".TABLE_PREFIX."quiz_results r left join ".TABLE_PREFIX."user u on(u.userid=r.r_userid) where r.rid = '".intval($_POST['id'])."'")){
echo "Result Was Unable To Be Found In Your Database [<a href='javascript:history.go(-1);'>Back</a>]";
exit;
}
// ----------------------------
// Did we want to delete?
// ----------------------------
if($_POST['verify']){
// ----------------------------
// Yes we did...
// ----------------------------
// Delete Result
$DB->query("delete from ".TABLE_PREFIX."quiz_results where rid = ".intval($_POST['id'])."");
$Engine->Redirect(
"Result Deleted Successfully",
array(
array("Moderate Quiz Results","?do=results"),
)
);
} else {
// ----------------------------
// No we didn't...
// ----------------------------
$Engine->Redirect(
"Result Not Deleted",
array(
array("Moderate This Result","?do=moderate_user_results&id={$_POST['id']}"),
array("Moderate Quiz Results","?do=results"),
)
);
}
}
using the code from this line:
Code:
$DB->query("delete from ".TABLE_PREFIX."quiz_results where rid = ".intval($_POST['id'])."");
and adding these variables taken from Amy's mod:
Quote:
$foruminfo['score'] $quiztaken['r_score']
|
but I have no idea how to put it together, or where to put it after it is together... so as to automatically check and delete at set intervals etc. and, of course, we don't want to be constantly querying the database now, do we? Perhaps even a button added in the code above that performs this function manually, rather than on an automatic timer (ie "hit the button, all results below a certain percentage are deleted").
These reasons are why overwriting the results on each subsequent attempt would be a much more attractive option. I don't care if I have to hard-code it in rather than make it a selectable option, as I only plan to use this mod for the aforementioned purpose anyway.
Any coders out there interested in breezing through this one? If I can get this far with no coding knowledge whatsoever, I imagine you guys could throw something useable up here between lighting up your smoke and putting it out. I'd appreciate any help you could offer. Thanks.