단계별 학습기록 조회

Platform.api.loadStepRecords()

현재 실행 중인 콘텐츠의 저장된 단계별 학습기록 목록을 조회한다. 이때 응답된 목록은 저장 시간 최근 순이다. 응답이 사용 가능해지면 이행하는 Promise를 반환한다.

구문

Platform.api.loadStepRecords(condition)
Platform.api.loadStepRecords(condition, [mock])

매개변수

  • condition
    학습기록 정보 조회 조건 Object
    • stepNo:{Integer} 조회하려는 단계.
  • mock [선택]
    개발시 응답으로 받을 값. 서비스에 배포된 후에는 무시된다.
    • 성공 또는 실패값. 아래 반환 값 참조.

반환 값

응답 객체로 이행하는 Promise 객체.

성공 시

  • result: {String} "SUCCESS"
  • data: {Array<Object>} 저장 결과값
    • totalStepNo:{Integer}전체 단계 수. 1 이상.
    • stepNo:{Integer} 현재 단계 수. 1 ~ 전체단계 수
    • stepName: {String} 현재 단계 이름.
    • point: {Integer} 100점 환산 점수. 0~100
    • score: {Float} 콘텐츠별 랭킹 산정을 위한 값. 0 이상.
    • displayScore: {String} 랭킹 목록에 보여지는 스코어에 대한 포맷팅된 값.
    • saveTime: {Integer} 저장된 일시를 의미하는 timestamp 값.

실패 시

  • result: {String} "FAIL"
  • message: {String} 오류 내용
  • help: {String} 도움말. 없을 수 있음.

예제

Platform.api.getStepRecords({
   step: 3
}).then(function(resposne) {
   if (response.result != 'SUCCESS') {
      alert(response.message || '조회에 실패하였습니다.');
      return;
   }
   
   var data = response.data;
   console.log('총 %d개의 학습 기록이 있습니다.', data.length);
   console.log('[학습기록]');
   data.forEach(function(record) {
      console.log('%위 %s님 (%f점)', ranking.rank, ranking.nickname, ranking.score);
   });
});

2023. 5. 12 오후 5:34:05 편집