Ayomaid08

Ayomaid08

Member Since 1 Year Ago

Experience Points 310
Experience Level 1

4,690 experience to go until the next level!

In case you were wondering, you earn Laracasts experience when you:

  • Complete a lesson — 100pts
  • Create a forum thread — 50pts
  • Reply to a thread — 10pts
  • Leave a reply that is liked — 50pts
  • Receive a "Best Reply" award — 500pts
Lessons Completed 2
Lessons
Completed
Best Reply Awards 0
Best Reply
Awards
  • start-engines Created with Sketch.

    Start Your Engines

    Earned once you have completed your first Laracasts lesson.

  • first-thousand Created with Sketch.

    First Thousand

    Earned once you have earned your first 1000 experience points.

  • 1-year Created with Sketch.

    One Year Member

    Earned when you have been with Laracasts for 1 year.

  • 2-years Created with Sketch.

    Two Year Member

    Earned when you have been with Laracasts for 2 years.

  • 3-years Created with Sketch.

    Three Year Member

    Earned when you have been with Laracasts for 3 years.

  • 4-years Created with Sketch.

    Four Year Member

    Earned when you have been with Laracasts for 4 years.

  • 5-years Created with Sketch.

    Five Year Member

    Earned when you have been with Laracasts for 5 years.

  • school-session Created with Sketch.

    School In Session

    Earned when at least one Laracasts series has been fully completed.

  • welcome-newcomer Created with Sketch.

    Welcome To The Community

    Earned after your first post on the Laracasts forum.

  • full-time-student Created with Sketch.

    Full Time Learner

    Earned once 100 Laracasts lessons have been completed.

  • pay-it-forward Created with Sketch.

    Pay It Forward

    Earned once you receive your first "Best Reply" award on the Laracasts forum.

  • subscriber-token Created with Sketch.

    Subscriber

    Earned if you are a paying Laracasts subscriber.

  • lifer-token Created with Sketch.

    Lifer

    Earned if you have a lifetime subscription to Laracasts.

  • lara-evanghelist Created with Sketch.

    Laracasts Evangelist

    Earned if you share a link to Laracasts on social media. Please email [email protected] with your username and post URL to be awarded this badge.

  • chatty-cathy Created with Sketch.

    Chatty Cathy

    Earned once you have achieved 500 forum replies.

  • lara-veteran Created with Sketch.

    Laracasts Veteran

    Earned once your experience points passes 100,000.

  • 10k-strong Created with Sketch.

    Ten Thousand Strong

    Earned once your experience points hits 10,000.

  • lara-master Created with Sketch.

    Laracasts Master

    Earned once 1000 Laracasts lessons have been completed.

  • laracasts-tutor Created with Sketch.

    Laracasts Tutor

    Earned once your "Best Reply" award count is 100 or more.

  • laracasts-sensei Created with Sketch.

    Laracasts Sensei

    Earned once your experience points passes 1 million.

  • top-50 Created with Sketch.

    Top 50

    Earned once your experience points ranks in the top 50 of all Laracasts users.

11 Dec
7 months ago

Ayomaid08 started a new conversation Generating Multiple Student Report Sheets In One Web Page

I am building a student management app. Am stuck in viewing class reports. I can show individual reports (scores, percentage, personal details, psychomotor domain etc) for each student in a class. But I need to show all reports for each student in a class in one web page with page breaks between them. So we'll have Student1 with all scores and information, Student2 with all scores and information etc in on very long web page. My results table on DB has studentId and StudentClass columns to differentiate things. I feel I should use a forloop but can't wrap my head around how to. Below is my controller:

 public function viewresult(Request $request){


   $subjects = $request->get('subjects');
   $studentname = $request->get('studentname');
   $studentId = $request->get('studentId');
   $student = Student::where('id', $studentId)->first();
   $regNumber = $request->get('regNumber');
   $term = $request->get('term');
   if ($term ==1) {
       $termended = "First";
   }
   $session = $request->get('session');
   $sessionnow = Session::where('id', $session)->first()->name; 
   $studentClass = $request->get('studentClass');
   $classname = Stclass::where('id', $studentClass)->first()->name;
   $teachersignature = Stclass::where('id', $studentClass)->first()->teachersignature;
   $teachername = Stclass::find($studentClass)->teachers()->first()->fullName;

   $setting = Setting::all()->first(); 

   $grades = DB::table('grades')->get();
   $comments = Comment::all();



    // $results = Result::where('studentClass', $studentClass)->where('session', $session)->where('term', $term)->where('studentId', $studentId)->get(); 

      $results = DB::table('results')
                    ->where('studentClass', $studentClass)->where('session', $session)->where('term', $term)->where('studentId', $studentId)->whereNull('deleted_at')
                    ->selectRaw('results.*, (results.test1 + results.test2) as cav, results.exam + results.test1 + results.test2 as totalmark')->get();

       $rating = DB::table('ratings')->where('student_id', $studentId)->where('term', $term)->where('session', $session)->first();
       



     $resultpercent = DB::table('results')
                  -> where('studentClass', $studentClass)->where('session', $session)->where('term', $term)->where('studentId', $studentId)->whereNull('deleted_at')
                  ->selectRaw("SUM(results.exam + (results.test1 + results.test2))/(COUNT(results.subject)) as overallpercent")->get();

                     $resultpercentclass = DB::table('results')
                  -> where('studentClass', $studentClass)->where('session', $session)->where('term', $term)->whereNull('deleted_at')
                  ->selectRaw("SUM((results.exam + (results.test1 + results.test2)/2)/2)/(COUNT(results.subject)) as percentclass")->groupBy('studentId')->orderBy('percentclass', 'desc')->get();

            
      

        if($results->isEmpty()){
          
           return "No Result";
          // 
        } elseif(!$results->isEmpty() AND !isset($rating)){
            return view('admin.results.viewresult', compact('subjects', 'studentname', 'regNumber', 'studentClass', 'studentId', 'term', 'session', 'results', 'student', 'setting', 'sessionnow', 'classname', 'termended', 'grades', 'comments', 'rating', 'teachername', 'resultpercent', 'resultpercentclass', 'teachersignature'));
          // 
      }
        elseif(!$results->isEmpty() AND isset($rating)){
            

              return view('admin.results.resultrating', compact('subjects', 'studentname', 'regNumber', 'studentClass', 'studentId', 'term', 'session', 'results', 'student', 'setting', 'sessionnow', 'classname', 'termended', 'grades', 'comments', 'rating', 'teachername', 'resultpercent', 'resultpercentclass', 'teachersignature'));

        }


}

