Skip to main content Link Search Menu Expand Document (external link)

admin.questions.go

  • This contains function related to application questions

#1

func getQuestionsByProformaHandler

Here pid refers to proforma ID

  • Used to fetch questions from the pid using the function:
    func fetchProformaQuestion(ctx, pid, &questions)
    
    • This takes pid and an empty array of type ApplicationQuestion as parameters.

Mentioned in application/db.question

#2

func postQuestionHandler
  • Used to post proforma questions using the function :
    func createProformaQuestions(ctx, &question) 
    
    • This takes struct of type ApplicationQuestion as parameter.

Mentioned in application/db.question

Also, checks are made so that no empty questions in posted.

#3

func putQuestionHandler
  • Used to update proforma questions using the function :
    func putProformaQuestions(ctx, &question) 
    
    • This takes struct of type ApplicationQuestion as parameter.

Mentioned in application/db.question

Also, a check is done to ensure that ID of the question is not 0.

#4

func deleteQuestionHandler
  • Used to delete proforma questions using the function :
    func deleteProformaQuestions(ctx, qid) 
    
    • This takes qid (question id) as parameter.

Mentioned in application/db.question

#5

func getAnswersForProforma
  • Returns a map of answers to the application questions. The function used to fetch answers is :
    func fetchAllAnswers(ctx, pid, questionID, &answers)
    
    • This takes pid, qid (question id) and an empty array of type ApplicationQuestionAnswer as parameter.

Mentioned in application/db.question