<commit_before><?php
namespace App\Repositories;

use Carbon\Carbon;
use Illuminate\Database\Connection;
use Illuminate\Support\Facades\DB;

class QuizRepository
{
	public function getExamList()
	{
		$examList = DB::select("SELECT exam.id, exam.label, exam.validate FROM examen AS exam");
		return $examList;
	}

	public function getExamenNameForSurvey($idExamen)
	{
		$examenName =DB::select("SELECT label
				FROM examen
				WHERE id = " . $idExamen);
		return $examenName;
	}

	public function getSurveyList($idExamen)
	{
		$surveyList =DB::select("SELECT sur.id, sur.labelle, sur.description, sur.examen_id 
				FROM survey AS sur
				WHERE sur.examen_id = " . $idExamen);
		return $surveyList;
	}

	public function getSurveyNameForQuiz($idSurvey)
	{
		$surveyName =DB::select("SELECT labelle
				FROM survey
				WHERE id = " . $idSurvey);
		return $surveyName;
	}

	public function getQuestionList($idSurvey)
	{
		$questionList =DB::select("SELECT question.id, question.label AS Intitule, question.note, question.type_id, choice.response AS reponse, choice.label AS choix, choice.id AS idChoix
				FROM question
				INNER JOIN choice ON question.id = choice.question_id
				WHERE question.survey_id = " . $idSurvey);
		return $questionList;
	}

	public function setUserAnswers($idCandidat, $idExamen, $idSurvey, $idQuestion, $valueReponse, $idNote, $idChoice)
	{
		$questionList = DB::insert("INSERT INTO useranswer (user_id, examen_id, survey_id, question_id, answer_value, note_response, choice_id
 			VALUES (".$idCandidat.",".$idExamen.",".$idSurvey.",".$idQuestion.",'".$valueReponse."',".$idNote.",".$idChoice.")");
		return true;
	}
    <commit_msg>correction requete insertion<commit_after><?php
namespace App\Repositories;

use Carbon\Carbon;
use Illuminate\Database\Connection;
use Illuminate\Support\Facades\DB;

class QuizRepository
{
	public function getExamList()
	{
		$examList = DB::select("SELECT exam.id, exam.label, exam.validate FROM examen AS exam");
		return $examList;
	}

	public function getExamenNameForSurvey($idExamen)
	{
		$examenName =DB::select("SELECT label
				FROM examen
				WHERE id = " . $idExamen);
		return $examenName;
	}

	public function getSurveyList($idExamen)
	{
		$surveyList =DB::select("SELECT sur.id, sur.labelle, sur.description, sur.examen_id 
				FROM survey AS sur
				WHERE sur.examen_id = " . $idExamen);
		return $surveyList;
	}

	public function getSurveyNameForQuiz($idSurvey)
	{
		$surveyName =DB::select("SELECT labelle
				FROM survey
				WHERE id = " . $idSurvey);
		return $surveyName;
	}

	public function getQuestionList($idSurvey)
	{
		$questionList =DB::select("SELECT question.id, question.label AS Intitule, question.note, question.type_id, choice.response AS reponse, choice.label AS choix, choice.id AS idChoix
				FROM question
				INNER JOIN choice ON question.id = choice.question_id
				WHERE question.survey_id = " . $idSurvey);
		return $questionList;
	}

	public function setUserAnswers($idCandidat, $idExamen, $idSurvey, $idQuestion, $valueReponse, $idNote, $idChoice)
	{
		$questionList = DB::insert("INSERT INTO useranswer (user_id, examen_id, survey_id, question_id, answer_value, note_response, choice_id)
 			VALUES (".$idCandidat.",".$idExamen.",".$idSurvey.",".$idQuestion.",'".$valueReponse."',".$idNote.",".$idChoice.")");
		return true;
	}
    
{'fraction_non_alphanumeric': 0.13031755542240864, 'fraction_numerical': 0.0, 'mean_word_length': 4.707692307692308, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5033825', 'n_tokens_mistral': 1257, 'n_tokens_neox': 1143, 'n_words': 254}