amber-framework-knowledge-pack / eval /heldout_sources.jsonl
crimson-knight's picture
Amber framework demo knowledge pack: train/valid pairs + two 50-item eval sets
f879505 verified
Raw
History Blame Contribute Delete
20.7 kB
{"kind": "mc", "question": "Amber framework docs (Create project structure): Then a basic setup \\(without views nor models\\) requires an ____ file inside `src/controllers` directory.\nWhich term fills the blank?\nA) debugger\nB) application_controller.cr\nC) database\nD) _some_model_or_table_name__field_name\nAnswer with a single letter (A, B, C, or D).", "gold": "B", "term": "application_controller.cr", "source_unit_ids": ["cookbook/from-scratch.md#2-create-project-structure"]}
{"kind": "mc", "question": "Amber framework docs (Including Jennifer in Server Bootstrap): The final step in configuration is to include Jennifer in your ____ file.\nWhich term fills the blank?\nA) distinct\nB) src/{project}.cr\nC) --release\nD) --back\nAnswer with a single letter (A, B, C, or D).", "gold": "B", "term": "src/{project}.cr", "source_unit_ids": ["guides/models/jennifer/README.md#15-including-jennifer-in-server-bootstrap"]}
{"kind": "mc", "question": "Amber framework docs (The :layout Option): An example ____: And the layout `views/layouts/application.slang`: The `content` variable holds the rendered view that will be injected in the layout.\nWhich term fills the blank?\nA) views/home/index.slang\nB) postgresql\nC) /app\nD) max\nAnswer with a single letter (A, B, C, or D).", "gold": "A", "term": "views/home/index.slang", "source_unit_ids": ["guides/views/README.md#7-the-layout-option"]}
{"kind": "mc", "question": "Amber framework docs (In your production machine:): You can get your encryption key from ____ file in your development machine.\nWhich term fills the blank?\nA) index\nB) chat_room:\nC) save\nD) .encryption_key\nAnswer with a single letter (A, B, C, or D).", "gold": "D", "term": ".encryption_key", "source_unit_ids": ["deployment/manual-deploy.md#2-in-your-production-machine"]}
{"kind": "mc", "question": "Amber framework docs (Redirection): A successful ____action, for instance, will usually redirect to the `show` action for the model we just created.\nWhich term fills the blank?\nA) config/environments/development.yml\nB) .then\nC) create\nD) settings.cr\nAnswer with a single letter (A, B, C, or D).", "gold": "C", "term": "create", "source_unit_ids": ["guides/controllers/redirection.md#0-redirection"]}
{"kind": "mc", "question": "Amber framework docs (Relations): * ____ - reload relation and returns it.\nWhich term fills the blank?\nA) ChatSocket\nB) postgresql\nC) #{{relation_name}}_reload\nD) save\nAnswer with a single letter (A, B, C, or D).", "gold": "C", "term": "#{{relation_name}}_reload", "source_unit_ids": ["guides/models/jennifer/models.md#3-relations"]}
{"kind": "mc", "question": "Amber framework docs (Relations): Jennifer provides 4 types of relations out of the box: ____, `belongs_to`, `has_and_belongs_to_many`, and `has_one`.\nWhich term fills the blank?\nA) has_many\nB) --back\nC) config/environments/development.yml\nD) rebroadcast!\nAnswer with a single letter (A, B, C, or D).", "gold": "A", "term": "has_many", "source_unit_ids": ["guides/models/jennifer/models.md#3-relations"]}
{"kind": "mc", "question": "Amber framework docs (Using the Amber CLI on Heroku): When you deploy your project to heroku the amber build-pack will make available the `amber cli` to you via the ____ path.\nWhich term fills the blank?\nA) {project_name}/config/environments\nB) StaticController\nC) ./tmp/{timestamp}_console.cr\nD) bin/amber\nAnswer with a single letter (A, B, C, or D).", "gold": "D", "term": "bin/amber", "source_unit_ids": ["deployment/heroku.md#3-using-the-amber-cli-on-heroku"]}
{"kind": "mc", "question": "Amber framework docs (Halt! and redirect\\_to): Unlike other frameworks Amber ____ stops the current execution of the request and performs the redirection at that given time.\nWhich term fills the blank?\nA) /spec\nB) @foo\nC) redirect_to\nD) config/initializers\nAnswer with a single letter (A, B, C, or D).", "gold": "C", "term": "redirect_to", "source_unit_ids": ["guides/controllers/halt.md#1-halt-and-redirect-to"]}
{"kind": "mc", "question": "Amber framework docs (If you need js / css compiled): https://github.com/heroku/heroku-buildpack-nodejs.git ``` If you want js / css to be compiled, you need to modify the ____ command in `package.json` to `\"build\": \"npm run release\",`.\nWhich term fills the blank?\nA) build\nB) config/application.cr\nC) weblog\nD) index.ecr\nAnswer with a single letter (A, B, C, or D).", "gold": "A", "term": "build", "source_unit_ids": ["deployment/dokku.md#6-if-you-need-js-css-compiled"]}
{"kind": "mc", "question": "Amber framework docs (In your production machine:): Finally run your project executable with ____ .\nWhich term fills the blank?\nA) gitignore\nB) bin/<your-app>\nC) Amber::Server\nD) weblog\nAnswer with a single letter (A, B, C, or D).", "gold": "B", "term": "bin/<your-app>", "source_unit_ids": ["deployment/manual-deploy.md#2-in-your-production-machine"]}
{"kind": "mc", "question": "Amber framework docs (Usage): In this example you would get the ____ response.\nWhich term fills the blank?\nA) gitignore\nB) html\nC) includes\nD) <repository>\nAnswer with a single letter (A, B, C, or D).", "gold": "B", "term": "html", "source_unit_ids": ["guides/controllers/respond-with.md#1-usage"]}
{"kind": "mc", "question": "Amber framework docs (Setting the current environment): As mentioned previously, Amber sets the application environment based on the ____ environment variable.\nWhich term fills the blank?\nA) AMBER_ENV\nB) join\nC) crystal\nD) Profile.all\nAnswer with a single letter (A, B, C, or D).", "gold": "A", "term": "AMBER_ENV", "source_unit_ids": ["guides/configuration.md#5-setting-the-current-environment"]}
{"kind": "mc", "question": "Amber framework docs (The :template Option): This is the view template you would like to render, this could be of ____, `ecr`, `mustache`, or `temel`\nWhich term fills the blank?\nA) .crystal-version\nB) secret_key_base\nC) slang\nD) archived\nAnswer with a single letter (A, B, C, or D).", "gold": "C", "term": "slang", "source_unit_ids": ["guides/views/README.md#6-the-template-option"]}
{"kind": "mc", "question": "Amber framework docs (In your production machine:): Install____ and `shards` commands \\([See installation guide](https://crystal-lang.org/docs/installation/)\\).\nWhich term fills the blank?\nA) amber\nB) first\nC) crystal\nD) http://www.mycoolsite.com/page\nAnswer with a single letter (A, B, C, or D).", "gold": "C", "term": "crystal", "source_unit_ids": ["deployment/manual-deploy.md#2-in-your-production-machine"]}
{"kind": "mc", "question": "Amber framework docs (Routing Parameters): Any other parameters defined by the routing, such as :id, will also be available in the ____ object.\nWhich term fills the blank?\nA) false\nB) openssl\nC) params\nD) render\nAnswer with a single letter (A, B, C, or D).", "gold": "C", "term": "params", "source_unit_ids": ["guides/controllers/params.md#5-routing-parameters"]}
{"kind": "mc", "question": "Amber framework docs (Usage): If you do not specify a response type with the ____ header or using the dot notation in the url, you will get the first defined response type.\nWhich term fills the blank?\nA) rebroadcast!\nB) first\nC) accepts\nD) bin/amber\nAnswer with a single letter (A, B, C, or D).", "gold": "C", "term": "accepts", "source_unit_ids": ["guides/controllers/respond-with.md#1-usage"]}
{"kind": "mc", "question": "Amber framework docs (Granite): Granite also supports basic one-to-many relationships with ____ and `has_many` macros that will be familiar to developers experienced with ActiveRecord.\nWhich term fills the blank?\nA) belong_to\nB) shard.yml\nC) type\nD) openssl\nAnswer with a single letter (A, B, C, or D).", "gold": "A", "term": "belong_to", "source_unit_ids": ["guides/models/README.md#1-granite"]}
{"kind": "mc", "question": "Amber framework docs (File Upload): You can access files from the ____ macro using the `files` method.\nWhich term fills the blank?\nA) config/environments/development.yml\nB) params\nC) views/home/index.slang\nD) has_many\nAnswer with a single letter (A, B, C, or D).", "gold": "B", "term": "params", "source_unit_ids": ["cookbook/file-upload.md#0-file-upload"]}
{"kind": "mc", "question": "Amber framework docs (Redirection): Alternately, it could redirect to the ____ action to show all the things of that same type.\nWhich term fills the blank?\nA) Dockerfile\nB) handle_leave\nC) index\nD) #add_{{relation_name}}\nAnswer with a single letter (A, B, C, or D).", "gold": "C", "term": "index", "source_unit_ids": ["guides/controllers/redirection.md#0-redirection"]}
{"kind": "mc", "question": "Amber framework docs (STI): Single table inheritance can be used in this way: The subclass extends the superclass definition with new fields and uses string field ____ to identify itself.\nWhich term fills the blank?\nA) chromedriver\nB) type\nC) {project_name}/config/routes.cr\nD) config/environments/test.yml\nAnswer with a single letter (A, B, C, or D).", "gold": "B", "term": "type", "source_unit_ids": ["guides/models/jennifer/models.md#4-sti"]}
{"kind": "mc", "question": "Amber framework docs (Relations): * ____ - adds given object to relation or builds it from has and adds.\nWhich term fills the blank?\nA) #add_{{relation_name}}\nB) src/controllers/hello_controller.cr\nC) chat_room:\nD) .buildpacks\nAnswer with a single letter (A, B, C, or D).", "gold": "A", "term": "#add_{{relation_name}}", "source_unit_ids": ["guides/models/jennifer/models.md#3-relations"]}
{"kind": "mc", "question": "Amber framework docs (Delete and Destroy): ____ first loads objects and runs callbacks and then calls delete on each.\nWhich term fills the blank?\nA) rebroadcast!\nB) bin/myapp\nC) destroy\nD) api/index\nAnswer with a single letter (A, B, C, or D).", "gold": "C", "term": "destroy", "source_unit_ids": ["guides/models/jennifer/models.md#17-delete-and-destroy"]}
{"kind": "mc", "question": "Amber framework docs (Pipelines): With our ____ pipeline now define we can use it in our routes definitions.\nWhich term fills the blank?\nA) channel.push\nB) :web\nC) lldb\nD) {project_name}/config\nAnswer with a single letter (A, B, C, or D).", "gold": "B", "term": ":web", "source_unit_ids": ["guides/routing/pipelines.md#0-pipelines"]}
{"kind": "mc", "question": "Amber framework docs (Validating request parameters): Amber attempts to alleviate the issues that come with invalid parameters and provides a ____ object to all controllers which contains a built-in `validation` method.\nWhich term fills the blank?\nA) slang\nB) gitignore\nC) :errors\nD) params\nAnswer with a single letter (A, B, C, or D).", "gold": "D", "term": "params", "source_unit_ids": ["guides/controllers/params.md#6-validating-request-parameters"]}
{"kind": "mc", "question": "Amber framework docs (Naming Partials): This holds true even when you're pulling in a partial from another folder: `<%= render \"shared/menu.html.ecr\" %>` That code will pull in the partial from ____.\nWhich term fills the blank?\nA) default\nB) .to_s\nC) database\nD) app/views/shared/_menu.html.ecr\nAnswer with a single letter (A, B, C, or D).", "gold": "D", "term": "app/views/shared/_menu.html.ecr", "source_unit_ids": ["guides/views/README.md#13-naming-partials"]}
{"kind": "mc", "question": "Amber framework docs (System Tests): Before running your specs ensure you have installed the ____ and that `selenium-server standalone` is in your system path.\nWhich term fills the blank?\nA) chromedriver\nB) #errors\nC) {project_name}/config/routes.cr\nD) slang\nAnswer with a single letter (A, B, C, or D).", "gold": "A", "term": "chromedriver", "source_unit_ids": ["guides/testing/system-tests.md#0-system-tests"]}
{"kind": "mc", "question": "Amber framework docs (Add a new Route): Notice how after `\\chat`, the struct ____ that was created above is mapped to that route.\nWhich term fills the blank?\nA) .css\nB) ./tmp/{timestamp}_console.cr\nC) ChatSocket\nD) chat_room\nAnswer with a single letter (A, B, C, or D).", "gold": "C", "term": "ChatSocket", "source_unit_ids": ["guides/websockets/sockets.md#3-add-a-new-route"]}
{"kind": "mc", "question": "Amber framework docs (If you need js / css compiled): Not defining a .buildpack file will cause Dokku to build your project using the ____ as Dokku will auto-detect it, this will not work and cause issues.\nWhich term fills the blank?\nA) Dockerfile\nB) bin/amber\nC) app/views/shared/_menu.html.ecr\nD) config/mailer.cr\nAnswer with a single letter (A, B, C, or D).", "gold": "A", "term": "Dockerfile", "source_unit_ids": ["deployment/dokku.md#6-if-you-need-js-css-compiled"]}
{"kind": "mc", "question": "Amber framework docs (Relations): * ____ - removes given object from relation.\nWhich term fills the blank?\nA) #remove_{{relation_name}}\nB) _some_model_or_table_name__field_name\nC) secret_key_base\nD) encryption_key\nAnswer with a single letter (A, B, C, or D).", "gold": "A", "term": "#remove_{{relation_name}}", "source_unit_ids": ["guides/models/jennifer/models.md#3-relations"]}
{"kind": "recall", "question": "According to the Amber web framework documentation (Update your project shard.yml), which term completes this statement: Once your Amber project is created, you will need to update your ____ file to include Jennifer as a dependency. Answer with just the term.", "gold": "shard.yml", "source_unit_ids": ["guides/models/jennifer/README.md#4-update-your-project-shard-yml"]}
{"kind": "recall", "question": "According to the Amber web framework documentation (Pipelines), which term completes this statement: Don't get rid of ____ if you need to serve static assets. Answer with just the term.", "gold": "StaticController", "source_unit_ids": ["guides/routing/pipelines.md#0-pipelines"]}
{"kind": "recall", "question": "According to the Amber web framework documentation (Filters), which term completes this statement: Filters are inherited, so if you set a filter on____, it will be run on every controller in your application. Answer with just the term.", "gold": "ApplicationController", "source_unit_ids": ["guides/controllers/filters.md#0-filters"]}
{"kind": "recall", "question": "According to the Amber web framework documentation (Naming Partials), which term completes this statement: To render a partial as part of a view, you use the render method within the view: `<%= render \"menu\" %>` This will render a file named ____ at that point within the view being rendered. Answer with just the term.", "gold": "_menu.html.ecr", "source_unit_ids": ["guides/views/README.md#13-naming-partials"]}
{"kind": "recall", "question": "According to the Amber web framework documentation (Update your project shard.yml), which term completes this statement: Add the following code snippet to your application's ____ file: ```yaml Answer with just the term.", "gold": "shard.yml", "source_unit_ids": ["guides/models/jennifer/README.md#4-update-your-project-shard-yml"]}
{"kind": "recall", "question": "According to the Amber web framework documentation (Configuring Routes), which term completes this statement: Routes are configured in the ____ file. Answer with just the term.", "gold": "{project_name}/config/routes.cr", "source_unit_ids": ["guides/routing/routes.md#1-configuring-routes"]}
{"kind": "recall", "question": "According to the Amber web framework documentation (Relation), which term completes this statement: To join a model relation such as ____, `belongs_to` and `has_one` you can pass it's name and join type as: Answer with just the term.", "gold": "has_many", "source_unit_ids": ["guides/models/jennifer/models.md#19-relation"]}
{"kind": "recall", "question": "According to the Amber web framework documentation (Testing), which term completes this statement: You can ensure smooth testing by adding the following to your ____: Also just regular deleting or truncation could be used but transactions provide 15x speed up \\(at least for postgres; mysql gets less impact\\). Answer with just the term.", "gold": "spec_helper.cr", "source_unit_ids": ["guides/models/jennifer/models.md#43-testing"]}
{"kind": "recall", "question": "According to the Amber web framework documentation (File Upload), which term completes this statement: Files are detected and turned into ____ and put into a temporary file cache. Answer with just the term.", "gold": "Amber::Router::File", "source_unit_ids": ["cookbook/file-upload.md#0-file-upload"]}
{"kind": "recall", "question": "According to the Amber web framework documentation (The :layout Option), which term completes this statement: This will render the ____ template inside the `views/layouts/application.slang` layout. Answer with just the term.", "gold": "views/home/index.slang", "source_unit_ids": ["guides/views/README.md#7-the-layout-option"]}
{"kind": "recall", "question": "According to the Amber web framework documentation (Routing Parameters), which term completes this statement: We can add a route which captures the ____ parameter in a \"pretty\" URL: In this case, when a user opens the URL `/clients/active`, `params[:status]` will be set to \"active\" Answer with just the term.", "gold": ":status", "source_unit_ids": ["guides/controllers/params.md#5-routing-parameters"]}
{"kind": "recall", "question": "According to the Amber web framework documentation (Relations), which term completes this statement: ____ also accepts the next 2 arguments and uses regular arguments in a slightly different way: * `join_table` - join table name; by default, relation table names are in alphabetic order, joined by underscores. Answer with just the term.", "gold": "has_and_belongs_to_many", "source_unit_ids": ["guides/models/jennifer/models.md#3-relations"]}
{"kind": "recall", "question": "According to the Amber web framework documentation (Setting the current environment), which term completes this statement: For example to run Amber in the production environment, we can set the ____ to `production`. Answer with just the term.", "gold": "AMBER_ENV", "source_unit_ids": ["guides/configuration.md#5-setting-the-current-environment"]}
{"kind": "recall", "question": "According to the Amber web framework documentation (Inline Mode), which term completes this statement: The ____ command in inline mode allows you to execute a line of code \\(or several with semicolons\\) with your application code and environment loaded. Answer with just the term.", "gold": "exec", "source_unit_ids": ["cli/exec.md#2-inline-mode"]}
{"kind": "recall", "question": "According to the Amber web framework documentation (In your development machine:), which term completes this statement: && npm run release` to compile/minify ____ and `.js` files. Answer with just the term.", "gold": ".css", "source_unit_ids": ["deployment/manual-deploy.md#1-in-your-development-machine"]}
{"kind": "recall", "question": "According to the Amber web framework documentation (File Upload), which term completes this statement: The attributes you can access are: For example, let's say we have a controller with a ____ method that we want someone to `POST` a JSON body that includes a file to upload: ```crystal Answer with just the term.", "gold": "create", "source_unit_ids": ["cookbook/file-upload.md#0-file-upload"]}
{"kind": "recall", "question": "According to the Amber web framework documentation (Setting the current environment), which term completes this statement: If you would like to set the environment to something else, you will need to configure the ____ environment variable before running the server process. Answer with just the term.", "gold": "AMBER_ENV", "source_unit_ids": ["guides/configuration.md#5-setting-the-current-environment"]}
{"kind": "recall", "question": "According to the Amber web framework documentation (Editor Mode), which term completes this statement: Specifying a value for the ____ option allows you to go _n_ scripts back and edit+run that script. Answer with just the term.", "gold": "--back", "source_unit_ids": ["cli/exec.md#12-editor-mode"]}
{"kind": "recall", "question": "According to the Amber web framework documentation (Setting the current environment), which term completes this statement: By default, the environment is set to ____. Answer with just the term.", "gold": "development", "source_unit_ids": ["guides/configuration.md#5-setting-the-current-environment"]}
{"kind": "recall", "question": "According to the Amber web framework documentation (Create project structure), which term completes this statement: Secondly a ____ file with pipelines and routes blocks, also see: [routing](../guides/routing/). Answer with just the term.", "gold": "routes.cr", "source_unit_ids": ["cookbook/from-scratch.md#2-create-project-structure"]}