Quiz

object Quiz

Object for a quiz

class Object
trait Matchable
class Any
Quiz.type

Type members

Classlikes

case class Quiz(quizId: UUID, question: String, answerList: List[Answer], maxScore: Int, imagePath: Option[String])

A quiz has an identifier, a question, some answers, a max score and optionally an image

A quiz has an identifier, a question, some answers, a max score and optionally an image

Value parameters:
answerList

a list of answers

imagePath

an image path (optional)

maxScore

a max score

question

the question of the quiz

quizId

a random UUID for the quiz

Value members

Concrete methods

def changeAnswerList(quiz: Quiz, answerList: List[Answer]): Quiz

Change the list of answers

Change the list of answers

Value parameters:
answerList

a new answer list

quiz

the quiz to edit

Returns:

Quiz

def changeImagePath(quiz: Quiz, imagePath: Option[String]): Quiz

Change image path of a quiz

Change image path of a quiz

Value parameters:
imagePath

a new quiz image path (optional)

quiz

the quiz to edit

Returns:

Quiz

def changeMaxScore(quiz: Quiz, maxScore: Int): Quiz

Change max score of a quiz

Change max score of a quiz

Value parameters:
maxScore

a new quiz max score

quiz

the saved quiz to edit

Returns:

Quiz

def changeQuestion(quiz: Quiz, questionText: String): Quiz

Change question of a quiz

Change question of a quiz

Value parameters:
questionText

a new quiz text question

quiz

the quiz to edit

Returns:

Quiz

def getCorrectAnswers(quiz: Quiz): List[Answer]

Return the list of the correct answers of the quiz

Return the list of the correct answers of the quiz

Value parameters:
quiz

the quiz

Returns:

List[Answer]

Concrete fields

val printQuiz: Quiz => String
val printQuizFull: Quiz => String