Пример #1
0
 public function createfromsub($subjectid)
 {
     $type = config('questionbank.types');
     $difficulty = config('questionbank.difficulty');
     $level = config('questionbank.level');
     $lesson = Lesson::where('subject_subject_id', $subjectid)->lists('name', 'id')->toArray();
     return view('questionbank::questionsub.create', compact('subjectid', 'lesson', 'type', 'difficulty', 'level'));
 }
Пример #2
0
 public function lesson_report(Request $req, Lesson $UserModel, $subid)
 {
     $lessons = $UserModel::with('elements')->where('subject_subject_id', $subid)->paginate(20);
     $subjects = Subject::where('id', $subid)->first();
     if ($req->has('title')) {
         $lessons = Lesson::where('subject_subject_id', $subid)->where('name', $req->input('title'))->paginate(20);
     }
     return view('subject::reports.lesson_report', compact('lessons', 'subid', 'subjects'));
 }
Пример #3
0
 public function index($lessonid, Request $req)
 {
     $elements = Element::where('subject_lesson_id', $lessonid)->orderBy('element_order')->paginate(20);
     if ($req->has('title')) {
         $elements = Element::where('title', 'LIKE', "%" . $req->input('title') . "%")->where('subject_lesson_id', $lessonid)->paginate(20);
     }
     $lessons = Lesson::where('id', $lessonid)->get()->first();
     return view('subject::elements.index_element', compact('elements', 'lessonid', 'lessons'));
 }
Пример #4
0
 public function lesson(Lesson $Lesson, $id)
 {
     if (!($lesson = $Lesson->student()->with(['elements' => function ($query) {
         $query->where('state', 'نشط')->orderBy('element_order', 'asc');
     }])->findOrFail($id))) {
         return redirect()->route('students.profile.subjects.index');
     }
     $lessons_arr = Lesson::where('subject_subject_id', $lesson->subject_subject_id)->orderBy('lesson_order', 'ASC')->get()->toArray();
     $this->makeSubjectLessonsMenu($lesson->subject_subject_id, $lessons_arr);
     return view('students::profile.subjects.lesson', compact('lesson'));
 }
Пример #5
0
 public function index($sid)
 {
     //$tasks = Lesson::where('academystructure_subject_id',$id)->paginate(20);
     $subject_name = Subject::findOrFail($sid)->toArray();
     //$lesson_name=Lesson::findOrFail($lessonid)->toArray();
     //dd($subject_name);
     $lessons = Lesson::where('subject_subject_id', $sid)->paginate(20);
     //		$lessons = Lesson::paginate(20);
     /*
     		OR send model as argument
     */
     return view('subject::lessons.index', compact('lessons', 'sid', 'subject_name'));
 }
Пример #6
0
 public function index($subid, $lessonid, Request $req)
 {
     //$tasks = Lesson::where('academystructure_subject_id',$id)->paginate(20);
     if ($lessonid === -1) {
         $subject_name = Lesson::findOrFail($lessonid)->toArray();
     } else {
         $subject_name = Subject::findOrFail($subid)->toArray();
     }
     $lessons = Lesson::where('subject_subject_id', $subid)->orderBy('lesson_order', 'ASC')->paginate(20);
     if ($req->has('name')) {
         $lessons = Lesson::where('name', 'LIKE', "%" . $req->input('name') . "%")->where('subject_subject_id', $subid)->orderBy('lesson_order', 'ASC')->paginate(20);
     }
     return view('subject::lessons.index', compact('lessons', 'subid', 'subject_name'));
 }
 public function editquestion($id, $activity_id)
 {
     $types = config('questionbank.types');
     $difficulty = config('questionbank.difficulty');
     $level = config('questionbank.level');
     $question = Question::with('choices')->findOrFail($id);
     $lesson = Lesson::findOrFail($question->lesson_id);
     $subject_id = $lesson->subject_subject_id;
     $lesson = Lesson::where('subject_subject_id', $lesson->subject_subject_id)->pluck('name', 'id')->toArray();
     // TO AVOID THE ERROR IN VIEW
     session()->forget('typeQ');
     return view('teachers::profile.questions.edit', compact('subject_id', 'types', 'difficulty', 'level', 'question', 'lesson', 'activity_id'));
 }
Пример #8
0
 public function lessonlevel($subjectid, Lesson $lesson)
 {
     $lessons = $lesson->where('subject_subject_id', $subjectid)->get();
     foreach ($lessons as &$lesson) {
         //config('questionbank.types')[0]
         $lesson->lessons_understand = Question::where('lesson_id', $lesson->id)->where('level', config('questionbank.level')['الفهم'])->count();
         $lesson->lessons_memory = Question::where('lesson_id', $lesson->id)->where('level', config('questionbank.level')['التذكر'])->count();
         $lesson->lessons_conclusion = Question::where('lesson_id', $lesson->id)->where('level', config('questionbank.level')['الاستنتاج'])->count();
         $lesson->lessons_application = Question::where('lesson_id', $lesson->id)->where('level', config('questionbank.level')['تطبيق'])->count();
         $lesson->lessons_analysis = Question::where('lesson_id', $lesson->id)->where('level', config('questionbank.level')['تحليل'])->count();
     }
     return view('questionbank::report.lessonlevel', compact('lessons'));
 }
Пример #9
0
 public function edit($id)
 {
     $types = config('questionbank.types');
     $difficulty = config('questionbank.difficulty');
     $level = config('questionbank.level');
     $question = Question::with('choices')->findOrFail($id);
     $lesson = Lesson::findOrFail($question->lesson_id);
     $subject_id = $lesson->subject_subject_id;
     $subject = Subject::findOrFail($subject_id);
     // $lesson = Lesson::where('subject_subject_id',$lesson->subject_subject_id)->pluck('name','id')->toArray();
     $lessons = Lesson::where('subject_subject_id', $lesson->subject_subject_id)->orderBy('lesson_order', 'ASC')->pluck('lesson_order', 'id')->toArray();
     // TO AVOID THE ERROR IN VIEW
     session()->forget('typeQ');
     return view('questionbank::subject.edit', compact('lessons', 'subject_id', 'types', 'difficulty', 'level', 'question', 'lesson', 'subject'));
 }