amber-framework-knowledge-pack / eval /memorization.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 (Set Encryption Key): Copy the key from ____ and set it to env, like so:\nWhich term fills the blank?\nA) {project_name}/config\nB) chat_room:\nC) .encryption_key\nD) .crystal-version\nAnswer with a single letter (A, B, C, or D).", "gold": "C", "term": ".encryption_key", "source_unit_ids": ["deployment/dokku.md#11-set-encryption-key"]}
{"kind": "mc", "question": "Amber framework docs (Working with Views): [Amber Generators](https://docs.amberframework.org/amber/cli/generate) support ____ and `ecr` templates using the `-t` option when creating a new project.\nWhich term fills the blank?\nA) slang\nB) redirect_to\nC) Dockerfile\nD) {project_name}/config/environments\nAnswer with a single letter (A, B, C, or D).", "gold": "A", "term": "slang", "source_unit_ids": ["guides/views/README.md#1-working-with-views"]}
{"kind": "mc", "question": "Amber framework docs (The Test Environment): In this case, we can modify our test environment by changing the options found in ____.\nWhich term fills the blank?\nA) Amber::WebSockets::ClientSocket\nB) config/environments/test.yml\nC) includes\nD) :checkbox\nAnswer with a single letter (A, B, C, or D).", "gold": "B", "term": "config/environments/test.yml", "source_unit_ids": ["guides/testing/README.md#3-the-test-environment"]}
{"kind": "mc", "question": "Amber framework docs (The `web` container): You can see the webpack configuration in the ____ directory to see what assets are compiled.\nWhich term fills the blank?\nA) config/database.yml\nB) channel.push\nC) .delete\nD) config/webpack\nAnswer with a single letter (A, B, C, or D).", "gold": "D", "term": "config/webpack", "source_unit_ids": ["guides/docker.md#7-the-web-container"]}
{"kind": "mc", "question": "Amber framework docs (Introduction): * ____ - Called when a user leaves the channel.\nWhich term fills the blank?\nA) config/routes.cr\nB) with\nC) handle_leave\nD) Resources\nAnswer with a single letter (A, B, C, or D).", "gold": "C", "term": "handle_leave", "source_unit_ids": ["guides/websockets/channels.md#1-introduction"]}
{"kind": "mc", "question": "Amber framework docs (Methods and Actions): Controllers are defined as such: As an example, if a user goes to ____ in your application to add a new client, Amber will create an instance of **ApiController** and call it's **index** method\nWhich term fills the blank?\nA) has_and_belongs_to_many\nB) save\nC) api/index\nD) config/\nAnswer with a single letter (A, B, C, or D).", "gold": "C", "term": "api/index", "source_unit_ids": ["guides/controllers/README.md#3-methods-and-actions"]}
{"kind": "mc", "question": "Amber framework docs (Validation API): ____ Returns true if all params are valid or false otherwise.\nWhich term fills the blank?\nA) #valid?\nB) --back\nC) Amber::Router::File\nD) .delete\nAnswer with a single letter (A, B, C, or D).", "gold": "A", "term": "#valid?", "source_unit_ids": ["guides/controllers/params.md#9-validation-api"]}
{"kind": "mc", "question": "Amber framework docs (docker-compose.yml): It includes the ____, `mailcatcher`, `migrate`, `app`, and `web` containers.\nWhich term fills the blank?\nA) database\nB) config/database.yml\nC) bin/{your-app-name}\nD) FormBuilder.form\nAnswer with a single letter (A, B, C, or D).", "gold": "A", "term": "database", "source_unit_ids": ["guides/docker.md#2-docker-compose-yml"]}
{"kind": "mc", "question": "Amber framework docs (From Source): Download and install ____ **NOTE:** At the time of this writing, v1.4.1 is the current stable release, but you should use the most recent tag in place of that.\nWhich term fills the blank?\nA) .buildpacks\nB) amber\nC) render\nD) chat_room\nAnswer with a single letter (A, B, C, or D).", "gold": "B", "term": "amber", "source_unit_ids": ["guides/installation.md#2-from-source"]}
{"kind": "mc", "question": "Amber framework docs (Encrypted Environment Settings): **Never commit the encryption key!** Setup your production machine and use the variable ____ See more on [encrypt section](../cli/encrypt.md)\nWhich term fills the blank?\nA) chromedriver\nB) AMBER_ENCRYPTION_KEY\nC) _some_model_or_table_name__field_name\nD) chat_room\nAnswer with a single letter (A, B, C, or D).", "gold": "B", "term": "AMBER_ENCRYPTION_KEY", "source_unit_ids": ["guides/configuration.md#13-encrypted-environment-settings"]}
{"kind": "mc", "question": "Amber framework docs (Finding Layouts): If there is no such controller-specific layout, Amber will use ____.\nWhich term fills the blank?\nA) @[NoInline]\nB) src/views/layouts/application.html.ecr\nC) secret_key_base\nD) user_join\nAnswer with a single letter (A, B, C, or D).", "gold": "B", "term": "src/views/layouts/application.html.ecr", "source_unit_ids": ["guides/views/README.md#9-finding-layouts"]}
{"kind": "mc", "question": "Amber framework docs (Encrypted Environment Settings): This file is added to ____ to avoid inclusion in version control.\nWhich term fills the blank?\nA) .gitignore\nB) :web\nC) watch\nD) .delete\nAnswer with a single letter (A, B, C, or D).", "gold": "A", "term": ".gitignore", "source_unit_ids": ["guides/configuration.md#13-encrypted-environment-settings"]}
{"kind": "mc", "question": "Amber framework docs (Working with Views): (Kilt will work with ____ and `temel` as well, but they haven't been tested in amber, so your experience may vary.) Kilt automatically selects the templating engine based on the extension of the file being read (e.g.\nWhich term fills the blank?\nA) mustache\nB) src/views/layouts/photos.ecr\nC) join\nD) distinct\nAnswer with a single letter (A, B, C, or D).", "gold": "A", "term": "mustache", "source_unit_ids": ["guides/views/README.md#1-working-with-views"]}
{"kind": "mc", "question": "Amber framework docs (Validation API): ____ Input must be valid otherwise raises an error.\nWhich term fills the blank?\nA) --back\nB) create\nC) src/views/layouts/photos.ecr\nD) #validate!\nAnswer with a single letter (A, B, C, or D).", "gold": "D", "term": "#validate!", "source_unit_ids": ["guides/controllers/params.md#9-validation-api"]}
{"kind": "mc", "question": "Amber framework docs (The `mailcatcher` container): If you generate mailers, it will configure the ____ to point to the mail catcher container.\nWhich term fills the blank?\nA) @foo\nB) SMTP_URL\nC) AMBER_ENV\nD) ./microsecond-blog\nAnswer with a single letter (A, B, C, or D).", "gold": "B", "term": "SMTP_URL", "source_unit_ids": ["guides/docker.md#4-the-mailcatcher-container"]}
{"kind": "mc", "question": "Amber framework docs (Encrypted Environment Settings): With Amber you can encrypt your environment setting using `amber encrypt {environment}`, this command will open your editor to allow make changes if needed and then encrypt the file ____.\nWhich term fills the blank?\nA) pets\nB) gitignore\nC) {environment}.enc\nD) src/views/layouts/photos.ecr\nAnswer with a single letter (A, B, C, or D).", "gold": "C", "term": "{environment}.enc", "source_unit_ids": ["guides/configuration.md#13-encrypted-environment-settings"]}
{"kind": "mc", "question": "Amber framework docs (Validation API): ____ Setup validation rules to be performed.\nWhich term fills the blank?\nA) AMBER_ENCRYPTION_KEY\nB) #validation\nC) config/routes.cr\nD) app/views/shared/_menu.html.ecr\nAnswer with a single letter (A, B, C, or D).", "gold": "B", "term": "#validation", "source_unit_ids": ["guides/controllers/params.md#9-validation-api"]}
{"kind": "mc", "question": "Amber framework docs (Create Procfile): Create a ____ at the root of your Amber application and add the following: The Amber buildpack takes care of compiling the project for you.\nWhich term fills the blank?\nA) .first!\nB) Procfile\nC) button_to\nD) shards.yml\nAnswer with a single letter (A, B, C, or D).", "gold": "B", "term": "Procfile", "source_unit_ids": ["deployment/dokku.md#8-create-procfile"]}
{"kind": "mc", "question": "Amber framework docs (Validation API): This array of errors is populated after running ____ or `#valid?`.\nWhich term fills the blank?\nA) has_many\nB) #validate!\nC) max\nD) crystallang/crystal:{version}\nAnswer with a single letter (A, B, C, or D).", "gold": "B", "term": "#validate!", "source_unit_ids": ["guides/controllers/params.md#9-validation-api"]}
{"kind": "mc", "question": "Amber framework docs (docker-compose.yml): The ____ file will allow you to easily get up and running.\nWhich term fills the blank?\nA) .git/hook/post-receive\nB) params\nC) redirect_to\nD) docker-compose.yml\nAnswer with a single letter (A, B, C, or D).", "gold": "D", "term": "docker-compose.yml", "source_unit_ids": ["guides/docker.md#2-docker-compose-yml"]}
{"kind": "mc", "question": "Amber framework docs (FormBuilder in Plain Crystal Code): When using the ____ method in plain Crystal code, the `<<` syntax is required to add the generated field HTML to the form HTML string OR you can use the lower level `String.build` instead:\nWhich term fills the blank?\nA) belongs_to\nB) FormBuilder.form\nC) spec\nD) {project_name}/config/environments\nAnswer with a single letter (A, B, C, or D).", "gold": "B", "term": "FormBuilder.form", "source_unit_ids": ["guides/views/form-builder.md#5-formbuilder-in-plain-crystal-code"]}
{"kind": "mc", "question": "Amber framework docs (Custom): Then in your routes file: Alternatively you can use [____](../guides/controllers/respond-with.md) helper.\nWhich term fills the blank?\nA) database_url\nB) respond_with\nC) handle_message\nD) archived\nAnswer with a single letter (A, B, C, or D).", "gold": "B", "term": "respond_with", "source_unit_ids": ["cookbook/json-api.md#1-custom"]}
{"kind": "mc", "question": "Amber framework docs (Dockerfile): It will also add the project to the ____ folder on the image so you can use this in production as well.\nWhich term fills the blank?\nA) Amber::Server\nB) src/views/layouts/photos.ecr\nC) /app\nD) lldb\nAnswer with a single letter (A, B, C, or D).", "gold": "C", "term": "/app", "source_unit_ids": ["guides/docker.md#1-dockerfile"]}
{"kind": "mc", "question": "Amber framework docs (Resources): Let’s add a resource to the ____ Then go to the root of your project, and run `amber routes` This will output the standard matrix of HTTP verbs, controller, action, pipeline, scope, and URI pattern.\nWhich term fills the blank?\nA) bin/myapp\nB) config/routes.cr\nC) .distinct\nD) save\nAnswer with a single letter (A, B, C, or D).", "gold": "B", "term": "config/routes.cr", "source_unit_ids": ["guides/routing/routes.md#4-resources"]}
{"kind": "mc", "question": "Amber framework docs (Transaction): To rollback a transaction, raise ____ exception.\nWhich term fills the blank?\nA) DB::Rollback\nB) has_many\nC) save\nD) postgres\nAnswer with a single letter (A, B, C, or D).", "gold": "A", "term": "DB::Rollback", "source_unit_ids": ["guides/models/jennifer/models.md#39-transaction"]}
{"kind": "mc", "question": "Amber framework docs (`amber new`): An ____ configuration file is generated a long with the default application directory structure.\nWhich term fills the blank?\nA) <repository>\nB) from\nC) .amber.yml\nD) index.ecr\nAnswer with a single letter (A, B, C, or D).", "gold": "C", "term": ".amber.yml", "source_unit_ids": ["cli/new.md#1-amber-new"]}
{"kind": "mc", "question": "Amber framework docs (Resources): The ____ macro is a quick way to setup up resourceful routing for all seven standard actions for a controller in a single line.\nWhich term fills the blank?\nA) #remove_{{relation_name}}\nB) resources\nC) belong_to\nD) controllers\nAnswer with a single letter (A, B, C, or D).", "gold": "B", "term": "resources", "source_unit_ids": ["guides/routing/routes.md#4-resources"]}
{"kind": "mc", "question": "Amber framework docs (Define Buildpack): Create a file named ____ in the root of your project and with this: ```text https://github.com/amberframework/heroku-buildpack-amber.git\nWhich term fills the blank?\nA) distinct\nB) amber\nC) link_to\nD) .buildpacks\nAnswer with a single letter (A, B, C, or D).", "gold": "D", "term": ".buildpacks", "source_unit_ids": ["deployment/dokku.md#5-define-buildpack"]}
{"kind": "mc", "question": "Amber framework docs (The Flash): Make sure the Flash, Session and CSRF pipelines are enabled in your ____ file and in the order that the scaffolding renders them.\nWhich term fills the blank?\nA) params\nB) index.ecr\nC) save\nD) routes.cr\nAnswer with a single letter (A, B, C, or D).", "gold": "D", "term": "routes.cr", "source_unit_ids": ["guides/controllers/sessions.md#6-the-flash"]}
{"kind": "mc", "question": "Amber framework docs (Add Amber dependency): First you require to add the ____ shard dependency in your `shard.yml` file: Then execute `shards install` :\nWhich term fills the blank?\nA) Amber.settings.secrets\nB) amber\nC) #add_{{relation_name}}\nD) {project_name}/config\nAnswer with a single letter (A, B, C, or D).", "gold": "B", "term": "amber", "source_unit_ids": ["cookbook/from-scratch.md#1-add-amber-dependency"]}
{"kind": "recall", "question": "According to the Amber web framework documentation (Creating the database), which term completes this statement: Edit the database setting for your current environment by editing the file: Amber looks at the ____ key for the default database connection string. Answer with just the term.", "gold": "database_url", "source_unit_ids": ["guides/create-new-app.md#2-creating-the-database"]}
{"kind": "recall", "question": "According to the Amber web framework documentation (6. Printing instance variables), which term completes this statement: For printing ____ var in this code: You can use `self.foo` in the debugger terminal or VSCode GUI. Answer with just the term.", "gold": "@foo", "source_unit_ids": ["examples/crystal-debug.md#15-6-printing-instance-variables"]}
{"kind": "recall", "question": "According to the Amber web framework documentation (Set Encryption Key), which term completes this statement: Ensure you first run: To be able to decrypt and use production environment you'll need to set `ENV[\"AMBER_ENCRYPTION_KEY\"]` to the value of your local projects ____ file. Answer with just the term.", "gold": ".encryption_key", "source_unit_ids": ["deployment/dokku.md#11-set-encryption-key"]}
{"kind": "recall", "question": "According to the Amber web framework documentation (Where), which term completes this statement: The ____ method accepts a block which represents the where clause of the query statement. Answer with just the term.", "gold": "where", "source_unit_ids": ["guides/models/jennifer/models.md#13-where"]}
{"kind": "recall", "question": "According to the Amber web framework documentation (Scopes (aka. Prepared queries)), which term completes this statement: The ____ macro allows you to define a Crystal block containing the desired prepared query statement, and creates a class method on the model to execute. Answer with just the term.", "gold": "scope", "source_unit_ids": ["guides/models/jennifer/models.md#5-scopes-aka-prepared-queries"]}
{"kind": "recall", "question": "According to the Amber web framework documentation (Distinct), which term completes this statement: ____ retrieves database column values without repeats. Answer with just the term.", "gold": ".distinct", "source_unit_ids": ["guides/models/jennifer/models.md#24-distinct"]}
{"kind": "recall", "question": "According to the Amber web framework documentation (Tips and Tricks for debugging Crystal applications), which term completes this statement: ____ does not show data for variables in crystal yet, see issue [\\#4457](https://github.com/crystal-lang/crystal/issues/4457) Fully debugging Crystal applications is not supported yet. Answer with just the term.", "gold": "lldb", "source_unit_ids": ["examples/crystal-debug.md#6-tips-and-tricks-for-debugging-crystal-applications"]}
{"kind": "recall", "question": "According to the Amber web framework documentation (The Amber Heroku Buildpack), which term completes this statement: If you need to use a specific version create a ____ file in your application root directory with the version that should be used \\(e.g. Answer with just the term.", "gold": ".crystal-version", "source_unit_ids": ["deployment/heroku.md#1-the-amber-heroku-buildpack"]}
{"kind": "recall", "question": "According to the Amber web framework documentation (Callbacks), which term completes this statement: The available macros for defining callbacks include: * ____ * `after_save` * `before_create` * `after_create` * `after_initialize` * `before_destroy` They accept method names. Answer with just the term.", "gold": "before_save", "source_unit_ids": ["guides/models/jennifer/models.md#7-callbacks"]}
{"kind": "recall", "question": "According to the Amber web framework documentation (Group), which term completes this statement: ____ allows to add columns for `GROUP BY` section. Answer with just the term.", "gold": ".group", "source_unit_ids": ["guides/models/jennifer/models.md#21-group"]}
{"kind": "recall", "question": "According to the Amber web framework documentation (Debug on VSCode), which term completes this statement: By convention the project directory name is the same as your application name, if you have changed it, please update `${workspaceFolderBasename}` with the name configured inside ____ Answer with just the term.", "gold": "shards.yml", "source_unit_ids": ["examples/crystal-debug.md#2-debug-on-vscode"]}
{"kind": "recall", "question": "According to the Amber web framework documentation (File Mode), which term completes this statement: The changes you make will **not** modify the original source file, but they will be used when `amber exec` runs the code and saved as a ____ file. Answer with just the term.", "gold": "./tmp/{timestamp}_console.cr", "source_unit_ids": ["cli/exec.md#14-file-mode"]}
{"kind": "recall", "question": "According to the Amber web framework documentation (Create Procfile), which term completes this statement: To deploy your app to Dokku you're going to need a ____. Answer with just the term.", "gold": "Procfile", "source_unit_ids": ["deployment/dokku.md#8-create-procfile"]}
{"kind": "recall", "question": "According to the Amber web framework documentation (Define Crystal Version), which term completes this statement: Create a file named ____ in the root of your project with the wanted crystal version: Answer with just the term.", "gold": ".crystal-version", "source_unit_ids": ["deployment/dokku.md#7-define-crystal-version"]}
{"kind": "recall", "question": "According to the Amber web framework documentation (Eager load), which term completes this statement: Also you can extract the first entity via ____. Answer with just the term.", "gold": "first", "source_unit_ids": ["guides/models/jennifer/models.md#38-eager-load"]}
{"kind": "recall", "question": "According to the Amber web framework documentation (Add A Jennifer Initializer to Configuration), which term completes this statement: Note that we pass the ____ to `Jennifer::Config.read` this will allow Jennifer to use the correct database settings for the environment. Answer with just the term.", "gold": "AMBER_ENV", "source_unit_ids": ["guides/models/jennifer/README.md#12-add-a-jennifer-initializer-to-configuration"]}
{"kind": "recall", "question": "According to the Amber web framework documentation (Finding Layouts), which term completes this statement: For example, rendering actions from the PhotosController class will use ____. Answer with just the term.", "gold": "src/views/layouts/photos.ecr", "source_unit_ids": ["guides/views/README.md#9-finding-layouts"]}
{"kind": "recall", "question": "According to the Amber web framework documentation (1. Install dependencies), which term completes this statement: If you already have ____, `amber`, and a database installed, you can [skip this step](#2.-generate-a-new-amber-application). Answer with just the term.", "gold": "crystal", "source_unit_ids": ["getting-started/README.md#2-1-install-dependencies"]}
{"kind": "recall", "question": "According to the Amber web framework documentation (Resources), which term completes this statement: In order to use resourceful routing for a particular controller, your controller _must_ define and implement all seven standard actions: ____, `edit`, `new`, `show`, `create`, `destroy`, and `update`. Answer with just the term.", "gold": "index", "source_unit_ids": ["guides/routing/routes.md#4-resources"]}
{"kind": "recall", "question": "According to the Amber web framework documentation (CSRF), which term completes this statement: To use CSRF, enable the pipe in your ____ by adding the following pipe to a pipeline. Answer with just the term.", "gold": "routes.cr", "source_unit_ids": ["guides/controllers/csrf.md#0-csrf"]}