This commit is contained in:
@@ -814,7 +814,7 @@ SenaSDK.prototype.start = function () {
|
||||
if (self.shuffle && self.data?.options) {
|
||||
self.shuffleArray(self.data.options);
|
||||
}
|
||||
self.startTime = Date.now();
|
||||
// self.startTime = Date.now();
|
||||
};
|
||||
|
||||
SenaSDK.prototype.markUserInteraction = function () {
|
||||
@@ -870,8 +870,8 @@ SenaSDK.prototype.end = function (answer, callback) {
|
||||
|
||||
// ========== STANDARD GAMES (Quiz/Sort/Fill) ==========
|
||||
|
||||
self.endTime = Date.now();
|
||||
const duration = (self.endTime - self.startTime) / 1000;
|
||||
// self.endTime = Date.now();
|
||||
// const duration = (self.endTime - self.startTime) / 1000;
|
||||
|
||||
const answerStr = String(answer || '');
|
||||
const userAnswers = answerStr.includes('|')
|
||||
@@ -918,21 +918,19 @@ SenaSDK.prototype.end = function (answer, callback) {
|
||||
});
|
||||
}
|
||||
|
||||
// Check time limit
|
||||
if (self.timeLimit > 0 && duration > self.timeLimit) {
|
||||
isCorrect = false;
|
||||
console.log('🎮 Sena SDK: Time limit exceeded');
|
||||
}
|
||||
// // Check time limit
|
||||
// if (self.timeLimit > 0 && duration > self.timeLimit) {
|
||||
// isCorrect = false;
|
||||
// console.log('🎮 Sena SDK: Time limit exceeded');
|
||||
// }
|
||||
|
||||
const result = {
|
||||
isCorrect: isCorrect,
|
||||
duration: duration,
|
||||
correctAnswer: correctAnswers.join(' | '),
|
||||
userAnswer: userAnswers.join(' | ')
|
||||
};
|
||||
isCorrect: isCorrect,
|
||||
correctAnswer: correctAnswers.join(' | '),
|
||||
userAnswer: userAnswers.join(' | ')
|
||||
};
|
||||
|
||||
console.log(`🎮 Sena SDK: Result: ${isCorrect ? 'CORRECT' : 'INCORRECT'} (${duration}s)`);
|
||||
|
||||
console.log(`🎮 Sena SDK: Result: ${isCorrect ? 'CORRECT' : 'INCORRECT'}`);
|
||||
if (callback) callback(result.isCorrect);
|
||||
return result;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user