This part assign the id of the lesson to the column lesson_id and is replaced by the next lesson id of the array, so it is a normal behavior that it only save the last lesson:
foreach($request->lesson_id as $lesson)
{
$scr->lesson_id = $lesson;
}
You should instead use something like:
$scr = new Assestment;
$scr->year_id = $request->year_id;
$scr->grade_id = $request->grade_id;
$scr->clas_id = $request->clas_id;
$scr->student_id = $request->student_id;
$scr->score = $score;
$scr->save();
$scr->lessons()->sync($request->lesson_id);
And you should have a pivot table since your assestment belongs to many lessons. https://laravel.com/docs/5.3/eloquent-relationships#many-to-many
The table, named assestment_lesson, should have the columns assestment_id and lesson_id.