@@ -732,7 +732,8 @@ mod analytics_tests {
732732 ] ;
733733
734734 for i in 0 ..10 {
735- let mut session = create_test_session ( & env, & student, "RUST101" , & format ! ( "module_{}" , i % 3 + 1 ) ) ;
735+ let mut session =
736+ create_test_session ( & env, & student, "RUST101" , & format ! ( "module_{}" , i % 3 + 1 ) ) ;
736737 session. session_id = BytesN :: from_array ( & env, & [ i as u8 ; 32 ] ) ;
737738 session. session_type = session_types[ i % 4 ] . clone ( ) ;
738739 session. interactions = 15 + i * 2 ;
@@ -762,7 +763,8 @@ mod analytics_tests {
762763
763764 // Create sessions with varying engagement patterns
764765 for i in 0 ..8 {
765- let mut session = create_test_session ( & env, & student, "RUST101" , & format ! ( "module_{}" , i + 1 ) ) ;
766+ let mut session =
767+ create_test_session ( & env, & student, "RUST101" , & format ! ( "module_{}" , i + 1 ) ) ;
766768 session. session_id = BytesN :: from_array ( & env, & [ i as u8 ; 32 ] ) ;
767769 session. interactions = 20 + i * 3 ;
768770 client. record_session ( & session) ;
@@ -775,7 +777,8 @@ mod analytics_tests {
775777 // Request engagement prediction
776778 client. request_ml_insight ( & student, & course_id, & InsightType :: EngagementPrediction ) ;
777779
778- let insight = client. get_ml_insight ( & student, & course_id, & InsightType :: EngagementPrediction ) ;
780+ let insight =
781+ client. get_ml_insight ( & student, & course_id, & InsightType :: EngagementPrediction ) ;
779782 assert ! ( insight. is_some( ) ) ;
780783 let insight = insight. unwrap ( ) ;
781784 assert_eq ! ( insight. insight_type, InsightType :: EngagementPrediction ) ;
@@ -789,7 +792,8 @@ mod analytics_tests {
789792 let course_id = Symbol :: new ( & env, "RUST101" ) ;
790793
791794 // Create sessions with varying performance to simulate knowledge gaps
792- let modules_scores = [ ( "module_1" , 85 ) , ( "module_2" , 45 ) , ( "module_3" , 90 ) , ( "module_4" , 55 ) ] ;
795+ let modules_scores =
796+ [ ( "module_1" , 85 ) , ( "module_2" , 45 ) , ( "module_3" , 90 ) , ( "module_4" , 55 ) ] ;
793797
794798 for ( i, ( module, score) ) in modules_scores. iter ( ) . enumerate ( ) {
795799 let mut session = create_test_session ( & env, & student, "RUST101" , module) ;
@@ -804,7 +808,8 @@ mod analytics_tests {
804808 // Request knowledge gap analysis
805809 client. request_ml_insight ( & student, & course_id, & InsightType :: KnowledgeGapAnalysis ) ;
806810
807- let insight = client. get_ml_insight ( & student, & course_id, & InsightType :: KnowledgeGapAnalysis ) ;
811+ let insight =
812+ client. get_ml_insight ( & student, & course_id, & InsightType :: KnowledgeGapAnalysis ) ;
808813 assert ! ( insight. is_some( ) ) ;
809814 let insight = insight. unwrap ( ) ;
810815 assert_eq ! ( insight. insight_type, InsightType :: KnowledgeGapAnalysis ) ;
@@ -828,7 +833,8 @@ mod analytics_tests {
828833
829834 for ( student, score, _label) in students_data {
830835 for i in 0 ..3 {
831- let mut session = create_test_session ( & env, student, "RUST101" , & format ! ( "module_{}" , i + 1 ) ) ;
836+ let mut session =
837+ create_test_session ( & env, student, "RUST101" , & format ! ( "module_{}" , i + 1 ) ) ;
832838 session. session_id = BytesN :: from_array ( & env, & [ score as u8 + i as u8 ; 32 ] ) ;
833839 client. record_session ( & session) ;
834840
@@ -841,7 +847,8 @@ mod analytics_tests {
841847 // Request collaborative learning insight for student1
842848 client. request_ml_insight ( & student1, & course_id, & InsightType :: CollaborativeInsight ) ;
843849
844- let insight = client. get_ml_insight ( & student1, & course_id, & InsightType :: CollaborativeInsight ) ;
850+ let insight =
851+ client. get_ml_insight ( & student1, & course_id, & InsightType :: CollaborativeInsight ) ;
845852 assert ! ( insight. is_some( ) ) ;
846853 let insight = insight. unwrap ( ) ;
847854 assert_eq ! ( insight. insight_type, InsightType :: CollaborativeInsight ) ;
@@ -856,7 +863,8 @@ mod analytics_tests {
856863
857864 // Create normal sessions first
858865 for i in 0 ..5 {
859- let mut session = create_test_session ( & env, & student, "RUST101" , & format ! ( "module_{}" , i + 1 ) ) ;
866+ let mut session =
867+ create_test_session ( & env, & student, "RUST101" , & format ! ( "module_{}" , i + 1 ) ) ;
860868 session. session_id = BytesN :: from_array ( & env, & [ i as u8 ; 32 ] ) ;
861869 session. interactions = 20 ;
862870 client. record_session ( & session) ;
@@ -871,13 +879,17 @@ mod analytics_tests {
871879 short_session. session_id = BytesN :: from_array ( & env, & [ 10u8 ; 32 ] ) ;
872880 short_session. interactions = 5 ;
873881 client. record_session ( & short_session) ;
874- client. complete_session ( & short_session. session_id , & ( short_session. start_time + 300 ) , & Some ( 40 ) , & 50 ) ;
882+ client. complete_session (
883+ & short_session. session_id , & ( short_session. start_time + 300 ) , & Some ( 40 ) , & 50
884+ ) ;
875885
876886 let mut long_session = create_test_session ( & env, & student, "RUST101" , "module_7" ) ;
877887 long_session. session_id = BytesN :: from_array ( & env, & [ 11u8 ; 32 ] ) ;
878888 long_session. interactions = 50 ;
879889 client. record_session ( & long_session) ;
880- client. complete_session ( & long_session. session_id , & ( long_session. start_time + 7200 ) , & Some ( 85 ) , & 100 ) ;
890+ client. complete_session (
891+ & long_session. session_id , & ( long_session. start_time + 7200 ) , & Some ( 85 ) , & 100
892+ ) ;
881893
882894 // Request anomaly detection
883895 client. request_ml_insight ( & student, & course_id, & InsightType :: AnomalyDetection ) ;
@@ -918,7 +930,8 @@ mod analytics_tests {
918930 // Request learning path optimization
919931 client. request_ml_insight ( & student, & course_id, & InsightType :: LearningPathOptimization ) ;
920932
921- let insight = client. get_ml_insight ( & student, & course_id, & InsightType :: LearningPathOptimization ) ;
933+ let insight =
934+ client. get_ml_insight ( & student, & course_id, & InsightType :: LearningPathOptimization ) ;
922935 assert ! ( insight. is_some( ) ) ;
923936 let insight = insight. unwrap ( ) ;
924937 assert_eq ! ( insight. insight_type, InsightType :: LearningPathOptimization ) ;
@@ -943,7 +956,8 @@ mod analytics_tests {
943956 ] ;
944957
945958 for ( i, ( session_type, score, duration) ) in session_types_data. iter ( ) . enumerate ( ) {
946- let mut session = create_test_session ( & env, & student, "RUST101" , & format ! ( "module_{}" , i + 1 ) ) ;
959+ let mut session =
960+ create_test_session ( & env, & student, "RUST101" , & format ! ( "module_{}" , i + 1 ) ) ;
947961 session. session_id = BytesN :: from_array ( & env, & [ i as u8 ; 32 ] ) ;
948962 session. session_type = session_type. clone ( ) ;
949963 session. interactions = 15 + i * 2 ;
@@ -957,7 +971,8 @@ mod analytics_tests {
957971 // Request effectiveness metrics
958972 client. request_ml_insight ( & student, & course_id, & InsightType :: EffectivenessMetrics ) ;
959973
960- let insight = client. get_ml_insight ( & student, & course_id, & InsightType :: EffectivenessMetrics ) ;
974+ let insight =
975+ client. get_ml_insight ( & student, & course_id, & InsightType :: EffectivenessMetrics ) ;
961976 assert ! ( insight. is_some( ) ) ;
962977 let insight = insight. unwrap ( ) ;
963978 assert_eq ! ( insight. insight_type, InsightType :: EffectivenessMetrics ) ;
@@ -991,7 +1006,8 @@ mod analytics_tests {
9911006 // Request adaptive recommendations
9921007 client. request_ml_insight ( & student, & course_id, & InsightType :: AdaptiveRecommendation ) ;
9931008
994- let insight = client. get_ml_insight ( & student, & course_id, & InsightType :: AdaptiveRecommendation ) ;
1009+ let insight =
1010+ client. get_ml_insight ( & student, & course_id, & InsightType :: AdaptiveRecommendation ) ;
9951011 assert ! ( insight. is_some( ) ) ;
9961012 let insight = insight. unwrap ( ) ;
9971013 assert_eq ! ( insight. insight_type, InsightType :: AdaptiveRecommendation ) ;
@@ -1006,7 +1022,8 @@ mod analytics_tests {
10061022
10071023 // Create only 2 sessions (insufficient for most ML analyses)
10081024 for i in 0 ..2 {
1009- let mut session = create_test_session ( & env, & student, "RUST101" , & format ! ( "module_{}" , i + 1 ) ) ;
1025+ let mut session =
1026+ create_test_session ( & env, & student, "RUST101" , & format ! ( "module_{}" , i + 1 ) ) ;
10101027 session. session_id = BytesN :: from_array ( & env, & [ i as u8 ; 32 ] ) ;
10111028 client. record_session ( & session) ;
10121029
@@ -1045,7 +1062,8 @@ mod analytics_tests {
10451062
10461063 // Create sufficient data for pattern recognition
10471064 for i in 0 ..6 {
1048- let mut session = create_test_session ( & env, & student, "RUST101" , & format ! ( "module_{}" , i + 1 ) ) ;
1065+ let mut session =
1066+ create_test_session ( & env, & student, "RUST101" , & format ! ( "module_{}" , i + 1 ) ) ;
10491067 session. session_id = BytesN :: from_array ( & env, & [ i as u8 ; 32 ] ) ;
10501068 session. interactions = 20 + i * 5 ;
10511069 client. record_session ( & session) ;
@@ -1094,7 +1112,8 @@ mod analytics_tests {
10941112
10951113 // Create comprehensive data
10961114 for i in 0 ..8 {
1097- let mut session = create_test_session ( & env, & student, "RUST101" , & format ! ( "module_{}" , i + 1 ) ) ;
1115+ let mut session =
1116+ create_test_session ( & env, & student, "RUST101" , & format ! ( "module_{}" , i + 1 ) ) ;
10981117 session. session_id = BytesN :: from_array ( & env, & [ i as u8 ; 32 ] ) ;
10991118 session. interactions = 15 + i * 3 ;
11001119 client. record_session ( & session) ;
0 commit comments