diff --git a/classes/answer.class.php b/classes/answer.class.php index 8e33e01..ad3fb38 100644 --- a/classes/answer.class.php +++ b/classes/answer.class.php @@ -49,4 +49,22 @@ namespace TestProject; return $id_arr; } + /** + * Get question text + * + * @return string Question text + */ + public function getText(){ + return $this->text_str; + } + + /** + * Get if answer is correct + * + * @return bool if is correct + */ + public function isCorrect(){ + return $this->correct_bln; + } + } diff --git a/index.php b/index.php index 4b3d5f7..5b8402d 100644 --- a/index.php +++ b/index.php @@ -1,7 +1,14 @@ getName(); + $email_str = $user->getEmail(); +} + $quizzes_arr = Quiz::getList(); ?> @@ -24,11 +31,11 @@ $quizzes_arr = Quiz::getList();
- +
- - + +
@@ -49,5 +56,7 @@ $quizzes_arr = Quiz::getList();
+ + diff --git a/quiz.php b/quiz.php new file mode 100644 index 0000000..6f27d2a --- /dev/null +++ b/quiz.php @@ -0,0 +1,67 @@ +getID() ); + +$quest1 = new Question( $questID_arr[0] ); + +$_SESSION['user_id'] = $user->getID(); +?> + + + + + Basic PHP Quiz + + + + +
+
+
+

getName(); ?>

+
+
+
+
+

getText(); ?>

+
+
+
+
+ getAnswers() as $answer ){ + $id = $answer->getID(); + $text = $answer->getText(); + ?> +
+ +
+ +
+
+
+ +
+
+
+
+ + + + +