It is $results that actually show individual results.

21 Nov
7 months ago

Ayomaid08 left a reply on Get Positions(Rank) For Pupils In Report App

@ashraam Thanks for your response. I checked out redis for the first time today, after your suggestion. I have also read the docs on laravel. But truly, I couldn't quite understand how to use, maybe because I am in a race against time. Would you be kind to provide examples vis-a-vis my stated problems?

20 Nov
8 months ago

Ayomaid08 started a new conversation Get Positions(Rank) For Pupils In Report App

I am building a report card app. My view for pupil's report sheet is like so:

SUBJECT CA 1 CA 2 CA AVERAGE EXAMINATION TOTAL PERCENTAGE POSITIO Mathematics 80 70 75.0000 56 65.50000000 1st English 70 45 57.5000 100 78.75000000 3rd Biology 89 23 56.0000 90 73.00000000 4th

In my results table in DB, I have columns: student_id, studentClass, CA1, CA2, Examination and other essentials. I do not a total percentage, CA Average nor Overall Percentage column. The Overall Percentage is gotten by Total Percentage/Number of Subjects (in the above example : 72.416666666667). The CA Average and Total Percentage are calculated on the fly using query builder as you will find in my controller below.

What I need is to calculate

  1. Positions in class e.g Elementary 1A. Each pupil is assigned a position based on Overall Percentage. like 1st, 2nd, 3rd etc. And of course if there's a tie, the next position is skipped.
  2. Positions across arms e.g Eementary can have Elementary 1A, 1B, 1C etc. I need to assign positions to pupils by overall percentage in comparison to all pupils in Elementary(1A, 1B, 1C etc.).
  3. Subject Positions: This is calculated using Total Percentage scored by a pupil in each subject, in comparison with other pupils in same class, e.g Elementary 1A. It's the last column in my view above. I could find a fix for it either.

I have searched for solutions.What I have seen so far were solutions where the Position(rank) is calculated using a column on the DB table. In my case I do not have such column, as I used QB to calculate on the fly. I did try to implement that method by calculating at least CA Average and Total Percentage during insert but got 'unsupported operand' error.

My Controller:

,,, public function studentresultsheet(Request $request){

        $stclass = $request->get('stclass');
        $myclass = Stclass::find($request->get('stclass'))->name;
        $studentId = $request->get('studentId');
        $studentname = Student::find($request->get('studentId'))->surname;

        $session= $request->get('sessionnow');
        $term = $request->get('term');

        $myids = Stclass::find($stclass)->students;
      
        // $dodo = DB::table('results')
        //           -> where('studentClass', $stclass)->where('session', $session)->where('term', $term)
        //           ->selectRaw('results.studentId')->distinct()->get();

          

                
                  
      

         $resultpercent = DB::table('results')
                  -> where('studentClass', $stclass)->where('session', $session)->where('term', $term)->where('studentId', $studentId)
                  ->selectRaw("SUM((results.exam + (results.test1 + results.test2)/2)/2)/(COUNT(results.subject)) as overallpercent")->get();

                   $dodo = DB::table('results')
                  -> where('studentClass', $stclass)->where('session', $session)->where('term', $term)
                  ->selectRaw('results.studentId')->get();

                

         $results = DB::table('results')
                    ->where('studentClass', $stclass)->where('session', $session)->where('term', $term)->where('studentId', $studentId)
                    ->selectRaw('results.*, (results.test1 + results.test2)/2 as cav, (results.exam + (results.test1 + results.test2)/2)/2 as totalmark')->get();

      return view('admin.results.studentresultsheet', compact('results', 'myclass', 'studentname','resultpercent', 'countsubjects'));

}

''' Thanks.