Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AI Question generation support #77

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
"coverageThreshold": {
"global": {
"statements": 95,
"branches": 92,
"branches": 91,
"lines": 95,
"functions": 95
}
Expand Down
7 changes: 4 additions & 3 deletions src/controllers/ctl-creator.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ export const ControllerThisOrThatCreator = function($scope, $timeout, $sanitize,
if (mode == null) {
mode = 'save'
}
const _isValid = $scope.validation('save')
const _isValid = mode == 'history' ? true : $scope.validation('save')

if (_isValid) {
// Create a qset to save
Expand Down Expand Up @@ -106,7 +106,7 @@ export const ControllerThisOrThatCreator = function($scope, $timeout, $sanitize,
else
{
_ids[0] = null
_urls[0] = item.answers[0]?.options.asset?.value
_urls[0] = item.answers[0].options.asset?.value?.length > 0 ? item.answers[0].options.asset.value : item.answers[0].text
}

if ( !item.answers[1]?.options.asset.type || item.answers[1].options.asset.type == 'image' || item.answers[1]?.options.asset && item.answers[1].options.asset.type == 'audio' ) {
Expand All @@ -118,10 +118,11 @@ export const ControllerThisOrThatCreator = function($scope, $timeout, $sanitize,
else
{
_ids[1] = null
_urls[1] = item.answers[1]?.options.asset?.value
_urls[1] = item.answers[1].options.asset?.value?.length > 0 ? item.answers[1].options.asset.value : item.answers[1].text
}

} catch (error) {
console.log(error)
alert('Uh oh. Something went wrong with uploading your questions.')
}

Expand Down
7 changes: 7 additions & 0 deletions src/install.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ general:
is_qset_encrypted: Yes
is_answer_encrypted: Yes
is_storage_enabled: No
is_generable: Yes
api_version: 2
files:
creator: creator.html
Expand Down Expand Up @@ -37,3 +38,9 @@ meta_data:
This or That is a game in which students must answer questions by choosing one of two images.
excerpt: >
Students must answer a question by choosing one of two images.
generation_prompt: >
Each question provides two potential answer options, a correct option and an incorrect option. Answers can either be images or text, but only text answer options
are allowed unless images are explicitly requested. Text answers should be as concise as possible and should not include any language indicating the choice's
correctness or format. Feedback options for each answer should be used to elaborate on why the selection was correct or incorrect. Within each question,
the asset object must contain a key called type that indicates the answer type (text or image).

Loading