Skip to content

Commit f7917f5

Browse files
authored
Merge pull request #475 from concord-consortium/plugin-api-resource-url
Add resourceUrl to Plugin runtime context
2 parents 73d31d6 + 45d62cb commit f7917f5

21 files changed

+871
-848
lines changed

app/assets/javascripts/lara-typescript.js

Lines changed: 776 additions & 775 deletions
Large diffs are not rendered by default.

app/views/plugins/_show.haml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,8 @@
147147
userEmail: #{@run.user && @run.user.email ? "'#{escape_javascript(@run.user.email)}'" : 'null'},
148148
classInfoUrl: #{@run.class_info_url ? "'#{escape_javascript(@run.class_info_url)}'" : 'null'},
149149
firebaseJwtUrl: '#{escape_javascript(firebase_jwt_url)}',
150-
wrappedEmbeddable: embeddableContext
150+
wrappedEmbeddable: embeddableContext,
151+
resourceUrl: '#{escape_javascript(@sequence_run ? sequence_url(@sequence_run.sequence) : activity_url(@run.activity))}'
151152
}
152153
console.log("Adding #{plugin.name} runtime plugin as #{v3_plugin_label} with V3 LARA Plugin API")
153154
LARA.InternalAPI.initPlugin('#{v3_plugin_label}', pluginContext);

docs/lara-plugin-api/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ ___
207207

208208
**Ƭ IInteractiveAvailableEventHandler**: *`function`*
209209

