Skip to content

Commit b6211c9

Browse files
committed
update duration section
1 parent f0c4ca6 commit b6211c9

File tree

2 files changed

+16
-4
lines changed

2 files changed

+16
-4
lines changed

qasdk/src/main/java/co/astrnt/qasdk/AstrntSDK.java

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -202,11 +202,11 @@ public void saveInterviewResult(InterviewResultApiDao resultApiDao, InterviewApi
202202

203203
InterviewApiDao currentInterview1 = getCurrentInterview();
204204
if (resultApiDao.getInformation().getQuestionsMcqInfo() != null && !resultApiDao.getInformation().getQuestionsMcqInfo().isEmpty()) {
205-
updateInterviewSelectedAnswer(currentInterview1, resultApiDao);
205+
updateInterviewSelectedAnswer(currentInterview1, resultApiDao, isContinue);
206206
}
207207
final Handler handler = new Handler(Looper.getMainLooper());
208208
handler.postDelayed(() -> {
209-
updateInterviewSelectedAnswer(currentInterview1, resultApiDao);
209+
updateInterviewSelectedAnswer(currentInterview1, resultApiDao, isContinue);
210210
}, 2000);
211211

212212
if (currentInterview.getCompany() != null) {
@@ -367,7 +367,7 @@ public void saveInterview(InterviewApiDao interview, String token, String interv
367367
}
368368
}
369369

370-
private void updateInterviewSelectedAnswer(InterviewApiDao interview, InterviewResultApiDao interviewResultApiDao) {
370+
private void updateInterviewSelectedAnswer(InterviewApiDao interview, InterviewResultApiDao interviewResultApiDao, Boolean isContinue) {
371371
if (!isSectionInterview()) {
372372
updateQuestionInfo(interviewResultApiDao.getInformation().getInterviewIndex(), interviewResultApiDao.getInformation().getInterviewSubIndex(), interviewResultApiDao.getInformation().getInterviewAttempt());
373373
} else {
@@ -453,6 +453,9 @@ private void updateInterviewSelectedAnswer(InterviewApiDao interview, InterviewR
453453
clearSelectedAnswer(section.getSample_question());
454454
}
455455

456+
if (!isContinue) {
457+
section.setDurationSection(section.getDuration());
458+
}
456459
if (i == interviewResultApiDao.getInformation().getSectionIndex() && interviewResultApiDao.getInformation().getSectionInfo().equals("start")) {
457460
if (section.getPreparationTime() >= interviewResultApiDao.getInformation().getPreparationTime() && interviewResultApiDao.getInformation().getPreparationTime() > 0) {
458461
section.setPreparationTime(interviewResultApiDao.getInformation().getPreparationTime());
@@ -553,7 +556,7 @@ private void updateInterviewSelectedAnswer(InterviewApiDao interview, InterviewR
553556
realm.copyToRealmOrUpdate(interview);
554557
realm.commitTransaction();
555558
} else {
556-
updateInterviewSelectedAnswer(interview, interviewResultApiDao);
559+
updateInterviewSelectedAnswer(interview, interviewResultApiDao, isContinue);
557560
}
558561
}
559562

qasdk/src/main/java/co/astrnt/qasdk/dao/SectionApiDao.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ public class SectionApiDao extends RealmObject {
1717
private String type; //SectionType
1818
private String sub_type;
1919
private int duration;
20+
private int duration_section;
2021
private int preparation_time;
2122
private int preparation_time_api;
2223
private boolean randomize;
@@ -94,6 +95,14 @@ public void setDuration(int duration) {
9495
this.duration = duration;
9596
}
9697

98+
public int getDurationSection() {
99+
return duration_section;
100+
}
101+
102+
public void setDurationSection(int duration_section) {
103+
this.duration_section = duration_section;
104+
}
105+
97106
public int getPreparationTime() {
98107
return preparation_time;
99108
}

0 commit comments

Comments
 (0)