Added debug logging for Assessment Builder

This commit is contained in:
Ruben Ramirez 2025-04-04 10:43:27 -05:00
parent dc49593fac
commit 6514816aba

View file

@ -20,10 +20,14 @@ jQuery(document).ready(function($) {
* Updates the total cost display based on the questions currently in the assessment list.
*/
function updateTotalCost() {
console.log('--- Updating Total Cost ---'); // Debug
let totalCost = 0;
$currentList.find('.selected-question-item').each(function() {
totalCost += parseInt($(this).data('cost') || 0);
$currentList.find('.selected-question-item').each(function(index) {
const cost = parseInt($(this).data('cost') || 0);
console.log(`Item ${index}: data-cost = ${$(this).data('cost')}, parsed cost = ${cost}`); // Debug
totalCost += cost;
});
console.log('Calculated Total Cost:', totalCost); // Debug
$totalCostSpan.text(totalCost);
}