${this.image
@@ -502,6 +513,12 @@ class SelfCheck extends I18NMixin(lazyImageLoader(SchemaBehaviors(DDD))) {
static get tag() {
return "self-check";
}
+ firstUpdated(changedProperties) {
+ if (super.firstUpdated) {
+ super.firstUpdated(changedProperties);
+ }
+ this.setAttribute("typeof", "oer:Assessment");
+ }
static get properties() {
return {
...super.properties,
@@ -559,6 +576,20 @@ class SelfCheck extends I18NMixin(lazyImageLoader(SchemaBehaviors(DDD))) {
attribute: "accent-color",
reflect: true,
},
+ /**
+ * Learning objective reference emitted as oer:hasLearningObjective.
+ */
+ hasLearningObjective: {
+ type: String,
+ attribute: "has-learning-objective",
+ },
+ /**
+ * Activity reference emitted as oer:assessing.
+ */
+ assessing: {
+ type: String,
+ attribute: "assessing",
+ },
};
}
/**
diff --git a/elements/sorting-question/lib/sorting-question.haxProperties.json b/elements/sorting-question/lib/sorting-question.haxProperties.json
index ee36ba3fa1..14bb3a9aa2 100644
--- a/elements/sorting-question/lib/sorting-question.haxProperties.json
+++ b/elements/sorting-question/lib/sorting-question.haxProperties.json
@@ -28,6 +28,24 @@
"description": "Question Header.",
"inputMethod": "textfield"
},
+ {
+ "property": "gradingFormat",
+ "title": "Grading format",
+ "description": "OER Schema: grading format for this assessment (e.g. points, letter, percent, completion).",
+ "inputMethod": "textfield"
+ },
+ {
+ "property": "hasLearningObjective",
+ "title": "Learning objective",
+ "description": "OER Schema: learning objective associated with this assessment.",
+ "inputMethod": "textfield"
+ },
+ {
+ "property": "forCourse",
+ "title": "Course",
+ "description": "OER Schema: course this assessment is intended for.",
+ "inputMethod": "textfield"
+ },
{
"property": "answers",
"title": "Answers",
diff --git a/elements/star-rating/star-rating.js b/elements/star-rating/star-rating.js
index 2764b8cf40..028dc8f3c9 100644
--- a/elements/star-rating/star-rating.js
+++ b/elements/star-rating/star-rating.js
@@ -2,10 +2,11 @@
* Copyright 2021 The Pennsylvania State University
* @license Apache-2.0, see License.md for full text.
*/
-import { html, css } from "lit";
+import { html, css, nothing } from "lit";
import "@haxtheweb/simple-icon/lib/simple-icon-button.js";
import "@haxtheweb/simple-icon/simple-icon.js";
import { SimpleColors } from "@haxtheweb/simple-colors/simple-colors.js";
+import { SchemaBehaviors } from "@haxtheweb/schema-behaviors/schema-behaviors.js";
/**
* `star-rating`
* `Rating display widget or button to do rating`
@@ -13,11 +14,70 @@ import { SimpleColors } from "@haxtheweb/simple-colors/simple-colors.js";
* @demo demo/index.html
* @element star-rating
*/
-class StarRating extends SimpleColors {
+class StarRating extends SchemaBehaviors(SimpleColors) {
static get tag() {
return "star-rating";
}
+ static get haxProperties() {
+ return {
+ canScale: true,
+ gizmo: {
+ title: "Star Rating",
+ description: "Rating display widget or button to do rating.",
+ icon: "icons:star",
+ color: "yellow",
+ tags: [
+ "Instructional",
+ "rating",
+ "stars",
+ "rubric",
+ "scale",
+ "feedback",
+ ],
+ handles: [],
+ meta: {
+ author: "HAXTheWeb core team",
+ },
+ },
+ settings: {
+ configure: [
+ {
+ property: "score",
+ title: "Score",
+ description: "Current score value.",
+ inputMethod: "number",
+ },
+ {
+ property: "possible",
+ title: "Possible",
+ description: "Maximum possible score.",
+ inputMethod: "number",
+ },
+ {
+ property: "numStars",
+ title: "Number of Stars",
+ description: "Number of stars to display.",
+ inputMethod: "number",
+ },
+ {
+ property: "interactive",
+ title: "Interactive",
+ description: "Allow user interaction to set the rating.",
+ inputMethod: "boolean",
+ },
+ {
+ property: "rubricScaleMode",
+ title: "Rubric Scale Mode",
+ description:
+ "Emit OER Schema RubricScale and RubricLevel metadata (levelOrdinal/levelPoints) for each star.",
+ inputMethod: "boolean",
+ },
+ ],
+ },
+ };
+ }
+
static get styles() {
return [
super.styles,
@@ -69,6 +129,14 @@ class StarRating extends SimpleColors {
interactive: { type: Boolean, reflect: true },
numStars: { type: Number, attribute: "num-stars" },
_calPercent: { type: Number }, // this value we'll calculate based on changes to score and possible
+ /**
+ * Opt-in: emit OER Schema RubricScale + RubricLevel metadata.
+ */
+ rubricScaleMode: {
+ type: Boolean,
+ attribute: "rubric-scale-mode",
+ reflect: true,
+ },
};
}
@@ -82,11 +150,15 @@ class StarRating extends SimpleColors {
this.dark = true;
this.contrast = 0;
this.accentColor = "yellow";
+ this.rubricScaleMode = false;
}
render() {
return html`
-
+
${this.renderStar(this.numStars, this.interactive)}
@@ -125,7 +197,18 @@ class StarRating extends SimpleColors {
contrast="${this.contrast}"
class="star"
data-value="${Number(count + 1)}"
- >`,
+ typeof="${this.rubricScaleMode ? "oer:RubricLevel" : nothing}"
+ property="${this.rubricScaleMode ? "oer:hasLevel" : nothing}"
+ >${this.rubricScaleMode
+ ? html`
`
+ : nothing}`,
);
} else {
content.push(
@@ -135,7 +218,18 @@ class StarRating extends SimpleColors {
?dark="${this.dark}"
contrast="${this.contrast}"
class="star"
- >`,
+ typeof="${this.rubricScaleMode ? "oer:RubricLevel" : nothing}"
+ property="${this.rubricScaleMode ? "oer:hasLevel" : nothing}"
+ >${this.rubricScaleMode
+ ? html`
`
+ : nothing}`,
);
}
count++;
@@ -154,6 +248,14 @@ class StarRating extends SimpleColors {
}),
);
}
+ /**
+ * Calculate the points assigned to a given rubric level (1-indexed)
+ * based on the total possible score spread evenly across all stars.
+ */
+ _rubricLevelPoints(level) {
+ if (this.numStars === 0) return 0;
+ return Math.round((this.possible / this.numStars) * level);
+ }
updated(changedProperties) {
if (super.updated) {
super.updated(changedProperties);
diff --git a/elements/stop-note/stop-note.js b/elements/stop-note/stop-note.js
index e4c53202bb..c048353757 100644
--- a/elements/stop-note/stop-note.js
+++ b/elements/stop-note/stop-note.js
@@ -2,6 +2,7 @@ import { html, css } from "lit";
import { remoteLinkBehavior } from "@haxtheweb/utils/lib/remoteLinkBehavior.js";
import { SimpleIconsetStore } from "@haxtheweb/simple-icon/lib/simple-iconset.js";
import { I18NMixin } from "@haxtheweb/i18n-manager/lib/I18NMixin.js";
+import { SchemaBehaviors } from "@haxtheweb/schema-behaviors/schema-behaviors.js";
import "@haxtheweb/simple-icon/simple-icon.js";
import { DDD } from "@haxtheweb/d-d-d/d-d-d.js";
@@ -27,7 +28,7 @@ export const StopNoteIconList = {
info: "stopnoteicons:book-icon",
};
-class StopNote extends I18NMixin(remoteLinkBehavior(DDD)) {
+class StopNote extends SchemaBehaviors(I18NMixin(remoteLinkBehavior(DDD))) {
/**
* LitElement constructable styles enhancement
*/
@@ -208,7 +209,7 @@ class StopNote extends I18NMixin(remoteLinkBehavior(DDD)) {
-
+
${this.title}
@@ -328,6 +329,7 @@ class StopNote extends I18NMixin(remoteLinkBehavior(DDD)) {
*/
firstUpdated(changedProperties) {
if (super.firstUpdated) super.firstUpdated(changedProperties);
+ this.setAttribute("typeof", "oer:LearningComponent");
this.remoteLinkTarget = this.shadowRoot.querySelector("#link");
this._syncSlottedLinkColor();
// if we have no status BUT icon was supplied; this is to support legacy implementations
diff --git a/elements/tagging-question/lib/tagging-question.haxProperties.json b/elements/tagging-question/lib/tagging-question.haxProperties.json
index fc3f1c0bc1..3cfd1199c8 100644
--- a/elements/tagging-question/lib/tagging-question.haxProperties.json
+++ b/elements/tagging-question/lib/tagging-question.haxProperties.json
@@ -29,6 +29,24 @@
"description": "Question for users to respond to.",
"inputMethod": "textfield"
},
+ {
+ "property": "gradingFormat",
+ "title": "Grading format",
+ "description": "OER Schema: grading format for this assessment (e.g. points, letter, percent, completion).",
+ "inputMethod": "textfield"
+ },
+ {
+ "property": "hasLearningObjective",
+ "title": "Learning objective",
+ "description": "OER Schema: learning objective associated with this assessment.",
+ "inputMethod": "textfield"
+ },
+ {
+ "property": "forCourse",
+ "title": "Course",
+ "description": "OER Schema: course this assessment is intended for.",
+ "inputMethod": "textfield"
+ },
{
"property": "answers",
"title": "Answers",
diff --git a/elements/un-sdg/un-sdg.js b/elements/un-sdg/un-sdg.js
index d451eeb2a0..9f5dc8c947 100644
--- a/elements/un-sdg/un-sdg.js
+++ b/elements/un-sdg/un-sdg.js
@@ -1,5 +1,6 @@
import { LitElement, html, css } from 'lit';
-export class UnSdg extends LitElement {
+import { SchemaBehaviors } from '@haxtheweb/schema-behaviors/schema-behaviors.js';
+export class UnSdg extends SchemaBehaviors(LitElement) {
static get tag() {
return 'un-sdg';
}
@@ -58,11 +59,13 @@ export class UnSdg extends LitElement {
// ensure we are between the 17 goals we support
if (this.goal >= 1 && this.goal <= 17) {
if (this.colorOnly) {
- return html`
`;
+ return html`
`;
}
else {
return html`
+

+
+ ${this.audioDescriptionSource && this.audioDescriptionEnabled
? html`