Skip to content
Draft
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
1 change: 1 addition & 0 deletions docs/components/pie-author/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ The class `pie-loading` will be added to the element while assets are being load
| `disableBundler` | `disable-bundler` | Allows disabling of the default behaviour which is to look up and load the JS bundle that define the Custom Elements used by the item config. This if for advanced use cases when using the pie-player in a container that is managing loading of Custom Elements and Controllers. | `boolean` | `false` |
| `imageSupport` | -- | external providers can set this if they need to upload the assets to the cloud etc. by default we use data urls | `ExternalImageSupport` | `new DataURLImageSupport()` |
| `isInsidePieApiAuthor` | `is-inside-pie-api-author` | If pie-author is used inside pie-api-author component. Do not set it manually. | `boolean` | `false` |
| `reFetchBundle` | `re-fetch-bundle` | used to automatically re-fetch the bundle (in case we get a 503) | `boolean` | `false` |
| `uploadSoundSupport` | -- | external providers can set this if they need to upload the assets to the cloud etc. by default we use data urls | `ExternalUploadSoundSupport` | `new DataURLUploadSoundSupport()` |
| `version` | `version` | | `string` | `VERSION` |

Expand Down
1 change: 1 addition & 0 deletions docs/components/pie-player/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ The class `pie-loading` will be added to the element while assets are being load
| `disableBundler` | `disable-bundler` | Allows disabling of the default behaviour which is to look up and load the JS bundle that define the Custom Elements used by the item config. This if for advanced use cases when using the pie-player in a container that is managing loading of Custom Elements and Controllers. | `boolean` | `false` |
| `env` | -- | Describes runtime environment for the player. | `{ mode: String \| Mode; role: String \| Role; partialScoring?: boolean; }` | `{mode: "gather", role: "student"}` |
| `hosted` | `hosted` | Indicates if player running in the context of a PIE hosting system. Do not modify the default value for this property if you are not implementing a PIE host. If true, the host is responsible for all model updates. | `boolean` | `false` |
| `reFetchBundle` | `re-fetch-bundle` | used to automatically re-fetch the bundle (in case we get a 503) | `boolean` | `false` |
| `renderStimulus` | `render-stimulus` | If the item contains a stimulus, the player will render it by default. Set this property to false to not render stimulus. | `boolean` | `true` |
| `session` | -- | The Pie Session | `{ id: string; data: any[]; }` | `{id: "", data: []}` |
| `showBottomBorder` | `show-bottom-border` | In evaluate mode, add a bottom border to visually separate each item in the case of a multi-item | `boolean` | `false` |
Expand Down
7 changes: 4 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@pie-framework/pie-player-components",
"version": "2.11.4",
"version": "2.11.4-beta.3",
"description": "Pie Player Components",
"module": "dist/index.mjs",
"main": "dist/index.js",
Expand Down Expand Up @@ -35,7 +35,8 @@
"yalc": "yalc push",
"commit": "git-cz",
"semantic-release": "semantic-release",
"pretest": "if [ -f set-version.sh ]; then ./set-version.sh $npm_package_version; else echo \"skip post-install\"; fi"
"pretest": "if [ -f set-version.sh ]; then ./set-version.sh $npm_package_version; else echo \"skip post-install\"; fi",
"full": "git clean -xdf . && yarn install && yarn pretest && yarn build && yarn demo"
},
"dependencies": {
"@material/select": "^2.2.0",
Expand All @@ -44,7 +45,7 @@
"@material/tab-bar": "^2.2.0",
"@pie-framework/pie-configure-events": "^1.4.1",
"@pie-framework/pie-player-events": "^0.1.0",
"@pie-lib/pie-toolbox-math-rendering-module": "1.9.3",
"@pie-lib/pie-toolbox-math-rendering-module": "1.21.0-beta.0",
"async-retry": "^1.2.3",
"lodash": "^4.17.15",
"parse-package-name": "^0.1.0"
Expand Down
16 changes: 16 additions & 0 deletions src/components.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,10 @@ export namespace Components {
*/
'isInsidePieApiAuthor'?: boolean;
/**
* used to automatically re-fetch the bundle (in case we get a 503)
*/
'reFetchBundle'?: boolean;
/**
* external providers can set this if they need to upload the assets to the cloud etc. by default we use data urls
*/
'uploadSoundSupport': ExternalUploadSoundSupport;
Expand Down Expand Up @@ -130,6 +134,10 @@ export namespace Components {
'hosted'?: boolean;
'provideScore': () => Promise<false | any[]>;
/**
* used to automatically re-fetch the bundle (in case we get a 503)
*/
'reFetchBundle'?: boolean;
/**
* If the item contains a stimulus, the player will render it by default. Set this property to false to not render stimulus.
*/
'renderStimulus': boolean;
Expand Down Expand Up @@ -275,6 +283,10 @@ declare namespace LocalJSX {
*/
'onModelUpdated'?: (event: CustomEvent<any>) => void;
/**
* used to automatically re-fetch the bundle (in case we get a 503)
*/
'reFetchBundle'?: boolean;
/**
* external providers can set this if they need to upload the assets to the cloud etc. by default we use data urls
*/
'uploadSoundSupport'?: ExternalUploadSoundSupport;
Expand Down Expand Up @@ -331,6 +343,10 @@ declare namespace LocalJSX {
*/
'onSession-changed'?: (event: CustomEvent<any>) => void;
/**
* used to automatically re-fetch the bundle (in case we get a 503)
*/
'reFetchBundle'?: boolean;
/**
* If the item contains a stimulus, the player will render it by default. Set this property to false to not render stimulus.
*/
'renderStimulus'?: boolean;
Expand Down
12 changes: 9 additions & 3 deletions src/components/pie-author/pie-author.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {
h
} from "@stencil/core";

import { _dll_pie_lib__pie_toolbox_math_rendering_accessible } from "@pie-lib/pie-toolbox-math-rendering-module/module";
import { _dll_pie_lib__pie_toolbox_math_rendering, _dll_pie_lib__pie_toolbox_math_rendering_accessible } from "@pie-lib/pie-toolbox-math-rendering-module/module";

import {PieContent, ItemConfig, PieElement, PieModel, PieController} from "../../interface";
import {
Expand Down Expand Up @@ -173,6 +173,11 @@ export class Author {
*/
@Prop() canWatchConfigSettings: boolean = false;

/**
* used to automatically re-fetch the bundle (in case we get a 503)
*/
@Prop() reFetchBundle?: boolean = false;

@Method()
async validateModels() {
if (!this.pieContentModel || !this.pieContentModel.models) {
Expand Down Expand Up @@ -647,14 +652,15 @@ export class Author {
doc: this.doc,
endpoints,
useCdn: false,
forceBundleUrl
forceBundleUrl,
reFetchBundle: this.reFetchBundle
});
}
}

private renderMath() {
setTimeout(() => {
_dll_pie_lib__pie_toolbox_math_rendering_accessible.renderMath(this.el);
_dll_pie_lib__pie_toolbox_math_rendering.renderMath(this.el);
}, 50);
}

Expand Down
11 changes: 9 additions & 2 deletions src/components/pie-player/pie-player.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import {SessionChangedEvent} from "@pie-framework/pie-player-events";
import {
_dll_pie_lib__pie_toolbox_math_rendering,
_dll_pie_lib__pie_toolbox_math_rendering_accessible
} from "@pie-lib/pie-toolbox-math-rendering-module/module";
import {
Expand Down Expand Up @@ -122,6 +123,11 @@ export class Player {
*/
@Prop() showBottomBorder: boolean = false;

/**
* used to automatically re-fetch the bundle (in case we get a 503)
*/
@Prop() reFetchBundle?: boolean = false;

@Watch("addCorrectResponse")
watchAddCorrectResponse(newValue, oldValue) {
if (newValue !== oldValue) {
Expand Down Expand Up @@ -223,7 +229,8 @@ export class Player {
endpoints: endpoints,
bundle: this.hosted ? BundleType.player : BundleType.clientPlayer,
useCdn: false,
forceBundleUrl
forceBundleUrl,
reFetchBundle: this.reFetchBundle
});
}
} catch (err) {
Expand Down Expand Up @@ -391,7 +398,7 @@ export class Player {

private renderMath() {
setTimeout(() => {
_dll_pie_lib__pie_toolbox_math_rendering_accessible.renderMath(this.el);
_dll_pie_lib__pie_toolbox_math_rendering.renderMath(this.el);
}, 50);
}

Expand Down
Loading