Skip to content
Snippets Groups Projects
Unverified Commit 19832f18 authored by Cseh Viktor's avatar Cseh Viktor
Browse files

Lab number added

parent 8427abcd
No related branches found
No related tags found
No related merge requests found
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
|---|---| |---|---|
| id | Integer (auto) | | id | Integer (auto) |
| questionText | String | | questionText | String |
| lab | Int |
| answer1 | String | | answer1 | String |
| answer2 | String | | answer2 | String |
| answer3 | String | | answer3 | String |
...@@ -29,6 +30,7 @@ Returned data: `200 OK` ...@@ -29,6 +30,7 @@ Returned data: `200 OK`
"data": [ "data": [
{ {
"id": 1, "id": 1,
"lab": 1,
"questionText": "1.kerdes szövege", "questionText": "1.kerdes szövege",
"answer1": "Elso valaszlegetoseg", "answer1": "Elso valaszlegetoseg",
"answer2": "Masodik valaszlegetoseg", "answer2": "Masodik valaszlegetoseg",
...@@ -53,6 +55,7 @@ Returned data: `200 OK` ...@@ -53,6 +55,7 @@ Returned data: `200 OK`
{ {
"data": { "data": {
"id": 1, "id": 1,
"lab": 1,
"questionText": "1.kerdes szövege", "questionText": "1.kerdes szövege",
"answer1": "Elso valaszlegetoseg", "answer1": "Elso valaszlegetoseg",
"answer2": "Masodik valaszlegetoseg", "answer2": "Masodik valaszlegetoseg",
...@@ -73,6 +76,7 @@ Sent data in body: ...@@ -73,6 +76,7 @@ Sent data in body:
{ {
"data": { "data": {
"id": 1, "id": 1,
"lab": 1,
"questionText": "1.kerdes szövege", "questionText": "1.kerdes szövege",
"answer1": "Elso valaszlegetoseg", "answer1": "Elso valaszlegetoseg",
"answer2": "Masodik valaszlegetoseg", "answer2": "Masodik valaszlegetoseg",
...@@ -101,6 +105,7 @@ Sent data in body: ...@@ -101,6 +105,7 @@ Sent data in body:
```json ```json
{ {
"questionText": "x.kerdes szövege", "questionText": "x.kerdes szövege",
"lab": 1,
"answer1": "Elso valaszlegetoseg", "answer1": "Elso valaszlegetoseg",
"answer2": "Masodik valaszlegetoseg", "answer2": "Masodik valaszlegetoseg",
"answer3": "Harmadik valaszlegetoseg", "answer3": "Harmadik valaszlegetoseg",
......
...@@ -3,6 +3,7 @@ package models ...@@ -3,6 +3,7 @@ package models
type Question struct{ type Question struct{
//gorm.Model //gorm.Model
Id uint `gorm:"primaryKey;autoIncrement" json:"questionId"` Id uint `gorm:"primaryKey;autoIncrement" json:"questionId"`
Lab uint `gorm:"type:uint" json:"lab"`
QuestionText string `gorm:"type:text" json:"questionText"` QuestionText string `gorm:"type:text" json:"questionText"`
Answer1 string `gorm:"type:text" json:"answer1"` Answer1 string `gorm:"type:text" json:"answer1"`
Answer2 string `gorm:"type:text" json:"answer2"` Answer2 string `gorm:"type:text" json:"answer2"`
......
...@@ -9,6 +9,7 @@ import ( ...@@ -9,6 +9,7 @@ import (
type QuestionCreateStruct struct { type QuestionCreateStruct struct {
QuestionText string `gorm:"type:text" json:"questionText" binding:"required"` QuestionText string `gorm:"type:text" json:"questionText" binding:"required"`
Lab uint `gorm:"type:uint" json:"lab"`
Answer1 string `gorm:"type:text" json:"answer1" binding:"required"` Answer1 string `gorm:"type:text" json:"answer1" binding:"required"`
Answer2 string `gorm:"type:text" json:"answer2" binding:"required"` Answer2 string `gorm:"type:text" json:"answer2" binding:"required"`
Answer3 string `gorm:"type:text" json:"answer3" binding:"required"` Answer3 string `gorm:"type:text" json:"answer3" binding:"required"`
...@@ -18,6 +19,7 @@ type QuestionCreateStruct struct { ...@@ -18,6 +19,7 @@ type QuestionCreateStruct struct {
type QuestionUpdateStruct struct { type QuestionUpdateStruct struct {
QuestionText string `gorm:"type:text" json:"questionText"` QuestionText string `gorm:"type:text" json:"questionText"`
Lab uint `gorm:"type:uint" json:"lab"`
Answer1 string `gorm:"type:text" json:"answer1"` Answer1 string `gorm:"type:text" json:"answer1"`
Answer2 string `gorm:"type:text" json:"answer2"` Answer2 string `gorm:"type:text" json:"answer2"`
Answer3 string `gorm:"type:text" json:"answer3"` Answer3 string `gorm:"type:text" json:"answer3"`
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment