Added debug logging for Assessment Builder
This commit is contained in:
parent
dc49593fac
commit
6514816aba
1 changed files with 6 additions and 2 deletions
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue