Merge branch 'fix/section-review-logic' into 'master'
fix: section description dialog and review pretest exercise logic See merge request profile-image/kedaireka/polinema-adapative-learning/mobile-adaptive-learning!27
This commit is contained in:
commit
16778b14df
|
|
@ -1,3 +1,3 @@
|
||||||
const String baseUrl = 'https://580d-36-85-62-81.ngrok-free.app/';
|
const String baseUrl = 'http://54.173.167.62/';
|
||||||
|
|
||||||
const String mediaUrl = 'https://580d-36-85-62-81.ngrok-free.app/api/uploads/';
|
const String mediaUrl = 'http://54.173.167.62/api/uploads/';
|
||||||
|
|
|
||||||
|
|
@ -48,7 +48,11 @@ class LevelProvider with ChangeNotifier {
|
||||||
|
|
||||||
bool isPretestFinished(String levelId) {
|
bool isPretestFinished(String levelId) {
|
||||||
return _levels.any(
|
return _levels.any(
|
||||||
(level) => level.idLevel == levelId && level.idStudentLearning != null);
|
(level) =>
|
||||||
|
level.idLevel == levelId &&
|
||||||
|
level.idStudentLearning != null &&
|
||||||
|
level.score != null,
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
int getPretestScore(String levelId) {
|
int getPretestScore(String levelId) {
|
||||||
|
|
|
||||||
|
|
@ -29,7 +29,7 @@ class PretestCard extends StatelessWidget {
|
||||||
final score = levelProvider.getPretestScore(pretest.idLevel);
|
final score = levelProvider.getPretestScore(pretest.idLevel);
|
||||||
// final isAllowed = levelProvider.isLevelAllowed(pretest.idLevel);
|
// final isAllowed = levelProvider.isLevelAllowed(pretest.idLevel);
|
||||||
void navigateToMaterial() {
|
void navigateToMaterial() {
|
||||||
if (isFinished) {
|
if (isFinished && pretest.score != null) {
|
||||||
// Mode review untuk pretest yang sudah selesai
|
// Mode review untuk pretest yang sudah selesai
|
||||||
Navigator.push(
|
Navigator.push(
|
||||||
context,
|
context,
|
||||||
|
|
@ -133,8 +133,10 @@ class PretestCard extends StatelessWidget {
|
||||||
),
|
),
|
||||||
const SizedBox(height: 13),
|
const SizedBox(height: 13),
|
||||||
CustomButton(
|
CustomButton(
|
||||||
text: isFinished ? 'Review' : 'Learn Now',
|
text: isFinished && pretest.score != null
|
||||||
textStyle: isFinished
|
? 'Review'
|
||||||
|
: 'Learn Now',
|
||||||
|
textStyle: isFinished && pretest.score != null
|
||||||
? AppTextStyles.whiteTextStyle.copyWith(
|
? AppTextStyles.whiteTextStyle.copyWith(
|
||||||
fontWeight: FontWeight.w900,
|
fontWeight: FontWeight.w900,
|
||||||
)
|
)
|
||||||
|
|
@ -143,7 +145,9 @@ class PretestCard extends StatelessWidget {
|
||||||
),
|
),
|
||||||
width: double.infinity,
|
width: double.infinity,
|
||||||
height: 36,
|
height: 36,
|
||||||
color: isFinished ? Colors.green : AppColors.yellowButtonColor,
|
color: isFinished && pretest.score != null
|
||||||
|
? Colors.green
|
||||||
|
: AppColors.yellowButtonColor,
|
||||||
onPressed: navigateToMaterial,
|
onPressed: navigateToMaterial,
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
import 'package:english_learning/core/services/constants.dart';
|
import 'package:english_learning/core/services/constants.dart';
|
||||||
import 'package:english_learning/core/widgets/custom_snackbar.dart';
|
import 'package:english_learning/core/widgets/custom_snackbar.dart';
|
||||||
|
import 'package:english_learning/core/widgets/global_button.dart';
|
||||||
import 'package:english_learning/core/widgets/loading/shimmer_loading_widget.dart';
|
import 'package:english_learning/core/widgets/loading/shimmer_loading_widget.dart';
|
||||||
import 'package:english_learning/features/auth/provider/user_provider.dart';
|
import 'package:english_learning/features/auth/provider/user_provider.dart';
|
||||||
import 'package:english_learning/features/learning/modules/level/screens/level_list_screen.dart';
|
import 'package:english_learning/features/learning/modules/level/screens/level_list_screen.dart';
|
||||||
|
|
@ -126,25 +127,10 @@ class _TopicsListScreenState extends State<TopicsListScreen> {
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
Padding(
|
Padding(
|
||||||
padding: const EdgeInsets.all(16),
|
padding: const EdgeInsets.all(32.0),
|
||||||
child: ElevatedButton.icon(
|
child: GlobalButton(
|
||||||
style: ElevatedButton.styleFrom(
|
text: 'Close',
|
||||||
backgroundColor: AppColors.primaryColor,
|
|
||||||
shape: RoundedRectangleBorder(
|
|
||||||
borderRadius: BorderRadius.circular(8),
|
|
||||||
),
|
|
||||||
padding: const EdgeInsets.symmetric(
|
|
||||||
vertical: 12, horizontal: 20),
|
|
||||||
),
|
|
||||||
onPressed: () => Navigator.of(context).pop(),
|
onPressed: () => Navigator.of(context).pop(),
|
||||||
icon: const Icon(Icons.close, color: Colors.white),
|
|
||||||
label: const Text(
|
|
||||||
'Close',
|
|
||||||
style: TextStyle(
|
|
||||||
color: Colors.white,
|
|
||||||
fontWeight: FontWeight.bold,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user