MDL-67160 mod_forum: Show the users grading status in the grader
authorMathew May <mathewm@hotmail.co.nz>
Wed, 13 Nov 2019 06:08:35 +0000 (14:08 +0800)
committerMathew May <mathewm@hotmail.co.nz>
Mon, 18 Nov 2019 21:17:00 +0000 (10:17 +1300)
mod/forum/amd/build/local/grades/grader.min.js
mod/forum/amd/build/local/grades/grader.min.js.map
mod/forum/amd/src/local/grades/grader.js
mod/forum/templates/local/grades/local/grader/status.mustache

index c562ca5..42f26d6 100644 (file)
Binary files a/mod/forum/amd/build/local/grades/grader.min.js and b/mod/forum/amd/build/local/grades/grader.min.js differ
index 349a17e..76138fc 100644 (file)
Binary files a/mod/forum/amd/build/local/grades/grader.min.js.map and b/mod/forum/amd/build/local/grades/grader.min.js.map differ
index c47eee9..6302914 100644 (file)
@@ -115,6 +115,7 @@ const getUpdateUserContentFunction = (root, getContentForUser, getGradeForUser,
         if (spinner) {
             spinner.resolve();
         }
+        return userGrade;
     };
 };
 
@@ -393,9 +394,10 @@ export const launch = async(getListOfUsers, getContentForUser, getGradeForUser,
     // Fetch the userpicker for display.
     const userPicker = await getUserPicker(
         userList,
-        user => {
+        async(user) => {
+            const userGrade = await updateUserContent(user);
             const renderContext = {
-                status: null,
+                status: userGrade.hasgrade,
                 index: userIds.indexOf(user.id) + 1,
                 total: userList.length
             };
@@ -403,7 +405,6 @@ export const launch = async(getListOfUsers, getContentForUser, getGradeForUser,
                 statusContainer.innerHTML = html;
                 return html;
             }).catch();
-            updateUserContent(user);
         },
         saveGradeFunction,
         {
index 82d9cf0..b716374 100644 (file)
         "total": 10
     }
 }}
-{{#status}}<h2 class="font-weight-bold h5 mb-0">{{.}}</h2>{{/status}}
+<h2 class="font-weight-bold h5 mb-0">
+    {{#status}}
+        {{#str}}graded, forum{{/str}}
+    {{/status}}
+    {{^status}}
+        {{#str}}notgraded, forum{{/str}}
+    {{/status}}
+</h2>
 <div>{{#str}} indexoutoftotal, mod_forum, {"index": "{{index}}", "total":"{{total}}"}{{/str}}</div>