|
@@ -404,6 +404,7 @@ public class SoundCompareHandler implements WebSocketEventHandler {
|
|
|
|
|
|
boolean cadenceRight = false;
|
|
|
boolean intonationRight = false;
|
|
|
+ boolean integrityRight = false;
|
|
|
|
|
|
//有效节奏占比
|
|
|
float cadenceDuty = cadenceValidNum/compareNum;
|
|
@@ -447,13 +448,16 @@ public class SoundCompareHandler implements WebSocketEventHandler {
|
|
|
}
|
|
|
float integrityDuty = integrityValidNum/compareNum;
|
|
|
integrityScore += integrityDuty;
|
|
|
-
|
|
|
- if(cadenceRight&&intonationRight){
|
|
|
- userSoundInfoMap.get(phone).getMusicalNotesPlayStats().add(new MusicalNotesPlayStatDto(musicXmlInfo.getMusicalNotesIndex(), MusicalErrorTypeEnum.RIGHT));
|
|
|
- }else if(cadenceRight&&!intonationRight){
|
|
|
- userSoundInfoMap.get(phone).getMusicalNotesPlayStats().add(new MusicalNotesPlayStatDto(musicXmlInfo.getMusicalNotesIndex(), MusicalErrorTypeEnum.WRONG));
|
|
|
+ integrityRight = integrityDuty>0.7;
|
|
|
+
|
|
|
+ if(!cadenceRight){
|
|
|
+ userSoundInfoMap.get(phone).getMusicalNotesPlayStats().add(new MusicalNotesPlayStatDto(musicXmlInfo.getMusicalNotesIndex(), MusicalErrorTypeEnum.CADENCE_WRONG));
|
|
|
+ }else if(!intonationRight){
|
|
|
+ userSoundInfoMap.get(phone).getMusicalNotesPlayStats().add(new MusicalNotesPlayStatDto(musicXmlInfo.getMusicalNotesIndex(), MusicalErrorTypeEnum.INTONATION_WRONG));
|
|
|
+ }else if(!integrityRight){
|
|
|
+ userSoundInfoMap.get(phone).getMusicalNotesPlayStats().add(new MusicalNotesPlayStatDto(musicXmlInfo.getMusicalNotesIndex(), MusicalErrorTypeEnum.INTEGRITY_WRONG));
|
|
|
}else{
|
|
|
- userSoundInfoMap.get(phone).getMusicalNotesPlayStats().add(new MusicalNotesPlayStatDto(musicXmlInfo.getMusicalNotesIndex(), MusicalErrorTypeEnum.NOT_PLAY));
|
|
|
+ userSoundInfoMap.get(phone).getMusicalNotesPlayStats().add(new MusicalNotesPlayStatDto(musicXmlInfo.getMusicalNotesIndex(), MusicalErrorTypeEnum.RIGHT));
|
|
|
}
|
|
|
}
|
|
|
|