本文整理汇总了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);
}
}
}
示例2: index
public function index()
{
$answers = Answer::all();
// return View::make('admin.index', compact('answers'));
}
示例3: resultsonly
public function resultsonly()
{
$answers = Answer::all();
$questions = Question::all();
return View::make('resultsonly', array('answers' => $answers, 'questions' => $questions));
}
示例4: show
/**
* Display the specified resource.
* GET /answers/{id}
*
* @param int $id
* @return Response
*/
public function show($id)
{
return Answer::all();
}
示例5: getIndex
public function getIndex()
{
$answers = Answer::all();
// return View::make('audiopedia.index', compact('answers'));
}