Closed bumbu closed 9 years ago
The first part is fixed.
I don't get the error you're getting in Update 1
though. But I did a change in the line it gives the error and hope it'll work.
Let me know if it still doesn't work properly.
I still get the error. I suppose second error appears because there are no such file app/pdfs/qrcodes/#{copy.id}.png
in git. Or it didn't get generated.
Errno::ENOENT in GeneratedQuizzesController#create
No such file or directory @ rb_sysopen - /Users/bumbu/Development/Web/Thesis-FAF-111-Ungureanu-Eugeniu/app/pdfs/qrcodes/79.png
Extracted source (around line #15):
# stroke_axis
qr = RQRCode::QRCode.new("#{copy.id}", size: 1, level: :h).to_img
15 qr.resize(50, 50).save("#{Rails.root}/app/pdfs/qrcodes/#{copy.id}.png")
set_header(copy)
set_questions(copy)
start_new_page
Rails.root: /Users/bumbu/Development/Web/Thesis-FAF-111-Ungureanu-Eugeniu
Application Trace | Framework Trace | Full Trace
app/pdfs/quiz_pdf.rb:15:in `block in quiz_questions'
app/pdfs/quiz_pdf.rb:12:in `quiz_questions'
app/pdfs/quiz_pdf.rb:8:in `initialize'
app/controllers/generated_quizzes_controller.rb:20:in `new'
app/controllers/generated_quizzes_controller.rb:20:in `create'
Request
Parameters:
{"utf8"=>"✓",
"_method"=>"create",
"authenticity_token"=>"Qu633igyap6r34zLwcU5q6ilvYju74h9ic6DyokkeTxYBXRj7Zs17NcthWNLhg9uMRYqjkkwqZBVKd95bTcAhA==",
"generated_quiz"=>{"quiz_id"=>"3",
"course_id"=>"2",
"copies_nr"=>"",
"random_opt"=>"0",
"student_group_ids"=>["1"],
"questions_nr"=>"1",
"versions_nr"=>"1",
"question_groups_nrs"=>{"7"=>"1"}},
"commit"=>"Generate"}
I think i understood the problem.
For some reason, I put the app/pdfs/qrcodes
line in the .gitignore file. So the project from github doesn't have this directory. You just have to create the qrcodes
dir and it should work.
I created a quiz with 1 question and 4 answers (one is right). I did not add any groups to question.
I tried to generate the quiz with 1 question and 1 variant. It gave me an error:
Update 1:
After setting a group to the question the error changed: