Update Saqel Platform: 2026-09-09 00:24:41
This commit is contained in:
@@ -44,9 +44,11 @@ class TeacherLessonAuditModel {
|
||||
final decisionValue = json['decision']?.toString() ?? 'pending';
|
||||
|
||||
final ai = json['ai_analysis'] is Map ? Map<String, dynamic>.from(json['ai_analysis'] as Map) : null;
|
||||
final qa = ai != null && ai['quality_assessment'] is Map ? Map<String, dynamic>.from(ai['quality_assessment'] as Map) : null;
|
||||
final cpCount = (ai?['checkpoints_count'] as num?)?.toInt() ?? (json['socratic_stops_count'] as num?)?.toInt() ?? 0;
|
||||
final alignScore = (qa?['alignment_score'] as num?)?.toInt();
|
||||
final estimatedCp = (durationSeconds / 600).clamp(1, 4).toInt();
|
||||
final cpCount = (ai?['checkpoints_count'] as num?)?.toInt() ??
|
||||
(json['socratic_stops_count'] as num?)?.toInt() ??
|
||||
(durationSeconds > 0 ? estimatedCp : 0);
|
||||
final alignScore = (qa?['alignment_score'] as num?)?.toInt() ?? readiness;
|
||||
|
||||
return TeacherLessonAuditModel(
|
||||
lessonTitle: json['lesson_title'] ?? '',
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import 'dart:async';
|
||||
import 'dart:convert';
|
||||
import 'dart:typed_data';
|
||||
import 'package:http/http.dart' as http;
|
||||
@@ -6,6 +7,32 @@ import '../../core/services/storage_service.dart';
|
||||
import '../../core/utils/app_logger.dart';
|
||||
import '../models/teacher_models.dart';
|
||||
|
||||
class MultipartRequestWithProgress extends http.MultipartRequest {
|
||||
final void Function(int bytes, int totalBytes)? onProgress;
|
||||
|
||||
MultipartRequestWithProgress(String method, Uri url, {this.onProgress})
|
||||
: super(method, url);
|
||||
|
||||
@override
|
||||
http.ByteStream finalize() {
|
||||
final byteStream = super.finalize();
|
||||
if (onProgress == null) return byteStream;
|
||||
|
||||
final total = contentLength;
|
||||
int bytes = 0;
|
||||
|
||||
final transformer = StreamTransformer<List<int>, List<int>>.fromHandlers(
|
||||
handleData: (data, sink) {
|
||||
bytes += data.length;
|
||||
onProgress!(bytes, total);
|
||||
sink.add(data);
|
||||
},
|
||||
);
|
||||
|
||||
return http.ByteStream(byteStream.transform(transformer));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* ==============================================================================
|
||||
* SAQEL TEACHER STUDIO - ENTERPRISE REPOSITORY (ZERO-MOCK PRODUCTION RAIL)
|
||||
@@ -364,14 +391,16 @@ class TeacherRepository {
|
||||
double? fileSizeMb,
|
||||
String? filePath,
|
||||
Uint8List? fileBytes,
|
||||
void Function(int bytes, int totalBytes)? onProgress,
|
||||
}) async {
|
||||
final stopwatch = Stopwatch()..start();
|
||||
final uploadUri = Uri.parse('$baseUrl${AppConfig.uploadVideoEndpoint}');
|
||||
try {
|
||||
final headers = await _authHeaders();
|
||||
final request = http.MultipartRequest(
|
||||
final request = MultipartRequestWithProgress(
|
||||
'POST',
|
||||
uploadUri,
|
||||
onProgress: onProgress,
|
||||
);
|
||||
request.headers.addAll(headers..remove('Content-Type'));
|
||||
request.fields.addAll({
|
||||
|
||||
Reference in New Issue
Block a user