想做一个考试答题系统,但是提交的时候,接收不到题目id和卷子id,所以没办法存到数据库,哪位大神帮我看看怎么回事?
if ($hwpaper->save()){
$questions = HwQuestion::where('hw_knowledge_id', '=', $hwpaper->hw_knowledge_id)
->where('diffculty', '=', $hwpaper->diffculty)
->where('q_number', '>=', $hwpaper->start_number)
->where('q_number', '<=', $hwpaper->end_number)
->get();
$paper_id = $hwpaper->id;
// dd($questions);
return view('student.homework.practice', compact('questions', 'paper_id'));
} else {
return Redirect::back()->withInput()->withErros('失败');
}
}
public function postQuestion(Request $request)
{
// dd(Input::all());
$hwanswer = new HwStudentAnswer;
$hwanswer->hw_question_id = Input::get('question','1');
$hwanswer->hw_paper_id = Input::get('paper_id','167');
$hwanswer->selected_answer = Input::get('selected_answer');
// dd($hwanswer);
$hwanswer->save();
return $this->postRevise();
}
view
{{ }}{{ }}
紫焰123