Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
node_modules
public/
106 changes: 0 additions & 106 deletions bases/rsptx/assignment_server_api/assignment_builder/.eslintrc

This file was deleted.

132 changes: 114 additions & 18 deletions bases/rsptx/assignment_server_api/assignment_builder/.eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -1,20 +1,116 @@
module.exports = {
parser: '@typescript-eslint/parser',
parserOptions: {
project: './tsconfig.json',
tsconfigRootDir: __dirname,
sourceType: 'module'
},
plugins: ['@typescript-eslint'],
extends: ['plugin:@typescript-eslint/recommended'],
rules: {},
overrides: [
{
files: ['**/*.spec.ts', '**/*.spec.tsx'],
rules: {
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-unused-vars': 'off'
}
}
]
root: true,
parser: "@typescript-eslint/parser",
ignorePatterns: [".eslintrc.cjs"],
parserOptions: {
project: "./tsconfig.json",
tsconfigRootDir: __dirname,
sourceType: "module",
ecmaFeatures: {
jsx: true
}
},
plugins: ["react", "import", "@typescript-eslint", "prettier", "react-hooks", "only-warn"],
extends: [
"airbnb-typescript",
"plugin:@typescript-eslint/recommended",
"plugin:prettier/recommended"
],
settings: {
react: {
version: "detect"
}
},
rules: {
"no-unused-vars": "off",
"@typescript-eslint/no-unused-vars": "off",
semi: "warn",
"import/prefer-default-export": "off",
"no-undef": "off",
"newline-after-var": ["error", "always"],
"max-len": [
"error",
{
ignorePattern: "^.+ from .+$",
code: 140,
ignoreStrings: true,
ignoreTemplateLiterals: true,
ignoreRegExpLiterals: true
}
],
"import/named": "off",
"import/no-extraneous-dependencies": "off",
"import/no-unresolved": "off",
"import/extensions": "off",
"no-restricted-imports": "off",
"import/order": [
"warn",
{
groups: [["builtin", "external", "internal"], "parent", ["sibling", "index"]],
pathGroups: [
{
pattern: "react*",
group: "builtin",
position: "before"
},
{
pattern: "@*(reduxjs|dnd-kit|snowplow)/**/*",
group: "external",
position: "after"
}
],
alphabetize: {
order: "asc",
caseInsensitive: false
},
"newlines-between": "always"
}
],
"react/prop-types": "off",
"react/destructuring-assignment": "off",
"react/no-array-index-key": "off",
"react/no-unused-prop-types": "off",
"react/require-default-props": "off",
"jsx-quotes": ["error", "prefer-double"],
"react-hooks/rules-of-hooks": "error",
"react-hooks/exhaustive-deps": "error",
"react/react-in-jsx-scope": "off",
"react/jsx-curly-brace-presence": "error",
"jsx-a11y/click-events-have-key-events": "off",
"jsx-a11y/no-static-element-interactions": "off",
"jsx-a11y/control-has-associated-label": "off",
"jsx-a11y/label-has-associated-control": "off",
"jsx-a11y/alt-text": "off",
"import/no-cycle": "off",
"react/jsx-one-expression-per-line": "off",
"@typescript-eslint/semi": "off",
"@typescript-eslint/no-redeclare": "off",
"no-underscore-dangle": [
"error",
{
allowAfterThis: true
}
],
"no-console": "off",
"no-use-before-define": "off",
"@typescript-eslint/no-use-before-define": [
"error",
{
functions: false,
variables: false
}
],
"@typescript-eslint/naming-convention": "off",
quotes: ["error", "double", { avoidEscape: true, allowTemplateLiterals: true }],
"prettier/prettier": ["error", { singleQuote: false, trailingComma: "none" }]
},
overrides: [
{
files: ["**/*.spec.ts", "**/*.spec.tsx"],
rules: {
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/no-unused-vars": "off"
}
}
]
};
Original file line number Diff line number Diff line change
Expand Up @@ -166,48 +166,55 @@ function App() {
path: "grader",
async lazy() {
const { Grader } = await import("@components/routes/Grader");

return { Component: Grader };
},
children: [
{
index: true,
async lazy() {
const { GraderAssignmentsPage } = await import("@components/routes/Grader");

return { Component: GraderAssignmentsPage };
}
},
{
path: "gradebook",
async lazy() {
const { GraderGradebookPage } = await import("@components/routes/Grader");

return { Component: GraderGradebookPage };
}
},
{
path: ":assignmentId",
async lazy() {
const { GraderQuestionsPage } = await import("@components/routes/Grader");

return { Component: GraderQuestionsPage };
}
},
{
path: ":assignmentId/questions/:questionId",
async lazy() {
const { GraderQuestionPage } = await import("@components/routes/Grader");

return { Component: GraderQuestionPage };
}
},
{
path: ":assignmentId/questions/:questionId/students/:sid",
async lazy() {
const { GraderQuestionPage } = await import("@components/routes/Grader");

return { Component: GraderQuestionPage };
}
},
{
path: ":assignmentId/questions/:questionId/:sid",
async lazy() {
const { GraderQuestionPage } = await import("@components/routes/Grader");

return { Component: GraderQuestionPage };
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,11 +83,13 @@ export async function renderRunestoneComponent(
let preamble =
document.getElementById("latex_preamble") ||
document.querySelector("div.hidden-content.process-math");

if (preamble) {
preamble = preamble.innerHTML;
opt.preamble = preamble;
}
let res = window.component_factory[componentKind](opt);

console.log("res", res);

// For components with async initialization (like selectquestion),
Expand All @@ -109,16 +111,19 @@ export async function renderRunestoneComponent(
let key = moreOpts.gradingContainer
? `${moreOpts.gradingContainer} ${res.divid}`
: res.divid;

window.componentMap[key] = res;
}
if (!moreOpts.suppressFlagForReview && !moreOpts.graderMode) {
let flagButton = document.createElement("button");

flagButton.classList.add("flag-for-review");
flagButton.textContent = "Flag for Review";
flagButton.addEventListener("click", async function () {
let data = {
question_name: res.divid || res.selector_id || res.origOpts.orig.id
};

if (!data.question_name) {
alert("Error: Cannot determine question name to flag for review");
return;
Expand All @@ -131,8 +136,10 @@ export async function renderRunestoneComponent(
"Content-Type": "application/json"
}
});

if (response.ok) {
let resp = await response.json();

if (resp.success === true) {
flagButton.textContent = "Question Flagged";
flagButton.style.backgroundColor = "var(--rs-success)";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import { useDispatch } from "react-redux";
import { useSelectedAssignment } from "@/hooks/useSelectedAssignment";
import { Assignment, CreateAssignmentPayload } from "@/types/assignment";

import styles from "./AssignmentBuilder.module.css";
import {
saveBulkEnforceDue,
saveBulkVisibility,
Expand All @@ -41,8 +42,6 @@ import { useAssignmentRouting } from "./hooks/useAssignmentRouting";
import { useAssignmentState } from "./hooks/useAssignmentState";
import { useNameValidation } from "./hooks/useNameValidation";

import styles from "./AssignmentBuilder.module.css";

export const AssignmentBuilder = () => {
const dispatch = useDispatch();
const [importModalVisible, setImportModalVisible] = useState(false);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { notify } from "@components/ui/notify";
import { vi } from "vitest";

import { Assignment } from "@/types/assignment";
import { notify } from "@components/ui/notify";

import {
BulkUpdateAssignmentsTrigger,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import { Assignment } from "@/types/assignment";
import { notify } from "@components/ui/notify";
import { BulkActionResult } from "@store/assignment/assignment.logic.api";

import { Assignment } from "@/types/assignment";

import { getVisibilityMode } from "./components/edit/visibilityMode";

export interface VisibilityUpdate {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,11 @@ import { useExercisesSelector } from "@/hooks/useExercisesSelector";
import { Assignment, KindOfAssignment } from "@/types/assignment";

import { DateTimePicker } from "../../../../ui/DateTimePicker";

import { CourseTimezoneNotice } from "./CourseTimezoneNotice";

import { AssignmentReadings } from "../reading/AssignmentReadings";
import { VisibilityControl } from "./VisibilityControl";

import styles from "./AssignmentEdit.module.css";
import { CourseTimezoneNotice } from "./CourseTimezoneNotice";
import { VisibilityControl } from "./VisibilityControl";

const YES_NO_OPTIONS = [
{ label: "Yes", value: "true" },
Expand Down
Loading
Loading