当前位置: 首页>>代码示例>>PHP>>正文


PHP Answer::all方法代码示例

本文整理汇总了PHP中Answer::all方法的典型用法代码示例。如果您正苦于以下问题:PHP Answer::all方法的具体用法?PHP Answer::all怎么用?PHP Answer::all使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Answer的用法示例。


在下文中一共展示了Answer::all方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: postGuardar

 public function postGuardar()
 {
     $bandera = false;
     $id = Input::get('idQues');
     $ans = Input::get('res');
     $answers = Answer::all();
     $question = Question::find($id);
     $cantidad = Question::count();
     foreach ($answers as $a) {
         if ($a->id_question == $id) {
             $bandera = true;
             $answer = $a;
             break;
         }
     }
     if (!$bandera) {
         $answer = new Answer();
         $answer->id_question = $id;
         $ids = Auth::id();
         $student = Student::where('id_user', '=', $ids)->get()->first();
         $answer->id_student = $student->id;
         $answer->answer = $ans;
         $answer->result = QuestionsController::verifyAnswer($question, $ans);
         $answer->save();
     } else {
         $answer->result = QuestionsController::verifyAnswer($question, $ans);
         $answer->answer = $ans;
         $answer->save();
     }
     if ($cantidad == $id) {
         return Redirect::to('questions/exam?endTest=yes');
         //"holi ".$id." ".$ans;
     } else {
         if ($cantidad > $id) {
             return Redirect::to('questions/exam?numberQIn=' . ++$id);
         }
     }
 }
开发者ID:ReyesPedro,项目名称:PlataformaPreguntas,代码行数:38,代码来源:SolvingExamsController.php

示例2: index

 public function index()
 {
     $answers = Answer::all();
     // return View::make('admin.index', compact('answers'));
 }
开发者ID:ayooby,项目名称:whatisit,代码行数:5,代码来源:AdminController.php

示例3: resultsonly

 public function resultsonly()
 {
     $answers = Answer::all();
     $questions = Question::all();
     return View::make('resultsonly', array('answers' => $answers, 'questions' => $questions));
 }
开发者ID:sanderdrummer,项目名称:Homepages,代码行数:6,代码来源:HomeController.php

示例4: show

 /**
  * Display the specified resource.
  * GET /answers/{id}
  *
  * @param  int  $id
  * @return Response
  */
 public function show($id)
 {
     return Answer::all();
 }
开发者ID:anildukkipatty,项目名称:fu,代码行数:11,代码来源:AnswersController.php

示例5: getIndex

 public function getIndex()
 {
     $answers = Answer::all();
     // return View::make('audiopedia.index', compact('answers'));
 }
开发者ID:ayooby,项目名称:whatisit,代码行数:5,代码来源:AnswerController.php


注:本文中的Answer::all方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。