109
*/
public function actionIndex($id_question)
{
$question = QuestionController::findModel($id_question);
$test = TestController::findModel($question->id_test);
$searchModel = new AnswerVariantSearch();
$dataProvider = $searchModel->search(Yii::$app->request-
>queryParams);
$dataProvider->query->andWhere(['id_question' => $question-
>id]);
return $this->render('index', [
'searchModel' => $searchModel,
'dataProvider' => $dataProvider,
'question' => $question,
'test' => $test,
]);
}
/**
* Displays a single AnswerVariant model.
* @param integer $id
* @return mixed
* @throws NotFoundHttpException if the model cannot be found
*/
public function actionView($id)
{
$model = $this->findModel($id);
$question = QuestionController::findModel($model-
>id_question);
$test = TestController::findModel($question->id_test);