fix : supervisor

This commit is contained in:
chenh1 2021-09-23 14:50:17 +08:00
parent 7b13898924
commit ad12ccb7e3
5 changed files with 7 additions and 5 deletions

View File

@ -3,9 +3,8 @@
<component name="ChangeListManager">
<list default="true" id="90d49d24-cd7e-4f14-b075-c6e5fe5ae2ce" name="Default Changelist" comment="">
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/controllers/supervisor.go" beforeDir="false" afterPath="$PROJECT_DIR$/controllers/supervisor.go" afterDir="false" />
<change beforePath="$PROJECT_DIR$/lastupdate.tmp" beforeDir="false" afterPath="$PROJECT_DIR$/lastupdate.tmp" afterDir="false" />
<change beforePath="$PROJECT_DIR$/models/scoreRecord.go" beforeDir="false" afterPath="$PROJECT_DIR$/models/scoreRecord.go" afterDir="false" />
<change beforePath="$PROJECT_DIR$/models/topic.go" beforeDir="false" afterPath="$PROJECT_DIR$/models/topic.go" afterDir="false" />
<change beforePath="$PROJECT_DIR$/requests/test.go" beforeDir="false" afterPath="$PROJECT_DIR$/requests/test.go" afterDir="false" />
</list>
<option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" />

View File

@ -321,6 +321,7 @@ func (c *TestPaperApiController) Problem() {
userId := requestBody.UserId
problemType := requestBody.ProblemType
testId := requestBody.TestId
problemMessage := requestBody.ProblemMessage
var underTest models.UnderCorrectedPaper
var record models.ScoreRecord
@ -343,6 +344,7 @@ func (c *TestPaperApiController) Problem() {
newUnderTest.User_id = userId
newUnderTest.Test_question_type = 6
newUnderTest.Problem_type = problemType
newUnderTest.Problem_message=problemMessage
has, _ := newUnderTest.IsDuplicate()
if !has {
err = newUnderTest.Save()

View File

@ -1 +1 @@
{"C:\\Users\\chen\\go\\src\\open-ct\\controllers":1632375752562273700}
{"C:\\Users\\chen\\go\\src\\open-ct\\controllers":1632377189519465100}

View File

@ -31,7 +31,7 @@ func (t *Topic) GetTopic(id int64) error {
}
func GetDistributedTestIdPaperByUserId(id string, up *[]int64) error {
err := x.Table("under_corrected_paper").Select("test_id").Where("user_id = ?", id).Find(up)
err := x.Table("under_corrected_paper").Select("test_id").Where("user_id = ?", id).Where("test_question_type=1 or test_question_type=2 or test_question_type=3").Find(up)
if err != nil {
log.Panic(err)
log.Println("could not find any paper")

View File

@ -20,6 +20,7 @@ type TestProblem struct {
UserId string `json:"userId"`
ProblemType int64 `json:"problemType"`
TestId int64 `json:"testId"`
ProblemMessage string `json:"problemMessage"`
}
type TestAnswer struct {