chen
|
@ -2,6 +2,5 @@
|
||||||
<project version="4">
|
<project version="4">
|
||||||
<component name="VcsDirectoryMappings">
|
<component name="VcsDirectoryMappings">
|
||||||
<mapping directory="" vcs="Git" />
|
<mapping directory="" vcs="Git" />
|
||||||
<mapping directory="$PROJECT_DIR$/frontend" vcs="Git" />
|
|
||||||
</component>
|
</component>
|
||||||
</project>
|
</project>
|
|
@ -1,47 +1,7 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<project version="4">
|
<project version="4">
|
||||||
<component name="ChangeListManager">
|
<component name="ChangeListManager">
|
||||||
<list default="true" id="90d49d24-cd7e-4f14-b075-c6e5fe5ae2ce" name="Default Changelist" comment="">
|
<list default="true" id="90d49d24-cd7e-4f14-b075-c6e5fe5ae2ce" name="Default Changelist" comment="" />
|
||||||
<change afterPath="$PROJECT_DIR$/.idea/.gitignore" afterDir="false" />
|
|
||||||
<change afterPath="$PROJECT_DIR$/.idea/compiler.xml" afterDir="false" />
|
|
||||||
<change afterPath="$PROJECT_DIR$/.idea/encodings.xml" afterDir="false" />
|
|
||||||
<change afterPath="$PROJECT_DIR$/.idea/misc.xml" afterDir="false" />
|
|
||||||
<change afterPath="$PROJECT_DIR$/.idea/modules.xml" afterDir="false" />
|
|
||||||
<change afterPath="$PROJECT_DIR$/.idea/openscore.iml" afterDir="false" />
|
|
||||||
<change afterPath="$PROJECT_DIR$/.idea/vcs.xml" afterDir="false" />
|
|
||||||
<change afterPath="$PROJECT_DIR$/controllers/administrator.go" afterDir="false" />
|
|
||||||
<change afterPath="$PROJECT_DIR$/controllers/supervisor.go" afterDir="false" />
|
|
||||||
<change afterPath="$PROJECT_DIR$/font/msyh.ttc" afterDir="false" />
|
|
||||||
<change afterPath="$PROJECT_DIR$/font/msyhbd.ttc" afterDir="false" />
|
|
||||||
<change afterPath="$PROJECT_DIR$/font/msyhl.ttc" afterDir="false" />
|
|
||||||
<change afterPath="$PROJECT_DIR$/font/simhei.ttf" afterDir="false" />
|
|
||||||
<change afterPath="$PROJECT_DIR$/font/simkai.ttf" afterDir="false" />
|
|
||||||
<change afterPath="$PROJECT_DIR$/font/simsun.ttc" afterDir="false" />
|
|
||||||
<change afterPath="$PROJECT_DIR$/models/subject.go" afterDir="false" />
|
|
||||||
<change afterPath="$PROJECT_DIR$/requests/admin.go" afterDir="false" />
|
|
||||||
<change afterPath="$PROJECT_DIR$/requests/supervisor.go" afterDir="false" />
|
|
||||||
<change afterPath="$PROJECT_DIR$/responses/admin.go" afterDir="false" />
|
|
||||||
<change afterPath="$PROJECT_DIR$/responses/supervisor.go" afterDir="false" />
|
|
||||||
<change afterPath="$PROJECT_DIR$/test.xlsx" afterDir="false" />
|
|
||||||
<change afterPath="$PROJECT_DIR$/test1.xlsm" afterDir="false" />
|
|
||||||
<change beforePath="$PROJECT_DIR$/conf/mysql.conf" beforeDir="false" afterPath="$PROJECT_DIR$/conf/mysql.conf" afterDir="false" />
|
|
||||||
<change beforePath="$PROJECT_DIR$/controllers/base.go" beforeDir="false" afterPath="$PROJECT_DIR$/controllers/base.go" afterDir="false" />
|
|
||||||
<change beforePath="$PROJECT_DIR$/controllers/score.go" beforeDir="false" afterPath="$PROJECT_DIR$/controllers/score.go" afterDir="false" />
|
|
||||||
<change beforePath="$PROJECT_DIR$/go.mod" beforeDir="false" afterPath="$PROJECT_DIR$/go.mod" afterDir="false" />
|
|
||||||
<change beforePath="$PROJECT_DIR$/go.sum" beforeDir="false" afterPath="$PROJECT_DIR$/go.sum" afterDir="false" />
|
|
||||||
<change beforePath="$PROJECT_DIR$/lastupdate.tmp" beforeDir="false" afterPath="$PROJECT_DIR$/lastupdate.tmp" afterDir="false" />
|
|
||||||
<change beforePath="$PROJECT_DIR$/main.go" beforeDir="false" afterPath="$PROJECT_DIR$/main.go" afterDir="false" />
|
|
||||||
<change beforePath="$PROJECT_DIR$/models/base.go" beforeDir="false" afterPath="$PROJECT_DIR$/models/base.go" afterDir="false" />
|
|
||||||
<change beforePath="$PROJECT_DIR$/models/paperDistribution.go" beforeDir="false" afterPath="$PROJECT_DIR$/models/paperDistribution.go" afterDir="false" />
|
|
||||||
<change beforePath="$PROJECT_DIR$/models/scoreRecord.go" beforeDir="false" afterPath="$PROJECT_DIR$/models/scoreRecord.go" afterDir="false" />
|
|
||||||
<change beforePath="$PROJECT_DIR$/models/subTopic.go" beforeDir="false" afterPath="$PROJECT_DIR$/models/subTopic.go" afterDir="false" />
|
|
||||||
<change beforePath="$PROJECT_DIR$/models/testPaper.go" beforeDir="false" afterPath="$PROJECT_DIR$/models/testPaper.go" afterDir="false" />
|
|
||||||
<change beforePath="$PROJECT_DIR$/models/testPaperInfo.go" beforeDir="false" afterPath="$PROJECT_DIR$/models/testPaperInfo.go" afterDir="false" />
|
|
||||||
<change beforePath="$PROJECT_DIR$/models/topic.go" beforeDir="false" afterPath="$PROJECT_DIR$/models/topic.go" afterDir="false" />
|
|
||||||
<change beforePath="$PROJECT_DIR$/models/underCorrectedPaper.go" beforeDir="false" afterPath="$PROJECT_DIR$/models/underCorrectedPaper.go" afterDir="false" />
|
|
||||||
<change beforePath="$PROJECT_DIR$/models/user.go" beforeDir="false" afterPath="$PROJECT_DIR$/models/user.go" afterDir="false" />
|
|
||||||
<change beforePath="$PROJECT_DIR$/routers/router.go" beforeDir="false" afterPath="$PROJECT_DIR$/routers/router.go" afterDir="false" />
|
|
||||||
</list>
|
|
||||||
<option name="SHOW_DIALOG" value="false" />
|
<option name="SHOW_DIALOG" value="false" />
|
||||||
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
||||||
<option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
|
<option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
|
||||||
|
@ -108,7 +68,6 @@
|
||||||
</option>
|
</option>
|
||||||
</component>
|
</component>
|
||||||
<component name="ProjectId" id="1wGQ5od5FlSdqjEXHsUm5X5Fmj6" />
|
<component name="ProjectId" id="1wGQ5od5FlSdqjEXHsUm5X5Fmj6" />
|
||||||
<component name="ProjectLevelVcsManager" settingsEditedManually="true" />
|
|
||||||
<component name="ProjectViewState">
|
<component name="ProjectViewState">
|
||||||
<option name="showLibraryContents" value="true" />
|
<option name="showLibraryContents" value="true" />
|
||||||
</component>
|
</component>
|
||||||
|
@ -158,6 +117,11 @@
|
||||||
<filePath value="$PROJECT_DIR$/main.go" />
|
<filePath value="$PROJECT_DIR$/main.go" />
|
||||||
<method v="2" />
|
<method v="2" />
|
||||||
</configuration>
|
</configuration>
|
||||||
|
<recent_temporary>
|
||||||
|
<list>
|
||||||
|
<item itemvalue="Go Build.go build openscore" />
|
||||||
|
</list>
|
||||||
|
</recent_temporary>
|
||||||
</component>
|
</component>
|
||||||
<component name="SpellCheckerSettings" RuntimeDictionaries="0" Folders="0" CustomDictionaries="0" DefaultDictionary="application-level" UseSingleDictionary="true" transferred="true" />
|
<component name="SpellCheckerSettings" RuntimeDictionaries="0" Folders="0" CustomDictionaries="0" DefaultDictionary="application-level" UseSingleDictionary="true" transferred="true" />
|
||||||
<component name="SvnConfiguration">
|
<component name="SvnConfiguration">
|
||||||
|
@ -171,7 +135,6 @@
|
||||||
<option name="presentableId" value="Default" />
|
<option name="presentableId" value="Default" />
|
||||||
<updated>1628082264190</updated>
|
<updated>1628082264190</updated>
|
||||||
<workItem from="1628082267172" duration="70000" />
|
<workItem from="1628082267172" duration="70000" />
|
||||||
<workItem from="1630225901722" duration="22000" />
|
|
||||||
</task>
|
</task>
|
||||||
<servers />
|
<servers />
|
||||||
</component>
|
</component>
|
||||||
|
@ -215,6 +178,7 @@
|
||||||
<configuration name="GoApplicationRunConfiguration">
|
<configuration name="GoApplicationRunConfiguration">
|
||||||
<watch expression="*(*"[]string")(824637671088)" />
|
<watch expression="*(*"[]string")(824637671088)" />
|
||||||
<watch expression="*(*"[]string")(824637671088)" />
|
<watch expression="*(*"[]string")(824637671088)" />
|
||||||
|
<watch expression="*(*"openscore/models.Topic")(824635395360)" />
|
||||||
</configuration>
|
</configuration>
|
||||||
</watches-manager>
|
</watches-manager>
|
||||||
</component>
|
</component>
|
||||||
|
|
|
@ -140,9 +140,20 @@ func (c *AdminApiController) ReadExcel(){
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
//supervisorId := requestBody.SupervisorId
|
//supervisorId := requestBody.SupervisorId
|
||||||
failPath := requestBody.FilePath
|
// filePath := requestBody.FilePath
|
||||||
|
bytes := requestBody.Excel
|
||||||
//----------------------------------------------------
|
//----------------------------------------------------
|
||||||
f, err := excelize.OpenFile(failPath)
|
|
||||||
|
|
||||||
|
|
||||||
|
//bytes, err := os.ReadFile(filePath)
|
||||||
|
|
||||||
|
|
||||||
|
file, err := os.Create("excelFile")
|
||||||
|
file.Write(bytes)
|
||||||
|
|
||||||
|
|
||||||
|
f, err := excelize.OpenFile("excelFile")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Println(err)
|
fmt.Println(err)
|
||||||
return
|
return
|
||||||
|
@ -206,6 +217,9 @@ func (c *AdminApiController) ReadExcel(){
|
||||||
topic.Import_number=int64(len(rows)-1)
|
topic.Import_number=int64(len(rows)-1)
|
||||||
topic.Update()
|
topic.Update()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
file.Close()
|
||||||
|
os.Remove("excelFile")
|
||||||
//------------------------------------------------
|
//------------------------------------------------
|
||||||
data := make(map[string]interface{})
|
data := make(map[string]interface{})
|
||||||
data["data"] =nil
|
data["data"] =nil
|
||||||
|
@ -554,13 +568,10 @@ func (c *AdminApiController) Distribution(){
|
||||||
8.图片显示
|
8.图片显示
|
||||||
*/
|
*/
|
||||||
func (c *AdminApiController) Pic() {
|
func (c *AdminApiController) Pic() {
|
||||||
|
|
||||||
defer c.ServeJSON()
|
defer c.ServeJSON()
|
||||||
var requestBody requests.ReadFile
|
var requestBody requests.ReadFile
|
||||||
var resp Response
|
var resp Response
|
||||||
var err error
|
var err error
|
||||||
|
|
||||||
|
|
||||||
err =json.Unmarshal(c.Ctx.Input.RequestBody, &requestBody)
|
err =json.Unmarshal(c.Ctx.Input.RequestBody, &requestBody)
|
||||||
if err!=nil {
|
if err!=nil {
|
||||||
resp = Response{"10001","cannot unmarshal",err}
|
resp = Response{"10001","cannot unmarshal",err}
|
||||||
|
@ -612,3 +623,115 @@ func cutUser(oldData []models.User, n int) (newData[]models.User) {
|
||||||
}
|
}
|
||||||
return newData1
|
return newData1
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
9.大题展示列表
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
func (c *AdminApiController) TopicList() {
|
||||||
|
defer c.ServeJSON()
|
||||||
|
var requestBody requests.TopicList
|
||||||
|
var resp Response
|
||||||
|
var err error
|
||||||
|
|
||||||
|
err =json.Unmarshal(c.Ctx.Input.RequestBody, &requestBody)
|
||||||
|
if err!=nil {
|
||||||
|
resp = Response{"10001","cannot unmarshal",err}
|
||||||
|
c.Data["json"] = resp
|
||||||
|
return
|
||||||
|
}
|
||||||
|
//supervisorId := requestBody.SupervisorId
|
||||||
|
|
||||||
|
//----------------------------------------------------
|
||||||
|
//获取大题列表
|
||||||
|
topics := make([]models.Topic,0)
|
||||||
|
err = models.FindTopicList(&topics)
|
||||||
|
if err!=nil {
|
||||||
|
resp = Response{"0000","FindTopicList err ",err}
|
||||||
|
c.Data["json"] = resp
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
var topicVOList = make([]responses.TopicVO,len(topics))
|
||||||
|
for i := 0; i < len(topics); i++ {
|
||||||
|
|
||||||
|
topicVOList[i].SubjectName=topics[i].Subject_name
|
||||||
|
topicVOList[i].TopicName=topics[i].Question_name
|
||||||
|
topicVOList[i].Score=topics[i].Question_score
|
||||||
|
topicVOList[i].StandardError=topics[i].Standard_error
|
||||||
|
topicVOList[i].ScoreType=topics[i].Score_type
|
||||||
|
topicVOList[i].TopicId=topics[i].Question_id
|
||||||
|
topicVOList[i].ImportTime=topics[i].Import_time
|
||||||
|
|
||||||
|
subTopics := make([]models.SubTopic, 0)
|
||||||
|
models.FindSubTopicsByQuestionId(topics[i].Question_id,&subTopics)
|
||||||
|
subTopicVOS := make([]responses.SubTopicVO, len(subTopics))
|
||||||
|
for j:=0;j<len(subTopics);j++ {
|
||||||
|
subTopicVOS[j].SubTopicId=subTopics[j].Question_detail_id
|
||||||
|
subTopicVOS[j].SubTopicName=subTopics[j].Question_detail_name
|
||||||
|
subTopicVOS[j].Score=subTopics[j].Question_detail_score
|
||||||
|
subTopicVOS[j].ScoreDistribution=subTopics[j].Score_type
|
||||||
|
}
|
||||||
|
topicVOList[i].SubTopicVOList=subTopicVOS
|
||||||
|
}
|
||||||
|
|
||||||
|
//----------------------------------------------------
|
||||||
|
data := make(map[string]interface{})
|
||||||
|
data["topicVOList"] =topicVOList
|
||||||
|
resp = Response{"10000", "OK", data}
|
||||||
|
c.Data["json"] = resp
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
DistributionRecord
|
||||||
|
*/
|
||||||
|
func (c *AdminApiController) DistributionRecord() {
|
||||||
|
defer c.ServeJSON()
|
||||||
|
var requestBody requests.DistributionRecord
|
||||||
|
var resp Response
|
||||||
|
var err error
|
||||||
|
|
||||||
|
err =json.Unmarshal(c.Ctx.Input.RequestBody, &requestBody)
|
||||||
|
if err!=nil {
|
||||||
|
resp = Response{"10001","cannot unmarshal",err}
|
||||||
|
c.Data["json"] = resp
|
||||||
|
return
|
||||||
|
}
|
||||||
|
//supervisorId := requestBody.SupervisorId
|
||||||
|
subjectName := requestBody.SubjectName
|
||||||
|
//----------------------------------------------------
|
||||||
|
//获取大题列表
|
||||||
|
topics := make([]models.Topic,0)
|
||||||
|
err = models.FindTopicBySubNameList(&topics,subjectName)
|
||||||
|
if err!=nil {
|
||||||
|
resp = Response{"30003","FindTopicBySubNameList err ",err}
|
||||||
|
c.Data["json"] = resp
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
var distributionRecordList = make([]responses.DistributionRecordVO,len(topics))
|
||||||
|
for i := 0; i < len(topics); i++ {
|
||||||
|
|
||||||
|
distributionRecordList[i].TopicId=topics[i].Question_id
|
||||||
|
distributionRecordList[i].TopicName=topics[i].Question_name
|
||||||
|
distributionRecordList[i].ImportNumber=topics[i].Import_number
|
||||||
|
distributionTestNumber,err1 :=models.CountTestDistributionNumberByQuestionId(topics[i].Question_id)
|
||||||
|
fmt.Println(err1)
|
||||||
|
distributionUserNumber ,err1:=models.CountUserDistributionNumberByQuestionId(topics[i].Question_id)
|
||||||
|
fmt.Println(err1)
|
||||||
|
distributionRecordList[i].DistributionUserNumber=distributionUserNumber
|
||||||
|
distributionRecordList[i].DistributionTestNumber=distributionTestNumber
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
//----------------------------------------------------
|
||||||
|
data := make(map[string]interface{})
|
||||||
|
data["distributionRecordList"] =distributionRecordList
|
||||||
|
resp = Response{"10000", "OK", data}
|
||||||
|
c.Data["json"] = resp
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
After Width: | Height: | Size: 9.3 KiB |
After Width: | Height: | Size: 12 KiB |
After Width: | Height: | Size: 36 KiB |
After Width: | Height: | Size: 19 KiB |
After Width: | Height: | Size: 28 KiB |
After Width: | Height: | Size: 18 KiB |
After Width: | Height: | Size: 5.2 KiB |
After Width: | Height: | Size: 17 KiB |
After Width: | Height: | Size: 21 KiB |
After Width: | Height: | Size: 28 KiB |
After Width: | Height: | Size: 15 KiB |
After Width: | Height: | Size: 20 KiB |
After Width: | Height: | Size: 27 KiB |
After Width: | Height: | Size: 16 KiB |
After Width: | Height: | Size: 16 KiB |
After Width: | Height: | Size: 16 KiB |
After Width: | Height: | Size: 43 KiB |
After Width: | Height: | Size: 30 KiB |
|
@ -1 +1 @@
|
||||||
{"C:\\Users\\yang\\Desktop\\阅卷系统\\controllers":1630909324148193300}
|
{"C:\\Users\\chen\\go\\src\\openscore\\controllers":1631259834015725200}
|
|
@ -36,4 +36,12 @@ func (u *PaperDistribution) Save() error {
|
||||||
log.Println(err)
|
log.Println(err)
|
||||||
}
|
}
|
||||||
return err
|
return err
|
||||||
|
}
|
||||||
|
func CountUserDistributionNumberByQuestionId(questionId int64)(count int64,err error) {
|
||||||
|
paperDistribution :=new (PaperDistribution)
|
||||||
|
count, err1 := x.Where("question_id = ?", questionId).Count(paperDistribution)
|
||||||
|
if err!=nil {
|
||||||
|
log.Println("countUserDistributionNumberByQuestionId err ")
|
||||||
|
}
|
||||||
|
return count ,err1
|
||||||
}
|
}
|
|
@ -44,6 +44,14 @@ func GetLatestRecords(userId string, records *[]ScoreRecord) error {
|
||||||
|
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
func CountProblemFinishNumberByQuestionId(questionId int64)(count int64,err error) {
|
||||||
|
record :=new (ScoreRecord)
|
||||||
|
count, err1 := x.Where("question_id = ?", questionId).Where("test_record_type=?",6).Count(record)
|
||||||
|
if err!=nil {
|
||||||
|
log.Println("CountProblemFinishNumberByQuestionId err ")
|
||||||
|
}
|
||||||
|
return count,err1
|
||||||
|
}
|
||||||
func CountSelfScore(userId string,questionId int64)(count int64,err error) {
|
func CountSelfScore(userId string,questionId int64)(count int64,err error) {
|
||||||
record :=new (ScoreRecord)
|
record :=new (ScoreRecord)
|
||||||
count, err1 := x.Where("question_id = ?", questionId).Where("test_record_type=0").Where("user_id=?", userId).Count(record)
|
count, err1 := x.Where("question_id = ?", questionId).Where("test_record_type=0").Where("user_id=?", userId).Count(record)
|
||||||
|
|
|
@ -14,7 +14,7 @@ type SubTopic struct {
|
||||||
Score_type string `json:"score_type"`
|
Score_type string `json:"score_type"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func GetSubTopicsByQuestionId(id int64, st *[]SubTopic) error {
|
func FindSubTopicsByQuestionId(id int64, st *[]SubTopic) error {
|
||||||
err := x.Where("question_id = ?", id).Find(st)
|
err := x.Where("question_id = ?", id).Find(st)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Println("could not find any SubTopic")
|
log.Println("could not find any SubTopic")
|
||||||
|
|
|
@ -70,14 +70,7 @@ func (t *TestPaper) Insert() error {
|
||||||
}
|
}
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
func CountProblemFinishNumberByQuestionId(questionId int64)(count int64,err error) {
|
|
||||||
record :=new (ScoreRecord)
|
|
||||||
count, err1 := x.Where("question_id = ?", questionId).Where("test_record_type=?",6).Count(record)
|
|
||||||
if err!=nil {
|
|
||||||
log.Println("CountProblemFinishNumberByQuestionId err ")
|
|
||||||
}
|
|
||||||
return count,err1
|
|
||||||
}
|
|
||||||
func FindTestPaperByQuestionId(question_id int64, t *[]TestPaper) error {
|
func FindTestPaperByQuestionId(question_id int64, t *[]TestPaper) error {
|
||||||
err := x.Where("question_id = ? and correcting_status = ?", question_id, 0).Find(t)
|
err := x.Where("question_id = ? and correcting_status = ?", question_id, 0).Find(t)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -92,4 +85,14 @@ func FindUnDistributeTest(id int64 , t*[]TestPaper) error {
|
||||||
log.Println("could not GetUnDistributeTest")
|
log.Println("could not GetUnDistributeTest")
|
||||||
}
|
}
|
||||||
return err
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
func CountTestDistributionNumberByQuestionId(questionId int64)(count int64,err error) {
|
||||||
|
testPaper :=new (TestPaper)
|
||||||
|
count, err1 := x.Where("question_id = ?", questionId).Where("correcting_status=?",1).Count(testPaper)
|
||||||
|
if err!=nil {
|
||||||
|
log.Println("CountTestDistributionNumberByQuestionId err ")
|
||||||
|
}
|
||||||
|
return count,err1
|
||||||
}
|
}
|
|
@ -52,6 +52,13 @@ func FindTopicBySubNameList ( topics *[]Topic,subjectName string) error{
|
||||||
}
|
}
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
func FindTopicList ( topics *[]Topic) error{
|
||||||
|
err := x.Find(topics)
|
||||||
|
if err!=nil {
|
||||||
|
log.Println("FindTopicList err ")
|
||||||
|
}
|
||||||
|
return err
|
||||||
|
}
|
||||||
func InsertTopic ( topic *Topic)(err1 error,questionId int64) {
|
func InsertTopic ( topic *Topic)(err1 error,questionId int64) {
|
||||||
_,err:= x.Insert(topic)
|
_,err:= x.Insert(topic)
|
||||||
if err!=nil {
|
if err!=nil {
|
||||||
|
|
|
@ -1,45 +1,58 @@
|
||||||
package requests
|
package requests
|
||||||
|
|
||||||
type AddTopic struct {
|
type AddTopic struct {
|
||||||
AdminId string `joson:"adminId"`
|
AdminId string `json:"adminId"`
|
||||||
TopicName string `joson:"topicName"`
|
TopicName string `json:"topicName"`
|
||||||
ScoreType int64 `joson:"scoreType"`
|
ScoreType int64 `json:"scoreType"`
|
||||||
Score int64 `joson:"score"`
|
Score int64 `json:"score"`
|
||||||
Error int64 `joson:"error"`
|
Error int64 `json:"error"`
|
||||||
SubjectName string `joson:"subjectName"`
|
SubjectName string `json:"subjectName"`
|
||||||
TopicDetails []AddTopicDetail `joson:"topicDetails"`
|
TopicDetails []AddTopicDetail `json:"topicDetails"`
|
||||||
}
|
}
|
||||||
type AddTopicDetail struct {
|
type AddTopicDetail struct {
|
||||||
TopicDetailName string `joson:"topicDetailName"`
|
TopicDetailName string `json:"topicDetailName"`
|
||||||
DetailScoreTypes string `joson:"DetailScoreTypes"`
|
DetailScoreTypes string `json:"DetailScoreTypes"`
|
||||||
DetailScore int64 `joson:"detailScore"`
|
DetailScore int64 `json:"detailScore"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type SubjectList struct {
|
type SubjectList struct {
|
||||||
AdminId string `joson:"adminId"`
|
AdminId string `json:"adminId"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type QuestionBySubList struct {
|
type QuestionBySubList struct {
|
||||||
AdminId string `joson:"adminId"`
|
AdminId string `json:"adminId"`
|
||||||
SubjectName string `json:"subjectName"`
|
SubjectName string `json:"subjectName"`
|
||||||
}
|
}
|
||||||
type DistributionInfo struct {
|
type DistributionInfo struct {
|
||||||
AdminId string `joson:"adminId"`
|
AdminId string `json:"adminId"`
|
||||||
QuestionId int64 `json:"questionId"`
|
QuestionId int64 `json:"questionId"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type Distribution struct {
|
type Distribution struct {
|
||||||
AdminId string `joson:"adminId"`
|
AdminId string `json:"adminId"`
|
||||||
QuestionId int64 `json:"questionId"`
|
QuestionId int64 `json:"questionId"`
|
||||||
TestNumber int `json:"testNumber"`
|
TestNumber int `json:"testNumber"`
|
||||||
UserNumber int `json:"userNumber"`
|
UserNumber int `json:"userNumber"`
|
||||||
|
|
||||||
}
|
}
|
||||||
type ReadExcel struct {
|
type ReadExcel struct {
|
||||||
AdminId string `joson:"adminId"`
|
AdminId string `json:"adminId"`
|
||||||
FilePath string `json:"filePath"`
|
// FilePath string `json:"filePath"`
|
||||||
|
|
||||||
|
Excel []byte `json:"excel"`
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
type ReadFile struct {
|
type ReadFile struct {
|
||||||
PicName string `json:"picName"`
|
PicName string `json:"picName"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type TopicList struct {
|
||||||
|
AdminId string `json:"adminId"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type DistributionRecord struct {
|
||||||
|
AdminId string `json:"adminId"`
|
||||||
|
SubjectName string `json:"subjectName"`
|
||||||
|
}
|
|
@ -1,4 +1,9 @@
|
||||||
package responses
|
package responses
|
||||||
|
|
||||||
|
import (
|
||||||
|
"time"
|
||||||
|
)
|
||||||
|
|
||||||
type AddTopicVO struct {
|
type AddTopicVO struct {
|
||||||
QuestionId int64
|
QuestionId int64
|
||||||
QuestionDetailIds []AddTopicDetailVO
|
QuestionDetailIds []AddTopicDetailVO
|
||||||
|
@ -19,3 +24,26 @@ type DistributionInfoVO struct {
|
||||||
ImportTestNumber int64
|
ImportTestNumber int64
|
||||||
OnlineNumber int64
|
OnlineNumber int64
|
||||||
}
|
}
|
||||||
|
type TopicVO struct {
|
||||||
|
TopicId int64
|
||||||
|
SubjectName string
|
||||||
|
TopicName string
|
||||||
|
Score int64
|
||||||
|
StandardError int64
|
||||||
|
ScoreType int64
|
||||||
|
ImportTime time.Time
|
||||||
|
SubTopicVOList []SubTopicVO
|
||||||
|
}
|
||||||
|
type SubTopicVO struct {
|
||||||
|
SubTopicId int64
|
||||||
|
SubTopicName string
|
||||||
|
Score int64
|
||||||
|
ScoreDistribution string
|
||||||
|
}
|
||||||
|
type DistributionRecordVO struct {
|
||||||
|
TopicId int64
|
||||||
|
TopicName string
|
||||||
|
ImportNumber int64
|
||||||
|
DistributionTestNumber int64
|
||||||
|
DistributionUserNumber int64
|
||||||
|
}
|
||||||
|
|
|
@ -58,6 +58,8 @@ func init() {
|
||||||
beego.Router("/openct/marking/admin/questionBySubList",&controllers.AdminApiController{},"post:QuestionBySubList")
|
beego.Router("/openct/marking/admin/questionBySubList",&controllers.AdminApiController{},"post:QuestionBySubList")
|
||||||
beego.Router("/openct/marking/admin/insertTopic",&controllers.AdminApiController{},"post:InsertTopic")
|
beego.Router("/openct/marking/admin/insertTopic",&controllers.AdminApiController{},"post:InsertTopic")
|
||||||
beego.Router("/openct/marking/admin/subjectList",&controllers.AdminApiController{},"post:SubjectList")
|
beego.Router("/openct/marking/admin/subjectList",&controllers.AdminApiController{},"post:SubjectList")
|
||||||
|
beego.Router("/openct/marking/admin/topicList",&controllers.AdminApiController{},"post:TopicList")
|
||||||
|
beego.Router("/openct/marking/admin/DistributionRecord",&controllers.AdminApiController{},"post:DistributionRecord")
|
||||||
|
|
||||||
beego.Router("/openct/marking/admin/img",&controllers.AdminApiController{},"post:Pic")
|
beego.Router("/openct/marking/admin/img",&controllers.AdminApiController{},"post:Pic")
|
||||||
|
|
||||||
|
|