Wednesday, November 30, 2016

bulk zap 
 funk from grs content html on the command line


find . -name '*.html' -exec sed -i "" 's/
//g' {} \;

grs mobile quiz - qids per chapter

as part of moving to a qids-for-quiz approach (as opposed to embedding falcon, prepware quiz info, etc) with the grs mobile apps:

/Users/smr/current_projects/pws2016/app/controllers/sandbox_controller.rb

  # qids per chapter
  def qidsperc
    quiz_definition = QuizDefinition.find_by_name("Private Pilot, Airplane")
    qids_per_chapter = quiz_definition.qids_per_chapter()
    # qids_per_chapter = JSON.pretty_generate(qids_per_chapter)
    render json: qids_per_chapter
  end


/Users/smr/current_projects/pws2016/app/models/quiz_definition.rb

  def qids_per_chapter
    chapters = self.book.chapters
    dict = {}
    qapc = {}
    chapters.each { |chapter| 
      chapnum = chapter.chapnum
      qids = question_ids_for_chapnum(chapnum)  # N.B. these are shuffled
      dict[chapnum] = qids
      qapc[chapnum] = qids.count
    }
    dict[:qapc] = qapc
    return dict
  end

this script generates the json:
http://localhost:3000/sandbox/qidsperc

which you can then save in a file, e.g. qids_per_chapter.json
and embed into the app bundle.



  1. based on Private Pilot, Airplane
  2. this is based on a quiz definition so categories are taken into account
  3. a qapc data structure is baked in


Sunday, November 20, 2016

xcode8 - xcodebuild wank with signing ipa


https://pewpewthespells.com/blog/migrating_code_signing.html#signing-in-xcode-8

error looks like:
None of the valid provisioning profiles allowed the specified entitlements: application-identifier, beta-reports-active, keychain-access-groups

voodoo fix:
after using xcode (instead of the command line) to archive then export an ad-hoc ipa, the command line build issue seemed to resolve itself.