Skip to content

Commit b860d1e

Browse files
committed
Add logging for learning clues
1 parent 5fe4ca7 commit b860d1e

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

bases/rsptx/interactives/runestone/common/js/bookfuncs.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,9 @@
2929
3030
*/
3131

32+
import RunestoneBase from "./runestonebase.js";
33+
var rb = new RunestoneBase();
34+
3235
//
3336
// Page decoration functions
3437
//
@@ -722,6 +725,7 @@ function createStudyCluesWidget() {
722725
if (studyCluesConversationId === -1) {
723726
query = `Regarding section "${sectionInfo}": ${query}`;
724727
}
728+
rb.logBookEvent({ event: "studyclues_query", act: `query: ${query}`, div_id: `${sectionInfo}` });
725729
appendStudyCluesMessage(messagesEl, "user", query); // todo: make this conditional on being a book page and on the book being one of the supported books
726730
inputEl.value = "";
727731
sendBtn.disabled = true;
@@ -769,7 +773,7 @@ function createStudyCluesWidget() {
769773
/\[([^\]]+)\]\(([^)]+)\)/g,
770774
(match, text, key) => {
771775
const url = references[key]?.content_url;
772-
return url ? `<a href="${url}" target="_blank" rel="noopener noreferrer">${text}</a>` : match;
776+
return url ? `<a href="${url}" target="_blank" rel="noopener noreferrer">(${text})</a>` : match;
773777
}
774778
);
775779

0 commit comments

Comments
 (0)