import {Component, OnInit, ViewChild} from '@angular/core';
import { BsModalService } from 'ngx-bootstrap/modal';
import { AjaxService } from '../../../../core/service/ajax.service';
import { FramePageComponent } from '../../../frame/core/page/frame.page';
import { FrameService } from '../../../../core/service/frame.service';

@Component({
  selector: 'app-score-check',
  templateUrl: './score-check.component.html',
  styleUrls: ['./score-check.component.scss']
})
export class ScoreCheckComponent extends FramePageComponent implements OnInit {

  currStd;
  aspectMap;

  subjectArray = [];

  constructor(modalService: BsModalService) {
    super(modalService);
    for (let i = 1; i <= parseInt(FrameService.getParamValue('MaxJudgeNum', 7), 10); i++) {
      this.subjectArray.push({value: i, text: (i > 9 ? '' : '0') + i});
    }
  }

  ngOnInit() {
    // this.search.chooseStudent.subscribe((value:any)=>{
    //   console.log(value);
    // });
  }

  queryScore(std) {
    this.currStd = std;
    AjaxService.requestMap('score/check/std.htm', {std_id: std.std_id}, (map) => {
      this.aspectMap = map;
    });
  }

}
