This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Unexpected token (near goodAnswerCount), Unexpcted token (near correct_choice) and unrecognised keyword (near CASE) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@section('head') | |
<script> | |
var sessionMessage = <?php echo json_encode(Session::get('head_message')); ?> | |
</script> | |
<script src="{{ asset('js/message.js') }}"></script> | |
@endsection |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
array:4 [▼ | |
0 => array:3 [▼ | |
"query" => "select * from `questions` where exists (select * from `question_mappers` where `question_mappers`.`question_id` = `questions`.`id` and `category_id` = ? and `designation_id` = ? and `department_id` = ?) and `questions`.`deleted_at` is null order by RAND()" | |
"bindings" => array:3 [▼ | |
0 => "3" | |
1 => "1" | |
2 => "1" | |
] | |
"time" => 6.02 | |
] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public function index(Request $request) | |
{ | |
$questionsIds = Question::whereHas('questionMapper', function ($q) use ($request) { | |
$q->where('category_id', $request->jcategory_id); | |
$q->where('designation_id', $request->designation_id); | |
$q->where('department_id', $request->department_id); | |
})->with('questionMapper.questionCategory')->inRandomOrder()->get(); | |
// $userQuestionCollection = []; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SQLSTATE[42S22]: Column not found: 1054 Unknown column 'user_questions' in 'field list' (SQL: update `questions` set `updated_at` = 2018-03-26 17:05:45, `user_questions` = where `id` = 67) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$questions = Question::inRandomOrder()->limit(10)->get(); | |
dd($questions->paginate(1)); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- phpMyAdmin SQL Dump | |
-- version 4.5.4.1deb2ubuntu2 | |
-- http://www.phpmyadmin.net | |
-- | |
-- Host: localhost | |
-- Generation Time: Nov 15, 2017 at 07:18 AM | |
-- Server version: 5.7.20-0ubuntu0.16.04.1 | |
-- PHP Version: 7.0.22-0ubuntu0.16.04.1 | |
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ques = new Question(); | |
$ques->question_text = $request->question_text; | |
$ques->code_snippet = $request->code_snippet; | |
$ques->answer_explanation = $request->answer_explanation; | |
$ques->more_info_link = $request->more_info_link; | |
$ques->category_id = $request->category_id; | |
$ques->topic_id = $request->topic_id; | |
$ques->save(); | |
$data = []; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$data = []; | |
$now = Carbon::now(); | |
foreach($request->option as $key => $value) { | |
$data[] = [ | |
'question_id' => $ques->id, | |
'answer' => $value, | |
'created_at' => Carbon::now(), | |
'updated_at' => Carbon::now(), | |
]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public function store(Request $request) | |
{ | |
$ques = new Question(); | |
$ques->question_text = $request['question_text']; | |
$ques->code_snippet = $request['code_snippet']; | |
$ques->answer_explanation = $request['answer_explanation']; | |
$ques->more_info_link = $request['more_info_link']; | |
$ques->category_id = $request['category_id']; | |
$ques->topic_id = $request['topic_id']; | |
$ques->save(); |
NewerOlder