<commit_before>module Quiz.Update (..) where

import Effects exposing (Effects)
import Hop.Navigate exposing (navigateTo)
import Task
import API exposing (Quiz)
import Quiz.Actions exposing (..)
import Quiz.Models exposing (..)


type alias UpdateModel =
  { quizzes : List Quiz
  , flashAddress : Signal.Address String
  , confirmationAddress : Signal.Address ( QuizId, String )
  }


update : Action -> UpdateModel -> ( List Quiz, Effects Action )
update action model =
  case action of
    ListQuizzes ->
      let
        path =
          "/quizzes/"
      in
        ( model.quizzes, Effects.map HopAction (navigateTo path) )
<commit_msg>Fix edit quiz update action<commit_after>module Quiz.Update (..) where

import Effects exposing (Effects)
import Hop.Navigate exposing (navigateTo)
import Task
import API exposing (Quiz)
import Quiz.Actions exposing (..)
import Quiz.Models exposing (..)


type alias UpdateModel =
  { quizzes : List Quiz
  , flashAddress : Signal.Address String
  , confirmationAddress : Signal.Address ( QuizId, String )
  }


update : Action -> UpdateModel -> ( List Quiz, Effects Action )
update action model =
  case action of
    EditQuiz id ->
      let
        path =
          "/quizzes/" ++ (toString id)
      in
        ( model.quizzes, Effects.map HopAction (navigateTo path) )

    ListQuizzes ->
      let
        path =
          "/quizzes/"
      in
        ( model.quizzes, Effects.map HopAction (navigateTo path) )

{'fraction_non_alphanumeric': 0.0958904109589041, 'fraction_numerical': 0.0, 'mean_word_length': 2.7751937984496124, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 10, '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': '5967107', 'n_tokens_mistral': 456, 'n_tokens_neox': 428, 'n_words': 135}