$file, 'exe_user_id' => $user_id, 'exe_date' => $date, 'c_id' => $c_id, 'score' => $score, 'max_score' => $weighting, ]; Database::insert($TABLETRACK_HOTPOTATOES, $params); if ($origin == 'learnpath') { //if we are in a learning path, save the score in the corresponding //table to get tracking in there as well global $jscript2run; //record the results in the learning path, using the SCORM interface (API) $jscript2run .= ""; } } // Save the Scores save_scores($test, $score); // Back if ($origin != 'learnpath') { $url = "exercise.php"; // back to exercises $jscript2run .= ''; echo $jscript2run; } else { $htmlHeadXtra[] = $jscript2run; Display::display_reduced_header(); if (!empty($course_id) && !empty($learnpath_item_id) && !empty($lpViewId)) { $sql = "UPDATE $TABLE_LP_ITEM_VIEW SET status = 'completed' WHERE c_id = $course_id AND lp_item_id= $learnpath_item_id AND lp_view_id = $lpViewId "; Database::query($sql); echo Display::return_message(get_lang('This HotPotatoes test has been closed.'), 'confirm'); } else { echo Display::return_message(get_lang('Error'), 'error'); } Display::display_footer(); }