diff --git a/views/partials/testResult.hbs b/views/partials/testResult.hbs new file mode 100644 index 0000000..0bfe371 --- /dev/null +++ b/views/partials/testResult.hbs @@ -0,0 +1,31 @@ +
+
+ {{#eq userType 'account'}} +
+ Student: {{result.student.shortName}} +
+ {{/eq}} +
+ Submitted by: {{result.account.shortName}} +
+
+ Submitted at: {{formatTime result.time}} +
+
+
+
+ {{result.grade}} +
+
+ {{result.mark}} + --- + {{result.test.template.maxMark}} +
+
+ = +
+
+ {{result.percentage}}% +
+
+
diff --git a/views/test.hbs b/views/test.hbs index 736a6a7..2292a12 100644 --- a/views/test.hbs +++ b/views/test.hbs @@ -24,36 +24,19 @@
-

Result

+
+

+ {{#eq userType 'account'}} + Results + {{else}} + Result + {{/eq}} +

+
{{#if testResults.length}} - {{#each testResults as |result|}} -
-
-
- Submitted by: {{result.account.shortName}} -
-
- Submitted at: {{formatTime result.time}} -
-
-
-
- {{result.grade}} -
-
- {{result.mark}} - --- - {{../maxMark}} -
-
- = -
-
- {{result.percentage}}% -
-
-
+ {{#each testResults}} + {{> testResult result=this userType=../userType }} {{/each}} {{else}} {{#eq userType 'account'}}