Skip to content

Commit

Permalink
Merge branch 'fixing_issue-RunestoneInteractive#466' into fixing_issu…
Browse files Browse the repository at this point in the history
…e#466
  • Loading branch information
jjjonesj authored Jul 16, 2024
2 parents 4edb08e + 24a51bf commit f9384a1
Show file tree
Hide file tree
Showing 23 changed files with 1,352 additions and 1,117 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,8 @@ export function SearchResults() {
}}
>
<Column selectionMode="multiple" style={{ width: '3em' }} />
<Column field="question_json" header="Edit" body={EditButton} sortable />
<Column field="question_json" header="Edit" body={EditButton} />
<Column field="name" header="Name" sortable />
<Column field="qnumber" header="Question" sortable />
<Column field="topic" header="Topic" sortable />
<Column field="htmlsrc" header="Preview" body={PreviewTemplate} style={{ maxWidth: '100rem' }} />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ export const saveAssignmentQuestion = createAsyncThunk(
htmlsrc: preview_src,
question_json: JSON.stringify(store.interactive.question_json),
chapter: store.interactive.chapter,
author: store.interactive.author,
};
if (editonly) {
body.id = questionId;
Expand Down
4 changes: 3 additions & 1 deletion bases/rsptx/assignment_server_api/routers/instructor.py
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,9 @@ async def new_question(
status=status.HTTP_401_UNAUTHORIZED, detail="not an instructor"
)

if request_data.author is None:
request_data.author = user.first_name + " " + user.last_name

# First create the question
new_question = QuestionValidator(
**request_data.model_dump(),
Expand All @@ -246,7 +249,6 @@ async def new_question(
practice=False,
from_source=False,
review_flag=False,
author=user.first_name + " " + user.last_name,
)
try:
q = await create_question(new_question)
Expand Down
4 changes: 3 additions & 1 deletion bases/rsptx/assignment_server_api/routers/student.py
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,9 @@ async def doAssignment(
return RedirectResponse("/assignment/student/chooseAssignment")

current_time = datetime.datetime.utcnow()
if not (assignment.visibledate <= current_time and

if not (assignment.visibledate <= current_time and

(assignment.hideDate is None or assignment.hideDate >= current_time)):

if await is_instructor(request) is False:
Expand Down
5 changes: 4 additions & 1 deletion bases/rsptx/book_server_api/routers/course.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,10 @@ async def index(request: Request, user=Depends(auth_manager)):
rslogger.debug(f"{instructors=}")
templates = Jinja2Templates(directory=template_folder)
books = await fetch_library_book(course.base_course)
books = [books]
if books is None:
books = []
else:
books = [books]
row = await fetch_last_page(user, course_name)
if row:
last_page_url = row.last_page_url
Expand Down
Loading

0 comments on commit f9384a1

Please sign in to comment.