File tree Expand file tree Collapse file tree 3 files changed +12
-1
lines changed Expand file tree Collapse file tree 3 files changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -34,7 +34,8 @@ angular.module('mm.addons.mod_lesson')
3434 scrollView ,
3535 originalData ,
3636 blockData ,
37- jumps ;
37+ jumps ,
38+ firstPageLoaded = false ;
3839
3940 // Block the lesson so it cannot be synced.
4041 $mmSyncBlock . blockOperation ( mmaModLessonComponent , lessonId ) ;
@@ -73,6 +74,8 @@ angular.module('mm.addons.mod_lesson')
7374
7475 accessInfo = info ;
7576 $scope . canManage = info . canmanage ;
77+ $scope . retake = accessInfo . attemptscount ;
78+ $scope . showRetake = ! $scope . currentPage && $scope . retake > 0 ;
7679
7780 if ( info . preventaccessreasons && info . preventaccessreasons . length ) {
7881 // If it's a password protected lesson and we have the password, allow playing it.
@@ -210,6 +213,12 @@ angular.module('mm.addons.mod_lesson')
210213 loadMenu ( ) ;
211214 }
212215 $scope . displayMenu = ! ! data . displaymenu ;
216+
217+ if ( ! firstPageLoaded ) {
218+ firstPageLoaded = true ;
219+ } else {
220+ $scope . showRetake = false ;
221+ }
213222 } ) ;
214223 }
215224
Original file line number Diff line number Diff line change 11{
22 "answer" : " Answer" ,
3+ "attempt" : " Attempt: {{$a}}" ,
34 "attemptheader" : " Attempt" ,
45 "attemptsremaining" : " You have {{$a}} attempt(s) remaining" ,
56 "averagescore" : " Average score" ,
Original file line number Diff line number Diff line change 1515 < mm-timer ng-if ="endTime " end-time ="endTime " finished ="timeUp() " timer-text ="{{ 'mma.mod_lesson.timeremaining' | translate }} "> </ mm-timer >
1616
1717 <!-- Page content, including questions and buttons. -->
18+ < p ng-if ="showRetake && !eolData && !processData " class ="item item-text-wrap "> {{ 'mma.mod_lesson.attempt' | translate:{$a: retake} }}</ p >
1819 < mm-format-text ng-if ="pageData.ongoingscore && !eolData && !processData " class ="item item-text-wrap mma-mod-lesson-ongoingscore " watch ="true "> {{pageData.ongoingscore}}</ mm-format-text >
1920 < form ng-if ="!eolData && !processData " name ="mma-mod_lesson-player-form " class ="card ">
2021 < p class ="item item-text-wrap " ng-class ="{'item-divider': question} "> < mm-format-text watch ="true " component ="{{component}} " component-id ="{{lesson.coursemodule}} "> {{pageContent}}</ mm-format-text > </ p >
You can’t perform that action at this time.
0 commit comments