package cn.reghao.tnb.content.app.exam.controller;

import cn.reghao.jutil.web.WebResult;
import io.swagger.v3.oas.annotations.tags.Tag;
import io.swagger.v3.oas.annotations.Operation;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.ArrayList;
import java.util.List;

/**
 * @author reghao
 * @date 2024-08-29 09:47:56
 */
@Tag(name = "考试数据统计接口")
@RestController
@RequestMapping("/api/content/exam/statistic")
public class ExamStatisticController {
    @Operation(summary = "获取用户考试结果的统计数据", description = "N")
    @GetMapping(value = "/count", produces = MediaType.APPLICATION_JSON_VALUE)
    public String getExamCount() {
        List<String> list = new ArrayList<>();
        list.add("试卷1,试卷2,试卷3,试卷4,试卷4,试卷6,试卷7");
        list.add("8,4,1,8,0,0,0");
        return WebResult.success(list);
    }

    @Operation(summary = "获取用户的考试通过率", description = "N")
    @GetMapping(value = "/rate", produces = MediaType.APPLICATION_JSON_VALUE)
    public String getExamPassRate() {
        List<String> list = new ArrayList<>();
        list.add("试卷1,试卷2,试卷3,试卷4,试卷4,试卷6,试卷7");
        list.add("0.5,1.0,1.0,1.0,0.0,0.0,0.0");
        return WebResult.success(list);
    }
}
