Ejemplo n.º 1
0
 public function getQuizResult($answersSum)
 {
     return QuizResults::find()->where("'" . $answersSum . "' BETWEEN value_from AND value_to AND quiz_id=" . $this->id)->one()['text'];
 }
Ejemplo n.º 2
0
 /**
  * Deletes an existing Quiz model.
  * If deletion is successful, the browser will be redirected to the 'index' page.
  * @param integer $id
  * @return mixed
  */
 public function actionDelete($id)
 {
     $this->findModel($id)->delete();
     QuizResults::deleteAll(['quiz_id' => $id]);
     QuizQuestions::deleteAll(['quiz_id' => $id]);
     return $this->redirect(['index']);
 }