func (VS *Server) newProblem(c *gin.Context) {
	videoID, _ := VS.getIDParamFromURL(c, "id")
	product, _ := VS.getVideoCourseByID(c, videoID, "h_videos", "newProblem", "product, _ := VS.getVideoCourseByID", true)
	workerID, b := VS.getIDFromHTML(c, "workerID", "Purchase")
	if !b {
		return
	}
	photo, b := VS.getFileFromHTML(c, "photo", "Purchase", basePath+"/local-resources/video-courses/"+product.Name+"/problems/photos/")
	if !b {
		return
	}
	audio, b := VS.getFileFromHTML(c, "audio", "Purchase", basePath+"/local-resources/video-courses/"+product.Name+"/problems/audios/")
	if !b {
		return
	}

	// Get the text of the problem
	problemText := c.Request.FormValue("problemText")
	problem := VideoProblem{
		ID:            bson.NewObjectId(),
		IDVideoCourse: videoID,
		TextProblem:   problemText,
		PhotoProblem:  photo,
		IDWorker:      workerID,
		Audio:         audio,
	}
	idservicetype, b := VS.getIDParamFromURL(c, "idservicetype")
	if !b {
		return
	}
	VS.addElementToDatabaseWithRegisterFromCentral(c, problem, problem.ID, "h_videos", "newProblem", "VS.addElementToDatabaseWithRegisterFromCentral")
	VS.goodFeedback(c, "/video-course-problems/"+videoID.Hex()+"/"+idservicetype.Hex())
}
// Stores the new Problem information into the DataBase
Stores the new Problem information into the DataBase
// Stores the new Problem information into the DataBase
func (VS *Server) newProblem(c *gin.Context) {
	videoID, _ := VS.getIDParamFromURL(c, "id")
	product, _ := VS.getVideoCourseByID(c, videoID, "h_videos", "newProblem", "product, _ := VS.getVideoCourseByID", true)
	workerID, b := VS.getIDFromHTML(c, "workerID", "Purchase")
	if !b {
		return
	}
	photo, b := VS.getFileFromHTML(c, "photo", "Purchase", basePath+"/local-resources/video-courses/"+product.Name+"/problems/photos/")
	if !b {
		return
	}
	audio, b := VS.getFileFromHTML(c, "audio", "Purchase", basePath+"/local-resources/video-courses/"+product.Name+"/problems/audios/")
	if !b {
		return
	}
	problemText := c.Request.FormValue("problemText")
	problem := VideoProblem{
		ID:            bson.NewObjectId(),
		IDVideoCourse: videoID,
		TextProblem:   problemText,
		PhotoProblem:  photo,
		IDWorker:      workerID,
		Audio:         audio,
	}
	idservicetype, b := VS.getIDParamFromURL(c, "idservicetype")
	if !b {
		return
	}
	VS.addElementToDatabaseWithRegisterFromCentral(c, problem, problem.ID, "h_videos", "newProblem", "VS.addElementToDatabaseWithRegisterFromCentral")
	VS.goodFeedback(c, "/video-course-problems/"+videoID.Hex()+"/"+idservicetype.Hex())
}
func ( VS * Server ) newProblem ( c * gin . Context ) { videoID , _ := VS . getIDParamFromURL ( c , " " ) product , _ := VS . getVideoCourseByID ( c , videoID , " " , " " , " " , true ) workerID , b := VS . getIDFromHTML ( c , " " , " " ) if ! b { return } photo , b := VS . getFileFromHTML ( c , " " , " " , basePath + " " + product . Name + " " ) if ! b { return } audio , b := VS . getFileFromHTML ( c , " " , " " , basePath + " " + product . Name + " " ) if ! b { return } problemText := c . Request . FormValue ( " " ) problem := VideoProblem { ID : bson . NewObjectId ( ) , IDVideoCourse : videoID , TextProblem : problemText , PhotoProblem : photo , IDWorker : workerID , Audio : audio , } idservicetype , b := VS . getIDParamFromURL ( c , " " ) if ! b { return } VS . addElementToDatabaseWithRegisterFromCentral ( c , problem , problem . ID , " " , " " , " " ) VS . goodFeedback ( c , " " + videoID . Hex ( ) + " " + idservicetype . Hex ( ) ) }
Stores the new Problem information into the DataBase
Stores the new Problem information into the DataBase
// Get the text of the problem