Skip to content

Commit

Permalink
Stop storing code entries
Browse files Browse the repository at this point in the history
  • Loading branch information
alexmojaki committed Dec 7, 2024
1 parent 3b606b2 commit 11f0915
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 24 deletions.
18 changes: 9 additions & 9 deletions frontend/src/RunCode.js
Original file line number Diff line number Diff line change
Expand Up @@ -171,15 +171,15 @@ export const _runCode = wrapAsync(async function runCode({code, source}) {
finishedLastRunResolve();

postCodeEntry({
entry,
result: {
passed: data.passed,
messageSections: data.message_sections?.map(section => ({
type: section.type,
messages: section.messages?.map(m => _.truncate(m, {length: 1000})),
})),
output: _.truncate(data.output, {length: 1000}),
},
// entry,
// result: {
// passed: data.passed,
// messageSections: data.message_sections?.map(section => ({
// type: section.type,
// messages: section.messages?.map(m => _.truncate(m, {length: 1000})),
// })),
// output: _.truncate(data.output, {length: 1000}),
// },
});
});

Expand Down
31 changes: 16 additions & 15 deletions frontend/src/book/store.js
Original file line number Diff line number Diff line change
Expand Up @@ -514,19 +514,20 @@ export function logEvent(name, data = {}) {
}

export function postCodeEntry(codeEntry) {
const {user: {developerMode}, route, assistant: {numHints, requestingSolution}} = localState;
codeEntry = {
...codeEntry,
state: {
developerMode,
page_route: route,
num_hints: numHints,
requesting_solution: requestingSolution,
},
timestamp: new Date().toISOString(),
};
console.log("Posting code entry", codeEntry);
if (isProduction) {
databaseRequest("POST", codeEntry, "code_entries").catch(e => console.error(e));
}
// Disabling for now because this data isn't used.
// const {user: {developerMode}, route, assistant: {numHints, requestingSolution}} = localState;
// codeEntry = {
// ...codeEntry,
// state: {
// developerMode,
// page_route: route,
// num_hints: numHints,
// requesting_solution: requestingSolution,
// },
// timestamp: new Date().toISOString(),
// };
// console.log("Posting code entry", codeEntry);
// if (isProduction) {
// databaseRequest("POST", codeEntry, "code_entries").catch(e => console.error(e));
// }
}

0 comments on commit 11f0915

Please sign in to comment.