コード例 #1
0
 public function toExternalForm()
 {
     $data = ["profile" => $this->profile->toExternalForm()];
     $questions = [];
     foreach ($this->questions as $question) {
         $questions[] = $question;
     }
     uasort($questions, [$this, "sort_questions"]);
     $data["questions"] = [];
     foreach ($questions as $question) {
         unset($question["answer"]);
         $data["questions"][] = $question;
     }
     return $data;
 }
コード例 #2
0
 public static function delete_question(AssessmentProfile $profile, Token $id)
 {
     $query = Database::generate_query("assessment_question_delete", [$profile->getAssessmentId()->toString(), $id->toString()]);
     $query->execute();
 }