gronostajo / drill2

Browser-based multiple choice test learning assistant

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Integrate questions with a route

dimidd opened this issue · comments

Hi,

Is it possible to preload the questions file in a certain route, so the user won't have to bother with selecting the questions manually?
e.g. example.com/spanish-quiz would display the first question of spanish-quiz.txt

Hi.

As for now, question files have to be selected by user because they are always loaded from his computer. Security policies of browsers don't allow reading arbitrary files from the filesystem, they have to be selected manually. You could circumvent that by serving question files along with the app or by using HTML5 localStorage, but none of these is currently implemented and I don't think I will be adding such feature anytime soon.

If you need it, I believe you could add it relatively easily. $scope.loadQuestions() will load questions from $scope.dataString. You could choose appropriate question bank based on URL hash which you can get with the $location service.