210-
*Defined in [types.ts:233](../../lara-typescript/src/plugin-api/types.ts#L233)*
210+
*Defined in [types.ts:235](../../lara-typescript/src/plugin-api/types.ts#L235)*
211211

212212
InteractiveAvailable event handler.
213213

@@ -229,7 +229,7 @@ ___
229229

230230
**Ƭ ILogEventHandler**: *`function`*
231231

232-
*Defined in [types.ts:214](../../lara-typescript/src/plugin-api/types.ts#L214)*
232+
*Defined in [types.ts:216](../../lara-typescript/src/plugin-api/types.ts#L216)*
233233

234234
Log event handler.
235235

docs/lara-plugin-api/interfaces/iclassinfo.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727

2828
**● class_hash**: *`string`*
2929

30-
*Defined in [types.ts:185](../../../lara-typescript/src/plugin-api/types.ts#L185)*
30+
*Defined in [types.ts:187](../../../lara-typescript/src/plugin-api/types.ts#L187)*
3131

3232
___
3333
<a id="id"></a>
@@ -36,7 +36,7 @@ ___
3636

3737
**● id**: *`number`*
3838

39-
*Defined in [types.ts:183](../../../lara-typescript/src/plugin-api/types.ts#L183)*
39+
*Defined in [types.ts:185](../../../lara-typescript/src/plugin-api/types.ts#L185)*
4040

4141
___
4242
<a id="offerings"></a>
@@ -45,7 +45,7 @@ ___
4545

4646
**● offerings**: *[IOffering](ioffering.md)[]*
4747

48-
*Defined in [types.ts:188](../../../lara-typescript/src/plugin-api/types.ts#L188)*
48+
*Defined in [types.ts:190](../../../lara-typescript/src/plugin-api/types.ts#L190)*
4949

5050
___
5151
<a id="students"></a>
@@ -54,7 +54,7 @@ ___
5454

5555
**● students**: *[IUser](iuser.md)[]*
5656

57-
*Defined in [types.ts:187](../../../lara-typescript/src/plugin-api/types.ts#L187)*
57+
*Defined in [types.ts:189](../../../lara-typescript/src/plugin-api/types.ts#L189)*
5858

5959
___
6060
<a id="teachers"></a>
@@ -63,7 +63,7 @@ ___
6363

6464
**● teachers**: *[IUser](iuser.md)[]*
6565

66-
*Defined in [types.ts:186](../../../lara-typescript/src/plugin-api/types.ts#L186)*
66+
*Defined in [types.ts:188](../../../lara-typescript/src/plugin-api/types.ts#L188)*
6767

6868
___
6969
<a id="uri"></a>
@@ -72,7 +72,7 @@ ___
7272

7373
**● uri**: *`string`*
7474

75-
*Defined in [types.ts:184](../../../lara-typescript/src/plugin-api/types.ts#L184)*
75+
*Defined in [types.ts:186](../../../lara-typescript/src/plugin-api/types.ts#L186)*
7676

7777
___
7878

docs/lara-plugin-api/interfaces/iembeddableruntimecontext.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727

2828
**● container**: *`HTMLElement`*
2929

30-
*Defined in [types.ts:66](../../../lara-typescript/src/plugin-api/types.ts#L66)*
30+
*Defined in [types.ts:68](../../../lara-typescript/src/plugin-api/types.ts#L68)*
3131

3232
Embeddable container.
3333

@@ -38,7 +38,7 @@ ___
3838

3939
**● getInteractiveState**: *`function`*
4040

41-
*Defined in [types.ts:87](../../../lara-typescript/src/plugin-api/types.ts#L87)*
41+
*Defined in [types.ts:89](../../../lara-typescript/src/plugin-api/types.ts#L89)*
4242

4343
Function that returns interactive state (Promise) or null if embeddable isn't interactive.
4444

@@ -54,7 +54,7 @@ ___
5454

5555
**● getReportingUrl**: *`function`*
5656

57-
*Defined in [types.ts:97](../../../lara-typescript/src/plugin-api/types.ts#L97)*
57+
*Defined in [types.ts:99](../../../lara-typescript/src/plugin-api/types.ts#L99)*
5858

5959
Function that returns reporting URL (Promise) or null if it's not an interactive or reporting URL is not defined. Note that reporting URL is defined in the interactive state (that can be obtained via #getInteractiveState method). If your code needs both interactive state and reporting URL, you can pass interactiveStatePromise as an argument to this method to limit number of network requests.
6060

@@ -78,7 +78,7 @@ ___
7878

7979
**● interactiveAvailable**: *`boolean`*
8080

81-
*Defined in [types.ts:107](../../../lara-typescript/src/plugin-api/types.ts#L107)*
81+
*Defined in [types.ts:109](../../../lara-typescript/src/plugin-api/types.ts#L109)*
8282

8383
True if the interactive is immediately available
8484

@@ -89,7 +89,7 @@ ___
8989

9090
**● laraJson**: *`any`*
9191

92-
*Defined in [types.ts:85](../../../lara-typescript/src/plugin-api/types.ts#L85)*
92+
*Defined in [types.ts:87](../../../lara-typescript/src/plugin-api/types.ts#L87)*
9393

9494
Serialized form of the embeddable. Defined by LARA export code, so it's format cannot be specified here. Example (interactive):
9595

@@ -115,7 +115,7 @@ ___
115115

116116
**● onInteractiveAvailable**: *`function`*
117117

118-
*Defined in [types.ts:105](../../../lara-typescript/src/plugin-api/types.ts#L105)*
118+
*Defined in [types.ts:107](../../../lara-typescript/src/plugin-api/types.ts#L107)*
119119

120120
Function that subscribes provided handler to event that gets called when the interactive's availablity changes. Normally an interactive starts as available unless click to play is enabled. When click to play is enabled the interactive starts as not available and this handler is called when the click to play overlay is hidden.
121121

docs/lara-plugin-api/interfaces/iinteractiveavailableevent.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ Data passed to InteractiveAvailable event handlers.
2525

2626
**● available**: *`boolean`*
2727

28-
*Defined in [types.ts:227](../../../lara-typescript/src/plugin-api/types.ts#L227)*
28+
*Defined in [types.ts:229](../../../lara-typescript/src/plugin-api/types.ts#L229)*
2929

3030
Availablility of interactive
3131

@@ -36,7 +36,7 @@ ___
3636

3737
**● container**: *`HTMLElement`*
3838

39-
*Defined in [types.ts:223](../../../lara-typescript/src/plugin-api/types.ts#L223)*
39+
*Defined in [types.ts:225](../../../lara-typescript/src/plugin-api/types.ts#L225)*
4040

4141
Interactive container of the interactive that was just started.
4242

docs/lara-plugin-api/interfaces/iinteractivestate.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727

2828
**● activity_name**: *`string`*
2929

30-
*Defined in [types.ts:197](../../../lara-typescript/src/plugin-api/types.ts#L197)*
30+
*Defined in [types.ts:199](../../../lara-typescript/src/plugin-api/types.ts#L199)*
3131

3232
___
3333
<a id="id"></a>
@@ -36,7 +36,7 @@ ___
3636

3737
**● id**: *`number`*
3838

39-
*Defined in [types.ts:192](../../../lara-typescript/src/plugin-api/types.ts#L192)*
39+
*Defined in [types.ts:194](../../../lara-typescript/src/plugin-api/types.ts#L194)*
4040

4141
___
4242
<a id="interactive_name"></a>
@@ -45,7 +45,7 @@ ___
4545

4646
**● interactive_name**: *`string`*
4747

48-
*Defined in [types.ts:195](../../../lara-typescript/src/plugin-api/types.ts#L195)*
48+
*Defined in [types.ts:197](../../../lara-typescript/src/plugin-api/types.ts#L197)*
4949

5050
___
5151
<a id="interactive_state_url"></a>
@@ -54,7 +54,7 @@ ___
5454

5555
**● interactive_state_url**: *`string`*
5656

57-
*Defined in [types.ts:196](../../../lara-typescript/src/plugin-api/types.ts#L196)*
57+
*Defined in [types.ts:198](../../../lara-typescript/src/plugin-api/types.ts#L198)*
5858

5959
___
6060
<a id="key"></a>
@@ -63,7 +63,7 @@ ___
6363

6464
**● key**: *`string`*
6565

66-
*Defined in [types.ts:193](../../../lara-typescript/src/plugin-api/types.ts#L193)*
66+
*Defined in [types.ts:195](../../../lara-typescript/src/plugin-api/types.ts#L195)*
6767

6868
___
6969
<a id="raw_data"></a>
@@ -72,7 +72,7 @@ ___
7272

7373
**● raw_data**: *`string`*
7474

75-
*Defined in [types.ts:194](../../../lara-typescript/src/plugin-api/types.ts#L194)*
75+
*Defined in [types.ts:196](../../../lara-typescript/src/plugin-api/types.ts#L196)*
7676

7777
___
7878

docs/lara-plugin-api/interfaces/ijwtclaims.md

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535

3636
**● alg**: *`string`*
3737

38-
*Defined in [types.ts:149](../../../lara-typescript/src/plugin-api/types.ts#L149)*
38+
*Defined in [types.ts:151](../../../lara-typescript/src/plugin-api/types.ts#L151)*
3939

4040
___
4141
<a id="aud"></a>
@@ -44,7 +44,7 @@ ___
4444

4545
**● aud**: *`string`*
4646

47-
*Defined in [types.ts:150](../../../lara-typescript/src/plugin-api/types.ts#L150)*
47+
*Defined in [types.ts:152](../../../lara-typescript/src/plugin-api/types.ts#L152)*
4848

4949
___
5050
<a id="claims"></a>
@@ -53,7 +53,7 @@ ___
5353

5454
**● claims**: *[IPortalClaims](iportalclaims.md)*
5555

56-
*Defined in [types.ts:162](../../../lara-typescript/src/plugin-api/types.ts#L162)*
56+
*Defined in [types.ts:164](../../../lara-typescript/src/plugin-api/types.ts#L164)*
5757

5858
___
5959
<a id="class_info_url"></a>
@@ -62,7 +62,7 @@ ___
6262

6363
**● class_info_url**: *`string`*
6464

65-
*Defined in [types.ts:151](../../../lara-typescript/src/plugin-api/types.ts#L151)*
65+
*Defined in [types.ts:153](../../../lara-typescript/src/plugin-api/types.ts#L153)*
6666

6767
___
6868
<a id="domain"></a>
@@ -71,7 +71,7 @@ ___
7171

7272
**● domain**: *`string`*
7373

74-
*Defined in [types.ts:152](../../../lara-typescript/src/plugin-api/types.ts#L152)*
74+
*Defined in [types.ts:154](../../../lara-typescript/src/plugin-api/types.ts#L154)*
7575

7676
___
7777
<a id="domain_uid"></a>
@@ -80,7 +80,7 @@ ___
8080

8181
**● domain_uid**: *`number`*
8282

83-
*Defined in [types.ts:153](../../../lara-typescript/src/plugin-api/types.ts#L153)*
83+
*Defined in [types.ts:155](../../../lara-typescript/src/plugin-api/types.ts#L155)*
8484

8585
___
8686
<a id="exp"></a>
@@ -89,7 +89,7 @@ ___
8989

9090
**● exp**: *`number`*
9191

92-
*Defined in [types.ts:154](../../../lara-typescript/src/plugin-api/types.ts#L154)*
92+
*Defined in [types.ts:156](../../../lara-typescript/src/plugin-api/types.ts#L156)*
9393

9494
___
9595
<a id="externalid"></a>
@@ -98,7 +98,7 @@ ___
9898

9999
**● externalId**: *`number`*
100100

101-
*Defined in [types.ts:155](../../../lara-typescript/src/plugin-api/types.ts#L155)*
101+
*Defined in [types.ts:157](../../../lara-typescript/src/plugin-api/types.ts#L157)*
102102

103103
___
104104
<a id="iat"></a>
@@ -107,7 +107,7 @@ ___
107107

108108
**● iat**: *`number`*
109109

110-
*Defined in [types.ts:156](../../../lara-typescript/src/plugin-api/types.ts#L156)*
110+
*Defined in [types.ts:158](../../../lara-typescript/src/plugin-api/types.ts#L158)*
111111

112112
___
113113
<a id="iss"></a>
@@ -116,7 +116,7 @@ ___
116116

117117
**● iss**: *`string`*
118118

119-
*Defined in [types.ts:157](../../../lara-typescript/src/plugin-api/types.ts#L157)*
119+
*Defined in [types.ts:159](../../../lara-typescript/src/plugin-api/types.ts#L159)*
120120

121121
___
122122
<a id="logging"></a>
@@ -125,7 +125,7 @@ ___
125125

126126
**● logging**: *`boolean`*
127127

128-
*Defined in [types.ts:158](../../../lara-typescript/src/plugin-api/types.ts#L158)*
128+
*Defined in [types.ts:160](../../../lara-typescript/src/plugin-api/types.ts#L160)*
129129

130130
___
131131
<a id="returnurl"></a>
@@ -134,7 +134,7 @@ ___
134134

135135
**● returnUrl**: *`string`*
136136

137-
*Defined in [types.ts:159](../../../lara-typescript/src/plugin-api/types.ts#L159)*
137+
*Defined in [types.ts:161](../../../lara-typescript/src/plugin-api/types.ts#L161)*
138138

139139
___
140140
<a id="sub"></a>
@@ -143,7 +143,7 @@ ___
143143

144144
**● sub**: *`string`*
145145

146-
*Defined in [types.ts:160](../../../lara-typescript/src/plugin-api/types.ts#L160)*
146+
*Defined in [types.ts:162](../../../lara-typescript/src/plugin-api/types.ts#L162)*
147147

148148
___
149149
<a id="uid"></a>
@@ -152,7 +152,7 @@ ___
152152

153153
**● uid**: *`string`*
154154

155-
*Defined in [types.ts:161](../../../lara-typescript/src/plugin-api/types.ts#L161)*
155+
*Defined in [types.ts:163](../../../lara-typescript/src/plugin-api/types.ts#L163)*
156156

157157
___
158158

docs/lara-plugin-api/interfaces/ijwtresponse.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323

2424
**● claims**: *[IJwtClaims](ijwtclaims.md)*
2525

26-
*Defined in [types.ts:167](../../../lara-typescript/src/plugin-api/types.ts#L167)*
26+
*Defined in [types.ts:169](../../../lara-typescript/src/plugin-api/types.ts#L169)*
2727

2828
___
2929
<a id="token"></a>
@@ -32,7 +32,7 @@ ___
3232

3333
**● token**: *`string`*
3434

35-
*Defined in [types.ts:166](../../../lara-typescript/src/plugin-api/types.ts#L166)*
35+
*Defined in [types.ts:168](../../../lara-typescript/src/plugin-api/types.ts#L168)*
3636

3737
___
3838

docs/lara-plugin-api/interfaces/ilogdata.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ That's the minimal set of properties that needs to be provided. All the other pr
2626

2727
**● event**: *`string`*
2828

29-
*Defined in [types.ts:205](../../../lara-typescript/src/plugin-api/types.ts#L205)*
29+
*Defined in [types.ts:207](../../../lara-typescript/src/plugin-api/types.ts#L207)*
3030

3131
___
3232
<a id="event_value"></a>
@@ -35,7 +35,7 @@ ___
3535

3636
**● event_value**: *`any`*
3737

38-
*Defined in [types.ts:206](../../../lara-typescript/src/plugin-api/types.ts#L206)*
38+
*Defined in [types.ts:208](../../../lara-typescript/src/plugin-api/types.ts#L208)*
3939

4040
___
4141
<a id="parameters"></a>
@@ -44,7 +44,7 @@ ___
4444

4545
**● parameters**: *`any`*
4646

47-
*Defined in [types.ts:207](../../../lara-typescript/src/plugin-api/types.ts#L207)*
47+
*Defined in [types.ts:209](../../../lara-typescript/src/plugin-api/types.ts#L209)*
4848

4949
___
5050

0 commit comments

Comments
 (0)