@@ -530,17 +530,9 @@ public function updateScoTracking($scoUuid, $userId, $data)
530
530
531
531
// Compute total time
532
532
$ totalTimeInHundredth = $ this ->convertTimeInHundredth ($ totalTime );
533
- $ totalTimeInHundredth += $ sessionTimeInHundredth ;
534
-
535
- // Persist total time
536
- if ($ tracking ->getTotalTimeInt () > 0 ) {
537
- $ totalTimeInHundredth += $ tracking ->getTotalTimeInt ();
538
- }
539
-
540
533
$ tracking ->setTotalTime ($ totalTimeInHundredth , Scorm::SCORM_12 );
541
534
542
535
$ bestScore = $ tracking ->getScoreRaw ();
543
- $ bestStatus = $ tracking ->getLessonStatus ();
544
536
545
537
// Update best score if the current score is better than the previous best score
546
538
@@ -550,10 +542,8 @@ public function updateScoTracking($scoUuid, $userId, $data)
550
542
$ tracking ->setScoreMax ($ scoreMax );
551
543
}
552
544
553
- if (empty ($ bestStatus ) || ($ lessonStatus !== $ bestStatus && $ statusPriority [$ lessonStatus ] > $ statusPriority [$ bestStatus ])) {
554
- $ tracking ->setLessonStatus ($ lessonStatus );
555
- $ bestStatus = $ lessonStatus ;
556
- }
545
+ $ tracking ->setLessonStatus ($ lessonStatus );
546
+ $ bestStatus = $ lessonStatus ;
557
547
558
548
if (empty ($ progression ) && ('completed ' === $ bestStatus || 'passed ' === $ bestStatus )) {
559
549
$ progression = 100 ;
@@ -615,14 +605,10 @@ public function updateScoTracking($scoUuid, $userId, $data)
615
605
$ lessonStatus = $ successStatus ;
616
606
}
617
607
618
- $ bestStatus = $ tracking ->getLessonStatus ();
619
- if (empty ($ bestStatus ) || ($ lessonStatus !== $ bestStatus && $ statusPriority [$ lessonStatus ] > $ statusPriority [$ bestStatus ])) {
620
- $ tracking ->setLessonStatus ($ lessonStatus );
621
- $ bestStatus = $ lessonStatus ;
622
- }
608
+ $ tracking ->setLessonStatus ($ lessonStatus );
609
+ $ bestStatus = $ lessonStatus ;
623
610
624
- if (
625
- empty ($ tracking ->getCompletionStatus ())
611
+ if (empty ($ tracking ->getCompletionStatus ())
626
612
|| ($ completionStatus !== $ tracking ->getCompletionStatus () && $ statusPriority [$ completionStatus ] > $ statusPriority [$ tracking ->getCompletionStatus ()])
627
613
) {
628
614
// This is no longer needed as completionStatus and successStatus are merged together
0 commit comments