QuickExam
You can shuffle or randomize quiz questions and answers. Shuffling is also an effective way of preventing cheating because no two learners get questions in the same order while taking the same quiz.
The gem quick_exam
only supports txt, docx and Webpage html from Word format. You can completely change the format of the questions and answers.
Description | Example |
---|---|
Format for a Question: Not case sensitive. The starting must be letters |
Q , Question or Câu etc... |
Format for an Answer: Not case sensitive. Starting with a letter or a number |
A , a or 1 , 2 etc... |
Format for an Correct answer: Not case sensitive | !!!T |
Sample data
Q1. Who are all ________ people?
A. this
B. those !!!T
C. them
D. that
Q2. Claude is ________.
A. Frenchman
B. a French !!!T
C. a Frenchman
D. French man
Q3. I ____ a car next year.
A. buy
B. am buying !!!T
C. going to buy
D. bought
Installation
Install the latest release yourself as:
$ gem install quick_exam
In Rails or others, add it to your Gemfile:
gem 'quick_exam'
And then execute
$ bundle install
Usage
From CLI to export shuffle or randomize quiz question and answers
Run command help
$ quick_exam help export
to show options:
Usage:
quick_exam export FILE_PATH [options]
Options:
-q, [--shuffle-question=true|false] # Shuffle the question
# Default: true
-a, [--shuffle-answer=true|false] # Shuffle the answer
# Default: false
-s, [--same-answer=false] # The same answer for all questionnaires
# Default: false
-Q, [--f-ques=Q] # Question format. Just prefix the question
# Default: Q
-C, [--f-corr=!!!T] # Correct answer format
# Default: !!!T
-c, [--count=2] # Number of copies to created
# Default: 2
-d, [--dest=~/quick_exam_export/] # File storage path after export
shuffled questions and answers then export file
From script ruby to process raw data and get results after analysis
analyzer = QuickExam::Analyzer.new(path_file, f_ques: '', f_corr: '')
analyzer.analyze
The object analyzer
will have methods:
.records # Return the data after analyzing
.total_line # Return total line of the file
.f_ques # Return the format question
.f_corr # Return the format correct answer
To shuffle quiz question and answers
analyzer.records.mixes(count, shuffle_question: true, shuffle_answer: false, same_answer: false)
The method mixes
have 3 arguments:
count: # Require. Number of copies to created
shuffle_question: # Optional. Shuffle quiz question. Default: true
shuffle_answer: # Optional. Shuffle answer. Default: false
same_answer: # Optional. Same answer for all questionnaires. Default: false
Trick: Keep format Word
Commonly used for mathematical or chemical formats
From Word > Save As > Save with format Webpage html
Development
After checking out the repo, run bin/setup
to install dependencies. You can also run bin/console
for an interactive prompt that will allow you to experiment.
To install this gem onto your local machine, run bundle exec rake install
. To release a new version, update the version number in version.rb
, and then run bundle exec rake release
, which will create a git tag for the version, push git commits and tags, and push the .gem
file to rubygems.org.
Contributing
Bug reports and pull requests are welcome on GitHub at https://github.com/tm-minhtang/quick_exam/issues. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected
- Fork it
- Create your feature branch (git checkout -b my-new-feature)
- Commit your changes (git commit -am 'Added some feature')
- Push to the branch (git push origin my-new-feature)
- Create new Pull Request
Authors: Tang Quoc Minh [vhquocminhit@gmail.com]