forked from EVOgeek/Vmeda.Online
		
	Merge pull request #3968 from NoelDeMartin/MOBILE-4339
MOBILE-4339 quiz: Fix offline unanswered warning
This commit is contained in:
		
						commit
						b7629d4fb1
					
				| @ -160,6 +160,7 @@ export class AddonModQuizOfflineProvider { | |||||||
|             const state = CoreQuestion.getState(dbQuestion.state); |             const state = CoreQuestion.getState(dbQuestion.state); | ||||||
|             question.state = dbQuestion.state; |             question.state = dbQuestion.state; | ||||||
|             question.status = Translate.instant('core.question.' + state.status); |             question.status = Translate.instant('core.question.' + state.status); | ||||||
|  |             question.stateclass = state.stateclass; | ||||||
|         })); |         })); | ||||||
| 
 | 
 | ||||||
|         return questions; |         return questions; | ||||||
|  | |||||||
| @ -44,6 +44,7 @@ const STATES: Record<string, CoreQuestionState> = { | |||||||
|         name: 'todo', |         name: 'todo', | ||||||
|         class: 'core-question-notyetanswered', |         class: 'core-question-notyetanswered', | ||||||
|         status: 'notyetanswered', |         status: 'notyetanswered', | ||||||
|  |         stateclass: 'notyetanswered', | ||||||
|         active: true, |         active: true, | ||||||
|         finished: false, |         finished: false, | ||||||
|     }, |     }, | ||||||
| @ -51,6 +52,7 @@ const STATES: Record<string, CoreQuestionState> = { | |||||||
|         name: 'invalid', |         name: 'invalid', | ||||||
|         class: 'core-question-invalidanswer', |         class: 'core-question-invalidanswer', | ||||||
|         status: 'invalidanswer', |         status: 'invalidanswer', | ||||||
|  |         stateclass: 'invalidanswer', | ||||||
|         active: true, |         active: true, | ||||||
|         finished: false, |         finished: false, | ||||||
|     }, |     }, | ||||||
| @ -58,6 +60,7 @@ const STATES: Record<string, CoreQuestionState> = { | |||||||
|         name: 'complete', |         name: 'complete', | ||||||
|         class: 'core-question-answersaved', |         class: 'core-question-answersaved', | ||||||
|         status: 'answersaved', |         status: 'answersaved', | ||||||
|  |         stateclass: 'answersaved', | ||||||
|         active: true, |         active: true, | ||||||
|         finished: false, |         finished: false, | ||||||
|     }, |     }, | ||||||
| @ -65,6 +68,7 @@ const STATES: Record<string, CoreQuestionState> = { | |||||||
|         name: 'needsgrading', |         name: 'needsgrading', | ||||||
|         class: 'core-question-requiresgrading', |         class: 'core-question-requiresgrading', | ||||||
|         status: 'requiresgrading', |         status: 'requiresgrading', | ||||||
|  |         stateclass: 'requiresgrading', | ||||||
|         active: false, |         active: false, | ||||||
|         finished: true, |         finished: true, | ||||||
|     }, |     }, | ||||||
| @ -72,6 +76,7 @@ const STATES: Record<string, CoreQuestionState> = { | |||||||
|         name: 'finished', |         name: 'finished', | ||||||
|         class: 'core-question-complete', |         class: 'core-question-complete', | ||||||
|         status: 'complete', |         status: 'complete', | ||||||
|  |         stateclass: 'complete', | ||||||
|         active: false, |         active: false, | ||||||
|         finished: true, |         finished: true, | ||||||
|     }, |     }, | ||||||
| @ -79,6 +84,7 @@ const STATES: Record<string, CoreQuestionState> = { | |||||||
|         name: 'gaveup', |         name: 'gaveup', | ||||||
|         class: 'core-question-notanswered', |         class: 'core-question-notanswered', | ||||||
|         status: 'notanswered', |         status: 'notanswered', | ||||||
|  |         stateclass: 'notanswered', | ||||||
|         active: false, |         active: false, | ||||||
|         finished: true, |         finished: true, | ||||||
|     }, |     }, | ||||||
| @ -86,6 +92,7 @@ const STATES: Record<string, CoreQuestionState> = { | |||||||
|         name: 'gradedwrong', |         name: 'gradedwrong', | ||||||
|         class: 'core-question-incorrect', |         class: 'core-question-incorrect', | ||||||
|         status: 'incorrect', |         status: 'incorrect', | ||||||
|  |         stateclass: 'incorrect', | ||||||
|         active: false, |         active: false, | ||||||
|         finished: true, |         finished: true, | ||||||
|     }, |     }, | ||||||
| @ -93,6 +100,7 @@ const STATES: Record<string, CoreQuestionState> = { | |||||||
|         name: 'gradedpartial', |         name: 'gradedpartial', | ||||||
|         class: 'core-question-partiallycorrect', |         class: 'core-question-partiallycorrect', | ||||||
|         status: 'partiallycorrect', |         status: 'partiallycorrect', | ||||||
|  |         stateclass: 'partiallycorrect', | ||||||
|         active: false, |         active: false, | ||||||
|         finished: true, |         finished: true, | ||||||
|     }, |     }, | ||||||
| @ -100,6 +108,7 @@ const STATES: Record<string, CoreQuestionState> = { | |||||||
|         name: 'gradedright', |         name: 'gradedright', | ||||||
|         class: 'core-question-correct', |         class: 'core-question-correct', | ||||||
|         status: 'correct', |         status: 'correct', | ||||||
|  |         stateclass: 'correct', | ||||||
|         active: false, |         active: false, | ||||||
|         finished: true, |         finished: true, | ||||||
|     }, |     }, | ||||||
| @ -107,6 +116,7 @@ const STATES: Record<string, CoreQuestionState> = { | |||||||
|         name: 'mangrwrong', |         name: 'mangrwrong', | ||||||
|         class: 'core-question-incorrect', |         class: 'core-question-incorrect', | ||||||
|         status: 'incorrect', |         status: 'incorrect', | ||||||
|  |         stateclass: 'incorrect', | ||||||
|         active: false, |         active: false, | ||||||
|         finished: true, |         finished: true, | ||||||
|     }, |     }, | ||||||
| @ -114,6 +124,7 @@ const STATES: Record<string, CoreQuestionState> = { | |||||||
|         name: 'mangrpartial', |         name: 'mangrpartial', | ||||||
|         class: 'core-question-partiallycorrect', |         class: 'core-question-partiallycorrect', | ||||||
|         status: 'partiallycorrect', |         status: 'partiallycorrect', | ||||||
|  |         stateclass: 'partiallycorrect', | ||||||
|         active: false, |         active: false, | ||||||
|         finished: true, |         finished: true, | ||||||
|     }, |     }, | ||||||
| @ -121,6 +132,7 @@ const STATES: Record<string, CoreQuestionState> = { | |||||||
|         name: 'mangrright', |         name: 'mangrright', | ||||||
|         class: 'core-question-correct', |         class: 'core-question-correct', | ||||||
|         status: 'correct', |         status: 'correct', | ||||||
|  |         stateclass: 'correct', | ||||||
|         active: false, |         active: false, | ||||||
|         finished: true, |         finished: true, | ||||||
|     }, |     }, | ||||||
| @ -128,6 +140,7 @@ const STATES: Record<string, CoreQuestionState> = { | |||||||
|         name: 'cannotdeterminestatus', |         name: 'cannotdeterminestatus', | ||||||
|         class: 'core-question-unknown', |         class: 'core-question-unknown', | ||||||
|         status: 'cannotdeterminestatus', |         status: 'cannotdeterminestatus', | ||||||
|  |         stateclass: undefined, | ||||||
|         active: true, |         active: true, | ||||||
|         finished: false, |         finished: false, | ||||||
|     }, |     }, | ||||||
| @ -583,6 +596,15 @@ export type CoreQuestionState = { | |||||||
|     name: string; // Name of the state.
 |     name: string; // Name of the state.
 | ||||||
|     class: string; // Class to style the state.
 |     class: string; // Class to style the state.
 | ||||||
|     status: string; // The string key to translate the state.
 |     status: string; // The string key to translate the state.
 | ||||||
|  |     stateclass: // A machine-readable class name for the state that this question attempt is in.
 | ||||||
|  |         typeof QUESTION_TODO_STATE_CLASSES[number] | | ||||||
|  |         typeof QUESTION_INVALID_STATE_CLASSES[number] | | ||||||
|  |         typeof QUESTION_COMPLETE_STATE_CLASSES[number] | | ||||||
|  |         typeof QUESTION_NEEDS_GRADING_STATE_CLASSES[number] | | ||||||
|  |         typeof QUESTION_FINISHED_STATE_CLASSES[number] | | ||||||
|  |         typeof QUESTION_GAVE_UP_STATE_CLASSES[number] | | ||||||
|  |         typeof QUESTION_GRADED_STATE_CLASSES[number] | | ||||||
|  |         undefined; | ||||||
|     active: boolean; // Whether the question with this state is active.
 |     active: boolean; // Whether the question with this state is active.
 | ||||||
|     finished: boolean; // Whether the question with this state is finished.
 |     finished: boolean; // Whether the question with this state is finished.
 | ||||||
| }; | }; | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user