示例#1
0
 /**
  * Store a newly created resource in storage.
  *
  * @param  \Illuminate\Http\Request  $request
  * @return \Illuminate\Http\Response
  */
 public function store(Request $request)
 {
     $marks = Mark::create(['exam_id' => $request->exam_id, 'student_id' => $request->student_id, 'obt_marks' => $request->obt_marks]);
     $exams = Exam::find($request->exam_id);
     $students = Student::find($request->student_id);
     $marks->exams()->save($exams);
     $marks->students()->save($students);
     return redirect('principal/create#mark-tab')->withInput();
 }
示例#2
0
 public function getExamData($id)
 {
     $exam = Exam::find($id);
     $examfilee = file(public_path() . '' . $exam->examfile);
     $i = 0;
     $j = 0;
     $questions = array();
     foreach ($examfilee as $line) {
         if ($i % 2 == 0) {
             $j++;
             $questions['ques' . $i] = $line;
         } else {
             $questions['opt' . ($i - 1)] = explode(';', $line);
         }
         $i++;
     }
     $questions['size'] = $j;
     $questions['examid'] = $id;
     return $questions;
 }
 public function destroy($id)
 {
     $Exam = Exam::find($id);
     $Exam->delete();
     return Redirect::to('exam_area')->with('estado', 'eliminar');
 }
   <!--Start : Content -->
	  <div class="content">  
   

   <!--Start : Question Number (Example 2 de 5) -->	 
   
   <div class="row">
          <p class="instructions-title"><span style="background-color: #808285; padding: 3px 3px 3px 3px;">Exam Instructions </span></p>
    </div>
   <!--End : Question Number -->	

    <div class="frame">
                              
<p class="orange-p"> ITIL FOUNDATION (2011)</p>
 <?php 
$exam = Exam::find(1);
echo '<p class="instructions-p ">All ' . Question::count() . ' questions should be attempted</p>';
echo '<p class="instructions-p ">There are no trick questions</p>';
echo '<p class="instructions-p ">You have 75 minutes for this exam</p>';
echo '<p class="instructions-p ">You must get ' . $exam->score . ' points or more to pass</p>';
echo '<p class="instructions-p ">During this exam you are allowed to navigate freely and review items you have already answered</p>';
echo '<p class="instructions-p ">If you have time at the end of the exam you can review your answers or any questions that you flag for review during the exam</p>';
echo '<p class="instructions-p ">Please note that it is strictly forbidden to copy or reproduce the content of this exam without the approval of PEOPLECERT</p>                                  <br>';
?>
                               
		</div>
	    {{ Form::open(array('method' => 'GET', 'route' => array('exam.show', $exam->id))) }}
		      <input type="submit" class="btn-option" value="Next" >
      {{ Form::close() }}
	</div>
	</div>