1
1
{% extends "base.html" %}
2
2
3
3
{% block content %}
4
- hello< br >
4
+ < script >
5
+ const compositions = [ ] ;
6
+ const containers = [ ] ;
7
+ </ script >
5
8
{% comment %} https://developer.mozilla.org/en-US/docs/Web/HTML/Element/col#usage_notes {% endcomment %}
6
9
< table class ="dashboard ">
7
10
< colgroup >
101
104
< td > {{ assn.instrument.id }}</ td >
102
105
< td > {{ assn.instrument.name }}</ td >
103
106
< td > {{ sub.id }}</ td >
107
+ {% if assn.activity.category == 'Create' %}
108
+ < td >
109
+ Create, see below
110
+ </ td >
111
+ {% else %}
104
112
< td > {{ sub.content }}</ td >
113
+ {% endif %}
105
114
< td > {{ sub.submitted }}</ td >
106
115
< td > {{ sub.grade }}</ td >
107
116
< td > {{ sub.self_grade }}</ td >
108
117
< td > {{ att.id }}</ td >
109
118
< td > {{ att.file }}</ td >
110
119
< td > {{ att.submitted }}</ td >
111
120
</ tr >
112
- {% endfor %}
121
+ {% if assn.activity.category == 'Create' %}
122
+ < tr >
123
+ < td colspan ="22 ">
124
+ < div class ="" id ="flat-{{sub.id}} "> </ div >
125
+ < script >
126
+ compositions . push ( { { sub . content | safe } } )
127
+ containers . push ( document . getElementById ( 'flat-{{sub.id}}' ) )
128
+ </ script >
129
+ </ td >
130
+ </ tr >
131
+ {% endif %}
113
132
{% endfor %}
114
- {% endif %}
115
- </ tbody >
133
+ {% endfor %}
134
+ {% endif %}
135
+ </ tbody >
116
136
{% endfor %}
117
137
</ table >
118
- {% endblock content %}
138
+ {% endblock content %}
139
+
140
+ {% block custom_javascript %}
141
+ < script src ="https://prod.flat-cdn.com/embed-js/v2.3.0/embed.min.js "> </ script >
142
+ < script >
143
+ for ( let i = 0 ; i < compositions . length ; i ++ ) {
144
+ let embed = new Flat . Embed ( containers [ i ] , {
145
+ score : 'blank' ,
146
+ embedParams : {
147
+ appId : '60a51c906bcde01fc75a3ad0' ,
148
+ layout : 'responsive' ,
149
+ branding : false ,
150
+ themePrimary : '#450084' ,
151
+ controlsDisplay : false ,
152
+ controlsPlay : false ,
153
+ controlsFullscreen : false ,
154
+ controlsZoom : false ,
155
+ controlsPrint : false ,
156
+ displayFirstLinePartsNames : false ,
157
+ toolsetId : '64be80de738efff96cc27edd' ,
158
+ } ,
159
+ } ) ;
160
+ embed . loadJSON ( compositions [ i ] ) ;
161
+ }
162
+ </ script >
163
+ {% endblock custom_javascript %}
0 commit comments